Skip to content

fix(studio): code-review and live-test fixes for the variables stack#2052

Open
jrusso1020 wants to merge 1 commit into
07-07-feat_studio_render_with_preview_variables_template_handoff_docsfrom
07-07-fix_studio_code-review_and_live-test_fixes_for_the_variables_stack
Open

fix(studio): code-review and live-test fixes for the variables stack#2052
jrusso1020 wants to merge 1 commit into
07-07-feat_studio_render_with_preview_variables_template_handoff_docsfrom
07-07-fix_studio_code-review_and_live-test_fixes_for_the_variables_stack

Conversation

@jrusso1020

@jrusso1020 jrusso1020 commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

What

Top of the template-variables stack: fixes from an 8-angle code review + a full in-browser test pass over #2046#2051. Hunks touching stack-authored lines were absorbed into their PRs (gt absorb); this PR carries the fixes that touch pre-stack code.

  • studio: the SDK session never opened on the master view (activeCompPath is null there), so the Variables/Slideshow panels were dead on single-file projects — the primary use case. useStudioSdkSessions opens the session with an index.html fallback while edit-flow consumers keep the legacy null gating (cutover behavior unchanged). Found by driving the panel in a real browser
  • studio: "variables" registered in the URL-state tab allowlist so ?tab=variables deep links survive normalization; preview variable overrides are cleared when the composition or project changes so values can't leak into another composition's preview/render
  • studio: usePreviewDocumentVersion extracted from App.tsx (file-size gate)
  • sdk: handleSetVariableValue's CSS compat sync routed through cssCompatChange — one implementation of the --{id} channel; object values now clear a stale scalar prop instead of leaving it behind
  • sdk: content-keyed cache for getVariableUsage script scans
  • studio-server: shared variables-payload validation helper for the preview + render routes

How it was tested

The whole stack was exercised end-to-end against a live studio session (local agent-browser driving a real project): every control type committing to the preview, override pill/reset semantics, Set-default → disk → undo round-trip (verbatim file restore incl. CSS compat prop), add/remove declarations → disk, ?tab=variables deep links, HTTP injection/400s/ETag variance, and wire-level render forwarding. Review verdicts: 13 confirmed findings (9 fixed across the stack, others tracked), 4 candidates refuted by verification.

Test plan

  • Full suites green after fixes: sdk 435, studio 1392, studio-server 259
  • Manual browser test matrix (above) re-run against the fixed build
  • All pre-commit gates pass on every branch

🤖 Generated with Claude Code

Remainder of a review + in-browser test pass over the stack (hunks
touching stack-authored lines were absorbed into their PRs; these touch
pre-stack lines).

- studio: the SDK session never opened on the master view (activeCompPath
  is null there), so the Variables/Slideshow panels were dead on
  single-file projects — open the session with an index.html fallback
  (useStudioSdkSessions) while edit-flow consumers keep the legacy null
  gating, so cutover behavior is unchanged. Found by driving the panel
  in a real browser.
- studio: register "variables" in the URL-state tab allowlist so
  ?tab=variables deep links survive normalization; clear preview variable
  overrides when the composition or project changes so values can't leak
  into another composition's preview/render.
- studio: extract usePreviewDocumentVersion from App.tsx (file-size gate).
- sdk: route handleSetVariableValue's CSS compat sync through
  cssCompatChange — one implementation of the --{id} channel (object
  values now clear a stale scalar prop instead of leaving it behind).
- sdk: content-keyed cache for getVariableUsage script scans (same
  rationale as _gsapLabelCache).
- studio-server: shared variables-payload validation helper used by both
  the preview and render routes (was two copies of the same check).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@jrusso1020 jrusso1020 force-pushed the 07-07-fix_studio_code-review_and_live-test_fixes_for_the_variables_stack branch from 5751d71 to e8b75b7 Compare July 8, 2026 08:00
@jrusso1020 jrusso1020 force-pushed the 07-07-feat_studio_render_with_preview_variables_template_handoff_docs branch from b6b3f61 to 8254c95 Compare July 8, 2026 08:00
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