fix(studio): code-review and live-test fixes for the variables stack#2052
Open
Conversation
This was referenced Jul 8, 2026
Collaborator
Author
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
This was referenced Jul 8, 2026
Open
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>
5751d71 to
e8b75b7
Compare
b6b3f61 to
8254c95
Compare
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
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.activeCompPathis null there), so the Variables/Slideshow panels were dead on single-file projects — the primary use case.useStudioSdkSessionsopens the session with anindex.htmlfallback while edit-flow consumers keep the legacy null gating (cutover behavior unchanged). Found by driving the panel in a real browser"variables"registered in the URL-state tab allowlist so?tab=variablesdeep links survive normalization; preview variable overrides are cleared when the composition or project changes so values can't leak into another composition's preview/renderusePreviewDocumentVersionextracted from App.tsx (file-size gate)handleSetVariableValue's CSS compat sync routed throughcssCompatChange— one implementation of the--{id}channel; object values now clear a stale scalar prop instead of leaving it behindgetVariableUsagescript scansHow it was tested
The whole stack was exercised end-to-end against a live studio session (local
agent-browserdriving 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=variablesdeep 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
🤖 Generated with Claude Code