GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(web): restore renderer focus after preview presses by 0bkevin · Pull Request #9849 · pingdotgg/t3code

Conversation

@0bkevin

@0bkevin 0bkevin commented Sep 5, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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.

All reactions
@0bkevin
fix(web): preserve focus during preview presses
fb3d9aa
@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Sep 5, 2026
This was referenced Sep 5, 2026
fix(desktop): preserve user focus during preview presses #9848
Closed
fix(web): preserve composer focus during preview presses #9530
Closed
@juliusmarminge juliusmarminge mentioned this pull request Sep 9, 2026
[Bug]: preview_click leaves keyboard focus inside the preview tab, so the user's typing goes to the page #10980
Closed
2 tasks done
@BreakTheBeta BreakTheBeta mentioned this pull request Sep 10, 2026
fix(desktop): preserve composer focus during preview automation BreakTheBeta/T3codefold#9
Merged
@juliusmarminge

juliusmarminge commented Sep 12, 2026

Copy link
Copy Markdown
Member

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge juliusmarminge closed this Sep 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

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.

Projects

None yet

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.

2 participants

@0bkevin @juliusmarminge
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.