Skip to content

feat(desktop): make change base branch list searchable#1425

Merged
saddlepaddle merged 1 commit into
mainfrom
make-base-branch-list-searchable
Feb 12, 2026
Merged

feat(desktop): make change base branch list searchable#1425
saddlepaddle merged 1 commit into
mainfrom
make-base-branch-list-searchable

Conversation

@saddlepaddle
Copy link
Copy Markdown
Collaborator

@saddlepaddle saddlepaddle commented Feb 12, 2026

Summary

  • Replace the plain DropdownMenu in BaseBranchSelector (changes sidebar) with a searchable Popover + Command combo
  • Adds a search input that filters branches by case-insensitive substring match
  • Matches the existing pattern used in the new workspace modal's base branch selector

Test plan

  • Open a workspace with changes, click the git branch icon in the changes header
  • Verify the dropdown now shows a "Search branches..." input
  • Type a partial branch name and confirm the list filters correctly
  • Select a branch and confirm it sets the base branch as before
  • Verify "No branches found" shows when search has no matches

Summary by CodeRabbit

  • New Features
    • Added search functionality to base-branch selection interface, enabling users to filter and discover available branches more efficiently
    • Default branch is now marked with a visual indicator for easy identification among all available options
    • Improved branch selection user interface with enhanced navigation, organization, and discoverability
    • Branch filtering capability allows quick and easy lookup by branch name

Replace the plain DropdownMenu in BaseBranchSelector with a Popover +
Command combo that includes a search input for filtering branches.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 12, 2026

📝 Walkthrough

Walkthrough

The PR refactors the base-branch selection UI in ChangesHeader from a DropdownMenu to a searchable Popover component with Command-based filtering. It adds local state for search input and branch sorting, while maintaining existing behavior for branch updates and popover interactions.

Changes

Cohort / File(s) Summary
Base Branch Selector Refactoring
apps/desktop/src/renderer/screens/main/components/WorkspaceView/RightSidebar/ChangesView/components/ChangesHeader/ChangesHeader.tsx
Replaces DropdownMenu with Popover+Command searchable list for base-branch selection. Adds search state, memoized branch sorting, filtered results, and "(default)" label. Updates branch selection handler to close popover and reset search.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 A branch selector blooms with search so bright,
No more dropdowns hiding choices out of sight,
A popover dances with Command's gentle hand,
Finding branches quickly—oh, isn't it grand?
The humble UI transforms, clear and lean! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description check ❓ Inconclusive The description provides a clear summary of changes, test plan, and implementation details. However, it lacks the structured template sections (Description, Related Issues, Type of Change, Testing, Screenshots, Additional Notes) specified in the repository template. Restructure the description to follow the template format with all required sections, particularly separating the summary into a Description section and formalizing the test plan under Testing.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: making the base branch list in the changes sidebar searchable by replacing DropdownMenu with a Popover-based searchable interface.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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
  • Commit unit tests in branch make-base-branch-list-searchable

No actionable comments were generated in the recent review. 🎉

🧹 Recent nitpick comments
apps/desktop/src/renderer/screens/main/components/WorkspaceView/RightSidebar/ChangesView/components/ChangesHeader/ChangesHeader.tsx (1)

52-66: Inconsistent null-safety between sortedBranches and filteredBranches.

filteredBranches defensively handles potential nullish branch entries (.filter(Boolean) on line 61, optional chaining on line 64), but sortedBranches feeds those same entries through a.localeCompare(b) on line 56 without any guard. If branchData.remote ever contains a null/undefined element, the sort will throw before the filter can clean it up.

Either move the .filter(Boolean) into sortedBranches (so downstream code doesn't need to worry about it), or drop it entirely if the data contract guarantees non-nullish strings.

♻️ Suggested: filter once, early
 const sortedBranches = useMemo(() => {
-	return [...(branchData?.remote ?? [])].sort((a, b) => {
+	return [...(branchData?.remote ?? [])].filter(Boolean).sort((a, b) => {
 		if (a === branchData?.defaultBranch) return -1;
 		if (b === branchData?.defaultBranch) return 1;
 		return a.localeCompare(b);
 	});
 }, [branchData?.remote, branchData?.defaultBranch]);

 const filteredBranches = useMemo(() => {
-	if (!search) return sortedBranches.filter(Boolean);
+	if (!search) return sortedBranches;
 	const lower = search.toLowerCase();
-	return sortedBranches.filter((branch) =>
-		branch?.toLowerCase().includes(lower),
+	return sortedBranches.filter((branch) =>
+		branch.toLowerCase().includes(lower),
 	);
 }, [sortedBranches, search]);

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.

@saddlepaddle saddlepaddle merged commit 607fb09 into main Feb 12, 2026
6 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

🧹 Preview Cleanup Complete

The following preview resources have been cleaned up:

  • ✅ Neon database branch
  • ⚠️ Electric Fly.io app
  • ⚠️ Streams Fly.io app

Thank you for your contribution! 🎉

@Kitenite Kitenite deleted the make-base-branch-list-searchable branch February 19, 2026 21:44
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