Skip to content

Fix/devtools preview host surface - #1010

Open
Boj4ckk wants to merge 4 commits into
alpic-ai:mainfrom
Boj4ckk:fix/devtools-preview-host-surface
Open

Fix/devtools preview host surface#1010
Boj4ckk wants to merge 4 commits into
alpic-ai:mainfrom
Boj4ckk:fix/devtools-preview-host-surface

Conversation

@Boj4ckk

@Boj4ckk Boj4ckk commented Jul 28, 2026

Copy link
Copy Markdown

Why

Closes #841

The dark mode toggle in devtools had no visual effect because
index.css was not using the dark-theme CSS variables.

What

  • Applied dark-theme CSS variables for background and grid colors
    in the preview component
  • Background color is now driven by --preview-surface which
    resolves to the correct --color-background value based on
    the active theme

The dark-theme colors were chosen without existing specs — happy
to adjust if needed.

Testing

  • Verified dark mode works across all screen modes (full, pip, inline)
  • Added test case for grid color correctness in dark mode

Screenshots

Before → After

chess_before chess_after

Comment thread packages/devtools/src/index.css Outdated
@greptile-apps

greptile-apps Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR updates the devtools preview surface to follow light and dark theme tokens.

  • Adds theme-aware preview background and grid variables.
  • Applies the preview surface variable to the widget container in every display mode.
  • Adds Playwright coverage for surface and grid colors.

Confidence Score: 3/5

The PR is not yet safe to merge because dark preview mode still recolors unrelated tool-panel borders through the shared border token.

The scoped grid override fixes the grid itself, but [data-theme="dark"] continues to redefine --color-border on the preview-region ancestor, so descendant toolbar and drawer elements using border-border still inherit the unintended color.

Files Needing Attention: packages/devtools/src/index.css

Reviews (2): Last reviewed commit: "Merge branch 'alpic-ai:main' into fix/de..." | Re-trigger Greptile

@harijoe

harijoe commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Hi @Boj4ckk, thanks for your contribution!

As the contributor guidelines state, we require that either Greptile gives your PR a 5/5, or that you respond to the issues it raised explaining why you disagree with its review.

Also, since this is your first time contributing to the Skybridge repository, would you mind introducing yourself on our Discord? We'd love to get to know our contributors.

@Boj4ckk

Boj4ckk commented Jul 29, 2026

Copy link
Copy Markdown
Author

Hi @Boj4ckk, thanks for your contribution!

As the contributor guidelines state, we require that either Greptile gives your PR a 5/5, or that you respond to the issues it raised explaining why you disagree with its review.

Also, since this is your first time contributing to the Skybridge repository, would you mind introducing yourself on our Discord? We'd love to get to know our contributors.

Hey! Yes, I'm on it, thanks. I introduced myself in the #introductions Discord channel, btw

@Boj4ckk

Boj4ckk commented Jul 29, 2026

Copy link
Copy Markdown
Author

While manually testing the fix on the @examples/chess app, I noticed a behavior I'm unsure about from a product perspective. Wanted to flag it here.

Observed behavior

  • Toggling dark mode from the devtools preview toolbar correctly updates both the preview surface and the chess board theme.
  • However, the chess board has its own internal dark/light toggle.
  • Toggling the chess board's internal toggle updates the board locally, but it does not sync back to the devtools preview toggle.
image

Question
Is this the intended behavior? My understanding is that in a real host (ChatGPT/Claude) the host owns the theme and pushes it down to the view the view should not override the host's theme toggle. But I wanted to confirm this is the expected product behavior for devtools as well.

For context, my change in this PR only touches the preview region's CSS attribute (data-theme → data-preview-theme) to isolate the preview surface from the devtools UI chrome. I did not modify useSyncOpenaiTheme or the host→view theme propagation. So this behavior likely predates my change, but I wanted to make sure it's acknowledged.

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.

devtools: preview doesn't render the host surface background behind the iframe

2 participants