Skip to content

Replace the sidebar create dropdown with two direct action buttons - #19653

Merged
AmethystLiang merged 1 commit into
mainfrom
new-create-button-design
Sep 9, 2026
Merged

AmethystLiang merged 1 commit into
mainfrom
new-create-button-design

Conversation

@AmethystLiang

@AmethystLiang AmethystLiang commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​55 $\color{#cf222e}{\Huge{\mathbf{−}}}$​55 0
Prod 9 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​77 $\color{#cf222e}{\Huge{\mathbf{−}}}$​108 $\color{#cf222e}{\Huge{\mathbf{−}}}$​31

Why

#19375 unified the sidebar's two header buttons into one + dropdown. That removed the width-dependent layout branching, but it charged the cost to the action people take constantly: New workspace went from 1 click to 2, and Add project didn't actually become more discoverable — a menu item is invisible until you open the menu.

What

The + performs an action again instead of opening one. Both controls sit in the header, one click each, always visible.

  • sidebar-header-actions.tsx — dropdown removed. FolderPlus → openModal('add-repo'), Plus → openWorkspaceCreationComposerWithTourHandoff, with + kept rightmost so muscle memory holds. The setTimeout(…, 0) that worked around Radix's focus restoration on menu teardown goes with it — there's no menu to tear down. The tooltip now carries the shortcut (New workspace ⌘N), which the deleted menu row was the only place advertising.
  • SidebarHeader.tsx — min-w-0 truncate on the title span (see below), and hideWorkspaceOptions renamed to agentsViewActive, which is what it was always being passed.
  • repo-header-project-actions.tsx — "New group from project" moves to FolderTree, so FolderPlus means one thing in this sidebar.
  • i18n — the now-unused SidebarHeader.createMenu ("Create") key removed from all six locales.

The truncate fix isn't cosmetic

MIN_WIDTH is 220px. Four 24px buttons plus gaps is 108px, leaving the title 88px. The title span had no min-w-0 and no truncate, so it can't shrink:

Title Needs Without fix
Projects (en) 59px fits
Workspaces (en) 83px fits
Espacios de trabajo (es) ~110px wraps to two lines in a 32px row
ワークスペース (ja) ~90px wraps; ellipsises with the fix

Measured live in the app at 220px: with the fix the Spanish title is 16px tall; with truncate min-w-0 stripped it is 32px tall — two lines filling the entire header row. This was already marginal at three buttons; the fourth makes it certain.

Two deliberate removals — please sign off

  1. Add project no longer appears in the agents view. Previously only the options menu was hidden there and the create menu still rendered both items. That view lists activity, not projects, so hiding both is the consistent answer — but it is a capability removal.
  2. FolderPlus → FolderTree for "New group from project" is churn in a menu nobody complained about. It's labeled, so the cost is low.

Verification

Attached over CDP to a dev instance from this worktree:

  • Header renders View activity · Workspace options · Add project · New workspace — four buttons, 32px row, at sidebarWidth: 220, the exact minimum.
  • One click on + opened the Create worktree composer; one click on the folder icon opened "Add a project".
  • Spanish two-line failure and its fix measured live, as above.

Gates: sidebar suite (299 files / 2523 tests), contextual-tour tests, pnpm tc, changed-code quality gate, and verify:localization-{catalog,coverage,extraction} all pass.

One e2e trap worth knowing about

Landing.tsx renders its own button with the accessible name "Add project" whenever no workspace is open — exactly the state the sidebar e2e helpers run in. An unscoped getByRole('button', { name: 'Add project', exact: true }) matches twice and trips Playwright strict mode. The helpers are now scoped to a data-sidebar-header-actions hook. The old name: 'Create' selector was accidentally protected from this; the rename removed that protection.

Not yet run: the Electron e2e specs themselves. The updated selectors are reasoned and scoped, not executed.

Users can now reach New workspace and Add project with one click each,
without navigating a menu. The frequent action (new workspace) is more
discoverable at its rightmost position. Both controls are always visible
in the sidebar header action cluster.
@coderabbitai

coderabbitai Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 04c4960e-0ba0-40c2-85c3-e0fe840a9e33

📥 Commits

Reviewing files that changed from the base of the PR and between d196942 and db3deba.

📒 Files selected for processing (12)
  • src/renderer/src/components/sidebar/SidebarHeader.test.tsx
  • src/renderer/src/components/sidebar/SidebarHeader.tsx
  • src/renderer/src/components/sidebar/sidebar-header-actions.tsx
  • src/renderer/src/components/sidebar/worktree-list/rows/repo-header-project-actions.tsx
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
  • tests/e2e/golden-core-flows.spec.ts
  • tests/e2e/helpers/sidebar-project-dialog.ts
💤 Files with no reviewable changes (6)
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/en.json

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The sidebar create dropdown was replaced with separate New workspace and Add project buttons. Workspace creation invokes the tour handoff directly. Project creation opens the repository modal directly. Agents view keeps New workspace and hides Add project. The sidebar title now truncates within its fixed-height row. Related translations, icons, component tests, and end-to-end helpers were updated.

Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to db3de

The sidebar now exposes direct Add project and New workspace actions, preserving project-dialog and workspace-composer behavior while improving access to both flows. No concrete current-head merge risk remains.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the motivation, implementation, deliberate behavior changes, and verification results. However, it does not follow the required template because it omits the ELI5, Linked Issu… Complete the required description sections. Add the linked issue number after Fixes #, provide before-and-after visual proof or state N/A with a reason, complete the testing and checklist items, address AI Disclosure and the Agent skill…
Docstring Coverage ⚠️ Warning Docstring coverage is 11.11% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 6 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: replacing the sidebar create dropdown with two direct action buttons.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description explains the motivation, implementation, deliberate behavior changes, and verification results. However, it does not follow the required template because it omits the ELI5, Linked Issue with a completed issue reference, Visual Proof attachments or an explicit N/A explanation, testing checklist, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist sections.

Resolution

Complete the required description sections. Add the linked issue number after Fixes #, provide before-and-after visual proof or state N/A with a reason, complete the testing and checklist items, address AI Disclosure and the Agent skill upstream boundary, and document the remaining Electron e2e test status.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

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.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

  • Sidebar create dropdown replaced with two direct buttons — AddProjectButton (FolderPlus → openModal('add-repo')) and NewWorkspaceButton (Plus → openWorkspaceCreationComposerWithTourHandoff) render side-by-side in the header, each a one-click action. The setTimeout(0) Radix focus-restoration workaround is correctly dropped with the menu, and the shortcut (⌘N) moves into the New workspace tooltip.
  • agentsViewActive rename — hideWorkspaceOptions is now named for what it always carried, and in the agents view both the workspace options menu and Add project are hidden while New workspace remains.
  • Title truncation fix — min-w-0 truncate on the section title span prevents long localized titles (es "Espacios de trabajo") from wrapping the h-8 row into two lines.
  • Icon disambiguation — "New group from project" switches FolderPlus → FolderTree so FolderPlus means "Add project" consistently.
  • i18n — unused SidebarHeader.createMenu key removed from all six locales.
  • Tests — unit suite rewritten around direct buttons; e2e helpers scoped to the new data-sidebar-header-actions hook to avoid Playwright strict-mode collision with Landing's own "Add project" button.

The two deliberate removals are implemented correctly and read as sound tradeoffs: hiding Add project in the agents view is consistent with a view that lists activity, and the FolderPlus → FolderTree change is labeled so its cost is low. The e2e selectors in sidebar-project-dialog.ts and golden-core-flows.spec.ts match the rendered aria-labels and the scoping hook, so the not-yet-run Electron specs should pass as updated.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@AmethystLiang
AmethystLiang merged commit 73d0521 into main Sep 9, 2026
35 checks passed
@AmethystLiang
AmethystLiang deleted the new-create-button-design branch September 9, 2026 17:42
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