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(app): show the composer focus ring only when focus arrives by keyboard by usrnk1 · Pull Request #64976 · anomalyco/opencode

Conversation

@usrnk1

@usrnk1 usrnk1 commented Nov 19, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

When focus moves into the composer from another control, the composer now takes that control's focus ring state. Clicking a queued message, Exit shell or Quote no longer draws the ring around the composer. Reaching the same controls with the keyboard still shows it.

The composer only knew about pointer presses on itself, so any other click that moved focus into it looked like keyboard focus.

  • handoffRing / handOffFocus in @opencode/ui/context/field-focus read the ring state from the control that had focus. If the composer already has focus, its state is left as it is.
  • They're used by the composer's restoreFocus paths (queue edit, cancel and merge; Exit shell; quote; attachments chosen from the + menu or dropped; usage-exceeded dialog onDone) and by the session prompt focus (Quote, removing the last activity chip, plugin focus).
  • Focus input (Ctrl+L) always shows the ring, since a shortcut moved focus, as the focus-states skill requires.
  • Exit shell now restores focus before the mode change unmounts the button, so pressing it from the keyboard keeps the ring.

Verified with real input in headless Chromium against a dev server (1 = ring shown):

click, before click, after keyboard, after
Edit queued message 1 0 1
Exit shell 1 0 1
Quote (Alt+click, no comment) 1 0 n/a
Ctrl+L, from nothing focused or from a clicked composer 1

Queued message, before: after:

Quote, before: after:

No feature flag: this is a fix. Only packages/app and packages/ui change, and no GUI plugin SDK files.

Sorry, something went wrong.

Uh oh!

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

All reactions
@usrnk1
fix(app): show the composer focus ring only when focus arrives by key…
ec35c36
…board
@github-actions github-actions Bot added the contributor label Nov 19, 2026
opencodejr[bot]
opencodejr Bot reviewed Nov 19, 2026
View reviewed changes

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't verify this one: there's no browser in the review sandbox, so I reviewed the code and ran the tests. The composer/session tests show the same 2 failures on the base, and tsc passes for packages/app and packages/ui. Public API unchanged: the two new exports in @opencode/ui/context/field-focus are internal to the app.

The main concern is that handoffRing treats focus on <body>, or on a clicked control, as "no ring". That's right for the clicks this targets, but region.focus is also what the Ctrl+L input.focus command runs. Pressing Ctrl+L while focus is on the body or a clicked control showed the ring on the base and no longer does. The same applies to any restoreFocus that runs after focus has already fallen back to the body. Details are inline.

Minor: the touch-bar Exit shell button (editor.tsx:1643) still dispatches mode.normal before restoreFocus(). It wasn't reordered like the main button, so it won't keep the ring when pressed from the keyboard.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread packages/app/src/session/composer/region.tsx Outdated

