Repository navigation
feat(sidebar): drop a lone Host's PC header, and let Settings hide the filter row - #2073
Conversation
…wn key sidebarFilter is a device setting, on by default, saved in ovis:sidebar-filter as ovis:mirror-wrap and ovis:ui-font are, so an older tab's whole-record save of ovis:settings cannot erase it. Telemetry does not carry it. Co-authored-by: sisyphus-dev-ai <[email protected]>
When the sidebar shows one PC and it is the Host (the only PC, or the others hidden on this device), its group header is not drawn and its workspaces start the list. Nothing it held is lost: the state words, notice and error are lines of their own; the group is never folded (a stored fold is ignored, since no caret could open it); its + is a New workspace row after the workspaces; the PC name stays the group's accessible name and is no longer searched or suggested by the filter, as no row shows it. A lone PC that is not the Host keeps its header, for its name and its manage panel. Two PCs or more are unchanged. The test session and the demo have one PC: ui-regression.ts and recent-folders-regression.ts open New workspace from the row, and sidebar-spacing-demo-regression.ts folds two PCs, and now also checks that picking an agent of a folded PC keeps the fold (moved from ui-regression.ts). Co-authored-by: sisyphus-dev-ai <[email protected]>
… palette Settings -> Appearance -> Sidebar filter (on by default) leaves the Filter row out of the sidebar on this device. Filtering stays reachable: the command palette's new Filter workspaces and agents opens the drawer or the sidebar and draws the field, focused. It stays while it holds words and goes on its Close filter (the X while empty), Escape in it empty, the focus leaving the sidebar from it empty (a press on a row keeps it, so rows never move under the pointer) or the phone's drawer closing. With the setting on, the same palette entry focuses the field. "Filter workspaces and agents" moves to the base dictionaries, since the palette and the sidebar both use it; new strings are in Korean, Japanese and Chinese. Co-authored-by: sisyphus-dev-ai <[email protected]>
…er lane sidebar-declutter-demo-regression.ts drives the demo client at 390 and 1440 px, light and dark: a lone Host has no header, ignores a stored fold, keeps its state words offline and opens New workspace from its row; the Host shown alone of two does the same and names the hidden PC; a lone remote PC and two PCs keep their headers; Sidebar filter off removes the row, the palette opens and focuses it, and Settings turns it off and on. On origin/main it fails at its first check. Co-authored-by: sisyphus-dev-ai <[email protected]>
Co-authored-by: sisyphus-dev-ai <[email protected]>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 11 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
… close it on leaving Review findings on #2073 (merge pass, omo and Codex): - M1: closing the field the palette opened (Escape in it empty, Close filter) unmounted the focused control and left the focus on the body, and the desktop Escape went on to the page. It now gives the focus back to what had it when the field came, else to the list's first row, as useFocusReturn does, and the Escape that closes it stops there. - M2: only the input's blur closed an empty asked-for field, so Tab through Close filter into the list and out kept it, as did a press on something that takes no focus. A press outside the sidebar now closes it, as does the keyboard's focus leaving the sidebar from the field or any row; a press inside keeps it, also when the row it picks moves the focus to its pane. - L1: the lone Host's New workspace row also shows while its first roster loads, as the header's + did. - L2: turning the setting off while the field holds words keeps it as an asked-for field, so its clear no longer takes it from under the focus. - L3: the browser regression checks Escape with words, the focus after each dismissal, that the closing Escape goes no further, and that Tab into the list and a row press keep the field while a press outside takes it. Co-authored-by: sisyphus-dev-ai <[email protected]>
|
Merge-pass review verdicts:
|
|
f3b6cf6, Codex Sol (xhigh): MEDIUM and LOW only, no HIGH. Both are non-blocking for an owner PR after two fix rounds. They go into a follow-up issue at merge.
The omo re-review of this commit is still running. |
|
f3b6cf6, omo code reviewer: PASS (codeQualityStatus WATCH, APPROVE). No CRITICAL or HIGH findings.
Both reviewers have approved f3b6cf6 with MEDIUM or lower findings, after two fix rounds. These go into one follow-up issue at merge. #2073 waits on CI and merges last. |
|
Merged at f3b6cf6 by the merge pass.
CodeRabbit did not review this PR: its review limit was reached. |
…, and keep it open for the sidebar's own menus (#2141) Closes #2079 (follow-up to #2073). ## What it fixes for the user With Settings → Appearance → Sidebar filter off, the command palette's **Filter workspaces and agents** opens the filter field for a filter's time. Three edges of that field were still broken on main: 1. **Closing it could leave the focus on nothing.** When what opened the field is gone (for example the Settings switch, after turning the setting off while the field held words), Close filter / Escape fell back to the list's first `button`. That skipped the workspace row itself (a `div[role=button]`) and landed on the row's ⋯, which a desktop does not draw, so the focus stayed on `<body>`. Now it tries the opener, then each row control that is drawn, not inert and takes the focus, and checks that the focus actually landed before stopping. 2. **A row's menu counted as "outside" the sidebar.** The menu is drawn through a portal, so opening a row's menu from the keyboard closed the empty field (and the menu was then drawn one row out of place), and a click on a menu item closed the field before the click landed. Now the sidebar counts a menu or sheet as its own when the menu's button is inside it: `RowMenu` records each open menu's button (`rowMenuAnchor`). A tab's menu, or any other one, still takes the empty field, as before. 3. **A late blur check could clear newer words.** An empty field's blur to nowhere is decided a frame later. That frame is now cancelled when the field stops being closable or unmounts, and it rechecks that the field is still empty. Also, a press from the field's last close no longer makes its next blur ignored (`pressedInside` is reset when the field opens). Design: the focus return follows the same pattern as `useFocusTrap`'s return (lib/useFocusTrap.ts) and the WAI-ARIA dialog practice, which VS Code's and Zed's quick-pick filters also follow: focus goes back to the opener, or to the nearest sensible control, never to the document. ## Tests `scripts/sidebar-declutter-demo-regression.ts` gets a desktop `filterEdges` case (a new `flat=1` fixture param takes the worktrees off the demo's workspaces, so a row's first button is its undrawn ⋯): - the opener is gone → Close filter puts the focus on a visible row (fails on main: focus on `<body>`); - a row's menu opened from the keyboard keeps the field, sits under its row, and a click on its item keeps the field (fails on main); - an empty field's blur to nowhere closes it right after the press that closed it last (fails without the `pressedInside` reset); - a tab's menu takes the empty field (fails if every `.row-menu` counted as the sidebar); - words typed after a blur and before its frame survive (fails without the recheck). Each case was checked failing with its fix reverted and passing with it. The full script passes (desktop and phone, light and dark). `bun run check fast` is green. ## Reviews - omo-native-code-reviewer: PASS, 4 LOW (one, "any .row-menu counts", also raised by Codex and fixed here). - Codex Sol 6.1 Fast xhigh: BLOCK on c5b0e58 (MEDIUM: a tab's menu kept the field; LOW: the late-blur test could pass without its fix). Both fixed in fe5a42e; re-review PASS with no findings.
What it does for the user
Two small sidebar options from the owner's request.
1. One PC, no PC header. When the sidebar shows exactly one PC and it is the Host (the only PC, or every
other PC hidden on this device through Settings → Remote PCs → Show in sidebar, #1947), the PC's group
header row (name, Host tag, state dot, fold caret,
+) is gone and its workspaces start the list. With twoor more PCs shown nothing changes.
Nothing the header offered is lost:
+New workspaceovis:pc-collapsed:local) is ignored.aria-label="PC <name>". The filter no longer searches or suggests a name no row shows. When other PCs are hidden, the existing "1 PC hidden on this device" line under the list says so and opens the switches.No setting turns this off: it is simply how one PC looks, since nothing is lost.
2. Settings → Appearance → Sidebar filter. On by default (shown, as today). Off, the Filter row
above the lists is gone on this device. Filtering stays reachable: the command palette's new
Filter workspaces and agents opens the drawer (phone) or the sidebar (desktop) and draws the field,
focused. It stays while it holds words, and goes on its Close filter (its X while empty), Escape in it
empty, the focus leaving the sidebar from it empty, or the phone's drawer closing. A press on a row keeps it,
so rows never move under the pointer. With the setting on, the same palette entry just focuses the field.
There was no keyboard shortcut for the filter before. The palette entry (Mod+Shift+K, then "filter") is
the way in, on a phone too. English, Korean, Japanese and Chinese strings are included.
Design: the Claude app lists its sessions with no heading for the computer they run on, and the Codex and
Claude apps keep search in the palette alone. Both are followed here only where nothing is lost. Their
New button sits at the top; here the
+closes the list so the workspaces come first. DESIGN.md(Sidebar roster row and footer) has the details.
Screenshots
Demo client. Each sheet shows the 1440 px sidebar in dark and light, then the 390 px phone drawer in dark
and light.
Lone Host (a fold stored for it beforehand is ignored):

