You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: HTML files opened in the file viewer get none of the app theme, so they clash with the chat #32485
I searched existing issues and did not find a duplicate.
I included enough detail to reproduce or investigate the problem.
Area
apps/server
Steps to reproduce
Pick a custom theme (dark, with non-default canvas and text colors).
In a thread, have the assistant write a small page.html that styles itself with the documented theme variables, e.g. body{background:var(--background);color:var(--foreground)}, plus a line of plain unstyled text.
Click the file link in the reply, so it opens in the right-side file viewer.
Compare with the same HTML sent through html_render in 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 that html_render frames 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_render copy of the same HTML matches the theme.
Cause in source (tag v0.1.8-nightly.20261106.4288, unchanged on main):
FilePreviewPanel.tsx:274 renders BrowserDocumentFrame without htmlRender, so a workspace .html goes to FileDocument (BrowserDocumentFrame.tsx:165-174): a plain sandboxed iframe with bg-white, no theme fragment, no htmlRenderThemeMessage, no color-scheme.
The server serves the file raw (apps/server/src/http.tsassetFileResponse); only renderIntent: "mcp-app" gets injectMcpAppThemeBootstrap.
html_render frames instead get the active palette from useHtmlRenderTheme -> htmlRenderTheme (packages/shared/src/htmlRender.ts:175) via HtmlRenderDocument (BrowserDocumentFrame.tsx:187-196), the same colors applyThemePalette (themePalette.ts:1618) sets for the chat.
Suggested fix: have FileDocument pass the same theme (fragment + htmlRenderThemeMessage, colorScheme style) 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_render instead of opening the file, or hardcode the colors in the file.
Activity