Skip to content

feat: add All Worktrees overview option#767

Closed
Questler wants to merge 4 commits intoAutoMaker-Org:v0.14.0rcfrom
Questler:feat/all-worktrees-view
Closed

feat: add All Worktrees overview option#767
Questler wants to merge 4 commits intoAutoMaker-Org:v0.14.0rcfrom
Questler:feat/all-worktrees-view

Conversation

@Questler
Copy link

@Questler Questler commented Feb 10, 2026

Summary

  • Add an "All" option to the worktree selector that shows features from ALL worktrees and main combined in one board view
  • Fix running agent state display in All Worktrees view (shows Logs/Stop instead of Resume)
  • Show worktree drop targets when dragging cards in dropdown mode (3+ worktrees)

Closes #681
Closes #683

Changes

  • Sentinel value: ALL_WORKTREES_BRANCH constant in app-store.ts — when selected, bypasses worktree filtering to show all features
  • Worktree selector: "All Worktrees" option with Layers icon in both tab layout (1-2 worktrees) and dropdown layout (3+ worktrees), plus mobile
  • Agent state fix: Use aggregated effectiveRunningAutoTasks from all worktrees when "All" is selected, so cards correctly show running state
  • Drag-to-worktree in dropdown mode: When dragging a card with 3+ worktrees, temporary worktree pills appear as drop targets (reuses existing dnd-kit drop handler)

Files Modified

  • apps/ui/src/store/app-store.ts — ALL_WORKTREES_BRANCH constant
  • apps/ui/src/components/views/board-view.tsx — Board view integration, effectiveWorktreeBranch, effectiveRunningAutoTasks, isDragging prop
  • apps/ui/src/components/views/board-view/hooks/use-board-column-features.ts — Branch bypass logic
  • apps/ui/src/components/views/board-view/worktree-panel/types.ts — isDragging prop on WorktreePanelProps
  • apps/ui/src/components/views/board-view/worktree-panel/worktree-panel.tsx — WorktreeDropPill component, drag drop targets, tab + dropdown integration
  • apps/ui/src/components/views/board-view/worktree-panel/components/worktree-dropdown.tsx — Dropdown "All" option
  • apps/ui/src/components/views/board-view/worktree-panel/components/worktree-mobile-dropdown.tsx — Mobile "All" option
  • apps/ui/src/components/views/board-view/worktree-panel/components/worktree-tab.tsx — Deselection support

Test plan

  • Playwright verification test passed (sentinel persistence + branch filtering bypass)
  • "All" tab appears when at least 1 non-main worktree exists
  • Feature cards show correct running agent state in "All" view
  • Worktree-specific actions (commit, PR, auto-mode) are hidden in "All" view
  • Dragging a card in dropdown mode (3+ worktrees) shows worktree pills as drop targets
  • Dropping a card on a worktree pill moves it to that branch

🤖 Generated with Claude Code

Questler and others added 2 commits February 10, 2026 23:54
Adds an "All" option to the worktree selector that shows features from
all worktrees and main combined. Uses a sentinel value
ALL_WORKTREES_BRANCH to bypass worktree filtering. Supports dropdown
(3+ worktrees), tab (1-2 worktrees), and mobile layouts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use aggregated running tasks from all worktrees when ALL_WORKTREES_BRANCH
is selected, so feature cards correctly show Logs/Stop instead of Resume.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings February 10, 2026 23:12
@coderabbitai
Copy link

coderabbitai bot commented Feb 10, 2026

📝 Walkthrough

Walkthrough

Adds an "All Worktrees" virtual mode via a new exported sentinel ALL_WORKTREES_BRANCH, wiring it through the store, board-view, worktree panel, dropdowns, and hooks to aggregate counts, bypass per-branch filtering, and hide per-worktree UI when active.

Changes

Cohort / File(s) Summary
Store / Sentinel
apps/ui/src/store/app-store.ts
Export new sentinel ALL_WORKTREES_BRANCH = '__all_worktrees__'.
Board View Core
apps/ui/src/components/views/board-view.tsx, apps/ui/src/components/views/board-view/hooks/use-board-column-features.ts
Treat sentinel as "All" mode: selectedWorktree resolves to undefined, derive effective branch and running tasks aggregated across worktrees, apply across keyboard shortcuts, DnD, column filters, header counts, and feature filtering.
Worktree Panel Core
apps/ui/src/components/views/board-view/worktree-panel/worktree-panel.tsx, .../hooks/use-worktrees.ts, .../types.ts
Compute isAllWorktreesSelected, handleSelectAllWorktrees (sets sentinel), add isDragging prop, skip validation when sentinel active, compute totalCardCount, and propagate All-mode flags to children.
Worktree Dropdowns (desktop/mobile)
apps/ui/src/components/views/board-view/worktree-panel/components/worktree-dropdown.tsx, .../worktree-mobile-dropdown.tsx
Add props isAllWorktreesSelected, onSelectAllWorktrees, totalCardCount; add "All" item (Layers icon), switch trigger icon/label to "All", and show aggregated badge while hiding per-worktree indicators in All mode.
Worktree Tab
apps/ui/src/components/views/board-view/worktree-panel/components/worktree-tab.tsx
Add isAllWorktreesSelected prop; when true, hide BranchSwitchDropdown, DevServer, AutoMode, ActionsDropdown, and primary actions to present a compact, non-actionable tab.
Column feature matching
apps/ui/src/components/views/board-view/hooks/use-board-column-features.ts
When effective branch equals sentinel, treat all features as matching (ignore per-feature branchName filtering) while preserving existing non-branch rules.

Sequence Diagram

sequenceDiagram
    actor User
    participant UI as Worktree Panel UI
    participant Store as App Store
    participant Board as Board View
    participant Hooks as Board Hooks

    User->>UI: Click "All Worktrees"
    UI->>Store: setCurrentWorktree({ branch: ALL_WORKTREES_BRANCH })
    Store->>Board: emit currentWorktree change
    Board->>Hooks: derive currentWorktreeBranch / selectedWorktree
    Hooks->>Hooks: if branch == ALL_WORKTREES_BRANCH -> selectedWorktree = undefined
    Hooks->>Hooks: aggregate running tasks and card counts across worktrees
    Hooks-->>Board: return aggregated features, counts, undefined selection
    Board->>UI: render "All" label, aggregated counts, hide per-worktree controls
    UI-->>User: display unified All Worktrees view
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

Enhancement, scope: ui, Ready-To-Merge

Poem

🐇 I twitched my nose and hopped with glee,

Gathered branches all to see —
Layers stacked and cards align,
One view to watch each tiny line.
All worktrees now in a single tree.

🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: add All Worktrees overview option' directly and clearly summarizes the main change—adding an All Worktrees feature to allow unified view across all branches and worktrees.
Linked Issues check ✅ Passed The PR addresses #683 by enabling visibility of all tasks across branches/worktrees with a unified Kanban board view and worktree indicators on cards.
Out of Scope Changes check ✅ Passed All changes directly support the All Worktrees feature: sentinel constant, UI components for selection, aggregation logic, and worktree-specific UI hiding when All is active.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @Questler, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the user experience by introducing a consolidated 'All Worktrees' view. This new feature allows developers to gain a comprehensive overview of all active features across different worktrees and the main branch from a single interface. It streamlines the management of multiple development contexts by providing a unified board, eliminating the need to switch between individual worktrees to track progress. Additionally, it resolves a critical bug related to the display of running agent states, ensuring accurate operational feedback within this new aggregated view.

Highlights

  • All Worktrees Overview Option: An 'All' option has been added to the worktree selector, enabling users to view features from all worktrees and the main branch combined in a single board view.
  • Agent State Display Fix: The display of running agent states in the 'All Worktrees' view has been corrected, now showing 'Logs/Stop' instead of 'Resume' for features with active agents.
  • Sentinel Value for All Worktrees: A new ALL_WORKTREES_BRANCH constant was introduced in app-store.ts to act as a sentinel value, bypassing worktree filtering when the 'All' option is selected.
  • UI Integration: The 'All Worktrees' option, complete with a Layers icon, has been integrated into both tab and dropdown layouts of the worktree selector, including mobile views.
  • Aggregated Running Tasks: Logic was updated to use aggregated effectiveRunningAutoTasks from all worktrees when 'All' is selected, ensuring feature cards accurately reflect running agent states.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • apps/ui/src/components/views/board-view.tsx
    • Imported ALL_WORKTREES_BRANCH for use in worktree selection logic.
    • Modified selectedWorktree memoization to return undefined when ALL_WORKTREES_BRANCH is selected, indicating no single worktree is active.
    • Updated currentWorktreeBranch derivation to prioritize the resolved selectedWorktree branch or fall back to the store's branch, supporting the 'All Worktrees' sentinel.
    • Introduced effectiveRunningAutoTasks to aggregate running tasks from all worktrees when ALL_WORKTREES_BRANCH is selected, otherwise using tasks from the current worktree.
    • Updated inProgressFeaturesForShortcuts, useBoardActions, useBoardKeyboardShortcuts, useBoardDragDrop, useBoardColumnFeatures, BoardHeader, and BoardColumn components to use effectiveRunningAutoTasks for consistent agent state display.
    • Added filtering logic to getBacklogFeatures and getWaitingApprovalFeatures to allow all features to be selectable when ALL_WORKTREES_BRANCH is active.
  • apps/ui/src/components/views/board-view/hooks/use-board-column-features.ts
    • Imported ALL_WORKTREES_BRANCH to enable filtering bypass in 'All Worktrees' mode.
    • Modified feature filtering logic to show all features regardless of branch assignment when ALL_WORKTREES_BRANCH is the effective branch.
  • apps/ui/src/components/views/board-view/worktree-panel/components/worktree-dropdown.tsx
    • Imported DropdownMenuItem, Layers, and Check icons for the new 'All Worktrees' option.
    • Added isAllWorktreesSelected and onSelectAllWorktrees props to manage the 'All Worktrees' state and selection.
    • Updated the dropdown trigger to display 'All' with a Layers icon and total card count when 'All Worktrees' is selected, hiding worktree-specific indicators.
    • Added a new DropdownMenuItem for 'All Worktrees' with appropriate styling, icon, and total card count display.
  • apps/ui/src/components/views/board-view/worktree-panel/components/worktree-mobile-dropdown.tsx
    • Imported useMemo and Layers icon for mobile dropdown functionality.
    • Added isAllWorktreesSelected and onSelectAllWorktrees props for mobile 'All Worktrees' selection.
    • Updated the mobile dropdown trigger to show 'All' with a Layers icon and total card count when 'All Worktrees' is active.
    • Added an 'All Worktrees' option to the mobile dropdown menu, including selection indicator and total card count.
  • apps/ui/src/components/views/board-view/worktree-panel/components/worktree-tab.tsx
    • Added isAllWorktreesSelected prop to control UI elements based on the 'All Worktrees' selection.
    • Adjusted button styling to remove right border and rounded corners when isAllWorktreesSelected is true.
    • Conditionally rendered BranchSwitchDropdown, dev server indicator, auto mode indicator, and WorktreeActionsDropdown to hide them when isAllWorktreesSelected is true.
  • apps/ui/src/components/views/board-view/worktree-panel/hooks/use-worktrees.ts
    • Imported ALL_WORKTREES_BRANCH for worktree validation and selection logic.
    • Added logic to skip worktree validation in useEffect when ALL_WORKTREES_BRANCH is the current selection.
    • Modified selectedWorktree derivation to return undefined when ALL_WORKTREES_BRANCH is selected, ensuring consumers handle the virtual selection correctly.
  • apps/ui/src/components/views/board-view/worktree-panel/worktree-panel.tsx
    • Imported useMemo and Layers icon for UI components.
    • Imported ALL_WORKTREES_BRANCH for managing the 'All Worktrees' state.
    • Introduced isAllWorktreesSelected state and handleSelectAllWorktrees callback to manage the 'All Worktrees' view.
    • Computed totalCardCount for displaying the aggregated feature count in the 'All Worktrees' option.
    • Updated isWorktreeSelected to return false if 'All Worktrees' is selected, as no individual worktree is active.
    • Integrated the 'All Worktrees' option into both the WorktreeMobileDropdown and WorktreeDropdown components.
    • Added an 'All' tab button to the standard tabs layout, displayed when worktrees are enabled, allowing selection of the 'All Worktrees' view.
  • apps/ui/src/store/app-store.ts
    • Added ALL_WORKTREES_BRANCH as a sentinel constant to represent the 'All Worktrees' virtual selection.
Activity
  • The pull request was created by Questler.
  • A Playwright verification test for sentinel persistence and branch filtering bypass has passed.
  • Verification steps for the 'All' tab appearance, correct running agent state in 'All' view, and hiding worktree-specific actions in 'All' view are outlined in the test plan.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request successfully adds the "All Worktrees" overview option, which is a great enhancement for managing features across multiple worktrees. The implementation is thorough, touching all the necessary components from the data store to the UI panels. The logic to handle the virtual "All" selection, especially for aggregating running tasks, is well-handled. I've left one suggestion regarding centralizing a piece of duplicated logic to improve maintainability. Overall, this is a solid feature addition.

Comment on lines +80 to +84
// Compute total card count across all branches for "All" tab display
const totalCardCount = useMemo(() => {
if (!branchCardCounts) return 0;
return Object.values(branchCardCounts).reduce((sum, count) => sum + count, 0);
}, [branchCardCounts]);
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

You're calculating totalCardCount here, which is great. However, the same calculation is also performed inside WorktreeDropdown and WorktreeMobileDropdown. To avoid code duplication and redundant calculations, you can pass this totalCardCount down as a prop to those child components.

This would involve:

  1. Adding a totalCardCount prop to WorktreeDropdownProps and WorktreeMobileDropdownProps.
  2. Passing this totalCardCount to <WorktreeDropdown ... /> and <WorktreeMobileDropdown ... />.
  3. Removing the useMemo calculation for totalCardCount from the child components and using the prop instead.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds an “All Worktrees” virtual selection to the Board worktree selector so the board can display features from all branches/worktrees together, and adjusts running-agent state aggregation so cards show correct running status in that view.

Changes:

  • Introduces ALL_WORKTREES_BRANCH sentinel branch value in the app store.
  • Adds “All / All Worktrees” option across tab, dropdown, and mobile worktree selectors.
  • Updates board filtering + running-task aggregation to support the ALL view.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
apps/ui/src/store/app-store.ts Adds ALL_WORKTREES_BRANCH sentinel constant exported from the store module.
apps/ui/src/components/views/board-view.tsx Uses sentinel to bypass filtering and aggregates running tasks across worktrees in ALL mode.
apps/ui/src/components/views/board-view/hooks/use-board-column-features.ts Bypasses branch/worktree filtering when ALL_WORKTREES_BRANCH is active.
apps/ui/src/components/views/board-view/worktree-panel/worktree-panel.tsx Adds “All” tab and wires ALL selection into desktop/mobile selectors; hides worktree-specific controls in ALL mode.
apps/ui/src/components/views/board-view/worktree-panel/hooks/use-worktrees.ts Treats ALL selection as virtual (no selected worktree) and skips selection validation.
apps/ui/src/components/views/board-view/worktree-panel/components/worktree-dropdown.tsx Adds “All Worktrees” dropdown option + total card count; adjusts trigger indicators for ALL mode.
apps/ui/src/components/views/board-view/worktree-panel/components/worktree-mobile-dropdown.tsx Adds “All Worktrees” option + total card count in mobile dropdown.
apps/ui/src/components/views/board-view/worktree-panel/components/worktree-tab.tsx Hides branch switch/actions/dev server/auto-mode indicators when ALL is selected.
Comments suppressed due to low confidence (1)

apps/ui/src/components/views/board-view.tsx:522

  • selectedWorktreeBranch is derived from currentWorktreeBranch, so when the "All Worktrees" sentinel is selected it becomes __all_worktrees__. This value is later passed as defaultBranch / defaultBaseBranch and can cause newly created plans/features to be assigned to the sentinel instead of a real git branch. Treat ALL mode as "no single branch" when computing defaults (e.g., fall back to primary/main branch when currentWorktreeBranch === ALL_WORKTREES_BRANCH).
  // Get the branch for the currently selected worktree (for defaulting new features)
  // Use the branch from selectedWorktree, or fall back to main worktree's branch
  const selectedWorktreeBranch =
    currentWorktreeBranch || worktrees.find((w) => w.isMain)?.branch || 'main';


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

getTestSessionInfo={getTestSessionInfo}
onSelectWorktree={handleSelectWorktree}
isAllWorktreesSelected={isAllWorktreesSelected}
onSelectAllWorktrees={handleSelectAllWorktrees}
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

In dropdown layout, onSelectAllWorktrees is passed unconditionally. If useWorktreesEnabled can be false (it’s a user setting), this will still render the "All Worktrees" option even though worktrees are disabled. Pass undefined unless worktrees are enabled (and ideally only when there is at least one non-main worktree).

Suggested change
onSelectAllWorktrees={handleSelectAllWorktrees}
onSelectAllWorktrees={useWorktreesEnabled ? handleSelectAllWorktrees : undefined}

Copilot uses AI. Check for mistakes.
Comment on lines 850 to 855
{/* "All" tab - shown when worktrees are enabled */}
{useWorktreesEnabled && (
<Button
variant={isAllWorktreesSelected ? 'default' : 'outline'}
size="sm"
className="h-7 px-3 text-xs font-mono gap-1.5"
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

The "All" tab is shown whenever useWorktreesEnabled is true, even if there are no non-main worktrees. This diverges from the PR description/test plan (“All tab appears when at least 1 non-main worktree exists”) and makes the selector redundant on single-branch projects. Consider gating this on nonMainWorktrees.length > 0 (and similarly for the mobile/dropdown "All Worktrees" option).

Copilot uses AI. Check for mistakes.
Comment on lines 576 to 581
isActivating={isActivating}
branchCardCounts={branchCardCounts}
onSelectWorktree={handleSelectWorktree}
isAllWorktreesSelected={isAllWorktreesSelected}
onSelectAllWorktrees={useWorktreesEnabled ? handleSelectAllWorktrees : undefined}
/>
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

Mobile dropdown enables the "All Worktrees" option based only on useWorktreesEnabled. If the intended behavior is to show "All" only when at least one non-main worktree exists, also gate onSelectAllWorktrees on nonMainWorktrees.length > 0 to match the desktop tab behavior.

Copilot uses AI. Check for mistakes.
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/ui/src/components/views/board-view.tsx (1)

512-521: ⚠️ Potential issue | 🟠 Major

Avoid using ALL_WORKTREES_BRANCH as a real branch for feature defaults.
In All mode, currentWorktreeBranch becomes the sentinel and can flow into branch defaults/updates, which risks assigning features to "__all_worktrees__" and making them disappear from normal branch views.

🔧 Suggested fix (sanitize the branch for defaults)
-  const currentWorktreeBranch = selectedWorktree?.branch ?? currentWorktreeInfo?.branch ?? null;
+  const currentWorktreeBranch = selectedWorktree?.branch ?? currentWorktreeInfo?.branch ?? null;
+  const effectiveWorktreeBranch =
+    currentWorktreeBranch === ALL_WORKTREES_BRANCH ? null : currentWorktreeBranch;

-  const selectedWorktreeBranch =
-    currentWorktreeBranch || worktrees.find((w) => w.isMain)?.branch || 'main';
+  const selectedWorktreeBranch =
+    effectiveWorktreeBranch || worktrees.find((w) => w.isMain)?.branch || 'main';

Use effectiveWorktreeBranch anywhere a real branch is required (bulk updates, dialogs, defaults).

- Sanitize sentinel branch value so it never leaks into feature defaults
- Pass totalCardCount as prop from parent instead of recalculating in each child
- Only show "All" option when at least 1 non-main worktree exists

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
apps/ui/src/components/views/board-view.tsx (2)

640-665: ⚠️ Potential issue | 🟠 Major

Sentinel value can leak into feature branchName via bulk update.

In handleBulkUpdate, when workMode === 'current' (Line 652-654), finalBranchName is set to currentWorktreeBranch, which equals '__all_worktrees__' in All mode. This sentinel would be persisted as a real branchName on features.

Suggested fix
         if (workMode === 'current') {
           // If a worktree is selected, use its branch; otherwise work on main (undefined = no branch assignment)
-          finalBranchName = currentWorktreeBranch || undefined;
+          finalBranchName = effectiveWorktreeBranch || undefined;

1630-1632: ⚠️ Potential issue | 🟠 Major

Replace currentWorktreeBranch with effectiveWorktreeBranch in dialog props to prevent sentinel value leakage.

The sentinel value '__all_worktrees__' can appear in the UI through the currentBranch prop. When in All mode, currentWorktreeBranch is '__all_worktrees__', which is truthy and passes through the || undefined check. The WorkModeSelector component then displays this sentinel directly to the user in work mode descriptions like "Work will be done directly on all_worktrees".

Use effectiveWorktreeBranch instead, which correctly maps the sentinel to null:

Suggested fix for all three dialog props
-        currentBranch={currentWorktreeBranch || undefined}
+        currentBranch={effectiveWorktreeBranch || undefined}

Applies to lines 1583–1587 (MassEditDialog), 1630–1632 (AddFeatureDialog), and 1662–1665 (EditFeatureDialog).

🧹 Nitpick comments (4)
apps/ui/src/components/views/board-view/worktree-panel/components/worktree-mobile-dropdown.tsx (2)

58-68: Badge styling is duplicated inline across multiple locations.

The badge class string "inline-flex items-center justify-center h-4 min-w-[1rem] px-1 text-[10px] font-medium rounded bg-background/80 text-foreground border border-border" is repeated in the trigger (Line 65) and the dropdown item (Line 101), and also appears identically in worktree-dropdown.tsx. Consider extracting a shared constant or utility for this badge style to reduce duplication.

Also applies to: 99-104


78-109: Minor: onSelect vs onClick handler inconsistency.

The "All Worktrees" item uses onSelect (Line 81) while individual worktree items use onClick (Line 124). Both work for Radix DropdownMenuItem, but using the same handler prop throughout would be more consistent.

apps/ui/src/components/views/board-view/worktree-panel/worktree-panel.tsx (2)

417-425: Redundant double-check in isWorktreeSelected.

Both isAllWorktreesSelected (Line 421) and currentWorktree?.branch === ALL_WORKTREES_BRANCH are derived from the same state in the same render cycle. Since isWorktreeSelected is an inline function (not a stale callback), it always captures the current value of isAllWorktreesSelected. The second check adds no safety.

Not blocking — the intent is clear and it's harmless.


770-776: Minor: Missing useWorktreesEnabled guard in dropdown layout path.

Mobile (Line 581) guards onSelectAllWorktrees with useWorktreesEnabled && nonMainWorktrees.length > 0, but the desktop dropdown layout (Line 774) only checks nonMainWorktrees.length > 0. While the dropdown path inherently requires 3+ worktrees (implying worktrees are enabled), aligning the conditions would be more defensive.

Suggested alignment
             onSelectAllWorktrees={
-              nonMainWorktrees.length > 0 ? handleSelectAllWorktrees : undefined
+              useWorktreesEnabled && nonMainWorktrees.length > 0 ? handleSelectAllWorktrees : undefined
             }

When 3+ worktrees use the dropdown layout, temporary worktree pills
appear during card drag to serve as drop targets. Reuses existing
worktree-drop handler from use-board-drag-drop.ts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
apps/ui/src/components/views/board-view.tsx (2)

640-654: ⚠️ Potential issue | 🔴 Critical

Sentinel ALL_WORKTREES_BRANCH can leak as a real branch name during bulk update.

When the "All Worktrees" view is active, currentWorktreeBranch is '__all_worktrees__'. In workMode === 'current' (line 654), this truthy sentinel string becomes finalBranchName and is persisted as the feature's branchName on line 709. This corrupts feature data with a non-existent branch.

🐛 Proposed fix — guard against the sentinel in 'current' mode
         if (workMode === 'current') {
           // If a worktree is selected, use its branch; otherwise work on main (undefined = no branch assignment)
-          finalBranchName = currentWorktreeBranch || undefined;
+          finalBranchName =
+            currentWorktreeBranch && currentWorktreeBranch !== ALL_WORKTREES_BRANCH
+              ? currentWorktreeBranch
+              : undefined;

1586-1586: ⚠️ Potential issue | 🟡 Minor

Sentinel value may leak into dialog currentBranch props.

currentWorktreeBranch || undefined evaluates to '__all_worktrees__' in ALL mode since the sentinel is truthy. This passes through to MassEditDialog (line 1586), AddFeatureDialog (line 1633), and EditFeatureDialog (line 1665) as currentBranch. Depending on how these dialogs render the value, users may see __all_worktrees__ in the branch selector or it could affect branch-defaulting logic.

Consider using effectiveWorktreeBranch (which maps the sentinel to null) instead:

🛡️ Suggested fix
       <MassEditDialog
         ...
-        currentBranch={currentWorktreeBranch || undefined}
+        currentBranch={effectiveWorktreeBranch || undefined}
         ...
       />

Apply the same pattern at lines 1633 and 1665.

🧹 Nitpick comments (1)
apps/ui/src/components/views/board-view/worktree-panel/worktree-panel.tsx (1)

448-456: isWorktreeSelected ALL-mode guard is correct.

The early return when ALL is selected properly prevents any individual worktree from appearing selected. Minor nit: the double check on line 452 (isAllWorktreesSelected || currentWorktree?.branch === ALL_WORKTREES_BRANCH) is redundant since isAllWorktreesSelected is defined as exactly that comparison (line 102), but it's harmless.

@webdevcody webdevcody deleted the branch AutoMaker-Org:v0.14.0rc February 13, 2026 18:47
@webdevcody webdevcody closed this Feb 13, 2026
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.

2 participants