Repository navigation
[Bug]: HTML files opened in the file viewer get none of the app theme, so they clash with the chat #32486
baohappy02
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Before submitting
Area
apps/server
Steps to reproduce
page.htmlthat styles itself with the documented theme variables, e.g.body{background:var(--background);color:var(--foreground)}, plus a line of plain unstyled text.html_renderin the chat.Expected behavior
The file viewer's HTML frame gets the same theme as the chat (the
--background,--foreground, ... variables, color-scheme and font stacks thathtml_renderframes get), or at least the active theme's canvas and text colors, so the page matches the chat and sidebar.Actual behavior
The page uses a different color set than the chat; with a custom theme its text looks harsh and does not match. The
html_rendercopy of the same HTML matches the theme.Cause in source (tag v0.1.8-nightly.20261106.4288, unchanged on main):
FilePreviewPanel.tsx:274rendersBrowserDocumentFramewithouthtmlRender, so a workspace.htmlgoes toFileDocument(BrowserDocumentFrame.tsx:165-174): a plain sandboxed iframe withbg-white, no theme fragment, nohtmlRenderThemeMessage, nocolor-scheme.apps/server/src/http.tsassetFileResponse); onlyrenderIntent: "mcp-app"getsinjectMcpAppThemeBootstrap.html_renderframes instead get the active palette fromuseHtmlRenderTheme->htmlRenderTheme(packages/shared/src/htmlRender.ts:175) viaHtmlRenderDocument(BrowserDocumentFrame.tsx:187-196), the same colorsapplyThemePalette(themePalette.ts:1618) sets for the chat.Suggested fix: have
FileDocumentpass the same theme (fragment +htmlRenderThemeMessage,colorSchemestyle) to HTML files, or inject the theme bootstrap the way MCP apps get it, so pages that use the theme variables match the app.Impact
Major degradation or frequent failure
Version or commit
v0.1.8-nightly.20261106.4288
Environment
macOS, T3 Code (Nightly) desktop app
Logs or stack traces
Screenshots, recordings, or supporting files
No response
Workaround
Send the page with
html_renderinstead of opening the file, or hardcode the colors in the file.All reactions