Add 'right' option to app:tabbar#3281
Conversation
When tabbar is set to 'right', the vertical tab bar renders at the outer-right edge of the window. Implementation mirrors the existing 'left' layout via react-resizable-panels order props rather than introducing a parallel render path: - pkg/wconfig: extend jsonschema enum to include 'right' - schema/settings.json: same, for the published JSON schema - workspace.tsx: derive showVTabBar (left|right) and tabBarOnRight, flip Panel order props and AI panel padding side accordingly - workspace-layout-model.ts: add tabBarOnRight state, swap sizes[] index in handleOuterPanelLayout / handleInnerPanelLayout when the side group is on the right; rename setShowLeftTabBar to setShowVTabBar and the parameter in the percentage helpers The AI panel sits inboard of the vtab in both configurations: vtab is the outermost edge of the side group on whichever side it is rendered. roundTopLeft on the AI panel only applies in left mode; right mode does not currently round the mirrored corner — left as a follow-up if maintainers want it. Verified: tsc --noEmit and go build of pkg/wconfig produce no errors introduced by this change. Runtime testing has not been performed — maintainer review and a manual smoke test before merge are recommended.
|
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
WalkthroughThe pull request adds support for positioning the vertical tab bar on the right side of the workspace layout. A new Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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. Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.Comment |
Closes #3279.
Summary
Extends
app:tabbarto accept"right"in addition to"top"and"left". When set to"right", the vertical tab bar renders at the outer-right edge of the window.Approach
The existing
"left"layout already wraps the vtab and AI panel together in a "leftGroup" that sits in an outer panel beside content. Rather than introduce a parallel render tree, this PR mirrors the same structure via react-resizable-panelsorderprops:tabBarOnRight = (tabbar === "right")orderflips between 0 and 1; contentorderflips correspondingly.orderflips so vtab stays at the outermost edge of the side group on whichever side it's on. AI panel sits inboard.handleOuterPanelLayout,handleInnerPanelLayout) usesizes[1]instead ofsizes[0]for the relevant panel when on the right.pr-0.5topl-0.5.defaultSizepercentages stay unchanged — only the visual ordering flips, which is what react-resizable-panels usesorderfor.Files changed
pkg/wconfig/settingsconfig.gotop,left,rightschema/settings.jsonfrontend/app/workspace/workspace.tsxshowVTabBar/tabBarOnRight; conditionalorderand paddingfrontend/app/workspace/workspace-layout-model.tstabBarOnRight; swapsizes[]index in resize handlers; renamesetShowLeftTabBar→setShowVTabBar(only internal callsite wasworkspace.tsx)Design notes / open questions for maintainers
tabbar=right, with the AI panel inboard of the vtab. An alternative design keeps the AI panel anchored on the left and only moves the vtab. The mirror approach was chosen because it requires no changes to the layout model's grouping logic — the "leftGroup" simply becomes "sideGroup". Happy to refactor to the decoupled variant if you'd prefer it.AIPanel.roundTopLeftis left wired toshowLeftTabBaronly. In right mode, the AI panel does not currently round the mirrored corner. IfAIPanelshould accept aroundTopRightprop for symmetry, I can add that in a follow-up.setShowLeftTabBar→setShowVTabBarand the parameter ingetLeftGroupInitialPercentageetc. fromshowLeftTabBar→showVTabBar. Left the methodgetLeftGroupInitialPercentageun-renamed because the semantic ("the percentage occupied by the side group, regardless of which side") still reads acceptably and renaming would touch more callsites. Open to renaming if you'd prefer.Verification
go build ./pkg/wconfig/...— clean.npx tsc --noEmit -p tsconfig.json— no errors introduced in the touched files. (17 pre-existing errors infrontend/preview/mock/*andprocessviewer.preview.tsxonmainare unchanged.)Test plan
"app:tabbar": "right"insettings.json, restart Wave, confirm vtab appears on right edge."app:tabbar"from"left"→"right"→"top"at runtime — confirm transitions are clean (transitions are debounced viaenableTransitions(250))."app:tabbar": "left"still works exactly as before (no regression).🤖 Generated with Claude Code