FE-1545: Adopt the worksheet focus layer in the left sidebar lists and search - #9420
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
PR SummaryLow Risk Overview Filterable lists (Nodes, Types, etc.) are now a single Tab stop with roving tabindex on real row focus. Arrows move and update selection (Shift extends ranges); ArrowRight / ArrowLeft reach row ⋯ menus and group + actions via new Nets list follows the same two-column stop model: arrow navigation, Delete on subnet rows, delete button reachable by arrow instead of extra tab stops, with focus moved to a neighbor before delete. Search wraps the panel in a vertical User-facing docs in drawing-a-net.md and architecture worksheet.mdx describe the new behavior; Reviewed by Cursor Bugbot for commit e15ef88. Bugbot is set up for automated code reviews on this repo. Configure here. |
75fa218 to
f4a887d
Compare
f4a887d to
94a0e8c
Compare
94a0e8c to
7858534
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Row actions remain native Tab stops, and the fallback introduces quadratic rendering work.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adopts the shared worksheet keyboard-focus model across Petrinaut’s left sidebar.
Changes:
- Adds roving focus and keyboard navigation to sidebar lists and search.
- Makes row actions keyboard-reachable and adds Nets keyboard controls.
- Adds tests and updates user/architecture documentation.
File summaries
| File | Description |
|---|---|
.changeset/sidebar-focus-layer.md |
Records the keyboard-navigation change. |
libs/@local/petrinaut-arch-docs/content/ui/worksheet.mdx |
Documents new worksheet-layer consumers. |
libs/@hashintel/petrinaut/docs/drawing-a-net.md |
Documents sidebar keyboard controls. |
libs/@hashintel/petrinaut/src/ui/lib/clamp-index.ts |
Removes the obsolete helper. |
libs/@hashintel/petrinaut/src/ui/worksheet/focus-flow.test.tsx |
Tests removed-stop fallback behavior. |
libs/@hashintel/petrinaut/src/ui/worksheet/use-focus-stops.ts |
Adds fallback roving-tab-stop selection. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/LeftSideBar/panel.tsx |
Wraps search in a vertical focus flow. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/LeftSideBar/subviews/filterable-list-sub-view.test.tsx |
Tests list keyboard navigation. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/LeftSideBar/subviews/filterable-list-sub-view.tsx |
Migrates filterable lists to real focus. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/LeftSideBar/subviews/nets-list.tsx |
Adds roving focus and keyboard actions. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/LeftSideBar/subviews/row-action-cell.tsx |
Adds shared action-column wiring. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/LeftSideBar/subviews/search-panel.tsx |
Integrates input/results focus navigation. |
Review details
- Files reviewed: 12/12 changed files
- Comments generated: 2
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
baec145 to
bdaa0b0
Compare
Drop `find`, `unregister`, the shortcut-collision warning, and the silent run-refresh snapshots: `register` now replaces by id in place and notifies, and `useCommand` re-registers only when the id, label, category, keywords, or shortcut change, reading the latest `run` through a ref. Move the registry into `core.command-registry` and the React bindings into `react.commands`, export the bindings from `@hashintel/petrinaut/react` only, and add the arch-docs usage manual with a flow diagram. One changeset covers both packages.
bdaa0b0 to
20f6b10
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 20f6b10. Configure here.
…ings Move the auto-layout command into the editor's command set, through the mode-aware `usePetrinautCommands`, so nothing writes to the registry during render and the command respects edit mode and the active subnet; `createPetrinaut` loses its `commandRegistry` option. Read the properties panel width from the editor store only, give `useCommands` a server snapshot, return no keycaps for an empty shortcut, close the example palettes on Escape from any element inside them, and keep the sidebar command's label static so it holds its palette position.
Fold the three per-column text helpers into `fullText`/`displayText` over one `isTextColumn` predicate, collapse `updateCell` and the editor open/close paths, group the gutter's focus props, and list the layer's consumers in the worksheet architecture page.
…ppears `useFocusStops` computes the roving tab stop once per render and falls back to the first stop when the remembered row or column is gone, so a cleared marking or a dropped type element cannot take a grid out of the tab order. Rows expose `aria-selected`, and the spreadsheet changeset is dropped as an internal detail.
Merge the empty and non-empty list components, derive the visible rows in one pass instead of a flattened list re-searched per row, drop the `selectable` style variant, and rename `RowActionSlot` to `RowActionCell`. The worksheet architecture page lists the sidebar as a consumer.
…elete Row action buttons leave the tab order; ArrowRight still reaches them, so each list stays one Tab stop. Deleting a subnet from the keyboard focuses a neighbouring row before the deleted one unmounts. The sidebar changeset is dropped as an internal detail.

Summary
Before this PR, the left sidebar carried three hand-rolled focus models. Filterable lists tracked a virtual focus index in React state over unfocusable rows, with hover-only row menus. Nets list made every row and its invisible delete button a tab stop with no arrow keys. Search hopped focus between input and results through DOM queries and remounted the results on every keystroke.
Adopts the worksheet keyboard-flow layer across the sidebar. Each list is one Tab stop, arrows move and select, row menus and add buttons are reachable with ArrowRight, and the search input and its results form one vertical flow.
9420.mp4
Links
Changes
useFocusStopsRowActionCellmakes row menus and group add buttons keyboard-reachableFocusStackat the panel levelclampIndexhelper deletedReview fixes
Known issues
v,h,n,tstill fire while a list row holds focusNext steps
SubViewHeader, tab bars, and toolbarsTest coverage
filterable-list-sub-view.test.tsx:focus-flow.test.tsx:How to test