Repository navigation
feat(sidebar): open new tabs and split panes from the sidebar - #307
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: Repository: devswha/herdr-web-ui/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (10)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: devswha/herdr-web-ui/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (11)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 SummarySummary by CodeRabbit
WalkthroughThe change adds machine-scoped endpoints and sidebar actions to create workspace tabs and split panes. It also adds request validation, typed responses, operation feedback, translations, and contract tests. ChangesWorkspace tab and pane creation
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Feature Suggested reviewers: Merge Risk: ⚪ Minimal · up to The new sidebar actions appear ready to merge after normal checks; no actionable issue is established in the supplied evidence. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The new operations use existing machine-control permissions, with no demonstrated authorization bypass. Remote-machine forwarding currently rejects both operations, and recovery after an interrupted mutation remains uncertain. Retained concerns
Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 10 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Remote routing rejects both new endpoints, and split requests without a direction violate the herdr schema.
Review effort: Balanced
Findings: 1
Open (2)
What changed in this PR
Adds sidebar controls for creating tabs and splitting panes, backed by new server routes and shared API types.
Changes:
- Adds sidebar actions with pane selection and inline errors.
- Implements tab creation and pane splitting APIs.
- Updates translations, contract tests, and release notes.
| File | Description |
|---|---|
| src/lib/machineContext.tsx | Exposes machine-scoped creation actions. |
| src/lib/i18n.zh.ts | Adds Chinese action and error strings. |
| src/lib/i18n.ko.ts | Adds Korean action and error strings. |
| src/lib/i18n.ja.ts | Adds Japanese action and error strings. |
| src/lib/api.ts | Adds typed API wrappers. |
| src/components/Sidebar.tsx | Adds tab and split controls. |
| shared/protocol.ts | Defines responses and documents routes. |
| server/index.ts | Adds validated endpoints and local routing. |
| server/herdr/client.ts | Adds herdr RPC wrappers. |
| server/api.contract.test.ts | Covers mutations and body validation. |
| CHANGELOG.md | Documents the feature. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
devswha
left a comment
There was a problem hiding this comment.
Thanks @piotrchabros, this is a really nice addition, and the contract tests plus the ko/ja/zh strings are much appreciated. I read the whole diff and approved the CI run; typecheck, the unit suite and the build pass locally.
A few things before it can go in:
pane.splitneeds adirection. herdr's schema requires it (PaneSplitParams.required: ["direction"]); calling/api/pane/splitwithout one gets backinvalid_request: missing field 'direction', which the API turns into a 404. Could you either default it to"right"on the server or make it required (missing_direction), update the doc comment inshared/protocol.ts, and add a contract case?- Require
pane_idon split? Without one, herdr splits whatever pane is focused on the PC, which may not be the pane the caller meant. The sidebar always sends one anyway. - Demo:
site/demo/transport.tsneeds answers for/api/tab/createand/api/pane/split(the/api/workspace/createhandler is a good template); otherwise both buttons show an error on the public demo. - CHANGELOG: please end the entry with
([#307](https://github.com/devswha/herdr-web-ui/pull/307) by @piotrchabros). - Smaller: on touch screens a single-pane row now shows four always-visible 44px buttons, so please check it still fits a ~360px drawer; on desktop the workspace-header
+is always visible while rename only shows on hover; a non-stringlabelanswersmissing_labelwhereinvalid_labelwould be accurate.
Once 1, 3 and 4 are in I'll take it to final review. Thanks again!
…it direction, answer both in the demo
…-splits Carries the new tab and split buttons onto the folder-grouping sidebar, links the changelog entry, and keeps a late answer from taking the selection after the user picked another pane.
…e on another PC, and a sent dictation leaves the terminal line (#321) ## Change Two defects a pre-release review found in features merged today and not yet released, so there is no changelog entry. - **Sidebar, new tab and split (#307):** the guard that keeps a late answer from taking the selection compared this PC's selected pane. That value is `null` for as long as another PC is open, so picking a pane on PC A after clicking New tab or Split on PC B still switched the app to PC B. The guard now compares what the app has open on any PC (`selection`, passed by `MachineSidebar`). - **Terminal input line, dictation (#231):** a polish that landed between a send and its acknowledgement changed the line, and the acknowledgement then kept it as text typed meanwhile, so a sent command stayed in the line. `send` now forgets a pending polish, as the chat composer already does. ## Validation - `bun run typecheck`, `bun run test:unit` (1031 pass), `bun run build`, `bun run build:site`. - No new test: both are component code, and this repo has no DOM test environment. The first needs two PCs and the second a microphone, which the browser regression cannot stage.
…b and split buttons (#327) ## Why 0.3.42 added a new tab and a split button to the sidebar (#307). A pane row went from two actions to three or four, and the actions keep their width while hidden, so every pane's name and subtitle were cut 34 to 68 px shorter. The maintainer decided to drop both buttons and put the rows back as they were. ## Change - The sidebar is the file it was before #307, with folder grouping (#299) kept: no new tab button on a workspace or a lone pane's row, no split button. - `POST /api/tab/create` and `POST /api/pane/split` are removed with their client wrappers, protocol types, remote-PC allowlist entries, translations, demo answers and tests. A `remote-v11` bridge still carries the two routes; nothing calls them. - The terminal input line fix from #321 stays. ## Validation - `bun run typecheck`, `bun run test:unit` (1031 pass), `bun run generate:types --check`, `bun run build`, `bun run build:site`. - `scripts/directory-groups-regression.ts`: 7 steps pass. Same 1280 px screenshot before and after: a pane's name reads `/tmp/herdr-web-ui-cod…` where it read `/tmp/herdr-…`. - `src/components/Sidebar.tsx` and `MachineSidebar.tsx` have no diff against the commit before #307.


Change
The web UI could only create whole workspaces ("New session"). There was no way to open additional tabs inside a workspace or split a pane, even though herdr 0.9 supports both (
tab.create,pane.split).+button on each workspace header opens a new tab there; single-pane workspaces (which have no header) get it on the pane row instead. Each pane row gets a split button (splits right). The new pane is selected once herdr reports it; failures surface as inline sidebar errors.POST /api/tab/create {workspace_id?, cwd?, label?}->{tab_id, pane_id}andPOST /api/pane/split {pane_id?, direction?, cwd?}->{pane_id}, with the same JSON error envelope and validation style as the existing routes. Both are reachable through the/api/machines/:idlocal alias and remote-PC bridges.shared/protocol.ts(TabCreated,PaneSplit), frontend wrappers insrc/lib/api.ts+useMachineApi, changelog entry, ko/ja/zh strings with the same placeholders.Validation
bun run generate:types --check— up to date;bun run typecheck— clean;bun run build— ok.bun run test:unit— 940 pass, 0 fail (was failing until the 6 new strings were added to all three dictionaries).bun test server/api.contract.test.ts— new "creates, splits, and closes tabs in an owned workspace" test passes, extended mutation-body validation passes. One pre-existing failure ("creates, edits, searches…" pane/files mention assertion) reproduces on the pristine checkout, unrelated to this change.