Skip to content

Stop injecting a background over the page - #7

Merged
dallasbpeters merged 3 commits into
mainfrom
rolemodel/no-injected-background
Aug 25, 2026
Merged

Stop injecting a background over the page#7
dallasbpeters merged 3 commits into
mainfrom
rolemodel/no-injected-background

Conversation

@dallasbpeters

Copy link
Copy Markdown
Member

Three insertCSS calls painted html, body { background: … !important } on
dom-ready — one over the Studio, two over the editor. They existed to stop a
white flash before React mounts, which backgroundColor on the BrowserWindow
already does properly: the compositor paints it before the first frame, and an
!important rule painted afterwards can only fight the page.

It won. The Studio's own grid was drawn and then covered, every time, and the
diagnosis kept landing on the page's CSS because that is where the symptom was.

The --titlebar-inset-left injections stay; those are real.

Also carries rolemodel into the wallpaper picker — the toolkit had been
rendering it for weeks with no way in, because brandWallpapers.ts is generated
into this repo and nothing ran the generator.

🤖 Generated with Claude Code

dallasbpetersand others added 3 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>
Three insertCSS calls painted `html, body { background: … !important }` on
dom-ready — one over the Studio, two over the editor. They were there to stop a
white flash before React mounts, which `backgroundColor` on the BrowserWindow
already does properly: the compositor paints it before the first frame, and an
!important rule painted afterwards can only fight the page.
It won: the Studio's own grid was drawn and then covered, every time, and the
diagnosis kept landing on the page's CSS because that is where the symptom was.
The titlebar-inset rules stay — those are real.
brandWallpapers.ts and public/wallpapers/brand/ pick up `rolemodel`, generated
by the toolkit, which had been rendered for weeks with no way into the picker.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@dallasbpeters
dallasbpeters merged commit e63d487 into mainAug 25, 2026
13 of 17 checks passed
@dallasbpeters
dallasbpeters deleted the rolemodel/no-injected-background branch August 25, 2026 01:01
Sign up for freeto 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

@dallasbpeters