Repository navigation
fix(desktop): restore pre-Pierre changes rows (virtualized) + fix blanked icons - #5807
Conversation
…e fix Restores the pre-#5782 changes view: folder mode renders the old FolderHeader + FileRow grouped list (colored +N/-N, status badges, "/" paths, plain filenames), tree mode returns to the standalone Pierre tree. Pierre's single text-only row decoration + hardcoded git lane can't reproduce two-tone diff stats or our StatusIndicator icons, so the unified-Pierre folder view read as a degraded nested tree. Keeps the independent icon-sprite fix: fetchSymbolBody now rejects non-SVG responses. Missing icon assets resolve to the SPA index.html (HTTP 200), and that HTML, embedded in a <symbol>, aborted Pierre's innerHTML sprite parse mid-stream and silently dropped ~300 symbols — blanking .test.ts and many other file icons in the Pierre trees (Files tab + changes tree). All 535 symbols now parse. Tradeoff: folder mode is no longer list-virtualized (reverts #5782's perf change); tree mode keeps Pierre's virtualization.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe PR separates Changes sidebar tree and folder views, adds grouped folders and interactive file rows, simplifies tree path handling, applies Pierre tree styling, updates tree sizing documentation, and rejects HTML fallback responses during SVG icon loading. ChangesChanges sidebar views
SVG asset validation
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant ChangesFileList
participant ChangesFoldersView
participant FolderHeader
participant FileRow
participant TRPC
ChangesFileList->>ChangesFoldersView: render grouped changes
ChangesFoldersView->>FolderHeader: render folder controls
FolderHeader->>ChangesFoldersView: toggle folder state
ChangesFoldersView->>FileRow: render files in open folders
FileRow->>TRPC: submit discard mutation
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
Greptile SummaryThis PR reverts the Changes tab folder mode from the
Confidence Score: 3/5The folder-mode revert and icon fix are both clean, but the tree-mode simplification inadvertently removes the height cap that was the mechanism keeping Pierre's own virtualizer active for large file lists. The PR's stated goal is to keep Pierre's virtualization in tree mode, but removing MAX_VIEWPORT_ROWS and the Math.min cap sets the host height to Pierre's full content height — the deleted code comment explicitly identified this as what disables Pierre's internal virtualizer. For workspaces with many changed files, tree mode will now render every row eagerly instead of only visible rows, which could produce noticeable slowdowns. Everything else in the change — the new folder components, foldSignal epoch logic, SVG guard — is straightforward and correct. ChangesTreeView.tsx — the treeHeight calculation and the deleted MAX_VIEWPORT_ROWS constant.
|
| Filename | Overview |
|---|---|
| apps/desktop/src/renderer/lib/fileIcons/loadFallthroughIcons.ts | Adds SVG content-type guard to reject SPA HTML fallback responses, fixing sprite corruption that blanked 238+ icons in Pierre trees |
| apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspaceSidebar/hooks/useChangesTab/components/ChangesFileList/ChangesFileList.tsx | Routes folder-mode to ChangesFoldersView and tree-mode to ChangesTreeView; removes the data-changes-scroll-container attribute (not referenced in any v2 code) |
| apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspaceSidebar/hooks/useChangesTab/components/ChangesFileList/components/ChangesFoldersView/ChangesFoldersView.tsx | New component restoring pre-Pierre folder-grouped view; collapse-set logic and foldSignal epoch tracking look correct |
| apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspaceSidebar/hooks/useChangesTab/components/ChangesFileList/components/ChangesTreeView/ChangesTreeView.tsx | Stripped of folder-mode projection logic; tree-mode simplification is clean, but removing the MAX_VIEWPORT_ROWS height cap disables Pierre's internal virtualizer for large changesets |
| apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspaceSidebar/hooks/useChangesTab/components/ChangesFileList/components/FileRow/FileRow.tsx | New pre-Pierre file row restoring two-tone diff stats, StatusIndicator, discard mutation, and context/dropdown menus; no selected-state highlighting (intentional per pre-Pierre spec) |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
CFL["ChangesFileList"] -->|viewMode === 'tree'| CTV["ChangesTreeView\n(@pierre/trees)"]
CFL -->|viewMode === 'folders'| CFV["ChangesFoldersView\n(non-virtualized)"]
CFV --> FH["FolderHeader\n(collapse toggle)"]
CFV --> FR["FileRow\n(diff stats + StatusIndicator\ndiscard + context menu)"]
CTV --> Pierre["@pierre/trees\nusePierreFileTree"]
CTV --> UMH["useMeasuredTreeHeight\n(reads Pierre style.height)"]
UMH -->|contentHeight| TH["treeHeight = contentHeight + cushion\n⚠ no MAX_VIEWPORT_ROWS cap"]
loadFallthroughIcons["loadFallthroughIcons\nfetchSymbolBody"] -->|SVG guard| Sprite["Icon Sprite\n(symbol injection)"]
Pierre --> Sprite
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
CFL["ChangesFileList"] -->|viewMode === 'tree'| CTV["ChangesTreeView\n(@pierre/trees)"]
CFL -->|viewMode === 'folders'| CFV["ChangesFoldersView\n(non-virtualized)"]
CFV --> FH["FolderHeader\n(collapse toggle)"]
CFV --> FR["FileRow\n(diff stats + StatusIndicator\ndiscard + context menu)"]
CTV --> Pierre["@pierre/trees\nusePierreFileTree"]
CTV --> UMH["useMeasuredTreeHeight\n(reads Pierre style.height)"]
UMH -->|contentHeight| TH["treeHeight = contentHeight + cushion\n⚠ no MAX_VIEWPORT_ROWS cap"]
loadFallthroughIcons["loadFallthroughIcons\nfetchSymbolBody"] -->|SVG guard| Sprite["Icon Sprite\n(symbol injection)"]
Pierre --> Sprite
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspaceSidebar/hooks/useChangesTab/components/ChangesFileList/components/ChangesTreeView/ChangesTreeView.tsx:160-163
**Tree-mode virtualization silently disabled for large changesets**
The deleted comment from this PR was explicit: "A full-content host disables Pierre's internal virtualizer by making every row part of its viewport. Cap the host while retaining Pierre's own complete scroll range." By removing `MAX_VIEWPORT_ROWS` and the `Math.min(…)` cap, `treeHeight` now equals Pierre's full content height. Pierre's virtualizer then sees its entire row list as in-viewport and renders all rows eagerly — defeating virtualization for any changeset larger than ~20 files. The PR description says "Tree mode keeps Pierre's virtualization," but this change contradicts that: the cap was the mechanism that enabled it.
Reviews (1): Last reviewed commit: "fix(desktop): revert changes list to pre..." | Re-trigger Greptile
| const treeHeight = | ||
| contentHeight != null | ||
| ? contentHeight + HEIGHT_CUSHION | ||
| : (dirs.length + paths.length) * ROW_BOX + HEIGHT_CUSHION; |
There was a problem hiding this comment.
Tree-mode virtualization silently disabled for large changesets
The deleted comment from this PR was explicit: "A full-content host disables Pierre's internal virtualizer by making every row part of its viewport. Cap the host while retaining Pierre's own complete scroll range." By removing MAX_VIEWPORT_ROWS and the Math.min(…) cap, treeHeight now equals Pierre's full content height. Pierre's virtualizer then sees its entire row list as in-viewport and renders all rows eagerly — defeating virtualization for any changeset larger than ~20 files. The PR description says "Tree mode keeps Pierre's virtualization," but this change contradicts that: the cap was the mechanism that enabled it.
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspaceSidebar/hooks/useChangesTab/components/ChangesFileList/components/ChangesTreeView/ChangesTreeView.tsx
Line: 160-163
Comment:
**Tree-mode virtualization silently disabled for large changesets**
The deleted comment from this PR was explicit: "A full-content host disables Pierre's internal virtualizer by making every row part of its viewport. Cap the host while retaining Pierre's own complete scroll range." By removing `MAX_VIEWPORT_ROWS` and the `Math.min(…)` cap, `treeHeight` now equals Pierre's full content height. Pierre's virtualizer then sees its entire row list as in-viewport and renders all rows eagerly — defeating virtualization for any changeset larger than ~20 files. The PR description says "Tree mode keeps Pierre's virtualization," but this change contradicts that: the cap was the mechanism that enabled it.
How can I resolve this? If you propose a fix, please make it concise.There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (2)
apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspaceSidebar/hooks/useChangesTab/components/ChangesFileList/components/FileRow/FileRow.tsx (1)
178-227: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDropdown and context menus duplicate the same 5 actions verbatim.
DropdownMenuContent(Lines 178-227) andContextMenuContent(Lines 241-309) repeat Open Diff / Open Diff in New Tab / Open File / Open File in New Tab / Open in Editor with identical handlers, icons, and shortcut logic. Any future edit to one risks drifting from the other.♻️ Suggested direction
Define a single array of action descriptors (icon, label, onSelect, tier) once, then map it into both
<DropdownMenuItem>/<DropdownMenuShortcut>and<ContextMenuItem>/<ContextMenuShortcut>via a small render helper that takes the Item/Shortcut components as parameters.Also applies to: 241-309
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/`$workspaceId/components/WorkspaceSidebar/hooks/useChangesTab/components/ChangesFileList/components/FileRow/FileRow.tsx around lines 178 - 227, Refactor FileRow’s duplicated menu actions into one shared action-descriptor array containing each action’s icon, label, handler, disabled state, and shortcut tier. Add a small renderer that accepts the menu item and shortcut components, then use it for both DropdownMenuContent and ContextMenuContent while preserving all existing handlers, icons, labels, disabled conditions, and shortcut behavior.apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspaceSidebar/hooks/useChangesTab/components/ChangesFileList/components/ChangesFoldersView/ChangesFoldersView.tsx (1)
7-7: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winMove
FileRowunderChangesFoldersView/components/
FileRowis only used here, so it should be colocated withChangesFoldersViewinstead of staying in the sharedChangesFileList/components/folder.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/`$workspaceId/components/WorkspaceSidebar/hooks/useChangesTab/components/ChangesFileList/components/ChangesFoldersView/ChangesFoldersView.tsx at line 7, Move the FileRow component and its implementation file into the ChangesFoldersView/components directory, then update the import in ChangesFoldersView to use the new relative location. Remove the old shared-folder copy and adjust any related internal imports or exports so FileRow remains available only to ChangesFoldersView.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/`$workspaceId/components/WorkspaceSidebar/hooks/useChangesTab/components/ChangesFileList/components/FileRow/FileRow.tsx:
- Around line 52-71: Propagate selectedFilePath through folder mode so the
active file remains highlighted: in FileRow.tsx, add an isSelected or
selectedPath prop and apply the active-row class when it matches file.path; in
ChangesFoldersView.tsx, accept selectedFilePath and pass the computed selection
state to each FileRow; in ChangesFileList.tsx, pass selectedFilePath into the
ChangesFoldersView branch.
- Around line 148-230: Update the action wrapper containing the “Discard
changes” and “More actions” controls in FileRow to reveal itself when either
control receives keyboard focus, adding a focus-within visibility state
alongside the existing hover and open-menu states. Preserve the current opacity
and pointer-event behavior for mouse hover and open dropdown interactions.
---
Nitpick comments:
In
`@apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/`$workspaceId/components/WorkspaceSidebar/hooks/useChangesTab/components/ChangesFileList/components/ChangesFoldersView/ChangesFoldersView.tsx:
- Line 7: Move the FileRow component and its implementation file into the
ChangesFoldersView/components directory, then update the import in
ChangesFoldersView to use the new relative location. Remove the old
shared-folder copy and adjust any related internal imports or exports so FileRow
remains available only to ChangesFoldersView.
In
`@apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/`$workspaceId/components/WorkspaceSidebar/hooks/useChangesTab/components/ChangesFileList/components/FileRow/FileRow.tsx:
- Around line 178-227: Refactor FileRow’s duplicated menu actions into one
shared action-descriptor array containing each action’s icon, label, handler,
disabled state, and shortcut tier. Add a small renderer that accepts the menu
item and shortcut components, then use it for both DropdownMenuContent and
ContextMenuContent while preserving all existing handlers, icons, labels,
disabled conditions, and shortcut behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 1de5d727-68d8-4997-9e18-a548efa8bf8a
📒 Files selected for processing (13)
apps/desktop/src/renderer/lib/fileIcons/loadFallthroughIcons.tsapps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspaceSidebar/hooks/useChangesTab/components/ChangesFileList/ChangesFileList.tsxapps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspaceSidebar/hooks/useChangesTab/components/ChangesFileList/components/ChangesFoldersView/ChangesFoldersView.tsxapps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspaceSidebar/hooks/useChangesTab/components/ChangesFileList/components/ChangesFoldersView/components/FolderHeader/FolderHeader.tsxapps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspaceSidebar/hooks/useChangesTab/components/ChangesFileList/components/ChangesFoldersView/components/FolderHeader/index.tsapps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspaceSidebar/hooks/useChangesTab/components/ChangesFileList/components/ChangesFoldersView/index.tsapps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspaceSidebar/hooks/useChangesTab/components/ChangesFileList/components/ChangesTreeView/ChangesTreeView.tsxapps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspaceSidebar/hooks/useChangesTab/components/ChangesFileList/components/ChangesTreeView/hooks/useMeasuredTreeHeight/useMeasuredTreeHeight.tsapps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspaceSidebar/hooks/useChangesTab/components/ChangesFileList/components/ChangesTreeView/utils/buildPierreProjection/buildPierreProjection.test.tsapps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspaceSidebar/hooks/useChangesTab/components/ChangesFileList/components/ChangesTreeView/utils/buildPierreProjection/buildPierreProjection.tsapps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspaceSidebar/hooks/useChangesTab/components/ChangesFileList/components/ChangesTreeView/utils/buildPierreProjection/index.tsapps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspaceSidebar/hooks/useChangesTab/components/ChangesFileList/components/FileRow/FileRow.tsxapps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspaceSidebar/hooks/useChangesTab/components/ChangesFileList/components/FileRow/index.ts
💤 Files with no reviewable changes (3)
- apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspaceSidebar/hooks/useChangesTab/components/ChangesFileList/components/ChangesTreeView/utils/buildPierreProjection/buildPierreProjection.test.ts
- apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspaceSidebar/hooks/useChangesTab/components/ChangesFileList/components/ChangesTreeView/utils/buildPierreProjection/buildPierreProjection.ts
- apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspaceSidebar/hooks/useChangesTab/components/ChangesFileList/components/ChangesTreeView/utils/buildPierreProjection/index.ts
| interface FileRowProps { | ||
| file: ChangesetFile; | ||
| workspaceId: string; | ||
| worktreePath?: string; | ||
| /** Hide the directory prefix — used when the row sits under a folder group. */ | ||
| hideDir?: boolean; | ||
| onSelect?: (path: string, openInNewTab?: boolean, changeKey?: string) => void; | ||
| onOpenFile?: (absolutePath: string, openInNewTab?: boolean) => void; | ||
| onOpenInEditor?: (path: string) => void; | ||
| } | ||
|
|
||
| export const FileRow = memo(function FileRow({ | ||
| file, | ||
| workspaceId, | ||
| worktreePath, | ||
| hideDir, | ||
| onSelect, | ||
| onOpenFile, | ||
| onOpenInEditor, | ||
| }: FileRowProps) { |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Folder mode lost the "currently open file" highlight that tree mode has.
ChangesFileList passes selectedFilePath into ChangesTreeView so Pierre can focus the active row, but the folder-mode path never carries this value down to FileRow — FileRow has no prop/state to render a selected style at all. Users switching to folder view lose the visual cue for which file's diff is currently open.
apps/desktop/.../ChangesFileList/components/FileRow/FileRow.tsx#L52-L71: add anisSelected/selectedPathprop and apply an active-row class (e.g.bg-accent) when it matchesfile.path.apps/desktop/.../ChangesFileList/components/ChangesFoldersView/ChangesFoldersView.tsx#L13-L54: acceptselectedFilePathinChangesFoldersViewPropsand pass the computedisSelecteddown to eachFileRow.apps/desktop/.../ChangesFileList/ChangesFileList.tsx#L106-L128: passselectedFilePath={selectedFilePath}into the<ChangesFoldersView>branch alongside the existing props.
📍 Affects 3 files
apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspaceSidebar/hooks/useChangesTab/components/ChangesFileList/components/FileRow/FileRow.tsx#L52-L71(this comment)apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspaceSidebar/hooks/useChangesTab/components/ChangesFileList/components/ChangesFoldersView/ChangesFoldersView.tsx#L13-L54apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspaceSidebar/hooks/useChangesTab/components/ChangesFileList/ChangesFileList.tsx#L106-L128
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
`@apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/`$workspaceId/components/WorkspaceSidebar/hooks/useChangesTab/components/ChangesFileList/components/FileRow/FileRow.tsx
around lines 52 - 71, Propagate selectedFilePath through folder mode so the
active file remains highlighted: in FileRow.tsx, add an isSelected or
selectedPath prop and apply the active-row class when it matches file.path; in
ChangesFoldersView.tsx, accept selectedFilePath and pass the computed selection
state to each FileRow; in ChangesFileList.tsx, pass selectedFilePath into the
ChangesFoldersView branch.
| <div className="pointer-events-none absolute inset-y-0 right-2 flex items-center gap-0.5 opacity-0 group-hover:pointer-events-auto group-hover:opacity-100 has-[[data-state=open]]:pointer-events-auto has-[[data-state=open]]:opacity-100"> | ||
| {canDiscard && ( | ||
| <Tooltip> | ||
| <TooltipTrigger asChild> | ||
| <button | ||
| type="button" | ||
| aria-label="Discard changes" | ||
| className="flex size-5 items-center justify-center rounded text-muted-foreground hover:bg-accent hover:text-destructive" | ||
| onClick={(e) => { | ||
| e.stopPropagation(); | ||
| setShowDiscardConfirm(true); | ||
| }} | ||
| > | ||
| <Undo2 className="size-3.5" /> | ||
| </button> | ||
| </TooltipTrigger> | ||
| <TooltipContent side="top">Discard changes</TooltipContent> | ||
| </Tooltip> | ||
| )} | ||
| <DropdownMenu> | ||
| <DropdownMenuTrigger asChild> | ||
| <button | ||
| type="button" | ||
| aria-label="More actions" | ||
| className="flex size-5 items-center justify-center rounded text-muted-foreground hover:bg-accent hover:text-foreground data-[state=open]:bg-accent data-[state=open]:text-foreground" | ||
| onClick={(e) => e.stopPropagation()} | ||
| > | ||
| <ChevronDown className="size-3.5" /> | ||
| </button> | ||
| </DropdownMenuTrigger> | ||
| <DropdownMenuContent align="end" className="w-64"> | ||
| <DropdownMenuItem | ||
| onSelect={() => onSelect?.(file.path, false, changeKey)} | ||
| > | ||
| <GitCompare /> | ||
| Open Diff | ||
| </DropdownMenuItem> | ||
| <DropdownMenuItem | ||
| onSelect={() => onSelect?.(file.path, true, changeKey)} | ||
| > | ||
| <SquarePlus /> | ||
| Open Diff in New Tab | ||
| {diffNewTabTier && ( | ||
| <DropdownMenuShortcut> | ||
| {modifierLabel(diffNewTabTier)} | ||
| </DropdownMenuShortcut> | ||
| )} | ||
| </DropdownMenuItem> | ||
| <DropdownMenuItem | ||
| onSelect={() => absolutePath && onOpenFile?.(absolutePath)} | ||
| disabled={!onOpenFile || !absolutePath} | ||
| > | ||
| <FileText /> | ||
| Open File | ||
| {fileTier && ( | ||
| <DropdownMenuShortcut> | ||
| {modifierLabel(fileTier)} | ||
| </DropdownMenuShortcut> | ||
| )} | ||
| </DropdownMenuItem> | ||
| <DropdownMenuItem | ||
| onSelect={() => absolutePath && onOpenFile?.(absolutePath, true)} | ||
| disabled={!onOpenFile || !absolutePath} | ||
| > | ||
| <SquarePlus /> | ||
| Open File in New Tab | ||
| </DropdownMenuItem> | ||
| <DropdownMenuItem | ||
| onSelect={() => onOpenInEditor?.(file.path)} | ||
| disabled={!onOpenInEditor} | ||
| > | ||
| <ExternalLink /> | ||
| Open in Editor | ||
| {externalTier && ( | ||
| <DropdownMenuShortcut> | ||
| {modifierLabel(externalTier)} | ||
| </DropdownMenuShortcut> | ||
| )} | ||
| </DropdownMenuItem> | ||
| </DropdownMenuContent> | ||
| </DropdownMenu> | ||
| </div> | ||
| </div> |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Hover-only action buttons have no keyboard focus-visible state.
The actions wrapper is opacity-0 and only reveals via group-hover:opacity-100 / has-[[data-state=open]]:opacity-100. A keyboard user tabbing to the "Discard changes" or "More actions" button will focus an invisible control — no focus-within:opacity-100 (or similar) exists to reveal it.
♿ Proposed fix
- <div className="pointer-events-none absolute inset-y-0 right-2 flex items-center gap-0.5 opacity-0 group-hover:pointer-events-auto group-hover:opacity-100 has-[[data-state=open]]:pointer-events-auto has-[[data-state=open]]:opacity-100">
+ <div className="pointer-events-none absolute inset-y-0 right-2 flex items-center gap-0.5 opacity-0 group-hover:pointer-events-auto group-hover:opacity-100 group-focus-within:pointer-events-auto group-focus-within:opacity-100 has-[[data-state=open]]:pointer-events-auto has-[[data-state=open]]:opacity-100">📝 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.
| <div className="pointer-events-none absolute inset-y-0 right-2 flex items-center gap-0.5 opacity-0 group-hover:pointer-events-auto group-hover:opacity-100 has-[[data-state=open]]:pointer-events-auto has-[[data-state=open]]:opacity-100"> | |
| {canDiscard && ( | |
| <Tooltip> | |
| <TooltipTrigger asChild> | |
| <button | |
| type="button" | |
| aria-label="Discard changes" | |
| className="flex size-5 items-center justify-center rounded text-muted-foreground hover:bg-accent hover:text-destructive" | |
| onClick={(e) => { | |
| e.stopPropagation(); | |
| setShowDiscardConfirm(true); | |
| }} | |
| > | |
| <Undo2 className="size-3.5" /> | |
| </button> | |
| </TooltipTrigger> | |
| <TooltipContent side="top">Discard changes</TooltipContent> | |
| </Tooltip> | |
| )} | |
| <DropdownMenu> | |
| <DropdownMenuTrigger asChild> | |
| <button | |
| type="button" | |
| aria-label="More actions" | |
| className="flex size-5 items-center justify-center rounded text-muted-foreground hover:bg-accent hover:text-foreground data-[state=open]:bg-accent data-[state=open]:text-foreground" | |
| onClick={(e) => e.stopPropagation()} | |
| > | |
| <ChevronDown className="size-3.5" /> | |
| </button> | |
| </DropdownMenuTrigger> | |
| <DropdownMenuContent align="end" className="w-64"> | |
| <DropdownMenuItem | |
| onSelect={() => onSelect?.(file.path, false, changeKey)} | |
| > | |
| <GitCompare /> | |
| Open Diff | |
| </DropdownMenuItem> | |
| <DropdownMenuItem | |
| onSelect={() => onSelect?.(file.path, true, changeKey)} | |
| > | |
| <SquarePlus /> | |
| Open Diff in New Tab | |
| {diffNewTabTier && ( | |
| <DropdownMenuShortcut> | |
| {modifierLabel(diffNewTabTier)} | |
| </DropdownMenuShortcut> | |
| )} | |
| </DropdownMenuItem> | |
| <DropdownMenuItem | |
| onSelect={() => absolutePath && onOpenFile?.(absolutePath)} | |
| disabled={!onOpenFile || !absolutePath} | |
| > | |
| <FileText /> | |
| Open File | |
| {fileTier && ( | |
| <DropdownMenuShortcut> | |
| {modifierLabel(fileTier)} | |
| </DropdownMenuShortcut> | |
| )} | |
| </DropdownMenuItem> | |
| <DropdownMenuItem | |
| onSelect={() => absolutePath && onOpenFile?.(absolutePath, true)} | |
| disabled={!onOpenFile || !absolutePath} | |
| > | |
| <SquarePlus /> | |
| Open File in New Tab | |
| </DropdownMenuItem> | |
| <DropdownMenuItem | |
| onSelect={() => onOpenInEditor?.(file.path)} | |
| disabled={!onOpenInEditor} | |
| > | |
| <ExternalLink /> | |
| Open in Editor | |
| {externalTier && ( | |
| <DropdownMenuShortcut> | |
| {modifierLabel(externalTier)} | |
| </DropdownMenuShortcut> | |
| )} | |
| </DropdownMenuItem> | |
| </DropdownMenuContent> | |
| </DropdownMenu> | |
| </div> | |
| </div> | |
| <div className="pointer-events-none absolute inset-y-0 right-2 flex items-center gap-0.5 opacity-0 group-hover:pointer-events-auto group-hover:opacity-100 group-focus-within:pointer-events-auto group-focus-within:opacity-100 has-[[data-state=open]]:pointer-events-auto has-[[data-state=open]]:opacity-100"> |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
`@apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/`$workspaceId/components/WorkspaceSidebar/hooks/useChangesTab/components/ChangesFileList/components/FileRow/FileRow.tsx
around lines 148 - 230, Update the action wrapper containing the “Discard
changes” and “More actions” controls in FileRow to reveal itself when either
control receives keyboard focus, adding a focus-within visibility state
alongside the existing hover and open-menu states. Preserve the current opacity
and pointer-event behavior for mouse hover and open dropdown interactions.
Window the folder-mode changes list with @tanstack/react-virtual so large changesets stay responsive, while keeping the restored FolderHeader + FileRow look (colored stats, StatusIndicator, "/" paths). Folder-header and file rows are flattened into one list; each section virtualizes into the shared [data-changes-scroll-container] via scrollMargin, matching v1's FileListGroupedVirtualized. Tree mode already virtualizes via Pierre. Removes the "folder mode no longer virtualized" tradeoff from the revert.
Pierre keeps an empty decoration lane (flex: 1 1 0) on every row when the git lane is active but the row has no custom decoration — every file in the Files-tab explorer, plus changes with no +/- summary. That empty lane grows to fill the row and starves the name column, so Pierre's truncation grid middle-truncates names that easily fit (CLAUDE.md -> CLAUD…d). Add a shared PIERRE_TREE_UNSAFE_CSS that lets the name column take the free space and the decoration hug its own content. Pierre wraps unsafeCSS in @layer unsafe, so it overrides @layer base by cascade order — no !important.
🧹 Preview Cleanup CompleteThe following preview resources have been cleaned up:
Thank you for your contribution! 🎉 |
What
Restores the pre-#5782 Changes tab rendering (old
FolderHeader+FileRowgrouped look) and re-adds virtualization, plus two Pierre bug fixes.FolderHeader+FileRowgrouped list (two-tone colored+N −N,StatusIndicatorbadges,/folder paths, plain filenames, no dot) — now windowed with@tanstack/react-virtual(each section virtualizes into the shared[data-changes-scroll-container]viascrollMargin, matching v1'sFileListGroupedVirtualized).Why revert Pierre for this view
Pierre exposes only a single text-only row-decoration slot plus a hardcoded git lane, so it structurally can't render two-tone diff stats and our status icons per row — the unified-Pierre view read as a degraded nested tree. Reverting the rendering and re-virtualizing the old rows gets the intended look and keeps the perf win.
Fix 1 — blanked icons in the Pierre trees
.test.tsand ~300 other file types rendered iconless (Files tab + tree mode):index.html(HTTP200, not SVG); the old code only checkedresponse.ok, so that HTML got embedded in a<symbol>and Pierre'sdiv.innerHTMLsprite parse aborted mid-stream — only 238 of 547 symbols survived.fetchSymbolBodyrejects non-SVG responses. All 535 symbols parse.Fix 2 — Pierre trees truncating names that fit
Names like
CLAUDE.mdmiddle-truncated toCLAUD…din the Files-tab explorer. Pierre keeps an empty decoration lane (flex: 1 1 0) whenever the git lane is active but a row has no custom decoration; it grows to fill the row and starves the name column, so the truncation grid clips names that easily fit. Fix: a sharedPIERRE_TREE_UNSAFE_CSSlets the name column take the free space and the decoration hug its content. Pierre wrapsunsafeCSSin@layer unsafe, overriding@layer baseby cascade order — no!important.Verification (CDP, live dev app)
.test.ts).getVirtualItems, stay correctly positioned across sections (24px stacking + section-header gaps), noscrollMargindrift;measureElementcorrects heights.tsc --noEmitclean,biomeclean, fileIcons tests pass.Summary by CodeRabbit
New Features
Bug Fixes