Skip to content

fix(cli): label SVG contact sheet thumbnails by file name on Windows - #7308

Closed
n-bharath-chowdary wants to merge 2 commits into
heygen-com:mainfrom
n-bharath-chowdary:fix/svg-contact-sheet-label-windows
Closed

n-bharath-chowdary wants to merge 2 commits into
heygen-com:mainfrom
n-bharath-chowdary:fix/svg-contact-sheet-label-windows

Conversation

@n-bharath-chowdary

Copy link
Copy Markdown

What

The SVG contact sheet captions each thumbnail with its file name. On Windows the caption was the whole path (assets\svgs\logo) instead of logo.

Why

createSvgContactSheet builds its paths with join(), which uses backslashes on Windows, then took the caption with p.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 returns basename(svgPath, ".svg"), and used it where the labels are built. basename follows 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 .svg anywhere in the name, so a.svg.backup.svg became a.backup.svg. The new version only strips a trailing .svg.

Test plan

  • Added two unit tests for svgContactSheetLabel, in contactSheet.test.ts. The first builds the path with the platform's own join(), 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.mjs and comment-ratchet.mjs are clean on the changed files.

  • Nine other tests in contactSheet.test.ts already fail on this Windows machine without this change (EPERM: unlink when 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

n-bharath-chowdary and others added 2 commits November 6, 2026 14:23
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]>
@n-bharath-chowdary

Copy link
Copy Markdown
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.

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