Skip to content

feat(desktop): add toggleable preset bar below tab strip#1430

Merged
Kitenite merged 1 commit into
mainfrom
kitenite/make-presets-more-accessible
Feb 12, 2026
Merged

feat(desktop): add toggleable preset bar below tab strip#1430
Kitenite merged 1 commit into
mainfrom
kitenite/make-presets-more-accessible

Conversation

@Kitenite
Copy link
Copy Markdown
Collaborator

@Kitenite Kitenite commented Feb 12, 2026

Summary

  • Presets are currently only accessible via a dropdown menu in the GroupStrip toolbar
  • This adds a persistent horizontal bar (like a bookmarks bar) below the tab strip that shows all presets with their icons and names
  • A "Show Preset Bar" checkbox in the dropdown controls visibility, persisted across sessions via local DB

Changes

Schema & Migration

  • Add showPresetsBar boolean column to settings table (packages/local-db)
  • Migration 0023_add_show_presets_bar_setting

Backend (tRPC)

  • Add getShowPresetsBar / setShowPresetsBar procedures following existing confirmOnQuit pattern
  • Add DEFAULT_SHOW_PRESETS_BAR = false constant

Frontend

  • Add DropdownMenuCheckboxItem toggle ("Show Preset Bar") in GroupStrip dropdown with optimistic mutation
  • Create PresetsBar component — horizontal bar with ghost buttons per preset (icon + name), tooltips for descriptions
  • Conditionally render PresetsBar in ContentView between header and tab content

Test Plan

  • Open dropdown → toggle "Show Preset Bar" → bar appears/disappears below header
  • Clicking a preset in the bar opens a new terminal tab with that preset
  • Toggle persists after restarting the app
  • Bar hidden by default for new users
  • Bar not shown when no presets exist

Summary by CodeRabbit

  • New Features
    • Introduced a presets bar displaying available workspace presets with icons and descriptions. Hover over any preset for details or click to open it.
    • Added "Show Preset Bar" menu option to toggle the presets bar visibility (disabled by default).

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.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 12, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

This 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 show_presets_bar setting), TRPC backend endpoints for reading and updating the setting, a new PresetsBar UI component, and integration into GroupStrip and ContentView for toggle control and conditional rendering.

Changes

Cohort / File(s) Summary
Database & Schema
packages/local-db/drizzle/0023_add_show_presets_bar_setting.sql, packages/local-db/drizzle/meta/0023_snapshot.json, packages/local-db/drizzle/meta/_journal.json, packages/local-db/src/schema/schema.ts
Added show_presets_bar integer column to settings table with corresponding Drizzle schema snapshot and migration journal entry. Schema updates propagate to InsertSettings and SelectSettings types.
Constants & Settings Router
apps/desktop/src/shared/constants.ts, apps/desktop/src/lib/trpc/routers/settings/index.ts
Added DEFAULT_SHOW_PRESETS_BAR constant (false). Implemented getShowPresetsBar query and setShowPresetsBar mutation with default fallback and optimistic update pattern.
PresetsBar Component
apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/components/PresetsBar/PresetsBar.tsx, apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/components/PresetsBar/index.ts
New component rendering a horizontal scrollable bar of preset items. Each preset displays custom icon or default command icon with truncated name and tooltip. Clicking a preset opens it via openPreset(). Renders nothing when no presets exist.
UI Integration
apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/GroupStrip/GroupStrip.tsx, apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/index.tsx
GroupStrip adds DropdownMenuCheckboxItem "Show Preset Bar" with TRPC mutation hook (optimistic update, error rollback, cache invalidation). ContentView conditionally renders PresetsBar based on getShowPresetsBar query result.

Sequence Diagram

sequenceDiagram
    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
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Poem

🐰 Hops with glee through code so clean,
A presets bar, a sight pristine,
Toggle on, toggle off with flair,
Settings dance through database where—
TRPC flows to UI's care!

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch kitenite/make-presets-more-accessible

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Kitenite Kitenite merged commit f593357 into main Feb 12, 2026
13 of 14 checks passed
@Kitenite Kitenite deleted the kitenite/make-presets-more-accessible branch February 12, 2026 07:29
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 12, 2026

🚀 Preview Deployment

🔗 Preview Links

Service Status Link
Neon Database (Neon) View Branch
Fly.io Electric (Fly.io) View App
Fly.io Streams (Fly.io) View App
Vercel API (Vercel) Open Preview
Vercel Web (Vercel) Open Preview
Vercel Marketing (Vercel) Open Preview
Vercel Admin (Vercel) Open Preview
Vercel Docs (Vercel) Open Preview

Preview updates automatically with new commits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant