Skip to content

Make Studio Code aware of theme asset bundling - #4262

Merged
gcsecsey merged 2 commits into
trunkfrom
gcsecsey/studio-code-theme-guardrails
Jul 22, 2026
Merged

Make Studio Code aware of theme asset bundling#4262
gcsecsey merged 2 commits into
trunkfrom
gcsecsey/studio-code-theme-guardrails

Conversation

@gcsecsey

Copy link
Copy Markdown
Member

Related issues

How AI was used in this PR

I used Claude to investigate Studio Code's existing theme guardrails, confirm the asset-bundling gap, and draft the guardrail wording. I reviewed and validated the wording and the design decision (awareness over auto-running builds) myself.

Proposed Changes

A user customizing a site on an installed theme reported that Studio Code edited the theme's style.css directly. The existing guardrail already routes design changes into a child theme, but its reasoning only mentioned that a theme update wipes such edits. It missed a second failure mode: many themes serve a compiled or minified stylesheet in production (for example style.min.css, or assets built into build/ or dist/) while the readable source loads only in development, so an edit to the source may never reach the rendered site, and Studio has no build step to recompile it.

  • Awareness only, no behavior change. The child-theme default already sidesteps bundling, since a child theme's plain CSS is enqueued directly and never enters the parent's build pipeline, so the agent just needs to know why and decide when to surface it.
  • The wording lives in the visual-design skill (loaded during design work) rather than the system prompt, which already covers the child-theme action more tersely.

Testing Instructions

  • Ask Studio Code to restyle or add a section to a site whose active theme is an installed theme that ships compiled or minified assets.
  • Confirm it makes the change in a child theme (scaffold_theme with parentTheme) rather than editing the installed theme's source files.
  • Confirm it can explain, when relevant, that editing the installed theme's source would not reach the rendered site because the theme serves a compiled asset.

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?
@gcsecsey
gcsecsey requested review from a team and sejas July 20, 2026 16:12

@sejas sejas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. I confirmed there is no regression in child themes eval by running npm run eval -- --filter-pattern "child theme"

@gcsecsey
gcsecsey merged commit 853afe7 into trunk Jul 22, 2026
13 checks passed
@gcsecsey
gcsecsey deleted the gcsecsey/studio-code-theme-guardrails branch July 22, 2026 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants