Skip to content

fix(web): a late frame after Tab no longer collapses the words you selected - #982

Merged
badcuban merged 2 commits into
mainfrom
fix/composer-late-focus
Nov 17, 2026
Merged

badcuban merged 2 commits into
mainfrom
fix/composer-late-focus

Conversation

@badcuban

Copy link
Copy Markdown
Collaborator

A composer browser test ("keeps the rest of the suggestion after the cursor while typing its first words") started failing in main's merge queue some of the time. It is a real bug for people on a busy machine, not only a test problem.

Tab completion, menu picks, prompt recall, filling a prompt and restoring a stash write the message box and then put the cursor in place one frame later. A busy page draws that frame late, after the user's next keys. The cursor then jumped back and any words selected since were deselected. In the test, Tab's late focus landed after it retyped and selected two letters, so the rest of the suggestion never hid.

The put-off focus now leaves the box alone when it no longer holds what was written, or when words are selected in it. The editor handle gains hasSelectedText(). Two browser tests hold Tab's frame back until after the user's next keys: one retypes and selects, one only selects. Each fails without its half of the check.

The real-list "keeps the selection and its actions when the list moves the text's row" check also gets the file's 5-second AFTER_SCROLL wait instead of the default second. The assertion is unchanged; it failed in the same queue run under load.

Checks: fmt, lint and typecheck pass. The web unit suite passes (255 files), and so does the full browser suite (111 files, 1,098 tests before the second test was added). Under heavy local load, the composer test never failed in three runs of browser job 1; other tests that depend on timing did.

…lected

Tab completion, menu picks, prompt recall, filling a prompt and restoring a
stash write the message box and then put the cursor in place a frame later.
A busy page draws that frame late, after the user's next keys: the cursor
then jumped back and a selection made since collapsed. That is why the
composer suggestion browser test failed on CI under load: its Tab's focus
landed after it retyped and selected two letters.

The put-off focus now leaves the box alone when it no longer holds what was
written or words are selected in it (focusAfterWrite; the editor handle
gains hasSelectedText). A browser test holds Tab's frame back until after
the selection and fails without the fix.

The real-list selection test's check also gets the file's AFTER_SCROLL wait
instead of the default second; the assertion is the same.
@vercel

vercel Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
threadlines Skipped Skipped Nov 17, 2026 11:22pm UTC

Request Review

@badcuban
badcuban added this pull request to the merge queue Nov 17, 2026
Merged via the queue into main with commit 94ce8a6 Nov 17, 2026
24 checks passed
@badcuban
badcuban deleted the fix/composer-late-focus branch November 17, 2026 23:34

This branch was previously deployed

1 inactive deployment
Preview — 69bd87af Deployed Nov 17, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant