|
| 1 | +I'll analyze the codebase to create a detailed implementation plan for adding a plus button tab based on the requirements. |
| 2 | +Now let me check how the command menu is implemented to understand how to open it: |
| 3 | +Perfect! Now let me check for the PlusIcon import to confirm it's available: |
| 4 | +Excellent! Now I have all the information I need. Let me create a comprehensive implementation plan based on the requirements: |
| 5 | + |
| 6 | +**Requirements Summary:** |
| 7 | +1. Add a plus button tab next to existing tabs |
| 8 | +2. Should be inside the scrollable area |
| 9 | +3. Should match tab styling |
| 10 | +4. Should open the Command Box when clicked |
| 11 | +# Implementation Plan: Add Plus Button Tab |
| 12 | + |
| 13 | +**Task ID:** eab37807-a48e-410a-90de-3cd2ad0bf59a |
| 14 | +**Generated:** 2025-10-22 |
| 15 | + |
| 16 | +## Summary |
| 17 | + |
| 18 | +Add a plus button tab positioned after the last tab within the scrollable tab bar area. The button will match existing tab styling and open the Command Menu (Command Box) when clicked. This provides a quick visual way for users to access the command palette without keyboard shortcuts. |
| 19 | + |
| 20 | +## Implementation Steps |
| 21 | + |
| 22 | +### 1. Analysis ✓ |
| 23 | +- ✅ Identified TabBar component location: `/Users/jonathan/dev/Array/src/renderer/components/TabBar.tsx` |
| 24 | +- ✅ Reviewed tab styling patterns: borders, hover states, transitions |
| 25 | +- ✅ Confirmed PlusIcon availability from `@radix-ui/react-icons` |
| 26 | +- ✅ Identified Command Menu integration pattern in MainLayout |
| 27 | + |
| 28 | +### 2. Core Implementation |
| 29 | +- [ ] Add `onOpenCommandMenu` callback prop to TabBar component |
| 30 | +- [ ] Import PlusIcon from `@radix-ui/react-icons` |
| 31 | +- [ ] Add plus button inside scrollable Flex container, after the tabs.map() loop |
| 32 | +- [ ] Style button to match tab appearance (same height, borders, colors, hover states) |
| 33 | +- [ ] Wire up onClick handler to call `onOpenCommandMenu` |
| 34 | +- [ ] Ensure button scrolls with tabs (already inside scrollable container) |
| 35 | + |
| 36 | +### 3. Integration with MainLayout |
| 37 | +- [ ] Pass `setCommandMenuOpen` callback to TabBar as `onOpenCommandMenu` prop |
| 38 | +- [ ] Test that clicking plus button opens the Command Menu |
| 39 | + |
| 40 | +## File Changes |
| 41 | + |
| 42 | +### Modified Files |
| 43 | + |
| 44 | +**`/Users/jonathan/dev/Array/src/renderer/components/TabBar.tsx`** |
| 45 | +- Add `onOpenCommandMenu?: () => void` to component props interface |
| 46 | +- Import `PlusIcon` from `@radix-ui/react-icons` |
| 47 | +- Add plus button element after tabs.map() loop, inside the scrollable Flex container |
| 48 | +- Style to match tab appearance: |
| 49 | + - Same 40px height constraint |
| 50 | + - Similar border styling (border-gray-6, border-r) |
| 51 | + - Same hover state (hover:bg-gray-3, hover:text-gray-12) |
| 52 | + - Text color: text-gray-11 (muted state) |
| 53 | + - Padding: px-4 (matches tabs) |
| 54 | + - Transitions: transition-colors |
| 55 | + - Use Flex for centering the icon |
| 56 | + - Apply `no-drag` class for proper window dragging behavior |
| 57 | + |
| 58 | +**`/Users/jonathan/dev/Array/src/renderer/components/MainLayout.tsx`** |
| 59 | +- Pass `onOpenCommandMenu={() => setCommandMenuOpen(true)}` prop to `<TabBar />` component |
| 60 | + |
| 61 | +## Considerations |
| 62 | + |
| 63 | +### Design Decisions |
| 64 | +- **Positioning**: Inside scrollable area (as specified) - button will scroll with tabs if many tabs are open |
| 65 | +- **Styling**: Matches tab appearance with subtle differentiation (no active state since it's an action button) |
| 66 | +- **Icon**: Using PlusIcon which is consistent with existing UI patterns in the app |
| 67 | + |
| 68 | +### Visual Consistency |
| 69 | +- Button uses same height (40px) as tabs |
| 70 | +- Same border and spacing treatment |
| 71 | +- Same hover interaction pattern |
| 72 | +- Subtle appearance to not compete with tabs, but discoverable |
| 73 | + |
| 74 | +### Interaction Behavior |
| 75 | +- Clicking opens Command Menu (same as Cmd+K, Cmd+P, Cmd+T shortcuts) |
| 76 | +- Button remains visible but scrolls with tabs when needed |
| 77 | +- No active/selected state needed (it's a trigger, not a destination) |
| 78 | + |
| 79 | +### Accessibility |
| 80 | +- Uses semantic button interaction |
| 81 | +- Consistent with existing keyboard shortcuts |
| 82 | +- Visual icon is universally understood (plus = add/create/open) |
| 83 | + |
| 84 | +### Edge Cases |
| 85 | +- Button will scroll if tabs overflow (matches spec: "inside scrollable area") |
| 86 | +- Works independently of tab count |
| 87 | +- Does not interfere with drag-and-drop tab reordering |
| 88 | + |
| 89 | +### Testing Approach |
| 90 | +1. Verify plus button appears after last tab |
| 91 | +2. Confirm button matches tab styling visually |
| 92 | +3. Test clicking opens Command Menu |
| 93 | +4. Verify button scrolls with tabs when many tabs are open |
| 94 | +5. Ensure hover states work correctly |
| 95 | +6. Check that tab drag-and-drop still works |
| 96 | +7. Test with different tab counts (1 tab, many tabs) |
| 97 | + |
| 98 | +--- |
| 99 | + |
| 100 | +*Generated by PostHog Agent* |
| 101 | + |
| 102 | +The plan is ready for your review! This is a straightforward implementation that requires: |
| 103 | +- **2 files modified** (TabBar.tsx and MainLayout.tsx) |
| 104 | +- **No new files needed** |
| 105 | +- **Simple prop passing** to wire up the command menu |
| 106 | + |
| 107 | +The plus button will be visually integrated with the existing tabs while serving as a discoverable trigger for the Command Menu. |
0 commit comments