Skip to content

Stop injecting an !important background over the Studio - #6

Merged
dallasbpeters merged 2 commits into
mainfrom
rolemodel/no-injected-background
Aug 24, 2026
Merged

Stop injecting an !important background over the Studio#6
dallasbpeters merged 2 commits into
mainfrom
rolemodel/no-injected-background

Conversation

@dallasbpeters

Copy link
Copy Markdown
Member

The Studio's grid background never rendered in the app, and the host was doing it.

On dom-ready the Studio window injected:

html, body { background: #141415 !important; }

background is a shorthand, so with !important it resets background-image and background-size to their initial values. Nothing in a stylesheet can outrank it — which is why the grid painted correctly in a plain browser and computed to background-image: none in the app:

t+0ms   backgroundImage: none   backgroundColor: rgb(20, 20, 21)

And because it's injected on dom-ready it lands after first paint: the grid appeared, then vanished. That reads as the page overriding itself, and a lot of time went into looking for that override inside the page, where it wasn't.

It was belt-and-braces against a white flash on a cold load. The window already sets backgroundColor: "#141415", painted before the page exists — earlier than any injected rule can manage. So the injection bought nothing and cost every future page texture.

The drag region stays. That genuinely belongs to the host: it's about the window frame, a served page has no reason to know about it, and the rules are inert in a browser.

Also in here

A test I broke two PRs ago and shipped red. still required CFBundleName === PRODUCT_NAME, which I removed to stop Electron hunting for "RoleModel Studio Helper.app". I'd only run the ai-edition tests, typecheck and biome on that PR.

Split rather than deleted, because why CFBundleName must stay unset is worth asserting — the new test names the FATAL it caused.

Left alone

The editor window has the same shape (html, body, #root { background: #09090b !important }). Its wallpaper paints on .previewFrame, deeper in the tree, so the shorthand doesn't reach it. Worth revisiting; not worth changing blind.

electron suite: 588 passing.

🤖 Generated with Claude Code

dallasbpeters and others added 2 commits August 24, 2026 15:31
The Studio's grid background never rendered in the app, and the host was doing it.

On dom-ready the Studio window injected:

  html, body { background: #141415 !important; }

`background` is a shorthand, so with !important it resets background-image and
background-size to their initial values. Nothing in a stylesheet can outrank it,
which is why the grid painted correctly in a browser and computed to
`background-image: none` in the app. And because it is injected on dom-ready it
lands after first paint — the grid appeared, then vanished, which reads as the page
overriding itself. A long time was spent looking for that override inside the
page, where it was not.

It was belt-and-braces against a white flash on a cold load. The window already
sets `backgroundColor: "#141415"`, which is painted before the page exists —
earlier than any injected rule can manage — so the injection bought nothing and
cost every future page texture.

The drag region stays. That one genuinely belongs to the host: it is about the
window frame, a served page has no reason to know about it, and the rules are
inert in a browser.

The editor window has the same shape (`html, body, #root { background: #09090b
!important }`) and is left alone: its wallpaper paints on .previewFrame, deeper in
the tree, so the shorthand does not reach it. Worth revisiting, not worth changing
blind.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
`matches the display name macOS reads out of Info.plist` still required
CFBundleName to equal PRODUCT_NAME. I removed that override two PRs ago to stop
Electron looking for "RoleModel Studio Helper.app", and did not run this suite —
only the ai-edition tests, the typecheck and biome. It has been red since.

Split rather than deleted, because the reason CFBundleName must stay unset is worth
asserting: Electron resolves its helper apps from it, electron-builder names them
after productName, and setting it aborted the app before it drew a window. The new
test says so, and names the FATAL it caused.

CFBundleDisplayName still has to equal PRODUCT_NAME — that is the one a person
reads.

electron suite: 588 passing.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@dallasbpeters
dallasbpeters merged commit d68e004 into main Aug 24, 2026
13 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant