Skip to content

feat(desktop): improve changes sidebar header UI#1110

Merged
Kitenite merged 2 commits into
mainfrom
kitenite/create-filetree
Feb 1, 2026
Merged

feat(desktop): improve changes sidebar header UI#1110
Kitenite merged 2 commits into
mainfrom
kitenite/create-filetree

Conversation

@Kitenite
Copy link
Copy Markdown
Collaborator

@Kitenite Kitenite commented Feb 1, 2026

Summary

  • Changed base branch selector to icon-only button with dropdown showing "Current base branch" header
  • Consolidated changes header into single row (base branch, stash, view mode, refresh, PR status, expand/close)
  • Synced expanded/collapsed state between sidebar ChangesView and main content InfiniteScrollView using shared store

Test plan

  • Open changes sidebar and verify base branch icon opens dropdown with "Current base branch" header
  • Verify all header actions (stash, view mode, refresh, expand, close) are in a single row
  • Expand/collapse a category in sidebar, verify it syncs to the main changes content view
  • Expand/collapse a category in main content view, verify it syncs to sidebar

Summary by CodeRabbit

  • Style

    • Added right borders to category header and diff toolbar components for improved visual structure.
  • Refactor

    • Restructured the Changes header layout with a new dropdown menu for base branch selection, repositioned sidebar controls with keyboard shortcut tooltips, and improved overall control accessibility.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 1, 2026

📝 Walkthrough

Walkthrough

The pull request updates state management in InfiniteScrollView by replacing local expansion state with store-provided state, adds right borders to component styling in CategoryHeader and DiffToolbar, and restructures the ChangesHeader UI from a Select-based branch selector to a DropdownMenu-based implementation with reorganized header controls.

Changes

Cohort / File(s) Summary
State Management Refactor
apps/desktop/src/renderer/screens/main/components/WorkspaceView/ChangesContent/components/InfiniteScrollView/InfiniteScrollView.tsx
Replaced internal expandedCategories state with store-provided expandedSections and toggleSection; removed local state management and updated component to derive from store instead.
Styling Updates
apps/desktop/src/renderer/screens/main/components/WorkspaceView/ChangesContent/components/InfiniteScrollView/components/CategoryHeader/CategoryHeader.tsx, apps/desktop/src/renderer/screens/main/components/WorkspaceView/ChangesContent/components/InfiniteScrollView/components/DiffToolbar/DiffToolbar.tsx
Added right border (border-r) class to button and container elements, complementing existing border styling with no logic changes.
Header UI Redesign
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/ChangesHeader/ChangesHeader.tsx
Replaced Select-based base-branch selector with DropdownMenu-based UI featuring branch list with checkmark indicator; reorganized header layout to single row containing base-branch selector, stash dropdown, view mode toggle, refresh button, and PR status link; introduced LuGitBranch and HiCheck icons; simplified tooltip handling.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~35 minutes

Possibly related PRs

Poem

🐰 A border here, a dropdown there,
State moves to the store with care,
Headers dance in new array,
Branch selection finds its way!

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: improving the changes sidebar header UI through consolidation and reorganization of controls.
Description check ✅ Passed The description covers the key changes and includes a test plan, but lacks explicit mention of related issues and Type of Change section from the template.

✏️ 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 kitenite/create-filetree

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.

@Kitenite Kitenite merged commit bafe23e into main Feb 1, 2026
4 of 5 checks passed
@Kitenite Kitenite deleted the kitenite/create-filetree branch February 1, 2026 17:10
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 1, 2026

🧹 Preview Cleanup Complete

The following preview resources have been cleaned up:

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

Thank you for your contribution! 🎉

Copy link
Copy Markdown
Contributor

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In
`@apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/ChangesHeader/ChangesHeader.tsx`:
- Around line 57-74: The base-branch Button (the icon-only branch selector
inside ChangesHeader using DropdownMenuTrigger/DropdownMenu and the Button
component) lacks an accessible label; add an aria-label (e.g., "Select base
branch" or similar descriptive text) to that Button element so screen readers
can announce its purpose, and ensure the Tooltip content still matches the
aria-label for consistency; update the JSX for the Button used in ChangesHeader
(the Button with variant="ghost" size="icon" and <LuGitBranch />) to include the
aria-label prop.

Comment on lines +57 to +74
const handleBranchSelect = (branch: string) => {
if (branch === branchData?.defaultBranch && baseBranch === null) return;
setBaseBranch(branch);
};

if (isLoading || !branchData) {
return (
<span className="px-1.5 py-0.5 rounded bg-muted/50 text-foreground text-[10px] font-medium truncate">
{effectiveBaseBranch}
</span>
);
}

return (
<Tooltip open={tooltipOpen}>
<Select value={effectiveBaseBranch} onValueChange={handleChange}>
<DropdownMenu>
<Tooltip>
<TooltipTrigger asChild>
<SelectTrigger
size="sm"
className="h-5 px-1.5 py-0 text-[10px] font-medium border-none bg-muted/50 hover:bg-muted text-foreground min-w-0 w-auto gap-0.5 rounded"
onPointerEnter={handlePointerEnter}
onPointerLeave={handlePointerLeave}
>
<SelectValue />
</SelectTrigger>
<DropdownMenuTrigger asChild>
<Button
variant="ghost"
size="icon"
className="size-6 p-0"
disabled={isLoading}
>
<LuGitBranch className="size-3.5" />
</Button>
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.

⚠️ Potential issue | 🟡 Minor

Add an accessible label to the icon-only base-branch button.

Icon-only controls need an aria-label for screen readers.

🔧 Suggested fix
 						<Button
 							variant="ghost"
 							size="icon"
 							className="size-6 p-0"
 							disabled={isLoading}
+							aria-label="Change base branch"
 						>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const handleBranchSelect = (branch: string) => {
if (branch === branchData?.defaultBranch && baseBranch === null) return;
setBaseBranch(branch);
};
if (isLoading || !branchData) {
return (
<span className="px-1.5 py-0.5 rounded bg-muted/50 text-foreground text-[10px] font-medium truncate">
{effectiveBaseBranch}
</span>
);
}
return (
<Tooltip open={tooltipOpen}>
<Select value={effectiveBaseBranch} onValueChange={handleChange}>
<DropdownMenu>
<Tooltip>
<TooltipTrigger asChild>
<SelectTrigger
size="sm"
className="h-5 px-1.5 py-0 text-[10px] font-medium border-none bg-muted/50 hover:bg-muted text-foreground min-w-0 w-auto gap-0.5 rounded"
onPointerEnter={handlePointerEnter}
onPointerLeave={handlePointerLeave}
>
<SelectValue />
</SelectTrigger>
<DropdownMenuTrigger asChild>
<Button
variant="ghost"
size="icon"
className="size-6 p-0"
disabled={isLoading}
>
<LuGitBranch className="size-3.5" />
</Button>
const handleBranchSelect = (branch: string) => {
if (branch === branchData?.defaultBranch && baseBranch === null) return;
setBaseBranch(branch);
};
return (
<DropdownMenu>
<Tooltip>
<TooltipTrigger asChild>
<DropdownMenuTrigger asChild>
<Button
variant="ghost"
size="icon"
className="size-6 p-0"
disabled={isLoading}
aria-label="Change base branch"
>
<LuGitBranch className="size-3.5" />
</Button>
🤖 Prompt for AI Agents
In
`@apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/ChangesHeader/ChangesHeader.tsx`
around lines 57 - 74, The base-branch Button (the icon-only branch selector
inside ChangesHeader using DropdownMenuTrigger/DropdownMenu and the Button
component) lacks an accessible label; add an aria-label (e.g., "Select base
branch" or similar descriptive text) to that Button element so screen readers
can announce its purpose, and ensure the Tooltip content still matches the
aria-label for consistency; update the JSX for the Button used in ChangesHeader
(the Button with variant="ghost" size="icon" and <LuGitBranch />) to include the
aria-label prop.

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