GeezerVison is showing github.com — fix(web): restore renderer focus after preview presses by 0bkevin · Pull Request #9849 · pingdotgg/t3code
Conversation
0bkevin
commented
Sep 5, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Preview key presses can leave the host renderer with a connected preview control focused after native focus returns, so the next composer keystroke is lost. This keeps the existing void IPC contract and restores the prior DOM focus only when the document is still focused, the element remains connected, and no newer user focus took ownership.
The change is limited to the web renderer:
- Wrap the existing preview press bridge call with a DOM focus guard.
- Recognize native focus transfer separately from newer pointer, keyboard, or programmatic DOM focus.
- Keep overlapping calls concurrent while preventing an older call from reclaiming focus.
- Preserve the operation result or rejection when focus restoration fails.
PreviewAutomationHosts is mounted only in Electron (isElectron && previewBridge.automation), so the standalone browser path is unaffected. This is the renderer portion of #9530 and is independent of the desktop native companion PR.
Validation:
- 10 focused renderer focus tests passed.
@t3tools/web typecheck passed.
- Targeted lint passed with the existing warning at
PreviewAutomationHosts.tsx:741.
- Modeled baseline test failed before the guard and passed with it.
- No live Electron before/after recording is included yet; the draft remains pending that runtime evidence.
- During overlaps, the latest-call guard conservatively suppresses stale restoration; this does not claim to resolve every cross-thread focus race.
Refs #5792. Replaces the renderer portion of #9530. Desktop companion: #9848.
Model: GPT-5.6 Luna implementation; GPT-6 review
Harness: Codex in T3 Code
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Sep 5, 2026
|
Superseded by #11354 (fix(desktop): keep preview keystrokes out of the composer), which landed the desktop-side fix for preview automation leaking into the composer (Refs #5792). Closing this renderer focus-restore companion as wash leftover hygiene — reopen if anything unique still needs merging.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
size:L
100-499 changed lines (additions + deletions).
vouch:unvouched
Author is not yet trusted in the VOUCHED list.
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.