Skip to content

fix(playground-url): embed SVG files as text in CLI share links - #1850

Merged
joshunrau merged 1 commit into
DouglasNeuroInformatics:mainfrom
Sanilas-ai:fix/1768-cli-svg-text
Nov 5, 2026
Merged

joshunrau merged 1 commit into
DouglasNeuroInformatics:mainfrom
Sanilas-ai:fix/1768-cli-svg-text

Conversation

@Sanilas-ai

Copy link
Copy Markdown
Contributor

Closes #1768

Problem

The playground keeps an .svg file as text (see inferFileType / isBase64EncodedFileType in apps/playground/src/utils/file.ts). But the playground-url CLI treated .svg as a binary asset and skipped it. So a share link built from an instrument that imports an SVG (for example Interactive-With-React's React logo) showed a broken image.

Change

  • cli.ts: .svg is now in TEXT_FILE_EXT_REGEX and out of BINARY_FILE_EXT_REGEX, so the CLI embeds it as it is on disk. The skip warning now says the CLI leaves out binary assets to keep links short.
  • README, both AGENTS.md files and the $EditorFile doc comment now say the same.

Tests

  • Unit (cli.test.ts): a new test decodes the generated link and checks that logo.svg keeps its exact content and that nothing is reported as skipped. It fails on main and passes with this change (27/27).
  • e2e (testing/src/specs/playground.spec.ts): a new test runs the built CLI on Interactive-With-React and opens the link. It clicks Begin and checks that the React logo image inside the instrument iframe is visible and has loaded (naturalWidth > 0). It passes on chromium with this change. With main's cli.ts, the instrument never loads and the test fails.
  • pnpm lint passes in playground-url, and tsc and eslint pass on the spec.

Note: my machine's CPU has no AVX, so MongoDB can't run there. I ran the playground spec with a local Playwright config that starts only the playground web server and skips the API setup project. CI will run the full suite.

The playground holds an .svg as text, but the CLI grouped it with binary
assets and left it out, so a link built from an instrument with an SVG
logo rendered a broken image.

Closes DouglasNeuroInformatics#1768
@Sanilas-ai
Sanilas-ai requested a review from joshunrau as a code owner November 2, 2026 18:28
@joshunrau
joshunrau merged commit 7d4bd22 into DouglasNeuroInformatics:main Nov 5, 2026
2 checks 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.

The playground-url CLI skips .svg files as binary, so links for instruments that import an SVG fail to compile

2 participants