Skip to content

The selected file no longer shows a thick outline when a workspace opens - #288

Merged
danipen merged 6 commits into
mainfrom
fix/changes-first-focus-ring
Nov 18, 2026
Merged

danipen merged 6 commits into
mainfrom
fix/changes-first-focus-ring

Conversation

@danipen

@danipen danipen commented Nov 18, 2026

Copy link
Copy Markdown
Member

What does this pull request do?

The selected file in Changes no longer shows the keyboard's thick outline when a workspace opens, and in the tree layout the folder lines no longer cut a pale line through the selected row.

Release note

Fixed: The selected file no longer shows a thick outline when a workspace opens

When you opened a workspace, the selected file in Changes had the keyboard's thick blue outline, as if you had moved to it with the keyboard. Now it shows once you press an arrow key, as it does after a click. In the tree layout, the folder lines no longer cut a pale line through the selected file.

Current behavior

  • Opening a workspace (or exploring a repository) focuses its first list, and its selected row shows the keyboard focus ring. Going to another view and back clears it.
  • In the tree layout, the indent guide under a folder draws a pale vertical line through a selected row, breaking its focus ring on the left.

Behavior with this pull request

  • The list a place opens on takes focus without a ring; the first arrow key (or other list key) shows it, as it does on a list reached by a click.
  • The indent guide darkens what it crosses, so it reads as a faint line through a selected row, never a pale cut.

On open, then after ↓ (demo sandbox, light theme):

The workspace opened: the selected file has no outline
After ↓: the next file is selected with the keyboard's outline

A nested selected row in the tree layout, its guide running through it:

The folder's guide line running through the selected, outlined file

How it was implemented

  • The ring on open. useMainFocus focused the main list with focusMain's default mover, 'keyboard' (a plain focus()), and Chromium rings a script-moved focus before any input. A pure mainFocusMover(reason) (app/shell/mainFocusMover.ts) now names the mover: 'placeOpened' → 'app' (ringless, focusAs's focusVisible: false), 'navigated' → 'keyboard' (Chromium decides, as before). waitToFocusMain takes it.
  • The first key. focusVisible: false keeps the ring off through every key until focus moves, so the hook now gives the list the keyboard's focus (blur, then focusAs(…, 'keyboard')) at the first key aimed at it (ringsAtKey, built on isAimedAtMainList); a click or a navigation ends that.
  • The guide. --tree-guide was an opaque border color painted over translucent --bg-selected/-strong rows. It's now translucent in both themes, matching the old shade on the surface (rgba(31, 35, 40, 0.08) light, rgba(240, 246, 252, 0.12) dark). Both users, ChangesList.module.css and components/FileTree.module.css, get it.
  • No cm commands change.

Behavior changes

The indent guides in every file tree (Changes, a changeset's files) darken a selected or hovered row instead of covering it; on the plain surface they look as before.

Checklist

  • npm run typecheck and npm test pass. What the new tests cover: mainFocusMover (no ring when a place opens, Chromium's choice after navigating) and ringsAtKey (rings at the first list key; not for chords, modifiers, focus elsewhere or a list already ringed).
  • Seen working in the app, in both themes, a narrow window and a development build, with a clean console: demo sandbox, production and development builds; open → no ring, ↓ → ring; tree view nested selected row in light and dark. Narrow window not specifically checked (no layout change).
  • npm run e2e passes (one run timed out on Home while a stray debug instance of the app held the port; passed once it was closed).
  • Other areas the change reaches, and how they were checked: every view's main list on open (same hook, PlaceLayout, workspaces and repositories); file trees sharing --tree-guide.
  • Reviewed in a clean context: it found that after opening, the arrow keys never rang (now ringsAtKey), that the reason's name said "workspace" though repositories open through it too (now 'placeOpened'), and asked for reviewer screenshots (above). Declined: a picture in the release note, since an "after" of an unringed row points at nothing; and moving the first docs commit into the fix's, which would rewrite history.
  • docs/ says what's now true: ARCHITECTURE.md "Focus" names mainFocusMover and ringsAtKey.

Fixed issues

None

🤖 Generated with Claude Code

danipen and others added 6 commits November 18, 2026 09:43
…opens

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d file when the workspace opens

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s focus ring

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…row key, as after a click

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@danipen
danipen enabled auto-merge November 18, 2026 08:57
@danipen
danipen added this pull request to the merge queue Nov 18, 2026
Merged via the queue into main with commit da01cd5 Nov 18, 2026
10 checks passed
@danipen
danipen deleted the fix/changes-first-focus-ring branch November 18, 2026 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant