Repository navigation
fix(cli): label SVG contact sheet thumbnails by file name on Windows - #7308
Closed
n-bharath-chowdary wants to merge 2 commits into
Closed
n-bharath-chowdary wants to merge 2 commits into
n-bharath-chowdary wants to merge 2 commits into
Conversation
createSvgContactSheet builds its paths with join(), which uses backslashes on
Windows, then took the caption by splitting on "/". On Windows the whole path
survived, so a thumbnail was captioned "assets\svgs\logo" instead of "logo".
Take the caption with basename(), which follows the platform separator, and
only drop a trailing ".svg" (the old replace(".svg", "") removed the first
occurrence anywhere in the name).
SanHsien
added a commit
to SanHsien/hyperframes
that referenced
this pull request
Nov 6, 2026
…, record duplicate rule Review PR heygen-com#7304-heygen-com#7335: 10 merged already adopted or deferred; 10 open or draft PRs pinned (heygen-com#7304, heygen-com#7308, heygen-com#7311, heygen-com#7315, heygen-com#7321, heygen-com#7330-heygen-com#7334); open duplicates of pinned heygen-com#7281/heygen-com#7285/heygen-com#7286/heygen-com#7296 are tracked by those pins. strict exit 0; monitored 110 -> 120. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
|
Closing this as superseded: #6732 landed the same fix (basename for the SVG contact sheet label) on main. Thanks for the quick fixes there. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The SVG contact sheet captions each thumbnail with its file name. On Windows the caption was the whole path (
assets\svgs\logo) instead oflogo.Why
createSvgContactSheetbuilds its paths withjoin(), which uses backslashes on Windows, then took the caption withp.split("/").pop(). On Windows there is no/to split on, so the full path survived into the label.To reproduce on Windows: put an SVG in the capture
svgs/folder and run the SVG contact sheet. Each caption shows the folder path in front of the name.Related work
Tiny self-contained correction, so no separate issue. A search of open and closed issues and PRs for this label behaviour found nothing overlapping.
How
Added
svgContactSheetLabel(svgPath), which returnsbasename(svgPath, ".svg"), and used it where the labels are built.basenamefollows the platform separator, so it matches how the paths were joined.It also fixes a small second thing: the old
.replace(".svg", "")removed the first.svganywhere in the name, soa.svg.backup.svgbecamea.backup.svg. The new version only strips a trailing.svg.Test plan
Added two unit tests for
svgContactSheetLabel, incontactSheet.test.ts. The first builds the path with the platform's ownjoin(), so it fails on Windows with the old logic (expected 'assets\svgs\logo' to be 'logo') and passes with the fix. Windows CI covers it.With the fix, the two new tests pass on Windows.
oxlint,oxfmt --check,check-comment-citations.mjsandcomment-ratchet.mjsare clean on the changed files.Nine other tests in
contactSheet.test.tsalready fail on this Windows machine without this change (EPERM: unlinkwhen removing the temp files the image tests created). They are unrelated to this PR and fail the same way on an untouched checkout.Unit tests added/updated
Manual testing performed
Documentation updated (if applicable)
Comments follow CONTRIBUTING.md "Comments": they say why, not what, and a bug fix says what the code must do and how to reproduce the bug