Skip to content

Fix delayed reaction focus restoration - #448

Merged
max-sixty merged 3 commits into
mainfrom
codex/thread-ui-polish
Sep 8, 2026
Merged

max-sixty merged 3 commits into
mainfrom
codex/thread-ui-polish

Conversation

@max-sixty

@max-sixty max-sixty commented Sep 8, 2026 •

Copy link
Copy Markdown
Owner

Closing a reaction palette restores focus on the next animation frame because Chromium may leave focus on the hidden choice. That return now runs only while focus is still on the closing choice or has fallen to the document body, so a reader who moves to another control during the frame keeps their newer focus.

Tested with the 910-test everyday suite, all 50 reaction browser tests, ten consecutive runs of the former reaction-focus flake, and pre-commit.

This was written by Codex on behalf of @max-sixty

@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 reactions.js guard reads correctly to me, and the selection I ran for it is green: tests/test_render_reactions.py and tests/test_render_navigation.py (144 passed), plus tests/test_render_conversations.py and tests/test_render_aim.py (128 passed). The test half is what holds the verdict.

#445 repairs the same case, test_an_inline_thread_uses_surface_focus_until_its_reply_takes_over, and reaches the opposite conclusion about the reply ring. It reads the 1px offset as a cascade collision rather than an authored value, and the history supports that: a15715c ("Reply fields use one focus ring instead of an accented border plus outline") set the chrome text-box rule to outline-offset: 0; border-color: transparent, but theme.css's .lf-conversation-thread :is(.lf-btn, textarea, summary):is(:focus-visible, .lf-focus-visible) still declares outline-offset: 1px and outweighs it — (0,3,0) against the chrome rule's (0,2,1), the extra class coming from .lf-btn sitting in that :is() list beside textarea. So the reply field never took the band that commit wrote for it. #445 drops textarea from that list and gives the reply the text-box terms; asserting "offset": "1px" here pins the collision as intended behaviour instead.

The resting move is the same repair in both branches as well, with #445 re-reading it via el.blur() while the preview is still open rather than after Escape, so the tint comes from a visible thread rather than a display: none subtree.

#445 is the older branch and is green, so the cheapest resolution is to drop both test edits from here and let this PR carry only the reactions.js guard, which no other open PR touches. Otherwise whichever lands second conflicts in test_render_navigation.py, and if that is this one, the offset assertion goes red against #445's theme.css.

@max-sixty
max-sixty merged commit 6023c34 into main Sep 8, 2026
7 checks passed
@max-sixty
max-sixty deleted the codex/thread-ui-polish branch September 8, 2026 17:00
max-sixty added a commit that referenced this pull request Sep 17, 2026
…ruled out (#768)

The cutover list scored its candidates from a survey's estimates. Six of
the rows ranked next were measured against the code, and every one was
stale or overstated; an independent review then confirmed the six
verdicts and corrected three of the reasons behind them. The rows now
carry what was measured, and the ones the measurements ruled out have
moved to the survey note, whose table is now named Rejected.

What the measurements found:

- **`html` as the page scroller** was already done: `26feec8b` made the
switch on 2026-08-29, `theme.css` holds the rule, and the runtime reads
`document.scrollingElement`. The row is gone.
- **Same-document View Transitions** claimed ~150 lines against a
`motion.js` of 87. The update applies after the old state is captured,
later than the gesture's own turn; pointer input misses the page while
it animates; a fold collapses height so later content slides, which a
root cross-fade does not draw; and board cards move inside their own
scroller, whose clip a snapshot escapes under the Chrome 125 floor. #666
removed the paint-boundary transition version travel used, which also
leaves `theme.css`'s `lf-versioning` rule dead — deleted here.
- **idiomorph for the version patch**: a live-tree diff keeps only the
reader state an exclusion names, while `dom-children.js` compares
authored source with authored source and keeps all of it. It has needed
no fix since #514 split it out.
- **`tsc --checkJs`** runs in under a second, but a bug-back over six
runtime fixes (#404, #448, #625, #660, #676, #757) found no error that
the fix removed from the files it touched, and the errors it does report
are inference artifacts.
- **Browser-owned anchoring** was spiked on `agent-a4111d25e33d466d2`.
All three capture paths cut over and the anchors matched the Python
capture exactly, but Python grew by 168 lines, a quoted `leaf comment`
went from 0.2 s to 1.3 s and now needs Chrome, and the anchor tests went
from 8 s to 37 s: the refusals and the diagnostics for a quote the page
does not show read authored source the rendered page no longer holds.
- **The user-level daemon** nets roughly zero lines. The browser already
receives pushes over `EventSource`, the 70 µs stat loop serves CLI
writers in other processes, pid probing and most locks stay, Windows is
not a goal, and a user-level database stops the page directory being the
deployment unit.

Two rows are new. A size-first sweep of the largest hand-written
mechanisms found one candidate the defect-led survey missed: serving
each page through starlette and uvicorn, which `mcp` already installs,
keeping one process per page. And the keyboard system becomes item #24
under architecture simplification: the reader keeps every key, sequence,
hint, and the one-press-per-layer Escape, while the code that infers
which surfaces are open — where ten of the last 24 keyboard fixes landed
— gives way to a layer stack that openers push and closes pop. No
library owns that; the ones that came closest are in Rejected.

The preamble now says effort and confidence are estimates unless a row
cites a measurement.

Checks: the everyday suite (1,135) and
`test_a_revision_navigates_without_the_view_transition_api`, which
exercises activation with the View Transition API switched off, both
pass; pre-commit is green on the changed files.

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

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

---------

Co-authored-by: Claude Opus 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