Repository navigation
Changes tab UI beautification - #317
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Rate limit exceeded@Kitenite has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 7 minutes and 9 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (13)
WalkthroughMultiple presentational and structural UI changes: layout class fixes, new FolderRow and level-based FileItem indentation, refactored grouped/tree file lists, status utilities added, Select-based base-branch picker (TRPC), FileHeader open-in-app + worktreePath, and trpc changes router now counts lines for untracked files. Changes
Sequence Diagram(s)sequenceDiagram
participant UI as Renderer (ChangesHeader / FileHeader)
participant TRPC as trpc/changes router
participant FS as Filesystem/Repo
UI->>TRPC: queryBranches() / queryLastUsedApp()
TRPC->>FS: read branch refs / read file (for untracked)
FS-->>TRPC: branches list / file contents (or error)
TRPC-->>UI: branches payload / lastUsedApp / computed status (with additions)
Note right of UI: user selects base branch or clicks "Open in App"
UI->>TRPC: setBaseBranch mutation or openInApp mutation (with fullPath)
TRPC->>FS: (for openInApp) verify/read path or trigger OS open
TRPC-->>UI: mutation result / success or error
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
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. Comment |
🧹 Preview Cleanup CompleteThe following preview resources have been cleaned up:
Thank you for your contribution! 🎉 |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (6)
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileItem/FileItem.tsx (2)
11-27: Tighten status typing and consider centralizing status helpersThe mapping and new
copiedsupport look good, but this re-implements status handling with a loosestatus: string. To avoid drift between components (e.g.,getStatusIndicatorinGitFileTree/utils.ts) and improve type safety, consider:
- Typing the argument as
ChangedFile["status"]instead ofstring.- Hoisting the shared status → color/indicator mappings into a small shared helper so FileItem and the tree view stay in sync when new statuses are added.
91-99: Consider adding an accessible label/tooltip for the status badgeThe single-letter badge plus color (A/M/D/R/C/?) may be opaque to less-experienced users and screen readers. Consider adding a
title={file.status}on the badge or a visually hidden label (e.g.,aria-label={file.status}withsr-onlytext) so the exact status is discoverable without relying solely on color and single-letter codes.apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileList/FileListGrouped.tsx (1)
77-86: RTL truncation trick for folder names — verify behavior and semanticsUsing
dir="rtl"withw-0 grow truncateis a neat way to keep the tail of long folder paths visible while the count staysshrink-0. It’s worth double‑checking that:
- The visual result is as intended for typical LTR paths (no surprising cursor/selection behavior).
- You’re okay with using the
dirattribute purely for layout, since it can interact with true RTL locales.If this proves flaky in practice, an alternative is to keep
dir="ltr"and rely on atitle={displayName}tooltip plus standardtruncate(or a custom path-shortening helper) instead.apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/ViewModeToggle/ViewModeToggle.tsx (1)
11-39: Toggle logic is solid; consider aligning labels with the actionThe
handleToggleimplementation correctly flips between"grouped"and"tree", and the tooltip text clearly communicates the action (“Switch to …”). For better accessibility consistency, consider updatingaria-labelto match the action rather than the current state, e.g.:aria-label={ viewMode === "grouped" ? "Switch to tree view" : "Switch to grouped view" }so screen readers hear the same wording as the tooltip.
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/ChangesHeader/ChangesHeader.tsx (2)
37-59: ClarifybaseBranchsemantics and how to restore “follow default” behaviorThe
effectiveBaseBranch = baseBranch ?? branchData?.defaultBranch ?? "main"pattern suggestsbaseBranch === null/undefinedmeans “follow the repo’s default branch”. InhandleChange, though, we only early‑return when the user selects the default branch andbaseBranch === null, which means:
- After a user has picked a non‑default branch, there’s no way to get back to the
nullsentinel; selecting the default will store it as an explicit override.If the store contract really treats
nullas “no override, track whatever the backend considers default”, consider something like:const handleChange = (value: string) => { if (!branchData) return; if (value === branchData.defaultBranch) { setBaseBranch(null); } else { setBaseBranch(value); } };so users can explicitly “return to default” via the UI.
16-25: Header UI changes look good; decide what to do withahead/behindpropsThe new header layout with the base-branch Select, view-mode toggle, and tooltip-wrapped refresh button looks clean and compact. However,
aheadandbehindare still part ofChangesHeaderPropsbut are no longer rendered anywhere in this component.If the ahead/behind counts are no longer part of the UX, consider removing these props and their plumbing to keep the API lean. If they’re still important to users, you may want to reintroduce a small indicator here (even just a tooltip or badge) so that information doesn’t silently disappear.
Also applies to: 62-116
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
bun.lockis excluded by!**/*.lock
📒 Files selected for processing (12)
apps/desktop/src/renderer/screens/main/components/StartView/index.tsx(1 hunks)apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/TerminalSearch/TerminalSearch.tsx(1 hunks)apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/BaseBranchSelector/BaseBranchSelector.tsx(1 hunks)apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/CategorySection/CategorySection.tsx(1 hunks)apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/ChangesHeader/ChangesHeader.tsx(2 hunks)apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/CommitItem/CommitItem.tsx(1 hunks)apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileItem/FileItem.tsx(2 hunks)apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileList/FileListGrouped.tsx(2 hunks)apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileList/FileListTree.tsx(5 hunks)apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/ViewModeToggle/ViewModeToggle.tsx(2 hunks)apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/GitFileTree/FileTreeView.tsx(1 hunks)apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/GitFileTree/GroupedView.tsx(1 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
apps/desktop/**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (apps/desktop/AGENTS.md)
For Electron interprocess communication, ALWAYS use tRPC as defined in
src/lib/trpc
Files:
apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/TerminalSearch/TerminalSearch.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/GitFileTree/FileTreeView.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/ViewModeToggle/ViewModeToggle.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/GitFileTree/GroupedView.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/CategorySection/CategorySection.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/BaseBranchSelector/BaseBranchSelector.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/ChangesHeader/ChangesHeader.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/CommitItem/CommitItem.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileList/FileListGrouped.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileList/FileListTree.tsxapps/desktop/src/renderer/screens/main/components/StartView/index.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileItem/FileItem.tsx
apps/desktop/**/*.{ts,tsx}
📄 CodeRabbit inference engine (apps/desktop/AGENTS.md)
apps/desktop/**/*.{ts,tsx}: Please use alias as defined intsconfig.jsonwhen possible
Prefer zustand for state management if it makes sense. Do not use effect unless absolutely necessary
Files:
apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/TerminalSearch/TerminalSearch.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/GitFileTree/FileTreeView.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/ViewModeToggle/ViewModeToggle.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/GitFileTree/GroupedView.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/CategorySection/CategorySection.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/BaseBranchSelector/BaseBranchSelector.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/ChangesHeader/ChangesHeader.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/CommitItem/CommitItem.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileList/FileListGrouped.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileList/FileListTree.tsxapps/desktop/src/renderer/screens/main/components/StartView/index.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileItem/FileItem.tsx
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Maintain type safety and avoid using
anyunless absolutely necessary in TypeScript code
Files:
apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/TerminalSearch/TerminalSearch.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/GitFileTree/FileTreeView.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/ViewModeToggle/ViewModeToggle.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/GitFileTree/GroupedView.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/CategorySection/CategorySection.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/BaseBranchSelector/BaseBranchSelector.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/ChangesHeader/ChangesHeader.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/CommitItem/CommitItem.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileList/FileListGrouped.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileList/FileListTree.tsxapps/desktop/src/renderer/screens/main/components/StartView/index.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileItem/FileItem.tsx
**/components/**/[A-Z]*.tsx
📄 CodeRabbit inference engine (AGENTS.md)
Use one folder per component with structure ComponentName/ComponentName.tsx + index.ts barrel export
Files:
apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/TerminalSearch/TerminalSearch.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/GitFileTree/FileTreeView.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/ViewModeToggle/ViewModeToggle.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/GitFileTree/GroupedView.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/CategorySection/CategorySection.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/BaseBranchSelector/BaseBranchSelector.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/ChangesHeader/ChangesHeader.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/CommitItem/CommitItem.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileList/FileListGrouped.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileList/FileListTree.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileItem/FileItem.tsx
apps/desktop/src/renderer/**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Never import Node.js modules in renderer process or shared code - only in src/main/
Files:
apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/TerminalSearch/TerminalSearch.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/GitFileTree/FileTreeView.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/ViewModeToggle/ViewModeToggle.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/GitFileTree/GroupedView.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/CategorySection/CategorySection.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/BaseBranchSelector/BaseBranchSelector.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/ChangesHeader/ChangesHeader.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/CommitItem/CommitItem.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileList/FileListGrouped.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileList/FileListTree.tsxapps/desktop/src/renderer/screens/main/components/StartView/index.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileItem/FileItem.tsx
🧠 Learnings (6)
📓 Common learnings
Learnt from: CR
Repo: superset-sh/superset PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-08T23:32:32.232Z
Learning: Use React + TailwindCSS v4 + shadcn/ui for UI components
📚 Learning: 2025-12-08T23:32:32.232Z
Learnt from: CR
Repo: superset-sh/superset PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-08T23:32:32.232Z
Learning: Applies to apps/desktop/src/main/lib/terminal-*.ts : Use node-pty for terminal session management in the desktop app
Applied to files:
apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/TerminalSearch/TerminalSearch.tsx
📚 Learning: 2025-11-24T21:33:13.267Z
Learnt from: CR
Repo: superset-sh/superset PR: 0
File: apps/desktop/AGENTS.md:0-0
Timestamp: 2025-11-24T21:33:13.267Z
Learning: Applies to apps/desktop/**/*.{ts,tsx} : Please use alias as defined in `tsconfig.json` when possible
Applied to files:
apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/TerminalSearch/TerminalSearch.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/BaseBranchSelector/BaseBranchSelector.tsx
📚 Learning: 2025-12-08T23:32:32.232Z
Learnt from: CR
Repo: superset-sh/superset PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-08T23:32:32.232Z
Learning: Applies to src/components/{ui,ai-elements,react-flow}/**/*.tsx : Use kebab-case single files for shadcn/ui components in src/components/ui/, src/components/ai-elements, and src/components/react-flow/
Applied to files:
apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/TerminalSearch/TerminalSearch.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/GitFileTree/FileTreeView.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/ViewModeToggle/ViewModeToggle.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/GitFileTree/GroupedView.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/CategorySection/CategorySection.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/BaseBranchSelector/BaseBranchSelector.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/CommitItem/CommitItem.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileList/FileListGrouped.tsxapps/desktop/src/renderer/screens/main/components/StartView/index.tsx
📚 Learning: 2025-12-08T23:32:32.232Z
Learnt from: CR
Repo: superset-sh/superset PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-08T23:32:32.232Z
Learning: Applies to apps/desktop/src/main/lib/*{workspace,worktree}-*.ts : Use git worktree-based workspace management in the desktop app through workspace-manager.ts and worktree-manager.ts
Applied to files:
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/GitFileTree/FileTreeView.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/GitFileTree/GroupedView.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/BaseBranchSelector/BaseBranchSelector.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/ChangesHeader/ChangesHeader.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileList/FileListGrouped.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileList/FileListTree.tsx
📚 Learning: 2025-12-08T23:32:32.232Z
Learnt from: CR
Repo: superset-sh/superset PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-08T23:32:32.232Z
Learning: Use React + TailwindCSS v4 + shadcn/ui for UI components
Applied to files:
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/ChangesHeader/ChangesHeader.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileList/FileListGrouped.tsx
🧬 Code graph analysis (4)
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/ViewModeToggle/ViewModeToggle.tsx (2)
packages/ui/src/components/tooltip.tsx (3)
Tooltip(74-74)TooltipTrigger(74-74)TooltipContent(74-74)packages/ui/src/components/button.tsx (1)
Button(61-61)
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/CategorySection/CategorySection.tsx (2)
packages/ui/src/components/collapsible.tsx (2)
CollapsibleTrigger(26-26)CollapsibleContent(26-26)packages/ui/src/lib/utils.ts (1)
cn(4-6)
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileList/FileListGrouped.tsx (2)
packages/ui/src/components/collapsible.tsx (2)
Collapsible(26-26)CollapsibleTrigger(26-26)packages/ui/src/lib/utils.ts (1)
cn(4-6)
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileItem/FileItem.tsx (2)
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/GitFileTree/utils.ts (1)
getStatusIndicator(126-141)packages/ui/src/lib/utils.ts (1)
cn(4-6)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Build
🔇 Additional comments (15)
apps/desktop/src/renderer/screens/main/components/StartView/index.tsx (1)
141-157: Error banner shrink behavior looks goodSwitching to
shrink-0on the icon container and dismiss button keeps them from collapsing in tight layouts and aligns with the Tailwind v4 utility naming. No behavioral risk here.apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/GitFileTree/FileTreeView.tsx (1)
40-45: Chevron icon class updates are safe and consistentUsing
shrink-0on the expanded/collapsed chevrons preserves icon size and lets the filename text handle truncation. This matches the pattern used elsewhere in the tree components.apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/GitFileTree/GroupedView.tsx (1)
37-41: GroupedView chevron layout tightenedThe
shrink-0update for the chevrons keeps them from compressing when folder names are long, which should improve readability of the expand/collapse affordance without impacting behavior.apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/TerminalSearch/TerminalSearch.tsx (1)
129-176: Search control strip shrink behavior is appropriateUpdating the control container to
shrink-0keeps the case toggle, navigation buttons, and close button stable while the input and “No results” text handle width pressure. The behavior of the search itself is unchanged.apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/CommitItem/CommitItem.tsx (1)
61-75: Commit row layout changes improve readabilityMarking the chevrons,
shortHash, and timestamp spans asshrink-0keeps those fixed-width data points intact while allowing the commit message to truncate. This is a sensible layout trade‑off and doesn’t affect the collapsible behavior or selection logic.apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/CategorySection/CategorySection.tsx (1)
31-58: Stronger flex and overflow constraints in section headers/content look correctAdding
min-w-0to theCollapsible, header wrapper, trigger, and content, plusoverflow-hiddenon the container/content, addresses common flex+truncation issues and should prevent horizontal scroll bleed. Usingshrink-0on chevrons, the count badge, and the actions container keeps those affordances stable while the title text truncates. No functional regressions evident.apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/BaseBranchSelector/BaseBranchSelector.tsx (1)
41-48: Base branch selector label and styling are clearerThe new
fromlabel and updated trigger styles (muted background,font-medium, rounded) make the base-branch selector more readable and visually distinct without altering query behavior or state management. The use of therenderer/*alias is consistent with the project’s TS config.apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileList/FileListTree.tsx (5)
28-44: Status color mapping extended safely (including “copied”)Updating
getStatusColorto use explicit light/dark variants and adding a dedicated “copied” color aligns with the existinggetStatusIndicatormapping and improves visual differentiation. Fallbacks (untracked/default →text-muted-foreground) are preserved, so there’s no regression for unknown statuses.
127-140: LevelIndicators helper cleanly adds tree depth guidesThe new
LevelIndicatorscomponent is a straightforward, side‑effect‑free helper that renders vertical guides per depth level. It safely no‑ops atlevel === 0and usesshrink-0so guide columns don’t collapse when filenames truncate. This keeps the tree layout understandable without impacting selection or click behavior.
160-181: Folder row layout refactor improves truncation and icon behaviorThe folder branch now:
- Wraps the row in a
CollapsiblewithclassName="min-w-0"for proper flex behavior.- Uses a
CollapsibleTriggerwithitems-stretchandoverflow-hiddenso internal content, not the container, controls truncation.- Adds
LevelIndicatorsplus a nested flex row containing ashrink-0chevron and aflex-1 min-w-0 truncatefolder name.This should reduce horizontal overflow and keep the chevron stable while long folder names truncate. The expand/collapse logic (
isExpanded,onOpenChange) remains unchanged.
197-223: File row refactor: clearer stats and status with robust layoutFor file leaves, the updated row:
- Mirrors the folder structure (
LevelIndicators+ inner flex withflex-1 min-w-0) so names truncate cleanly.- Gated stats display (
showStatsand positive additions/deletions) in afont-mono shrink-0block, with light/dark colors matching the new status palette.- Moves the status indicator into a right-aligned, fixed‑width
span(font-mono shrink-0 whitespace-nowrap) to avoid wrapping.Selection styling still relies on
selectedPath === node.path && !selectedCommitHash, which is consistent with the previous behavior for “working tree vs commit” contexts. Click handling is unchanged and still guarded byisFile && node.file. Overall, this is a solid layout improvement without functional risk.
237-248: Root container min-width/overflow settings align with sidebar layoutWrapping the tree in
flex flex-col min-w-0 overflow-hiddenis appropriate for embedding inside other flex parents likeCategorySection. It ensures child rows can truncate instead of forcing horizontal scrolling or layout jitter.apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileItem/FileItem.tsx (1)
59-63: Stats gating and layout look correct
showStatsDisplaycorrectly avoids rendering empty stats, and the aggressive truncation on the file name (flex-1 min-w-0 ... truncate) works well with the monospace,shrink-0stats block so counts remain visible without layout jitter.Also applies to: 69-88
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileList/FileListGrouped.tsx (1)
112-113: Overflow constraints on the grouped list container look goodAdding
overflow-hiddento both the outer container and theCollapsibleshould prevent long folder names and file rows from bleeding into adjacent UI without affecting interaction.apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/ChangesHeader/ChangesHeader.tsx (1)
44-53: EnsureeffectiveBaseBranchis always represented in the Select options
Selectis controlled withvalue={effectiveBaseBranch}, while the option list is derived frombranchData.remote:
effectiveBaseBranchmay bebaseBranch(from the store) ordefaultBranch.sortedBranchesis built solely fromavailableBranches = branchData?.remote ?? [].If
remoteever omitsdefaultBranchor a previously storedbaseBranch(e.g., naming mismatch, local‑only branch), the Select could end up with a value that has no correspondingSelectItem, which can lead to empty labels or warnings depending on the Select implementation.It’s worth confirming that the tRPC
changes.getBranchescontract guaranteesdefaultBranch∈remoteand thatbaseBranchis always chosen from the same set; otherwise, consider includingdefaultBranch/baseBranchin the options when missing, or normalizing stored values to matchremote.Also applies to: 70-91
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (3)
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileItem/FileItem.tsx (3)
11-27: Tighten status typing toChangedFile["status"]for better safetyThe new badge helper looks good, but both helpers currently accept a plain
string. Since this component already depends onChangedFile, you can make the mapping exhaustive and type-safe:-function getStatusBadgeColor(status: string): string { +function getStatusBadgeColor(status: ChangedFile["status"]): string { @@ -function getStatusIndicator(status: string): string { +function getStatusIndicator(status: ChangedFile["status"]): string {This way any new status added to
ChangedFilewill surface here at compile time instead of silently falling into the default branch. As per coding guidelines, this keeps TS usage strongly typed.Also applies to: 58-60, 94-102
61-76: Stats gating and compact layout look good (small Tailwind nit)Conditionally showing stats only when non-zero and keeping them monospace is solid. Minor nit:
truncatealready appliesoverflow-hiddenandtext-ellipsis, so you could drop the extra classes on the filename span if you want to simplify:- <span className="flex-1 min-w-0 text-xs truncate overflow-hidden text-ellipsis"> + <span className="flex-1 min-w-0 text-xs truncate">Purely optional; current code is correct.
Also applies to: 78-92
29-42: Confirm untracked indicator symbol and consider de-duplicating mappingHere
getStatusIndicatornow returns"U"for"untracked", butgetStatusIndicatorinapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/GitFileTree/utils.tsstill returns"?"for untracked (per the provided snippet). If the goal is a consistent, GitHub-like indicator across views, it may be worth:
- Deciding whether untracked should be
"U"or"?"globally.- Sharing a single status→indicator mapping helper between FileItem and GitFileTree to avoid divergence.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
apps/desktop/src/lib/trpc/routers/changes/changes.ts(1 hunks)apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileItem/FileItem.tsx(3 hunks)
🧰 Additional context used
📓 Path-based instructions (6)
apps/desktop/**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (apps/desktop/AGENTS.md)
For Electron interprocess communication, ALWAYS use tRPC as defined in
src/lib/trpc
Files:
apps/desktop/src/lib/trpc/routers/changes/changes.tsapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileItem/FileItem.tsx
apps/desktop/**/*.{ts,tsx}
📄 CodeRabbit inference engine (apps/desktop/AGENTS.md)
apps/desktop/**/*.{ts,tsx}: Please use alias as defined intsconfig.jsonwhen possible
Prefer zustand for state management if it makes sense. Do not use effect unless absolutely necessary
Files:
apps/desktop/src/lib/trpc/routers/changes/changes.tsapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileItem/FileItem.tsx
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Maintain type safety and avoid using
anyunless absolutely necessary in TypeScript code
Files:
apps/desktop/src/lib/trpc/routers/changes/changes.tsapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileItem/FileItem.tsx
apps/desktop/src/lib/**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Never import Node.js modules like node:fs, node:path, node:os in src/lib/electron-router-dom.ts or similar shared code
Files:
apps/desktop/src/lib/trpc/routers/changes/changes.ts
**/components/**/[A-Z]*.tsx
📄 CodeRabbit inference engine (AGENTS.md)
Use one folder per component with structure ComponentName/ComponentName.tsx + index.ts barrel export
Files:
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileItem/FileItem.tsx
apps/desktop/src/renderer/**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Never import Node.js modules in renderer process or shared code - only in src/main/
Files:
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileItem/FileItem.tsx
🧠 Learnings (1)
📓 Common learnings
Learnt from: CR
Repo: superset-sh/superset PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-08T23:32:32.232Z
Learning: Use React + TailwindCSS v4 + shadcn/ui for UI components
🧬 Code graph analysis (1)
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileItem/FileItem.tsx (2)
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/GitFileTree/utils.ts (1)
getStatusIndicator(126-141)packages/ui/src/lib/utils.ts (1)
cn(4-6)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Build
| // Calculate line counts for untracked files (all lines are additions) | ||
| for (const file of parsed.untracked) { | ||
| try { | ||
| const fullPath = join(input.worktreePath, file.path); | ||
| const content = await readFile(fullPath, "utf-8"); | ||
| const lineCount = content.split("\n").length; | ||
| file.additions = lineCount; | ||
| file.deletions = 0; | ||
| } catch { | ||
| // File might be binary or unreadable | ||
| } | ||
| } |
There was a problem hiding this comment.
Fix empty-file line counting; optionally batch untracked reads
content.split("\n").length reports 1 for an empty file (and can over-count with trailing newlines), so an untracked empty file will show +1 line instead of 0. That’s a small but real correctness mismatch with typical diff/line-count semantics.
You can special-case empty content (and keep behavior unchanged otherwise), and if you like, also batch reads for better perf:
- // Calculate line counts for untracked files (all lines are additions)
- for (const file of parsed.untracked) {
- try {
- const fullPath = join(input.worktreePath, file.path);
- const content = await readFile(fullPath, "utf-8");
- const lineCount = content.split("\n").length;
- file.additions = lineCount;
- file.deletions = 0;
- } catch {
- // File might be binary or unreadable
- }
- }
+ // Calculate line counts for untracked files (all lines are additions)
+ await Promise.all(
+ parsed.untracked.map(async (file) => {
+ try {
+ const fullPath = join(input.worktreePath, file.path);
+ const content = await readFile(fullPath, "utf-8");
+ const lineCount =
+ content.length === 0 ? 0 : content.split("\n").length;
+ file.additions = lineCount;
+ file.deletions = 0;
+ } catch {
+ // File might be binary or unreadable
+ }
+ }),
+ );📝 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.
| // Calculate line counts for untracked files (all lines are additions) | |
| for (const file of parsed.untracked) { | |
| try { | |
| const fullPath = join(input.worktreePath, file.path); | |
| const content = await readFile(fullPath, "utf-8"); | |
| const lineCount = content.split("\n").length; | |
| file.additions = lineCount; | |
| file.deletions = 0; | |
| } catch { | |
| // File might be binary or unreadable | |
| } | |
| } | |
| // Calculate line counts for untracked files (all lines are additions) | |
| await Promise.all( | |
| parsed.untracked.map(async (file) => { | |
| try { | |
| const fullPath = join(input.worktreePath, file.path); | |
| const content = await readFile(fullPath, "utf-8"); | |
| const lineCount = | |
| content.length === 0 ? 0 : content.split("\n").length; | |
| file.additions = lineCount; | |
| file.deletions = 0; | |
| } catch { | |
| // File might be binary or unreadable | |
| } | |
| }), | |
| ); |
🤖 Prompt for AI Agents
In apps/desktop/src/lib/trpc/routers/changes/changes.ts around lines 171-182,
the untracked-file line counting uses content.split("\n").length which yields 1
for an empty file and can over-count when content ends with a trailing newline;
change the logic to treat an empty string as 0 lines and otherwise count lines
without counting a trailing newline as an extra line (e.g. if content is "" ->
0, else subtract the trailing-empty segment when content endsWith("\n") or use
an equivalent safe line-counting approach). Additionally, if you want better
performance, read untracked files in parallel (Promise.all over the file list)
instead of sequential await in the loop.
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (9)
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/CategorySection/CategorySection.tsx (2)
38-55: Header flex behavior looks solid; consider truncating long titlesThe
min-w-0+shrink-0tweaks on header, icons, count, and actions should keep the controls stable while the main text flexes, which is good. One follow-up you might consider: for very longtitlevalues, the text can still wrap or crowd the actions. Adding truncation (and giving the title span its ownmin-w-0) would keep the header layout robust in edge cases.Example (optional) adjustment:
- <span className="text-sm font-medium">{title}</span> + <span className="text-sm font-medium min-w-0 truncate"> + {title} + </span>
35-36: Doubleoverflow-hiddenmay clip focus outlines or nested overlaysAdding
overflow-hiddenon both theCollapsibleroot andCollapsibleContentwill keep the section visually contained, but it can also clip focus rings or any absolutely positioned children (e.g., menus/tooltips/popovers rendered inside this section). If you expect interactive children with their own overlays, it may be safer to limit the overflow rule (e.g.,overflow-x-hidden) or apply it one level deeper where you know content will never need to escape.This is more of a defensive layout tweak than a blocker, but worth double‑checking with your most complex
childrencases.Also applies to: 59-61
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FolderRow/FolderRow.tsx (1)
23-36: DuplicateLevelIndicatorsimplementation.This component is identical to the one in
FileItem.tsx(lines 14-27). Consider extracting it to a shared location (e.g.,../../utilsor a dedicated component) to avoid code duplication.apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/utils/status.tsx (1)
3-9: Unused imports.The
Hi*icons fromreact-icons/hi2are imported but never used. Only theLu*icons are used ingetStatusIndicator.Apply this diff:
-import { - HiMiniPencil, - HiMiniPlus, - HiMiniXMark, - HiArrowsRightLeft, - HiDocumentDuplicate, -} from "react-icons/hi2";apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileItem/FileItem.tsx (1)
14-27: DuplicateLevelIndicatorsimplementation.This is identical to the implementation in
FolderRow.tsx. As noted there, consider extracting to a shared utility to maintain DRY principles.apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileList/FileListTree.tsx (1)
121-131: Avoid non-null assertion; pass the already-guarded value.Since
node.fileis already checked on line 121, you can capture it in a variable to avoid the!assertion.Apply this diff:
- if (isFile && node.file) { + const file = node.file; + if (isFile && file) { return ( <FileItem - file={node.file} + file={file} isSelected={isSelected} - onClick={() => onFileSelect(node.file!)} + onClick={() => onFileSelect(file)} showStats={showStats} level={level} /> ); }apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/ChangesHeader/ChangesHeader.tsx (3)
10-10: Remove unused import.
HiArrowRightis imported but never used in the component.Apply this diff to remove the unused import:
-import { HiArrowPath, HiArrowRight } from "react-icons/hi2"; +import { HiArrowPath } from "react-icons/hi2";
16-25: Consider removing unused props from the interface.The
aheadandbehindprops are declared in the interface but are unused in the component (prefixed with_in the destructuring). Since the AI summary indicates this PR replaces the previous ahead/behind display with a new base-branch selector, these props appear to be vestigial from the old implementation.Apply this diff to clean up the interface:
interface ChangesHeaderProps { branch: string; - ahead: number; - behind: number; isRefreshing: boolean; onRefresh: () => void; viewMode: ChangesViewMode; onViewModeChange: (mode: ChangesViewMode) => void; worktreePath: string; }And update the component signature:
export function ChangesHeader({ branch, - ahead: _ahead, - behind: _behind, isRefreshing, onRefresh, viewMode, onViewModeChange, worktreePath, }: ChangesHeaderProps) {Also applies to: 29-30
53-58: Consider adding a clarifying comment.The early return logic prevents redundant state updates when the user selects the default branch while
baseBranchis alreadynull(meaning "use default"). While correct, this optimization is subtle and could benefit from a brief comment explaining the intent.Apply this diff to add a clarifying comment:
const handleChange = (value: string) => { + // Avoid redundant state update when selecting default branch while baseBranch is null if (value === branchData?.defaultBranch && baseBranch === null) { return; } setBaseBranch(value); };
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (10)
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/CategorySection/CategorySection.tsx(1 hunks)apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/ChangesHeader/ChangesHeader.tsx(2 hunks)apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileItem/FileItem.tsx(2 hunks)apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileList/FileListGrouped.tsx(2 hunks)apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileList/FileListTree.tsx(3 hunks)apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FolderRow/FolderRow.tsx(1 hunks)apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FolderRow/index.ts(1 hunks)apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/ViewModeToggle/ViewModeToggle.tsx(2 hunks)apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/utils/index.ts(1 hunks)apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/utils/status.tsx(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/ViewModeToggle/ViewModeToggle.tsx
- apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileList/FileListGrouped.tsx
🧰 Additional context used
📓 Path-based instructions (5)
apps/desktop/**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (apps/desktop/AGENTS.md)
For Electron interprocess communication, ALWAYS use tRPC as defined in
src/lib/trpc
Files:
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/utils/index.tsapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FolderRow/index.tsapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/ChangesHeader/ChangesHeader.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FolderRow/FolderRow.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/CategorySection/CategorySection.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileItem/FileItem.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileList/FileListTree.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/utils/status.tsx
apps/desktop/**/*.{ts,tsx}
📄 CodeRabbit inference engine (apps/desktop/AGENTS.md)
apps/desktop/**/*.{ts,tsx}: Please use alias as defined intsconfig.jsonwhen possible
Prefer zustand for state management if it makes sense. Do not use effect unless absolutely necessary
Files:
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/utils/index.tsapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FolderRow/index.tsapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/ChangesHeader/ChangesHeader.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FolderRow/FolderRow.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/CategorySection/CategorySection.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileItem/FileItem.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileList/FileListTree.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/utils/status.tsx
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Maintain type safety and avoid using
anyunless absolutely necessary in TypeScript code
Files:
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/utils/index.tsapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FolderRow/index.tsapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/ChangesHeader/ChangesHeader.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FolderRow/FolderRow.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/CategorySection/CategorySection.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileItem/FileItem.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileList/FileListTree.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/utils/status.tsx
apps/desktop/src/renderer/**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Never import Node.js modules in renderer process or shared code - only in src/main/
Files:
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/utils/index.tsapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FolderRow/index.tsapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/ChangesHeader/ChangesHeader.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FolderRow/FolderRow.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/CategorySection/CategorySection.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileItem/FileItem.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileList/FileListTree.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/utils/status.tsx
**/components/**/[A-Z]*.tsx
📄 CodeRabbit inference engine (AGENTS.md)
Use one folder per component with structure ComponentName/ComponentName.tsx + index.ts barrel export
Files:
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/ChangesHeader/ChangesHeader.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FolderRow/FolderRow.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/CategorySection/CategorySection.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileItem/FileItem.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileList/FileListTree.tsx
🧠 Learnings (5)
📓 Common learnings
Learnt from: CR
Repo: superset-sh/superset PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-08T23:32:32.232Z
Learning: Applies to apps/desktop/src/main/lib/*{workspace,worktree}-*.ts : Use git worktree-based workspace management in the desktop app through workspace-manager.ts and worktree-manager.ts
📚 Learning: 2025-12-08T23:32:32.232Z
Learnt from: CR
Repo: superset-sh/superset PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-08T23:32:32.232Z
Learning: Applies to apps/desktop/src/main/lib/*{workspace,worktree}-*.ts : Use git worktree-based workspace management in the desktop app through workspace-manager.ts and worktree-manager.ts
Applied to files:
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FolderRow/index.tsapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/ChangesHeader/ChangesHeader.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FolderRow/FolderRow.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileList/FileListTree.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/utils/status.tsx
📚 Learning: 2025-12-08T23:32:32.232Z
Learnt from: CR
Repo: superset-sh/superset PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-08T23:32:32.232Z
Learning: Applies to **/components/**/[A-Z]*.tsx : Use one folder per component with structure ComponentName/ComponentName.tsx + index.ts barrel export
Applied to files:
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FolderRow/index.tsapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FolderRow/FolderRow.tsx
📚 Learning: 2025-12-08T23:32:32.232Z
Learnt from: CR
Repo: superset-sh/superset PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-08T23:32:32.232Z
Learning: Use React + TailwindCSS v4 + shadcn/ui for UI components
Applied to files:
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/ChangesHeader/ChangesHeader.tsx
📚 Learning: 2025-12-08T23:32:32.232Z
Learnt from: CR
Repo: superset-sh/superset PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-08T23:32:32.232Z
Learning: Applies to src/components/{ui,ai-elements,react-flow}/**/*.tsx : Use kebab-case single files for shadcn/ui components in src/components/ui/, src/components/ai-elements, and src/components/react-flow/
Applied to files:
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/CategorySection/CategorySection.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileList/FileListTree.tsx
🧬 Code graph analysis (3)
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileItem/FileItem.tsx (4)
apps/desktop/src/shared/changes-types.ts (1)
ChangedFile(22-28)apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/utils/status.tsx (2)
getStatusColor(12-28)getStatusIndicator(30-47)apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/GitFileTree/utils.ts (2)
getStatusColor(106-121)getStatusIndicator(126-141)packages/ui/src/lib/utils.ts (1)
cn(4-6)
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileList/FileListTree.tsx (2)
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FolderRow/FolderRow.tsx (1)
FolderRow(38-100)apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileItem/FileItem.tsx (1)
FileItem(33-95)
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/utils/status.tsx (1)
apps/desktop/src/shared/changes-types.ts (1)
FileStatus(6-12)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Build
🔇 Additional comments (9)
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FolderRow/index.ts (1)
1-1: LGTM!Barrel export follows the component folder structure guideline (ComponentName/ComponentName.tsx + index.ts).
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/utils/index.ts (1)
1-1: LGTM!Clean barrel export enabling simplified imports of status utilities across the ChangesView components.
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FolderRow/FolderRow.tsx (1)
38-99: Component structure and implementation look good.The FolderRow component correctly implements the collapsible folder UI with variant support. The props interface is well-typed, and the component follows the expected folder/index.ts structure per coding guidelines.
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/utils/status.tsx (1)
12-47: LGTM!Status utility functions are well-typed, cover all
FileStatuscases, and include sensible defaults for future extensibility. The color scheme provides good visual distinction with proper dark mode support.apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileItem/FileItem.tsx (1)
33-94: LGTM!The FileItem component cleanly integrates level-based indentation and external status utilities. The props interface is well-typed with appropriate defaults, and the layout handles overflow correctly.
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileList/FileListTree.tsx (2)
84-134: LGTM!The TreeNodeComponent correctly handles folder expansion state, recursively renders children via FolderRow, and delegates file rendering to FileItem. The level-based indentation is properly incremented for nested nodes.
23-73: LGTM!The
buildFileTreefunction correctly constructs a hierarchical tree from flat file paths, with proper sorting (folders first, then alphabetical).apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/ChangesHeader/ChangesHeader.tsx (2)
37-42: LGTM!Good use of TRPC for data fetching with conditional enablement and zustand for state management. The query is properly guarded with the
enabledflag to prevent unnecessary requests whenworktreePathis not available.
60-118: LGTM!The UI implementation is well-structured with good UX considerations:
- Loading state provides immediate feedback
- Tooltips guide user interactions
- Default branch is clearly labeled in the dropdown
- Refresh button has appropriate disabled and loading states
- Responsive Tailwind classes and proper component composition
The accessibility is solid with keyboard navigation support from shadcn/ui components and descriptive tooltips.
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/ChangesContent/components/FileHeader/FileHeader.tsx (2)
58-58: Consider normalizing the path construction.The template literal concatenation could produce paths with double slashes if
worktreePathends with "/" orfile.pathstarts with "/". While most file systems tolerate this, it's cleaner to normalize.Apply this diff to normalize the path:
- const fullPath = `${worktreePath}/${file.path}`; + const fullPath = `${worktreePath.replace(/\/+$/, '')}/${file.path.replace(/^\/+/, '')}`;Alternatively, extract a path joining utility if this pattern is used elsewhere in the renderer.
69-82: Consider adding an aria-label for screen readers.The tooltip-wrapped button provides a good visual UX, but screen reader users might benefit from an explicit aria-label.
Apply this diff to enhance accessibility:
<TooltipTrigger asChild> <button type="button" onClick={handleOpenFile} + aria-label={`Open ${file.path} in ${currentApp.label}`} className="text-sm font-medium truncate font-mono text-left hover:underline hover:text-primary cursor-pointer" > {file.path} </button> </TooltipTrigger>
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
apps/desktop/src/renderer/components/OpenInButton/OpenInButton.tsx(1 hunks)apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/ChangesContent/ChangesContent.tsx(1 hunks)apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/ChangesContent/components/FileHeader/FileHeader.tsx(2 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
apps/desktop/**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (apps/desktop/AGENTS.md)
For Electron interprocess communication, ALWAYS use tRPC as defined in
src/lib/trpc
Files:
apps/desktop/src/renderer/components/OpenInButton/OpenInButton.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/ChangesContent/components/FileHeader/FileHeader.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/ChangesContent/ChangesContent.tsx
apps/desktop/**/*.{ts,tsx}
📄 CodeRabbit inference engine (apps/desktop/AGENTS.md)
apps/desktop/**/*.{ts,tsx}: Please use alias as defined intsconfig.jsonwhen possible
Prefer zustand for state management if it makes sense. Do not use effect unless absolutely necessary
Files:
apps/desktop/src/renderer/components/OpenInButton/OpenInButton.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/ChangesContent/components/FileHeader/FileHeader.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/ChangesContent/ChangesContent.tsx
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Maintain type safety and avoid using
anyunless absolutely necessary in TypeScript code
Files:
apps/desktop/src/renderer/components/OpenInButton/OpenInButton.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/ChangesContent/components/FileHeader/FileHeader.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/ChangesContent/ChangesContent.tsx
**/components/**/[A-Z]*.tsx
📄 CodeRabbit inference engine (AGENTS.md)
Use one folder per component with structure ComponentName/ComponentName.tsx + index.ts barrel export
Files:
apps/desktop/src/renderer/components/OpenInButton/OpenInButton.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/ChangesContent/components/FileHeader/FileHeader.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/ChangesContent/ChangesContent.tsx
apps/desktop/src/renderer/**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Never import Node.js modules in renderer process or shared code - only in src/main/
Files:
apps/desktop/src/renderer/components/OpenInButton/OpenInButton.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/ChangesContent/components/FileHeader/FileHeader.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/ChangesContent/ChangesContent.tsx
🧠 Learnings (3)
📚 Learning: 2025-12-08T23:32:32.232Z
Learnt from: CR
Repo: superset-sh/superset PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-08T23:32:32.232Z
Learning: Applies to apps/desktop/src/main/lib/*{workspace,worktree}-*.ts : Use git worktree-based workspace management in the desktop app through workspace-manager.ts and worktree-manager.ts
Applied to files:
apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/ChangesContent/components/FileHeader/FileHeader.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/ChangesContent/ChangesContent.tsx
📚 Learning: 2025-11-24T21:33:13.267Z
Learnt from: CR
Repo: superset-sh/superset PR: 0
File: apps/desktop/AGENTS.md:0-0
Timestamp: 2025-11-24T21:33:13.267Z
Learning: Applies to apps/desktop/**/*.{ts,tsx} : Please use alias as defined in `tsconfig.json` when possible
Applied to files:
apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/ChangesContent/components/FileHeader/FileHeader.tsx
📚 Learning: 2025-12-08T23:32:32.232Z
Learnt from: CR
Repo: superset-sh/superset PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-08T23:32:32.232Z
Learning: Applies to src/components/{ui,ai-elements,react-flow}/**/*.tsx : Use kebab-case single files for shadcn/ui components in src/components/ui/, src/components/ai-elements, and src/components/react-flow/
Applied to files:
apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/ChangesContent/components/FileHeader/FileHeader.tsx
🧬 Code graph analysis (2)
apps/desktop/src/renderer/components/OpenInButton/OpenInButton.tsx (1)
apps/desktop/src/main/lib/db/schemas.ts (1)
ExternalApp(97-97)
apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/ChangesContent/ChangesContent.tsx (1)
apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/ChangesContent/components/FileHeader/FileHeader.tsx (1)
FileHeader(49-115)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Build
🔇 Additional comments (5)
apps/desktop/src/renderer/components/OpenInButton/OpenInButton.tsx (1)
75-76: LGTM!Clean helper export that enables FileHeader to display the current app label in tooltips.
apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/ChangesContent/components/FileHeader/FileHeader.tsx (3)
1-4: LGTM!Clean imports for the new tooltip and open-in-app functionality. Correctly uses aliases and imports TRPC from renderer context.
7-10: LGTM!The worktreePath prop addition enables context-aware path resolution for open-in-app actions.
54-63: LGTM!The TRPC integration follows the same pattern as OpenInButton and correctly wires the open-in-app functionality.
apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/ChangesContent/ChangesContent.tsx (1)
111-111: LGTM!Clean integration with the updated FileHeader API. The
worktreePathis properly validated earlier in the component (lines 71-78), ensuring type safety.
Improve changes tab UI
Summary by CodeRabbit
New Features
Style
✏️ Tip: You can customize this high-level summary in your review settings.