Skip to content

Conversation

@gshahbazian
Copy link
Contributor

@gshahbazian gshahbazian commented Dec 27, 2025

Release Notes:

  • Use the files name for "is svg" checks so SVG previews and the toolbar button work in single-file mode.
Use the files full path and file name as fallbacks when the
worktree-relative path is empty, so SVG previews and the toolbar
button work in single-file mode.
@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Dec 27, 2025
@maxdeviant maxdeviant changed the title svg-preview: detect svg in single-file mode by checking full path Dec 27, 2025
Copy link
Member

@MrSubidubi MrSubidubi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for looking into this! I think we can simplify this, left a comment below.

Also, not required, but could I interest you into looking to add a test case for this? You might need to copy quite some code for this from elsewhere (and even need to add the test elsewhere). Yet, with a test, we'd be more certain this does not regress any time soon (and I think changes here need to be done at some point, so would be nice to have, but as mentioned, not required). Thanks!

@MrSubidubi MrSubidubi self-assigned this Dec 27, 2025
@gshahbazian gshahbazian changed the title svg_preview: Detect SVG in single-file mode by checking full path Dec 27, 2025
Copy link
Member

@MrSubidubi MrSubidubi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Thank you both for the fix as well as the fast follow up! Appreciated

@MrSubidubi MrSubidubi enabled auto-merge (squash) December 27, 2025 23:28
@MrSubidubi MrSubidubi merged commit 2cad6c8 into zed-industries:main Dec 27, 2025
23 checks passed
CherryWorm pushed a commit to CherryWorm/zed that referenced this pull request Dec 30, 2025
…d-industries#45747)

Release Notes:

- Use the files name for "is svg" checks so SVG previews and the toolbar
button work in single-file mode.
rtfeldman pushed a commit that referenced this pull request Jan 5, 2026
…5747)

Release Notes:

- Use the files name for "is svg" checks so SVG previews and the toolbar
button work in single-file mode.
LivioGama pushed a commit to LivioGama/zed that referenced this pull request Jan 20, 2026
…d-industries#45747)

Release Notes:

- Use the files name for "is svg" checks so SVG previews and the toolbar
button work in single-file mode.
LivioGama pushed a commit to LivioGama/zed that referenced this pull request Jan 20, 2026
…d-industries#45747)

Release Notes:

- Use the files name for "is svg" checks so SVG previews and the toolbar
button work in single-file mode.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement

2 participants