Skip to content

Changes tab UI beautification - #317

Merged
Kitenite merged 12 commits into
mainfrom
military-turtle-6e8b6d
Dec 11, 2025
Merged

Kitenite merged 12 commits into
mainfrom
military-turtle-6e8b6d

Conversation

@Kitenite

@Kitenite Kitenite commented Dec 11, 2025 •

Copy link
Copy Markdown
Member

Improve changes tab UI

Summary by CodeRabbit

  • New Features

    • Interactive base-branch selector with remote branch fetching.
    • File header can open files in external apps (tooltip + "Open in …") and accepts an optional worktree path.
    • New FolderRow-based grouped/tree rendering with indentation support and folder counts.
    • Untracked files now report line-based additions in file stats.
  • Style

    • Improved sidebar layout, truncation, overflow handling, and shrink behavior to preserve spacing.
    • Refined status badges/indicators and simplified view-mode toggle to a tooltip-wrapped button.

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

@vercel

vercel Bot commented Dec 11, 2025 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
website Ready Ready Preview Comment Dec 11, 2025 3:18am

@coderabbitai

coderabbitai Bot commented Dec 11, 2025 •

Copy link
Copy Markdown
Contributor

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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.

📥 Commits

Reviewing files that changed from the base of the PR and between 450dfc1 and 4ba2ef1.

📒 Files selected for processing (13)
  • apps/desktop/src/lib/trpc/routers/changes/changes.ts (3 hunks)
  • apps/desktop/src/lib/trpc/routers/changes/utils/parse-status.ts (2 hunks)
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/ChangesContent/components/DiffToolbar/DiffToolbar.tsx (0 hunks)
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/ChangesContent/components/DiffViewer/DiffViewer.tsx (0 hunks)
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/ChangesContent/components/FileHeader/FileHeader.tsx (2 hunks)
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/ChangesView.tsx (0 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/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/utils/status.tsx (1 hunks)
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ModeCarousel/constants.ts (1 hunks)
  • package.json (1 hunks)

Walkthrough

Multiple 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

Cohort / File(s) Summary
Tailwind shrink fixes
apps/desktop/src/renderer/screens/main/components/StartView/index.tsx, apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/TerminalSearch/TerminalSearch.tsx, apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/GitFileTree/FileTreeView.tsx, apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/GitFileTree/GroupedView.tsx, apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/CommitItem/CommitItem.tsx
Replaced flex-shrink-0 with shrink-0 and similar small class tweaks to stabilize icon/compact area sizing.
CategorySection layout
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/CategorySection/CategorySection.tsx
Added min-w-0/overflow-hidden and shrink-0 on chevrons/badges/actions to enforce layout and prevent unwanted shrinking.
Base branch UI & ChangesHeader
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/BaseBranchSelector/BaseBranchSelector.tsx, apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/ChangesHeader/ChangesHeader.tsx
Replaced static branch display with a Select-based base-branch picker wired to a TRPC branches query; updated label from vs → from and adjusted SelectTrigger styling and loading state.
FileItem & indentation
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileItem/FileItem.tsx
Added public level?: number prop (default 0), introduced LevelIndicators, moved status color lookup to shared util, and updated layout/truncation and status indicator placement.
FolderRow component
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FolderRow/FolderRow.tsx, apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FolderRow/index.ts
New FolderRow (tree/group variants) with level-based indentation, chevrons for tree variant, fileCount badge, and re-export added.
FileList tree/group refactor
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileList/FileListTree.tsx, apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileList/FileListGrouped.tsx
Replaced Collapsible-based UI with FolderRow-driven rendering; adjusted props (FileListTree now uses `selectedFile: ChangedFile
ViewModeToggle redesign
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/ViewModeToggle/ViewModeToggle.tsx
Replaced ToggleGroup with a tooltip-wrapped ghost Button and new icons; added internal toggle handler.
Status utilities & re-exports
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/utils/status.tsx, apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/utils/index.ts
Added getStatusColor and getStatusIndicator utilities and re-exported them from utils index.
FileHeader open-in-app + worktreePath
apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/ChangesContent/components/FileHeader/FileHeader.tsx, apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/ChangesContent/ChangesContent.tsx
FileHeader gained worktreePath prop, now shows a tooltip-wrapped clickable path that triggers TRPC mutation to open file in external app and queries lastUsedApp.
TRPC: untracked file handling
apps/desktop/src/lib/trpc/routers/changes/changes.ts
When computing status, read untracked files to count lines and set additions to that line count (deletions = 0), skipping unreadable/binary files with try/catch.
Export helper
apps/desktop/src/renderer/components/OpenInButton/OpenInButton.tsx
Exported getAppOption(id: ExternalApp) helper from OpenInButton.

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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Focus areas:
    • ChangesHeader: TRPC branches query, effectiveBaseBranch logic, and loading/placeholder handling.
    • FileListTree / FileListGrouped: prop signature changes (selection semantics), recursion and rendering correctness after removing Collapsible.
    • FileItem / FolderRow: level-based rendering, indentation visuals, and integration with new status utils.
    • trpc/changes: reading untracked files — correctness, performance, and binary-file handling.

Possibly related PRs

Poem

🐰 I nudged some classes, nipped a shrink,
Folders line up in tidy sync.
Branches fetched, a picker bright,
Untracked lines counted by moonlight.
Hop—UI hums; I munch a byte. 🥕

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description 'Improve changes tab UI' is too brief and vague; it lacks the required template sections including Related Issues, Type of Change, Testing, and Additional Notes. Expand the description to follow the repository template by adding Related Issues, selecting Type of Change, describing Testing steps, and adding relevant context about the architectural changes.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Changes tab UI beautification' is clear and directly related to the primary changes in the changeset, which focus on refactoring and improving the UI of the Changes tab across multiple components.

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.

@github-actions

github-actions Bot commented Dec 11, 2025 •

Copy link
Copy Markdown
Contributor

🧹 Preview Cleanup Complete

The following preview resources have been cleaned up:

  • ✅ Neon database branch

Thank you for your contribution! 🎉

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 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 helpers

The mapping and new copied support look good, but this re-implements status handling with a loose status: string. To avoid drift between components (e.g., getStatusIndicator in GitFileTree/utils.ts) and improve type safety, consider:

  • Typing the argument as ChangedFile["status"] instead of string.
  • 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 badge

The 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} with sr-only text) 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 semantics

Using dir="rtl" with w-0 grow truncate is a neat way to keep the tail of long folder paths visible while the count stays shrink-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 dir attribute 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 a title={displayName} tooltip plus standard truncate (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 action

The handleToggle implementation correctly flips between "grouped" and "tree", and the tooltip text clearly communicates the action (“Switch to …”). For better accessibility consistency, consider updating aria-label to 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: Clarify baseBranch semantics and how to restore “follow default” behavior

The effectiveBaseBranch = baseBranch ?? branchData?.defaultBranch ?? "main" pattern suggests baseBranch === null/undefined means “follow the repo’s default branch”. In handleChange, though, we only early‑return when the user selects the default branch and baseBranch === null, which means:

  • After a user has picked a non‑default branch, there’s no way to get back to the null sentinel; selecting the default will store it as an explicit override.

If the store contract really treats null as “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 with ahead/behind props

The new header layout with the base-branch Select, view-mode toggle, and tooltip-wrapped refresh button looks clean and compact. However, ahead and behind are still part of ChangesHeaderProps but 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

📥 Commits

Reviewing files that changed from the base of the PR and between 216c159 and 352ad03.

⛔ Files ignored due to path filters (1)
  • bun.lock is 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.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/GitFileTree/FileTreeView.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/ViewModeToggle/ViewModeToggle.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/GitFileTree/GroupedView.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/CategorySection/CategorySection.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/BaseBranchSelector/BaseBranchSelector.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/ChangesHeader/ChangesHeader.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/CommitItem/CommitItem.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileList/FileListGrouped.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileList/FileListTree.tsx
  • apps/desktop/src/renderer/screens/main/components/StartView/index.tsx
  • apps/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 in tsconfig.json when 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.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/GitFileTree/FileTreeView.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/ViewModeToggle/ViewModeToggle.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/GitFileTree/GroupedView.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/CategorySection/CategorySection.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/BaseBranchSelector/BaseBranchSelector.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/ChangesHeader/ChangesHeader.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/CommitItem/CommitItem.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileList/FileListGrouped.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileList/FileListTree.tsx
  • apps/desktop/src/renderer/screens/main/components/StartView/index.tsx
  • apps/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 any unless absolutely necessary in TypeScript code

Files:

  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/TerminalSearch/TerminalSearch.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/GitFileTree/FileTreeView.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/ViewModeToggle/ViewModeToggle.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/GitFileTree/GroupedView.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/CategorySection/CategorySection.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/BaseBranchSelector/BaseBranchSelector.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/ChangesHeader/ChangesHeader.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/CommitItem/CommitItem.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileList/FileListGrouped.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileList/FileListTree.tsx
  • apps/desktop/src/renderer/screens/main/components/StartView/index.tsx
  • apps/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.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/GitFileTree/FileTreeView.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/ViewModeToggle/ViewModeToggle.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/GitFileTree/GroupedView.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/CategorySection/CategorySection.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/BaseBranchSelector/BaseBranchSelector.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/ChangesHeader/ChangesHeader.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/CommitItem/CommitItem.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileList/FileListGrouped.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileList/FileListTree.tsx
  • 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/ContentView/TabsContent/Terminal/TerminalSearch/TerminalSearch.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/GitFileTree/FileTreeView.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/ViewModeToggle/ViewModeToggle.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/GitFileTree/GroupedView.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/CategorySection/CategorySection.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/BaseBranchSelector/BaseBranchSelector.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/ChangesHeader/ChangesHeader.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/CommitItem/CommitItem.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileList/FileListGrouped.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileList/FileListTree.tsx
  • apps/desktop/src/renderer/screens/main/components/StartView/index.tsx
  • apps/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.tsx
  • apps/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.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/GitFileTree/FileTreeView.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/ViewModeToggle/ViewModeToggle.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/GitFileTree/GroupedView.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/CategorySection/CategorySection.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/BaseBranchSelector/BaseBranchSelector.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/CommitItem/CommitItem.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileList/FileListGrouped.tsx
  • apps/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.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/GitFileTree/GroupedView.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/BaseBranchSelector/BaseBranchSelector.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/ChangesHeader/ChangesHeader.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileList/FileListGrouped.tsx
  • apps/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.tsx
  • apps/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 good

Switching to shrink-0 on 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 consistent

Using shrink-0 on 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 tightened

The shrink-0 update 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 appropriate

Updating the control container to shrink-0 keeps 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 readability

Marking the chevrons, shortHash, and timestamp spans as shrink-0 keeps 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 correct

Adding min-w-0 to the Collapsible, header wrapper, trigger, and content, plus overflow-hidden on the container/content, addresses common flex+truncation issues and should prevent horizontal scroll bleed. Using shrink-0 on 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 clearer

The new from label 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 the renderer/* 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 getStatusColor to use explicit light/dark variants and adding a dedicated “copied” color aligns with the existing getStatusIndicator mapping 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 guides

The new LevelIndicators component is a straightforward, side‑effect‑free helper that renders vertical guides per depth level. It safely no‑ops at level === 0 and uses shrink-0 so 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 behavior

The folder branch now:

  • Wraps the row in a Collapsible with className="min-w-0" for proper flex behavior.
  • Uses a CollapsibleTrigger with items-stretch and overflow-hidden so internal content, not the container, controls truncation.
  • Adds LevelIndicators plus a nested flex row containing a shrink-0 chevron and a flex-1 min-w-0 truncate folder 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 layout

For file leaves, the updated row:

  • Mirrors the folder structure (LevelIndicators + inner flex with flex-1 min-w-0) so names truncate cleanly.
  • Gated stats display (showStats and positive additions/deletions) in a font-mono shrink-0 block, 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 by isFile && node.file. Overall, this is a solid layout improvement without functional risk.


237-248: Root container min-width/overflow settings align with sidebar layout

Wrapping the tree in flex flex-col min-w-0 overflow-hidden is appropriate for embedding inside other flex parents like CategorySection. 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

showStatsDisplay correctly avoids rendering empty stats, and the aggressive truncation on the file name (flex-1 min-w-0 ... truncate) works well with the monospace, shrink-0 stats 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 good

Adding overflow-hidden to both the outer container and the Collapsible should 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: Ensure effectiveBaseBranch is always represented in the Select options

Select is controlled with value={effectiveBaseBranch}, while the option list is derived from branchData.remote:

  • effectiveBaseBranch may be baseBranch (from the store) or defaultBranch.
  • sortedBranches is built solely from availableBranches = branchData?.remote ?? [].

If remote ever omits defaultBranch or a previously stored baseBranch (e.g., naming mismatch, local‑only branch), the Select could end up with a value that has no corresponding SelectItem, which can lead to empty labels or warnings depending on the Select implementation.

It’s worth confirming that the tRPC changes.getBranches contract guarantees defaultBranch ∈ remote and that baseBranch is always chosen from the same set; otherwise, consider including defaultBranch/baseBranch in the options when missing, or normalizing stored values to match remote.

Also applies to: 70-91

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (3)
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileItem/FileItem.tsx (3)

11-27: Tighten status typing to ChangedFile["status"] for better safety

The new badge helper looks good, but both helpers currently accept a plain string. Since this component already depends on ChangedFile, 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 ChangedFile will 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: truncate already applies overflow-hidden and text-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 mapping

Here getStatusIndicator now returns "U" for "untracked", but getStatusIndicator in apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/GitFileTree/utils.ts still 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

📥 Commits

Reviewing files that changed from the base of the PR and between 352ad03 and 4192777.

📒 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.ts
  • apps/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 in tsconfig.json when 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.ts
  • apps/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 any unless absolutely necessary in TypeScript code

Files:

  • apps/desktop/src/lib/trpc/routers/changes/changes.ts
  • apps/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

Comment on lines +171 to +182
// 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
}
}

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

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.

Suggested change
// 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.

@Kitenite Kitenite changed the title military turtle 6e8b6d Changes tab UI Dec 11, 2025

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 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 titles

The min-w-0 + shrink-0 tweaks 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 long title values, the text can still wrap or crowd the actions. Adding truncation (and giving the title span its own min-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: Double overflow-hidden may clip focus outlines or nested overlays

Adding overflow-hidden on both the Collapsible root and CollapsibleContent will 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 children cases.

Also applies to: 59-61

apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FolderRow/FolderRow.tsx (1)

23-36: Duplicate LevelIndicators implementation.

This component is identical to the one in FileItem.tsx (lines 14-27). Consider extracting it to a shared location (e.g., ../../utils or 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 from react-icons/hi2 are imported but never used. Only the Lu* icons are used in getStatusIndicator.

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: Duplicate LevelIndicators implementation.

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.file is 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.

HiArrowRight is 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 ahead and behind props 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 baseBranch is already null (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

📥 Commits

Reviewing files that changed from the base of the PR and between 4192777 and 3a953af.

📒 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.ts
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FolderRow/index.ts
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/ChangesHeader/ChangesHeader.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FolderRow/FolderRow.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/CategorySection/CategorySection.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileItem/FileItem.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileList/FileListTree.tsx
  • apps/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 in tsconfig.json when 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.ts
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FolderRow/index.ts
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/ChangesHeader/ChangesHeader.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FolderRow/FolderRow.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/CategorySection/CategorySection.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileItem/FileItem.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileList/FileListTree.tsx
  • apps/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 any unless absolutely necessary in TypeScript code

Files:

  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/utils/index.ts
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FolderRow/index.ts
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/ChangesHeader/ChangesHeader.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FolderRow/FolderRow.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/CategorySection/CategorySection.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileItem/FileItem.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileList/FileListTree.tsx
  • apps/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.ts
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FolderRow/index.ts
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/ChangesHeader/ChangesHeader.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FolderRow/FolderRow.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/CategorySection/CategorySection.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileItem/FileItem.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileList/FileListTree.tsx
  • apps/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.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FolderRow/FolderRow.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/CategorySection/CategorySection.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileItem/FileItem.tsx
  • apps/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.ts
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/ChangesHeader/ChangesHeader.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FolderRow/FolderRow.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/components/FileList/FileListTree.tsx
  • apps/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.ts
  • apps/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.tsx
  • apps/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 FileStatus cases, 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 buildFileTree function 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 enabled flag to prevent unnecessary requests when worktreePath is 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 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 worktreePath ends with "/" or file.path starts 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

📥 Commits

Reviewing files that changed from the base of the PR and between 3a953af and 450dfc1.

📒 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.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/ChangesContent/components/FileHeader/FileHeader.tsx
  • apps/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 in tsconfig.json when 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.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/ChangesContent/components/FileHeader/FileHeader.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/ChangesContent/ChangesContent.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Maintain type safety and avoid using any unless absolutely necessary in TypeScript code

Files:

  • apps/desktop/src/renderer/components/OpenInButton/OpenInButton.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/ChangesContent/components/FileHeader/FileHeader.tsx
  • apps/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.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/ChangesContent/components/FileHeader/FileHeader.tsx
  • apps/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.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/ChangesContent/components/FileHeader/FileHeader.tsx
  • apps/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.tsx
  • apps/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 worktreePath is properly validated earlier in the component (lines 71-78), ensuring type safety.

@Kitenite Kitenite changed the title Changes tab UI Changes tab UI beautification Dec 11, 2025

This branch was successfully deployed

1 active deployment
Preview — 4ba2ef13 Deployed Dec 11, 2025 by vercel[bot]
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