Skip to content

Unify sidebar create actions into single dropdown menu - #19375

Merged
AmethystLiang merged 2 commits into
mainfrom
improve-new-project-experience
Sep 8, 2026
Merged

AmethystLiang merged 2 commits into
mainfrom
improve-new-project-experience

Conversation

@AmethystLiang

@AmethystLiang AmethystLiang commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 13 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​147 $\color{#cf222e}{\Huge{\mathbf{−}}}$​69 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​78
Prod 10 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​99 $\color{#cf222e}{\Huge{\mathbf{−}}}$​132 $\color{#cf222e}{\Huge{\mathbf{−}}}$​33

Problem

The sidebar had two separate create affordances (New workspace and Add project) that behaved differently depending on viewport width. This created confusion about what actions were available and where to find them.

Solution

Consolidate both create actions under a single "Create" button that opens a dropdown menu. The menu always shows both "New workspace" (with keyboard shortcut hint) and "Add project" options, providing a consistent experience across all viewports. This removes the need for width-based conditional logic and unclear overflow menus.

Changes

  • Replaced width-based layout branching with unified SidebarCreateMenu dropdown component
  • Updated button label from "New workspace" to "Create" for clarity
  • Standardized button text to "Add project" (removed "a new", "Add Project" casing inconsistency)
  • Added test helpers openSidebarWorkspaceComposer and updated openSidebarProjectDialog for menu interaction
  • Updated all e2e tests to use new menu-based interaction pattern
  • Added localization strings for new menu labels and shortcuts across all supported languages

Testing

  • E2E tests updated and passing with new menu interaction helpers
  • Unit tests updated for new SidebarHeader menu behavior
  • Cross-browser menu activation tested (handles Radix pointerdown + focus management)
  • Keyboard shortcut hint conditionally shown only when shortcut is assigned

- Combine "New workspace" and "Add project" under a unified "Create" button
- Remove layout logic that split these actions based on sidebar width
- Normalize "Add Project" to "Add project" (lowercase) throughout the UI
@coderabbitai

coderabbitai Bot commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Team

Run ID: 7536cc45-7470-4139-96ed-5c116fa6e23f

📥 Commits

Reviewing files that changed from the base of the PR and between 28c2598 and ccad9f6.

📒 Files selected for processing (9)
  • src/renderer/src/components/sidebar/SidebarHeader.test.tsx
  • src/renderer/src/components/sidebar/sidebar-header-actions.tsx
  • src/renderer/src/hooks/useShortcutLabel.ts
  • 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

📝 Walkthrough

Walkthrough

The sidebar now uses one Create menu for workspace and project creation in compact and wide layouts. Project labels are standardized as “Add project”. Localization entries were updated across supported languages. Shortcut formatting now supports unassigned actions. Unit and end-to-end tests use the shared menu and navigation helpers.

Merge Risk: 🔵 Low · up to 28c25

Localized sidebar creation labels may fall back to English or stale text. Regenerate and synchronize the localization catalogs before merging.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the problem, solution, scope, and testing, but it omits several required template sections. It does not include a linked issue, visual proof for the UI change, ELI5, AI disclo… Add the missing template sections. Include the required linked issue, before-and-after visual proof, or the exact N/A explanation only if applicable, ELI5, AI disclosure when applicable, review notes, agent skill boundary confirmation, note…
Docstring Coverage ⚠️ Warning Docstring coverage is 7.14% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 14 functions across 16 files. (7 skipped: … 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 summarizes the main change: consolidating sidebar create actions into one dropdown menu.
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 problem, solution, scope, and testing, but it omits several required template sections. It does not include a linked issue, visual proof for the UI change, ELI5, AI disclosure, review, boundary, notes, or checklist details.

Resolution

Add the missing template sections. Include the required linked issue, before-and-after visual proof, or the exact N/A explanation only if applicable, ELI5, AI disclosure when applicable, review notes, agent skill boundary confirmation, notes on compatibility and performance, and completed checklist items. Add tested platforms and clearly state whether lint, typecheck, test, and build passed or will be covered by CI.

Full details: Docstring Coverage

Explanation

Docstring coverage is 7.14% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 14 functions across 16 files. (7 skipped: 7 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
📝 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.

@coderabbitai coderabbitai 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.

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Team

Run ID: e1b5d16d-5654-47f3-a9d2-1f815ff1534b

📥 Commits

Reviewing files that changed from the base of the PR and between 2265fce and 28c2598.

📒 Files selected for processing (23)
  • src/renderer/src/components/Landing.tsx
  • src/renderer/src/components/new-workspace/ProjectCombobox.dialog-handoff.test.tsx
  • src/renderer/src/components/new-workspace/ProjectCombobox.test.tsx
  • src/renderer/src/components/new-workspace/ProjectCombobox.tsx
  • src/renderer/src/components/sidebar/SidebarHeader.test.tsx
  • src/renderer/src/components/sidebar/sidebar-header-actions.tsx
  • src/renderer/src/i18n/en-runtime-required.json
  • 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/ephemeral-vm-provisioned-root.spec.ts
  • tests/e2e/github-url-smart-input-transition.spec.ts
  • tests/e2e/golden-core-flows.spec.ts
  • tests/e2e/golden-worktree-create-switch.spec.ts
  • tests/e2e/helpers/sidebar-project-dialog.ts
  • tests/e2e/linear-url-workspace-entry.spec.ts
  • tests/e2e/new-workspace-create-more.spec.ts
  • tests/e2e/new-workspace-cross-project-dialog.spec.ts
  • tests/e2e/terminal-codex-skill-preview-artifact-repro.spec.ts
  • tests/e2e/worktree.spec.ts

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

Comment thread src/renderer/src/components/Landing.tsx Resolved

@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 critical issues — two minor suggestions inline. The refactor is clean and well covered by both unit and e2e tests.

Reviewed changes

  • Unified sidebar create menu — SidebarHeaderActions drops the width-based SIDEBAR_HEADER_WIDE_MIN_WIDTH split and always renders the new SidebarCreateMenu, whose dropdown carries New workspace (with the primary shortcut hint) and Add project.
  • Menu open/focus handling — SidebarCreateMenu opens via DropdownMenu and focuses the first item on open so Enter works after a mouse open, with the tour handoff moved from the button to the New workspace item.
  • Copy standardized — Add project replaces Add a new project / Add Project across ProjectCombobox, Landing, and the sidebar; new createMenu / addProject keys are added to all supported locales.
  • Test updates — SidebarHeader.test.tsx now drives the menu via a synthesized pointerdown plus a createMenuItem helper, and a new openSidebarWorkspaceComposer e2e helper replaces every { name: 'New workspace' } button click.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

Add formatOptionalPrimaryShortcutLabel that returns null when a
shortcut is unassigned, enabling simpler conditional rendering in
dropdown menus. Remove associated translation strings.
@AmethystLiang
AmethystLiang merged commit c056c6f into main Sep 8, 2026
4 checks passed

@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

  • Null-based shortcut label — replaced the 'Unassigned' sentinel check with a new formatOptionalPrimaryShortcutLabel in useShortcutLabel.ts that returns null for unbound actions, so SidebarCreateMenu renders the hint with a plain truthiness check instead of coupling to formatter copy.
  • Orphaned key cleanup — removed the now-unreferenced SidebarHeader keys (25a95899c9, ca6f729da2, moreActions) from en.json, en-runtime-required.json, and the partner locales, dropping them out of the boot bundle.
  • Test mock updated — SidebarHeader.test.tsx drives the new null sentinel and asserts the shortcut hint is omitted when workspace creation is unassigned.

Both prior suggestions are addressed cleanly; the new formatOptionalPrimaryShortcutLabel mirrors the existing formatOptionalShortcutLabel pattern with a distinct 'optionalPrimary' memoization key, and formatPrimaryShortcutLabel remains in use by TerminalContextMenu.

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

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