feat(desktop): add a default new-tab type

LA
1d ago
+2353-71

What & why

Fixes #10201.

Adds Default new tab in General settings and paradev settings set newTabDefaultKind ask|terminal|chat|browser. The default remains Ask, which opens the existing chooser. Other choices make the tab-bar + open that type immediately, with a separate chevron retaining the complete menu.

Chat uses the same openNewChat path as NEW_CHAT, including its existing agent selection. Browser opens in the right pane when that mode is enabled. The preference is stored in local SQLite, with a generated additive migration, and all four new strings are translated for every supported locale.

How I tested it

  • bun run lint passes.
  • bun run typecheck passes: 42 tasks.
  • bun run check:i18n passes, including the compiled-message audit.
  • New UI tests cover direct opening, the secondary chooser, deferred menu actions, and Ask in both tab appearances. These pass with Bun 1.4.3 and 1.4.4.
  • CLI settings tests cover all four values, reset to Ask, and rejection without changing the saved value: 56 settings tests pass with Bun 1.4.3 and 1.4.4.
  • The complete CLI suite passes (547 tests), as does the panes suite (146 tests).
  • Applied the generated SQLite migration to a temporary existing settings table and checked that it preserves existing values and supports every new kind.

The full monorepo test run is not green locally. It reports failures in unchanged shared, port-scanner, sandbox, API, host-service, and desktop tests. The desktop run has 9,340 passing tests and three failures outside this change; all new tests pass in that run. The recurrence formatting failure also reproduces separately with the pinned Bun 1.4.3. No unrelated tests or behavior were changed to suppress these failures.

Manual verification

Checked the development desktop renderer at http://localhost:3005 on this branch with the seeded local account and a small local test repository:

  • Ask opens the existing chooser.
  • Changing General → Default new tab to Terminal survives returning to the workspace; one press of + adds a terminal tab without opening the chooser.
  • The chevron retains the full menu.
  • CLI changes to Chat and Browser update the running app. + creates a chat tab through the existing Claude default and a Browser tab in the right pane, respectively. Agent execution was not verified: Claude CLI is absent on this machine.
  • Resetting the preference through the CLI restores Ask.

The stock local bootstrap hit an existing PostgreSQL 17 / PostgreSQL 18 constraint-rename mismatch. For this disposable test database, I applied the existing cloud migrations while omitting the PostgreSQL 18-only not-null constraint renames. No cloud migration or setup workaround is included in this PR. The new SQLite migration was applied unchanged by the development app.

Screenshots

Default setting and available choices:

Default new tab setting

Ask preserves the current chooser:

Ask opens the chooser

Terminal opens directly, with the chevron available beside +:

Direct Terminal tab

The secondary menu remains accessible:

Secondary tab chooser

Checklist

  • PR title follows conventional commits (type(scope): subject)
  • bun run lint and bun run typecheck pass (CI fails on lint warnings too)
  • "Allow edits from maintainers" is checked on fork PRs
  • I have signed the CLA (the bot asks on your first PR)

Summary by cubic

Fixes #10201 by letting users choose what the tab-bar + button opens. A new Default new tab setting (and paradev settings set newTabDefaultKind) offers Ask, Terminal, Chat, or Browser; Ask remains the default and keeps the existing chooser. With a concrete choice, + opens that tab type directly while a separate chevron retains the full tab menu. Chat reuses the existing NEW_CHAT flow, Browser respects right-pane mode when enabled, and the preference is persisted via a new SQLite migration with all four strings translated for every locale.

Summary by CodeRabbit

  • New Features
    • Choose a default action for new tabs: Ask, Terminal, Chat, or Browser. The setting is available in Behavior settings and through the CLI.
    • Click New tab to open your chosen default directly, while the adjacent menu remains available for selecting another tab type.
    • With Ask selected, use the menu to choose what to open.
  • Localization
    • Added translations for the new tab controls and setting in supported languages.