Skip to content

Keep focus on conversation cards after sending - #2116

Merged
max-sixty merged 9 commits into
mainfrom
codex/send-stays-on-card
Oct 9, 2026
Merged

max-sixty merged 9 commits into
mainfrom
codex/send-stays-on-card

Conversation

@max-sixty

@max-sixty max-sixty commented Oct 9, 2026 •

Copy link
Copy Markdown
Owner

Sending a contextual comment or reply now leaves focus on its conversation card or title across floating, inline, and panel threads. The banner's page-comment card also stays open and focused after sending. Pressing c resumes writing; Escape follows the surface's existing exit route.

Remove the margin-specific return-to-page branch from the shared send landing. Delayed banner refusals restore text entry only while the original input still owns focus, using the existing retained-intent mechanism. Update the keyboard contract, documentation, gallery, corpus, and browser expectations together.

Validation: focused browser checks cover first comments, replies, pointer and keyboard sends, follow-up composition, Escape, refusal recovery, and newer reading input; all 258 runtime tests and pre-commit checks pass. All 48 Mac appearance states were reviewed, with unchanged card/editor geometry and the intended focus rings. Independent source, keyboard journey, and deeper-cause reviews found no remaining issues, including overlapping send refusals.

This was written by Codex on behalf of max-sixty

Sending a first comment or reply now leaves focus on its card or title across
floating, inline and panel threads. The page-comment card also remains open
and focused. Follow-up writing uses c; Escape follows the existing exit route.
Remove the margin-specific page-target branch from the shared send landing.

Use retained input intent for banner refusal recovery so a late refusal cannot
take focus after a newer reading gesture. Update the keyboard contract,
documentation, gallery, corpus and browser expectations for the new policy.

Validation: 254 runtime tests and focused browser routes, refusal recovery,
geometry, and keyboard journeys pass. Source and live UI review are clean;
an additional overlapping-send refusal probe preserves the newer draft and
focus. The landing gate supplies broad and changed-nightly coverage.

> _This was written by Codex on behalf of max-sixty_
Review all 48 Mac states against current main. Geometry is unchanged; the six material pixel changes are the intended floating-card focus rings after sending and refusal.

> _This was written by Codex on behalf of max-sixty_
leaf-agent
leaf-agent previously approved these changes Oct 9, 2026

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test job is red on six cases in tests/test_render_send_placement.py. Each failing route sends from the margin card, presses Escape once, then clicks its marker expecting to reopen the card. With this PR's intended focus change, that Escape leaves the card for its page target; the marker click then closes the card, so the later placement assertion reads a hidden surface. I reproduced test_a_right_edge_passage_reopens_a_usable_card_without_moving_typing locally. Update those reopening journeys to leave the target as well before clicking the marker, then rerun the affected cases. I can push the mechanical test update if you'd like.

@leaf-agent
leaf-agent dismissed their stale review October 9, 2026 00:47

CI failed: six send-placement browser tests still follow the old one-Escape return route.

Send leaves focus on the conversation card. Reopening and board-drag journeys now leave the card for its passage, then dismiss it before continuing. Preserve the original placement, source replacement, and round-trip assertions.
leaf-agent
leaf-agent previously approved these changes Oct 9, 2026
# Conflicts:
#	skills/leaf/assets/runtime/thread/landing.js
The keyboard-settings control added in #2121 closes More before opening Command reference. Name that placement as a move through focusDestination, matching the focus API from #2036 and clearing the merge lint gate. Keep its send journey on the banner card until Escape, as the send focus policy requires.
leaf-agent
leaf-agent previously approved these changes Oct 9, 2026
leaf-agent
leaf-agent previously approved these changes Oct 9, 2026
# Conflicts:
#	skills/leaf/assets/runtime/keyboard/shortcut-bar.js
@max-sixty
max-sixty merged commit 12678d8 into main Oct 9, 2026
6 checks passed
@max-sixty
max-sixty deleted the codex/send-stays-on-card branch October 9, 2026 03:07
max-sixty added a commit that referenced this pull request Oct 9, 2026
Phase 3 landed as 1e9fad2. Each conflict is that squash meeting the phase 3 commits this branch holds, so each conflicted file is re-merged against phase 3's tip (8e85f82) as the base, leaving main's own later changes (#2116, #2039) to meet this phase's; none conflicts. The branch's diff against main is now exactly phase 4's.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
max-sixty added a commit that referenced this pull request Oct 9, 2026
…eads too

Main now keeps the card open and focused after a send (#2116). With Threads open the
card is where a page thread starts too, so the tests that followed the old close to
the control now stand on the card, and `c` writes in it again.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
max-sixty added a commit that referenced this pull request Oct 9, 2026
Main keeps the page comment card open after a send (#2116). Its box empties at once and
shrank, so Send moved under the press; a refusal then handed the words back and the box
grew again, moving Send with no gesture. The thread snapshot journey's general case, now
the card, failed the shift watch on that refusal. The box keeps the room its words took
until the user writes in it again or the card goes.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent added a commit that referenced this pull request Oct 9, 2026
Five nightly browser checks in [main CI run
37880455978](https://github.com/max-sixty/leaf/actions/runs/37880455978)
were asserting older UI behavior. This changes their expected readings
to match the shipped interaction while retaining their checks of focus,
reachability, and stable search position. Each of the five failed on
`main` before the edit and passed with it.

- The compact comment and draft journeys now expect Send to focus the
conversation card, as
[#2116](#2116) intended.
- The banner journey accounts for the visible Copy control in More. The
command reference journey accounts for its preference checkbox as a
native Tab stop.
- At a 320 px tall viewport, the reference can stay at its height limit
after filtering because its fixed controls and empty result occupy the
available room. The test still requires a smaller dialog at taller
viewports, a steady search field, and a visible empty result.

Verification: the five named browser tests passed locally after failing
individually before the edit; all three viewport variants of the
reference filtering test passed. The run's margin failures are covered
by [#2126](#2126), and its trace
gallery failures remain recorded in
[#2128](#2128). The focused
visual review editor failure is separate from these outdated assertions.

Co-authored-by: leaf-agent <[email protected]>
max-sixty added a commit that referenced this pull request Oct 9, 2026
)

Threads no longer has a comment box at its foot. The page comment card
under the banner's Comment on the page control (#1930) becomes the one
place a page thread starts, with Threads open or shut: the control, `c`
with nothing to comment on, and Resume writing all open it, and Threads
is where a thread lives once started.

## Behavior that changed

- With Threads open, `c` and the control open the card, which hangs over
the panel's top. A send leaves the user on the open card (main's #2116),
flashes Threads, and scrolls the new thread into view in the open list,
as an anchored comment's send does.
- After a send, the card's field keeps its height until the user writes
again, and the room its attachments took stays empty above the field
until the user puts the card away. Send stays under the press, a refusal
that hands back the words and images returns them to the room they left,
and typing again leaves the field's top where it was. The field's height
is a basis, not a floor, so a window that later shrinks still shrinks
the editor before the card scrolls.
- An executable revision arriving while the user writes in the card
opens it again with the caret where it was: editing continuity shows a
hidden root editor through its owner's Resume writing route
(`drafts.js`). It used to restore only a visible box, so the card came
back shut and the caret was lost.
- The card stays inside the window and both side safe areas at every
width, combining main's #2016 clamp with the safe-area insets.
- Threads' empty text points at the banner instead of "the box below".

## Code

- `thread/page-comment.js` owns the only general box. The panel's second
editor, the draft mirroring between the two, and every branch on whether
Threads is open are gone; `panel-elements.js`, `thread-panel.js` and
`leaf.js` stop building and wiring it. The panel foot stays as page
annotations' response-bar home.
- The card's composer takes `lf-general` with main's column composer
rules; the separate `.lf-page-composer` copy is gone.
- `reading-regions.js` drops `apparatusFor`, whose one caller was the
foot composer's reading region.

## Tests

- Every test that wrote into Threads' box now opens the card
(`page_comment` in `render_harness.py`). Tests of the panel box's own
layout, focus-after-send and Escape-to-list are rewritten for the card,
or reduced to what the panel still owns (main's short-panel test keeps
its grip and body-scroll checks; the card's short-window fit is the card
test's).
- Fixtures that needed Threads' list to overflow grow, since the list
now runs to the panel's foot.
- `clear_of_the_bar` counts the shortcut bar as covering only the
columns it spans: it yields a beside-panel its width, so a reply pinned
at the list's foot stands beside it.
- The words watch credits the closes the browser makes of open popovers
(light dismissal, an invoker's toggle, Escape) to the gesture that
caused them; a timer's close still fails.
- The focus-ring cover walk carries past a z-index to the stacking
context that holds it and ranks that context by its own place, hoisting
only static boxes above a static stacking context. It read the comments
panel's touch grip ring as under a thread's sticky title, whose z-index
lifts it inside the list and no further, while every pixel of the ring
was the ring's. New cases check a band lifted inside a static stacking
context on both sides of the control against the page's pixels.
- Thread appearance snapshots are accepted again from the tree merged
with main.

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

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
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