Skip to content

fix(file-explorer): stop italic ignored filenames clipping ".md" to ".ma" - #10047

Merged
nwparker merged 1 commit into
mainfrom
nwparker/fix-italic-md-clip
Jul 23, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/fix-italic-md-clip

Conversation

@nwparker

@nwparker nwparker commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Problem

In the right-sidebar file explorer, gitignored files whose names end in .md rendered as .ma — the trailing d was clipped off.

Root cause

Gitignored filenames render in an italic, shrink-to-fit <span> styled with the Tailwind truncate utility (overflow: hidden; text-overflow: ellipsis; white-space: nowrap).

Italic glyphs lean right and overhang their advance width. Because the span shrinks to its content and overflow: hidden clips at the content-box edge, the trailing glyph's slant overhang gets shaved — turning .md into .ma. This happens for any italic (ignored) name, not just ones long enough to truncate, which is why even short names like README.md and 04-roadmap.md were affected.

Only ignored files are italic (isIgnored && 'italic'), so only they showed the bug. Non-italic rows have no overhang and render fine.

Fix

src/renderer/src/components/right-sidebar/FileExplorerRow.tsx — add pr-0.5 to the italic case so there's room for the slant overhang inside the clipping box.

-              isIgnored && 'italic'
+              isIgnored && 'italic pr-0.5'

Evidence (before / after)

Minimal HTML repro of the exact CSS (truncate + italic, with and without the padding), rendered in WebKit at the sidebar's width. Top group is BEFORE (.md clipped to .ma); bottom group is AFTER with pr-0.5 (full .md visible):

before/after

….ma"

Gitignored files render their name in an italic, shrink-to-fit span with
Tailwind `truncate` (overflow:hidden). Italic glyphs overhang their advance
width, and overflow:hidden clips at the content-box edge, shaving the final
letter — so ".md" displayed as ".ma" (and any italic name lost its last char),
regardless of whether the name was actually truncated.

Add `pr-0.5` on the italic case to reserve room for the slant overhang.

Co-authored-by: Orca <[email protected]>
@coderabbitai

coderabbitai Bot commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Updated ignored file and directory names in FileExplorerRow to use additional right padding alongside italic styling. Added comments documenting that the padding prevents italic glyphs from being clipped during truncation.

🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (3 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR fixes italic filename clipping, but linked issue #39 requires an 'Add repo' action in the repo filter dropdown. Implement the repo filter dropdown Add repo option with divider, call addRepo(), open the folder picker, and preserve normal filter behavior.
Out of Scope Changes check ⚠️ Warning The file-explorer style tweak is unrelated to linked issue #39 and appears out of scope for the requested repo filter dropdown change. Limit this PR to the repo filter dropdown change, or split the file-explorer clipping fix into a separate PR.
Description check ⚠️ Warning The description covers the bug and fix, but it omits required template sections like Testing, AI Review Report, Security Audit, and Notes. Add the missing template sections, including Testing, AI Review Report with cross-platform checks, Security Audit, and Notes.
✅ Passed checks (2 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title is concise and accurately describes the ignored-file truncation fix in FileExplorerRow.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

@nwparker
nwparker merged commit 0990031 into main Jul 23, 2026
2 checks passed
@nwparker
nwparker deleted the nwparker/fix-italic-md-clip branch July 23, 2026 02:47
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
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