const focus = () => {
if (!input.session.data.isChild()) promptRef?.focus()
if (promptRef && !input.session.data.isChild()) handOffFocus(promptRef)

@opencodejr opencodejr Bot Nov 19, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is focusInput, which the Ctrl+L input.focus command calls, so it's a keyboard path. If focus is on <body> or on a control the user clicked earlier, handoffRing returns false and the ring is suppressed. On the base, .focus() showed it here (!pointer). One option is to have handoffRing return undefined when document.activeElement is the body or null, so the field's own pointer heuristic decides. Another is to keep plain .focus() for the Ctrl+L path.

Sorry, something went wrong.

Uh oh!

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

All reactions

@usrnk1 usrnk1 Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch: Ctrl+L went through handoffRing, so with focus on the body or a clicked control the ring was suppressed. Fixed in 177f415. The input.focus command now calls focusField(promptRef, true) in region.tsx, and the new-session Ctrl+L command passes visible = true to restoreFocus. A shortcut always shows the ring. The click and keyboard handoff paths still use handoffRing.

Sorry, something went wrong.

Uh oh!

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

opencodejr[bot] reacted with eyes emoji
All reactions
  • 👀 1 reaction

@opencodejr opencodejr Bot Nov 19, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked 177f415 and it fixes the problem. Both Ctrl+L paths now force the ring on, so they no longer depend on what had focus before.

  • Session Ctrl+L: focusInput (region.tsx:321-323) calls focusField(promptRef, true). The only caller of focusInput is the input.focus command (use-session-commands.tsx:665-670, ctrl+l), so no click path ends up showing the ring.
  • New-session Ctrl+L: onSelect: () => input.restoreFocus(undefined, true) (new-session/commands.tsx:41) reaches interaction.ts:566. That's the composer editor's restoreFocus, via ComposerModel = ComposerEditorModel & …. There visible ?? handoffRing(editor) uses the explicit true, and every other restoreFocus() call still goes through handoffRing.
  • Removing focus from region.tsx breaks nothing. Quote, chip removal and plugin focus use the separate handOffFocus path at region.tsx:374-376.
  • Calling restoreFocus() before mode.normal in the touch-bar Exit shell (editor.tsx:1643) matches the desktop Exit shell fix.

I ran tsc --noEmit on packages/app at pr/head in a temporary worktree, which I've since removed. There were no errors under src/. The only errors were missing Playwright types in component-tests/ and stories/playwright, which come from my environment.

I didn't re-run the browser check with real input, and I didn't change anything in repo/. Its checkout is still at ec35c36 with a bun.lock change that isn't mine, and I left both as they are.

Sorry, something went wrong.

Uh oh!

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

All reactions
@usrnk1
fix(app): show the composer ring for Ctrl+L and the touch-bar exit
177f415
@usrnk1

usrnk1 commented Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

Review summary points:

  • Ctrl+L / handoffRing suppressing the ring when focus is on the body or a clicked control: fixed in 177f415 (details in the inline thread). Ctrl+L now always shows the ring, in both the session and new-session composers.
  • Touch-bar Exit shell button dispatching mode.normal before restoreFocus(): fixed in 177f415. It now restores focus first, like the main button.
  • The 2 composer/session test failures match the base (jsxDEV export error in this environment). Nothing to change there.
All reactions

Sorry, something went wrong.

Uh oh!

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

@usrnk1
Merge origin/dev into queue-edit-focus
394f856
@usrnk1
usrnk1 enabled auto-merge (squash) November 19, 2026 20:56
opencodejr[bot]
opencodejr Bot reviewed Nov 19, 2026
View reviewed changes

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Ctrl+L point is addressed: both the session and new-session input.focus paths now force the ring with focusField(…, true). The touch-bar Exit shell button now restores focus before the mode change, like the main one. I still couldn't run it in a browser here, so this is from reading the code; tsc for packages/app passes, and the composer and session tests show the same 2 failures as on the base. Public API unchanged. Nothing new to flag.

Sorry, something went wrong.

Uh oh!

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

All reactions
@usrnk1
usrnk1 merged commit 19ee066 into dev Nov 19, 2026
10 checks passed

Uh oh!

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

@usrnk1
usrnk1 deleted the queue-edit-focus branch November 19, 2026 21:00
@thdxr thdxr mentioned this pull request Nov 20, 2026
port goal pill and stop session updates anomalyco/opencode-rune#230
Open
@Hona Hona mentioned this pull request Nov 20, 2026
Focus: a field's ring only when the keys put focus there anomalyco/rune#1297
Merged
@BrewTestBot BrewTestBot mentioned this pull request Nov 23, 2026
opencode 2.4.0 Homebrew/homebrew-core#327368
Merged
@amrkmn amrkmn mentioned this pull request Nov 23, 2026
opencode 2.4.0 amrkmn/homebrew-tap#1251
Closed
1 task
@github-actions github-actions Bot mentioned this pull request Nov 23, 2026
feat: opencode release v2.4.0 sprisa/opencode-server#95
Merged
@scottames-github-bot scottames-github-bot Bot mentioned this pull request Nov 27, 2026
chore(deps): update ⬆️ mise-packages scottames/dots#1181
Merged
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@opencodejr opencodejr[bot] opencodejr[bot] left review comments

Uh oh!

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

Assignees

No one assigned

Labels

contributor

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.

1 participant

@usrnk1
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.