Repository navigation
Conversation
…s back (#90) The adapter's showDialog hands focus back, when a notice replaces the prompt, only if the prompt contains document.activeElement. The prompt's input is in the Status Line's shadow root, where that reads as the host, so a search that finds nothing, an unknown ex command, :w, a failed :s or :set and :registers left focus on <body> and the next key reached no Field. The mirror wraps the instance's openNotification: it makes the same check in the prompt's own tree before the notice replaces the prompt, and calls cm.focus() after (the Session's marked focus, so the Cursor stays, #88). :wq and :x still end blurred behind their notice; they now blur a focused host, as :q does. Closes #90 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… every Field type, and one helper for the command line's steps - Ctrl-o then a notice-ending command line from Insert and from Replace mode is covered on the three Field types (red on main). The engine comes back in Insert from both, with or without a command line; the test says so. - :wq and :x now blur a Field the notice has just focused, so that path is pinned where it was not: :wq and :x on a Single-line Field, :x on a contenteditable, :wq on each rich editor. These pass on main too: they guard the outcome #65 set, they are not this fix's regression tests. - The steps every notice test repeated are `submitForNotice` in the e2e helpers; the rich-editor tests assert the host's focus, which their comment claimed. - The mirror's wrapper names what it reads (`replaced`, `hadFocus`), and the blurred-host branch of ContentEditableField.blur names the case it is left for. Refs #90 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A command line whose Enter ends in a notice (a search that finds nothing, an unknown ex command,
:w, a failed:sor:set,:registers) left focus on<body>: the Status Line showed the notice and the next key reached no Field. The adapter hands focus back only when the prompt containsdocument.activeElement, and the prompt's input is in the Status Line's shadow root, where that reads as the host.:wqand:xstill end blurred behind their notice. They now blur a Field the notice has just focused, as:qdoes; before, the Field was already blurred.docs/engine-seams.md"Focus" and "Leaving a contenteditable Field" say what is true now; the two Chromium facts are pinned intests/unit/chromium-facts.test.ts, "Focus".Evidence
npm run red-on-mainon the changed spec files → "every file is red on main": the 40 tests that pin the fix fail there, on the missing focus.After:
npm run checkpasses: 572 unit tests, 262 e2e, 0 flaky.npm run test:e2e:editors: 295 passed, 0 flaky.beforeEachtimeout in a Lexical test this PR does not touch (lexical.spec.ts:98at load average 38;lexical.spec.ts:307at 90 MB free memory). That hook loads the page and Activates; no command line is involved. Whethermainshows the same rate under that load was not checked.maina click does resume a contenteditable after such a notice.Merge Danger
Door: two-way
Reverting the two commits restores the old behaviour. Nothing is stored or migrated.
Blast Radius: every notice
Ctrl-ofrom Replace mode comes back in Insert; a notice-ending ex command from Visual mode leaves Normal mode.:registerslisting stays after the next key.Closes #90
🤖 Generated with Claude Code