chore(desktop): default Changes view diff to inline#4497
Conversation
Flip the persisted default for the Changes view diff mode from side-by-side to inline, and bump the persist version so existing users on the old default get migrated. The toolbar toggle still lets users switch back. SUPER-687
|
Capy auto-review is paused for this organization because the monthly auto-review limit has been reached. Increase the limit or turn it off in billing settings to resume automatic reviews. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughTwo renderer stores change persisted diff/display defaults and add migrations (changes: viewMode -> "inline", version 6; settings: diffStyle -> "unified", version 1). FileRow and DiffFileHeader now render paths with RTL-aware truncation and show monospace path tooltips. ChangesView Mode Default Migration
Settings diffStyle Default Migration
Path rendering and tooltips (FileRow & DiffFileHeader)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 flips the default diff view mode in the Changes view from
Confidence Score: 5/5Safe to merge — the change is minimal, follows the existing migration pattern exactly, and covers both fresh installs and existing users. The two-line logic change (new No files require special attention.
|
| Filename | Overview |
|---|---|
| apps/desktop/src/renderer/stores/changes/store.ts | Flips initialState.viewMode to "inline", bumps persist version 5→6, and adds a v6 migration that unconditionally sets viewMode = "inline" for all previously-persisted stores. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[App starts] --> B{localStorage\nchanges-store?}
B -- No --> C[Use initialState\nviewMode: 'inline']
B -- Yes --> D{Persisted version?}
D -- "< 6" --> E[Run migrate\nset viewMode = 'inline']
D -- "= 6" --> F[Use stored viewMode\nas-is]
E --> G[Store loaded\nviewMode: 'inline']
C --> G
F --> H[Store loaded\nviewMode: stored value]
Reviews (1): Last reviewed commit: "chore(desktop): default Changes view dif..." | Re-trigger Greptile
There was a problem hiding this comment.
No issues found across 1 file
You’re at about 90% of the monthly review limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.
The v2 workspace reads diffStyle from the separate `settings` store, which still defaulted to "split". Flip it to "unified" and add a persist migration so existing users get reset. SUPER-687
When a path is too long for the row, ellipsise the directory portion from the left (using the existing `direction: rtl` + <bdi> pattern) so the deepest folder and filename stay visible — matching FileMentionNode. Basename is now shrink-0 so it never gets clipped in favor of dir text.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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:
- Line 125: In FileRow.tsx (the FileRow component) the span with className
"shrink-0 truncate font-medium text-foreground" prevents text-overflow ellipsis
because shrink-0 stops the element from shrinking; fix by removing "shrink-0" so
truncate can work (or alternatively add an explicit width constraint such as a
max-w/min-w class like "max-w-[200px]" or restore the previous "min-w-[120px]"
while keeping truncate) — update the span's className accordingly.
🪄 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: 38e320c5-3598-4ba6-bd1a-58a62f85d885
📒 Files selected for processing (1)
apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspaceSidebar/hooks/useChangesTab/components/ChangesFileList/components/FileRow/FileRow.tsx
This reverts commit 777591f.
Render the file path in the sidebar row and the diff-pane header as
a single span with direction: rtl + <bdi>, so when space is tight a
single ellipsis appears on the left and the basename stays anchored
on the right. Tooltip on hover shows the full path.
Previously the sidebar used a CSS rtl trick on a multi-span layout
that broke icon/folder alignment, and the diff header used two
separately-truncated spans that produced double ellipses
("apps/.../rou… pipelines.…").
There was a problem hiding this comment.
1 issue found across 2 files (changes from recent commits).
You’re at about 91% of the monthly review limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspaceSidebar/hooks/useChangesTab/components/ChangesFileList/components/FileRow/FileRow.tsx">
<violation number="1" location="apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspaceSidebar/hooks/useChangesTab/components/ChangesFileList/components/FileRow/FileRow.tsx:112">
P2: The old filename label is set to `shrink-0`, which can hide the new filename/path for long rename entries. Allow this segment to shrink and truncate so the current path remains visible.</violation>
</file>
Tip: Review your code locally with the cubic CLI to iterate faster.
| {dir && <span className="truncate text-muted-foreground">{dir}</span>} | ||
| {oldBasename && ( | ||
| <span className="truncate text-muted-foreground"> | ||
| <span className="shrink-0 text-muted-foreground"> |
There was a problem hiding this comment.
P2: The old filename label is set to shrink-0, which can hide the new filename/path for long rename entries. Allow this segment to shrink and truncate so the current path remains visible.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspaceSidebar/hooks/useChangesTab/components/ChangesFileList/components/FileRow/FileRow.tsx, line 112:
<comment>The old filename label is set to `shrink-0`, which can hide the new filename/path for long rename entries. Allow this segment to shrink and truncate so the current path remains visible.</comment>
<file context>
@@ -108,22 +108,17 @@ export const FileRow = memo(function FileRow({
- )}
{oldBasename && (
- <span className="truncate text-muted-foreground">
+ <span className="shrink-0 text-muted-foreground">
{oldBasename}
<span className="px-1">→</span>
</file context>
| <span className="shrink-0 text-muted-foreground"> | |
| <span className="min-w-0 truncate text-muted-foreground"> |
Tip: Review your code locally with the cubic CLI to iterate faster.
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
Summary
viewModeto"inline"so existing users on the old default get migrated.DiffToolbarand the split/unified mapping inLightDiffViewerare unchanged; users can still switch back.Linear: SUPER-687
Test plan
changes-storelocalStorage): Changes view opens with the inline diff selected.viewMode: "side-by-side": after upgrade, Changes view opens with inline selected (migration ran).DiffToolbarstill flips between inline and side-by-side, and the choice persists across reload.FileViewerPane) reflects the new default since it reads the same store.Summary by cubic
Default diff is now inline in the Changes view and unified in the v2 diff pane (SUPER-687). Existing users are migrated (
changes-storev6 setsviewMode: "inline",settingsv1 setsdiffStyle: "unified"); toggles still persist, the v1 file viewer reflects the new default, and file paths in the v2 Changes list and diff header use GitHub‑style left-ellipsis truncation to keep filenames visible with a tooltip that shows the full path.Written for commit 9491377. Summary will update on new commits.
Summary by CodeRabbit
Updates
Style