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(desktop): preserve user focus during preview presses by 0bkevin · Pull Request #9848 · 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

Desktop preview key presses temporarily focus the guest WebContents so native keyboard events reach the preview. Cleanup must not restore a stale renderer after the preview window loses focus or after a user takes control, which could steal focus back from the user.

This desktop-only change snapshots the existing per-tab control epoch before focus transfer and rechecks it immediately before native focus restoration. The previous renderer is restored only while the app window is focused and the preview guest still owns focus. A human event during key dispatch or while key-up cleanup is in flight therefore prevents refocus. The existing Effect.ensuring cleanup remains in place for key-up and focus-emulation cleanup.

Scope is limited to apps/desktop/src/preview/Manager.ts and apps/desktop/src/preview/Manager.test.ts. The existing Promise<void> IPC contract is unchanged; this PR contains no web or contracts changes.

Validation:

  • Manager.test.ts: 80 passed
  • The cleanup-time pointer regression applied to the prior PR commit: 79 passed, 1 failed because the old restore guard refocused the previous renderer
  • Desktop typecheck passed with existing Effect suggestions
  • Targeted desktop lint and formatting checks passed

Live Electron before/after recording remains pending. This PR covers native desktop focus restoration and does not claim to fix DOM or composer focus behavior by itself.

Refs #5792. Replaces the desktop portion of #9530.

Implemented GPT-5.6 Luna; reviewed GPT-6 via Codex harness in T3 Code.

Sorry, something went wrong.

Uh oh!

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

All reactions
@0bkevin
fix(desktop): guard preview focus restoration
91cec30
@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Sep 5, 2026
macroscopeapp[bot]
macroscopeapp Bot reviewed Sep 5, 2026
View reviewed changes
Comment thread apps/desktop/src/preview/Manager.ts Resolved

Uh oh!

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

This was referenced Sep 5, 2026
fix(web): restore renderer focus after preview presses #9849
Closed
fix(web): preserve composer focus during preview presses #9530
Closed
@0bkevin
fix(desktop): guard focus after cleanup interruption
5f762cb
@github-actions github-actions Bot added size:S 10-29 changed lines (additions + deletions). and removed size:M 30-99 changed lines (additions + deletions). labels Sep 5, 2026
@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
@shivamhwp shivamhwp mentioned this pull request Sep 10, 2026
fix(desktop): hand keyboard focus back after an automation click #10982
Closed
@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 Manager/PreviewKeyboard fix for preview automation interfering with the composer (Refs #5792). Closing this desktop focus-restore companion as wash leftover hygiene — reopen if anything unique still needs merging.

0bkevin reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

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

@macroscopeapp macroscopeapp[bot] macroscopeapp[bot] left review comments

Uh oh!

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

Assignees

No one assigned

Labels

size:S 10-29 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.