The Host shown alone of two (Work PC hidden on this device):

Lone Host offline (its state words stay; no New workspace row):

Sidebar filter off:

Opened from the palette's Filter workspaces and agents, filtering:

The setting:


Stored format
sidebarFilteris a device setting kept in a key of its own,ovis:sidebar-filter(written bysaveSettings, read byloadSettingsinsrc/lib/settings.ts), asovis:mirror-wrapandovis:ui-fontare. It is never inside
ovis:settings, so an older tab's whole-record save cannot erase it(
settings.test.tschecks that against the pinned legacy writer). Older versions ignore the key. It goesthrough no HTTP or WebSocket contract and no telemetry.
Browser scripts touched
The test session and the demo both have one PC, so three scripts that reached into its header move to the row:
ui-regression.ts: New workspace opens from the row. The block that folded the only PC now checks thelone Host has no header and has the row, and keeps its Agents-selection checks.
recent-folders-regression.ts: New workspace opens from the row.sidebar-spacing-demo-regression.ts: rewrites the demo into two PCs (ashide-pc-demo-regression.tsdoes) and folds both. It also takes over the check that picking an agent of a folded PC keeps the fold.
New:
sidebar-declutter-demo-regression.ts(added to the browser lane).How it was verified
scripts/sidebar-declutter-demo-regression.tson origin/main(42bd1ef) fails at its first check:
AssertionError: 1440-dark: a lone Host is drawn without its header(actual 1, expected 0). On this branch 20/20 pass: 5 scenarios × 1440/390 × dark/light.
sidebar-filter, hide-pc, sidebar-machine-layout, sidebar-machine-removal, palette-machines.
bun run check run --build(isolated herdr): ui-regression and recent-folders-regression: both pass (ui-regression 76 PASS lines, recent-folders 390/1440/1920 light and dark). These and the seven demo scripts ran on fd17f796c, just before the last change below. That change moved the palette request's state fromApp.tsxintosrc/lib/useSidebarLayout.ts(the App hook ceiling), andsidebar-declutter-demo-regression.tspassed again on the final commit.settings.test.ts(default, own key, old-tab save, malformed key),sidebarFilter.test.ts(aheaderless PC's name is neither searched nor suggested), i18n and conventions.
bun run check fast: passes on cb818dc (report statusverified, source unchanged; unit 7674 pass, 0 fail).Review fixes (f3b6cf6)
From the merge pass's review of cb818dc (omo and Codex):
gives the focus back to what had it when the field came, else to the list's first row, as
useFocusReturndoes. The Escape that closes it goes no further.
keyboard's focus leaving the sidebar from the field or any row. A press inside keeps it, also when the row
it picks moves the focus to its pane.
+did.takes it from under the focus.
sidebar-declutter-demo-regression.tsnow checks Escape with words, the focus after each dismissal,that the closing Escape goes no further, that Tab into the list and a row press keep the field, and that a
press outside takes it. On cb818dc it fails at "Close filter gives the focus back, not to the body". On
f3b6cf6 it passes 20/20, and
bun run check fastpasses (unit 7674 pass, 0 fail).