Skip to content

Send c to the thread card on screen, from the card's own state - #1204

Merged
max-sixty merged 4 commits into
mainfrom
c-hint-flaky
Sep 26, 2026
Merged

max-sixty merged 4 commits into
mainfrom
c-hint-flaky

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

A thread's Reply box sometimes showed the c key hint and sometimes didn't. The badge, the shortcut line, and the c press already read one destination (commentDestination()), and they always agreed. What drifted was one of its inputs: the thread the user is at was re-derived from focus, beside the separate code that keeps the margin card up. The two disagreed wherever the card stays beside its passage without focus inside it: after Escape from the card, after g p, and after Escape from a passage's mark. The card showed a Reply box that c did not reach, and pressing c opened a second, new-comment composer next to it. The same gap made t re-enter the thread just left instead of walking on.

  • threadHere (formerly activeInlineThread, runtime/margin-projection.js) now reads the card's being up as the answer: the thread holding focus first, else the card's one thread. With Threads open, the list thread expanded for the target the user stands on plays the card's part (accompaniedThread, thread/landing.js). c answers in that thread's reply, t/T walk on from it, and the Threads toggle opens at it.
  • Pressing c on a passage whose card is up no longer starts a new thread on that passage; s still does.
  • tests/test_render_navigation.py adds a parametrized test that walks ten routes into, within, and out of the card and asserts the invariant rather than a route: exactly one box wears c, c lands in it, and while a card is up that box is its reply. Against the first version of the fix it fails on exactly the two routes that version missed. A second test covers the Threads-open case, and the walked-thread test checks that t walks on from the element.

This was written by Claude Code on behalf of max-sixty

🤖 Generated with Claude Code

