Skip to content

Preserve thread search when Escape leaves typing - #940

Merged
max-sixty merged 5 commits into
mainfrom
codex/thread-escape-panel
Sep 22, 2026
Merged

max-sixty merged 5 commits into
mainfrom
codex/thread-escape-panel

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Escape in thread search now returns focus to the whole panel while preserving the query and filters. Readers can stop typing and navigate matching threads without losing their search. Subsequent Escape presses clear the narrowing, then close the panel.

The search box reuses the existing text-entry Escape behavior. Its special clear-first handler and unused dependencies are removed, and the owning comments and browser regression reflect the new ordering.

Validated with the complete conversation browser suite (99 tests), runtime tests (33), lint, and a live baseline/candidate comparison. The everyday suite passed 1,271 cases; its one runtime-generation mismatch, caused by editing runtime comments during the run, passed when rerun on the settled files.

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.

keyboard/dispatch.js still carries the removed behavior as its worked example. The comment above the splice in stack() — the one ending return [...own, ...(typing ? [TYPING] : [controlScope]), ...ancestors]; — reads:

A control's own state is the innermost layer, before the generic text-box escape and any containing widget: the find box clears its own query before handing the reader back to the list the box belongs to.

That is exactly what this diff deletes, and it now contradicts the module header the same diff rewrote ("Its Escape uses the ordinary text-entry row to return to the panel, keeping the query"). A reader checking the register against dispatch.js gets opposite answers from the same file, and the ordering rule this line states is the one they would be checking.

The find box's remaining exact-input row is the example the line needs: TEXT_ENTRY claims Enter as an editing key, so thread.find.first standing before it is the same "own state before the generic claim" point, and it is live. Something like:

A control's own state is the innermost layer, before the generic text-box claim and any containing widget: the find box takes Enter into the first thread it found, ahead of the claim that would otherwise hand Enter to the box.

Happy to push that as a commit if you'd rather not.

Otherwise the change reads well, and it is the deeper fix rather than a reordering: keyboard/CLAUDE.md's ladder already puts a box (7) under its surface's narrowing (4) and the surface itself (3), so the special-cased Escape was the anomaly and removing it is what makes the find box conform. The generic text.leave row does cover it — boxHandsBack is satisfied by the panel containing the focused box, and the fallback target is the threads list.

Test selection

tests/test_render_conversations.py, tests/test_render_semantic_selection.py and tests/test_render_controls.py (235 cases) plus npm run test:runtime (34). One failure, test_render_controls.py::test_covering_threads_keeps_the_reader_and_their_work_inside, reproduces identically on the merge base 2bc9adc29ece5ef822cb1737ceb11cb1f21fd1bf (assert 85 == 131 ± 1, same values, -n0), so it is not this branch's — and that file is nightly rather than the everyday gate.

@max-sixty
max-sixty merged commit eaa9a31 into main Sep 22, 2026
5 checks passed
@max-sixty
max-sixty deleted the codex/thread-escape-panel branch September 22, 2026 18:52
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