feat: workspace subgroups — data model + migration + store#56
Merged
Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add SubgroupConfig type to types.ts - Update Workspace interface: subgroups[] + activeSubgroupId replaces layout - Add layout-tree helpers: getActiveSubgroup, findSubgroupForPane, getAllPaneIds - Update applyPresetWithRemap signature to accept layout + panes separately - Migrate all store actions to locate subgroup by pane before operating - Update PaneArea to render active subgroup's layout tree - Update Sidebar, SettingsPanel, useKeyboardShortcuts for subgroup-aware access - Add migration in init() for existing workspace configs (layout → subgroups) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…leSubgroup) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Owner
Author
Automated Review — FindingsSummary: 8 files reviewed, 9 agents ran (code quality, security, silent failures, simplification, DRY/reuse, comments, type design, TypeScript, efficiency) Must Fix (4 items)
Suggestions (11 items)
Nitpicks (5 items)
Review ran: code quality, security, silent failures, simplification, DRY/reuse, comments, type design, TypeScript, efficiency |
Must Fix: - movePaneToPosition: add same-subgroup validation to prevent cross-subgroup data corruption - getActiveSubgroup: throw explicit error on empty subgroups instead of non-null assertion crash - Migration: check Array.isArray + length > 0 (not just truthiness), add runtime shape check, batch saves into Promise.all, use console.error - closePane: defer killPtys until after state update succeeds to prevent ghost panes DRY / Reuse: - Extract updateSubgroupLayout() helper (replaces 5+ identical map expressions) - Extract removePaneFromSubgroup() helper (replaces 15-line duplicate in closePane + movePaneToWorkspace) - Extract makeSingleSubgroup() factory (replaces 3x boilerplate) - Export makePaneConfig() from layout-tree and reuse in splitPane + addSubgroup Bug Fixes: - swapPanes: add same-subgroup validation to prevent cross-subgroup corruption - cycleSubgroup: handle findIndex returning -1 for stale activeSubgroupId - duplicateWorkspace: log stale activeSubgroupId fallback Performance: - findSubgroupForPane: short-circuit tree walk via treeContainsPane instead of collecting all IDs - handlePaneClick: use useStore.getState() instead of closing over workspaces array Nitpicks: - Fix stale JSDoc on swapPanes, movePaneToPosition, updateNodeSizes, movePaneToWorkspace - Rename activeSg to activeSubgroup in SettingsPanel for naming consistency - Remove redundant 'as const' in customLayout - Add console.error for silent return null in splitPane and movePaneToPosition Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Owner
Author
Review Fixes AppliedFixed (20/20 items from 9 agents): Must Fix:
Suggestions:
Nitpicks:
Skipped:
All changes in commit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Workspace.layoutwithsubgroups: SubgroupConfig[]+activeSubgroupId— each subgroup owns an independent layout tree while panes stay flat at workspace levelstore.init()that wraps existinglayoutinto a single-elementsubgroupsarray and persists on first loadsplitPane,closePane,movePaneToWorkspace,swapPanes,movePaneToPosition,updateNodeSizes) to operate within subgroups viafindSubgroupForPane/getActiveSubgrouphelpersaddSubgroup(creates solo pane group),setActiveSubgroup(switches group + focuses first pane),cycleSubgroup(wrapping +1/-1 navigation)PaneAreato render only the active subgroup's layout treeSettingsPanellayout preset handling to operate on active subgroupuseKeyboardShortcutspane navigation to span all subgroupsTest plan
addSubgroupcreates a new solo pane group and switches to itcycleSubgroupwraps around at boundaries🤖 Generated with Claude Code