max-sixty and others added 4 commits September 25, 2026 19:47
The margin card, its margin entry, and its target are one place (the
margin owner's header), but activeInlineThread counted only the entry and
the card itself as standing at the card's thread. Escape from a card lands
on its target with the card still up, so there:

- the reply box lost its `c` badge and `c` opened a second, new-comment
  composer on the element beside the card's Reply box;
- `t` re-entered the thread just left instead of walking on, and `T`
  stepped to the last thread.

Standing on the target now reads as standing at the card's single thread,
so `c` answers in its reply, `t`/`T` walk from it, and Threads opens at it.
A new thread on that element stays reachable with `s`. The walked-thread
navigation test now checks the badge, the shortcut line, `c`, and the
walk from the target.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
With Threads open, arriving at a commented element expands its thread in
the list, which the margin owner's header says plays the card's part. The
thread reading ignored it: the expanded reply showed no `c`, `c` opened a
new-comment composer on the element, and `t` started the walk from the
top rather than from that thread.

The reading, renamed `threadHere` now that it answers for the list too,
returns the list thread `accompaniedThread` (thread/landing.js) names for
the target the user stands on, and the walk's place falls back to it. The
arrival repaints the inputs after expanding, since the focus event had
already painted them. A new navigation test covers the badge, `c`, and the
walk from the target with Threads open.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The badge, the shortcut line, and the press already read one
destination. What drifted was an input to it: `threadHere` re-derived
from focus whether the user stood where the card belonged, beside the
code that decides the card stays up. The two disagreed wherever the card
stays beside its target without focus on it: after `g p`, and after
Escape from a passage's mark. The card showed a reply that `c` did not
reach.

`threadHere` now reads the card's being up as the answer: focus inside a
thread first, else the card's one thread. The card is up only while the
user stands where it belongs, so the second reading had nothing to add.

A parametrized navigation test walks ten routes into, within, and out
of the card and asserts the invariant rather than a route: exactly one
box wears `c`, `c` lands in it, and while a card is up that box is its
reply. The walked-thread test keeps only the line and walk assertions it
no longer shares with it. The panel arrival drops a repaint request that
the focus move's own repaint already covers.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit 9ec3478 into main Sep 26, 2026
5 checks passed
@max-sixty
max-sixty deleted the c-hint-flaky branch September 26, 2026 04:10
max-sixty pushed a commit that referenced this pull request Sep 26, 2026
The nightly option-addition test still expected `c` to open a new
comment composer from a focused option. PR #1204 changed the shortcut to
enter the Reply box in the thread card already visible beside that
option. The test now checks that destination and verifies that the
shortcut neither selects an option nor opens a second composer.

The [failed nightly
run](https://github.com/max-sixty/leaf/actions/runs/36217032553) had one
other failure in the visual review journey. PR #1205 already corrected
that expectation on main; its focused case passes locally. Before this
change, the option test reproduced the remaining failure. Afterward, `uv
run pytest tests/test_render_options_addition.py -q -n0` passes (9
tests).

Co-authored-by: leaf-agent <[email protected]>
max-sixty added a commit that referenced this pull request Sep 27, 2026
…ows (#1294)

A margin card's Reply box never showed the `c` key while the card was at
rest, though `c` landed in it and the shortcut bar said "comment on the
thread". The card drew its Reply as a stand-in button
(`.lf-reply-disclosure`) over a hidden editor. `c`, the key badge and
landing all name the editor, so the badge was painted on a box the user
could not see. The key appeared only after the reply had been opened and
left open, for example after `c` then Escape, or once a draft existed.

#1204 fixed which box `c` reaches, and its invariant test read the badge
from the editor's `placeholder` attribute. That attribute records the
hint whether or not it is drawn, so the test passed on every route while
the key was invisible on eight of its ten.

The stand-in had matched the empty editor's box and face since #1165, so
it no longer changed how the card looked, only which node was on screen.
The card now draws the editor itself, as the Threads panel does. The
collapse/reveal state goes with the stand-in: its CSS,
`lfCollapseReply`, and the collapse on closing the card. `lfRevealReply`
remains the Threads panel's reveal.

### Behavior that moves

- At rest the card shows the editor's `Reply c` hint and its disabled
send glyph.
- Tab from the thread lands in the text box, as in the Threads panel,
rather than on a button that left page keys live.
- A press on the resting Reply focuses the editor directly instead of
running the thread landing, which re-scrolled the page to the passage
the card already stands beside.

### Tests

`test_c_lands_where_its_badge_is_and_in_the_card_on_screen` also
requires the drawn key to be visible whenever a card is up. It fails on
eight routes against the previous runtime and passes on all ten now.
Margin, navigation, chrome-contract and draft tests that pressed the
stand-in now press the editor, and assertions that the editor was hidden
at rest are gone.

Local: `uv run pytest tests` 1451 passed; `npm run test:runtime` 139
passed. Across the six affected browser files including nightly tests,
the branch fails the same 13 tests as its merge-base (6e3897a), plus
one Threads-panel scroll test that passes alone.

> _This was written by Claude Code on behalf of max-sixty_

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
max-sixty added a commit that referenced this pull request Nov 20, 2026
The sentence in authoring-on-me.md's "Make each question self-contained" told
the agent to name work by what it does "rather than by its number". Max wants
the number kept, since it is how the user finds the pull request, with words
beside it that say what the work is. The sentence now asks for that, with
"Merging #431, the retry for dropped uploads" as its title example, and moves
to the end of the paragraph, after what a question mainly holds, since he still
found it prefatory where it stood.

The naming rubrics now let an option cite a number its ask's title describes,
as "Merge #812" under "Merging #812, the LRU result cache", since the card
gives the number its context.

Evals (Claude Code, this tree, 3 runs a case): fork asks name the work 6/6,
items-right 27/27, guardrails 9/9. The agent's merge ask after a compaction
titles every thread with both, as "Merging #1211, the badge on notes waiting to
sync", but in each run still mentions #1204 in passing without saying what it
is, so names scores 0/3. The page-sections case names 1/3. A version whose
example was a passing mention ("#431, the retry for dropped uploads", not a
bare "#431") raised sections to 2/3 but titled merge asks "Merging #1211"
in 3/3, so the title example stays. About $14 of runs.
max-sixty added a commit that referenced this pull request Nov 20, 2026
…6560)

Agents on Leaf pages ask the user to decide about work they name only by
number: thread titles "Merging #6551", options "Merge #6551", passing
mentions such as "It doesn't depend on #6538". The user meets each ask
on its own in On Me or Threads, often hours later, and can't tell what
it is about. Of 43 merge asks on this machine's pages since 5 Nov, 17
were titled by number alone, and the turn-end check's fork wrote 31 of
the 43. This adds one sentence to the end of `authoring-on-me.md`'s
"Make each question self-contained": beside each pull request, issue or
commit a question mentions, say what that work is, with "Merging #431,
the retry for dropped uploads" as the title example. Every writer of an
ask reads that paragraph, the fork included through `clerk.GUIDANCE`. It
also adds a `names` rubric to the evals that score asks, which lets an
option cite a number its ask's title describes.

To weigh: passing mentions still slip. The agent's merge ask after a
compaction titles every thread well but mentions #1204 without saying
what it is in 3/3 runs, and page sections name their PRs 1/3. A version
whose example was a passing mention raised sections to 2/3 but brought
back bare "Merging #1211" titles, so the title example stays.

Requested by the maintainer, who rejected earlier versions that put the
rule in `SKILL.md`'s "Must remember" and that dropped the number; he
hasn't read this diff. Evals (Claude Code, 3 runs a case): fork asks
name the work 6/6 (main 0/6), items-right 27/27, guardrails 9/9. Tests:
`test_clerk.py`, `dev/tests/test_evals.py`.

> _This was written by Claude Code on behalf of max-sixty_
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants