Skip to content

fix: prioritize path truncation in changes sidebar#2090

Merged
jschwxrz merged 1 commit into
mainfrom
free-drinks-sin
May 18, 2026
Merged

fix: prioritize path truncation in changes sidebar#2090
jschwxrz merged 1 commit into
mainfrom
free-drinks-sin

Conversation

@jschwxrz
Copy link
Copy Markdown
Collaborator

  • adjusts changes sidebar file row layout so the directory path truncates before the filename
  • keeps the path directly next to the filename when there is enough horizontal space
  • allows the filename to truncate only once the path has collapsed under tight space

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 18, 2026

Greptile Summary

This PR adjusts the Tailwind flex layout of ChangesListItem so that the directory path collapses before the filename when the changes sidebar is narrow.

  • The outer left-side div gains flex-1 so it fills all space left by the right-side controls, and the filename/directory pair is wrapped in a new inner flex min-w-0 flex-1 span.
  • The filename span is marked shrink-0 (never shrinks via the flex algorithm) while max-w-full caps it at the parent width, giving truncate a natural trigger; the directory span is shrink with min-w-0, so it collapses first under space pressure.

Confidence Score: 5/5

Safe to merge — the change is purely cosmetic, touching only Tailwind classes on the sidebar row layout with no logic alterations.

The diff is a focused CSS-only change to four class strings. The flex properties used (shrink-0, max-w-full, shrink, min-w-0, flex-1) interact correctly to produce the priority-truncation order described in the PR: directory collapses before the filename, and the filename truncates only when the container is too narrow even for it alone.

No files require special attention.

Important Files Changed

Filename Overview
src/renderer/features/tasks/diff-view/changes-panel/components/changes-list-item.tsx Flex layout rework to prioritize path truncation over filename truncation; no logic changes, only Tailwind class adjustments.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Available width in sidebar row] --> B{filename natural width\n≤ container width?}
    B -- Yes --> C[Filename renders at natural width\nDirectory fills remaining space]
    C --> D{Directory natural width\nfits remaining space?}
    D -- Yes --> E[Both shown in full]
    D -- No --> F[Directory shrinks and truncates\nFilename unchanged]
    B -- No --> G[max-w-full caps filename at 100% of container\nFilename truncates via truncate class\nDirectory collapses to 0px]
Loading

Reviews (1): Last reviewed commit: "fix: prioritize path truncation in chang..." | Re-trigger Greptile

@jschwxrz jschwxrz merged commit e024570 into main May 18, 2026
1 check passed
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