feat(desktop): add toggleable preset bar below tab strip#1430
Conversation
Add a persistent horizontal bar that shows all terminal presets with their icons and names, similar to a bookmarks bar. Users can toggle visibility via a checkbox in the terminal dropdown menu. The setting is persisted across sessions via the local database.
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughThis pull request adds a user-preference feature to toggle the visibility of a presets bar in the workspace. The implementation spans database schema changes (new Changes
Sequence DiagramsequenceDiagram
actor User
participant GroupStrip as GroupStrip<br/>(UI)
participant TRPC as TRPC Client<br/>(electronTrpc)
participant Backend as Settings Router<br/>(Backend)
participant DB as Database
participant ContentView as ContentView<br/>(UI)
participant PresetsBar as PresetsBar<br/>(Component)
User->>GroupStrip: Click "Show Preset Bar" checkbox
GroupStrip->>GroupStrip: Optimistic update cache
GroupStrip->>TRPC: setShowPresetsBar(enabled: boolean)
TRPC->>Backend: Send mutation request
Backend->>DB: Upsert settings.show_presets_bar
DB-->>Backend: Update confirmed
Backend-->>TRPC: Return { success: true }
TRPC->>TRPC: Invalidate cache on settle
ContentView->>TRPC: getShowPresetsBar.useQuery()
TRPC->>Backend: Fetch current showPresetsBar
Backend->>DB: SELECT showPresetsBar
DB-->>Backend: Return value (or default)
Backend-->>TRPC: Return boolean
TRPC-->>ContentView: Update query data
alt showPresetsBar is true
ContentView->>PresetsBar: Render component
PresetsBar-->>User: Display preset items
else showPresetsBar is false
ContentView->>ContentView: Skip PresetsBar render
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
🚀 Preview Deployment🔗 Preview Links
Preview updates automatically with new commits |
Summary
Changes
Schema & Migration
showPresetsBarboolean column tosettingstable (packages/local-db)0023_add_show_presets_bar_settingBackend (tRPC)
getShowPresetsBar/setShowPresetsBarprocedures following existingconfirmOnQuitpatternDEFAULT_SHOW_PRESETS_BAR = falseconstantFrontend
DropdownMenuCheckboxItemtoggle ("Show Preset Bar") in GroupStrip dropdown with optimistic mutationPresetsBarcomponent — horizontal bar with ghost buttons per preset (icon + name), tooltips for descriptionsPresetsBarinContentViewbetween header and tab contentTest Plan
Summary by CodeRabbit