fix(web): drop chrome bar — render HTML like an .html file#21
Merged
Conversation
The shell was rendering a 33 px header above the iframe with "AI-generated content" + a Report mailto: link. Product call is now to render HTML pages with no chrome at all, so a Pagent URL feels identical to opening the .html file directly. Removes: - The REPORT_EMAIL constant + accompanying TODO - .html-chrome / .html-chrome-label / .html-chrome-report / .html-stack CSS - The <header role="banner"> + Report link from renderHtml() - The flex-column wrapper (iframe is now the only child) Iframe styling moves from `flex:1 1 auto;...;min-height:0` (designed for the flex parent) to `width:100%;height:100vh;border:0;display:block` so it pins to the viewport directly. Security boundary is unchanged. The three defense layers — server-side DOMPurify, meta-CSP in the srcdoc, iframe sandbox="" — all stay. The chrome bar was a visual disclosure, not a security control.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Symptom
HTML pages on Pagent rendered with a 33 px header above the iframe ("✦ AI-generated content" + a Report mailto link). Product call: HTML pages should render identically to opening the .html file directly — no chrome, no overlay.
Fix
apps/web/main.tsREPORT_EMAILconst + TODO..html-chrome*and.html-stackCSS rules.renderHtml()returns the iframe directly (no flex-column wrapper, no<header>).apps/web/html-renderer.tsflex:1 1 auto;…;min-height:0towidth:100%;height:100vh;border:0;display:block. The iframe now pins to the viewport on its own; the flex parent was only needed when the chrome bar was sharing space.Security note
Three defense layers unchanged:
<script>, on-handlers, dangerous URLs).default-src 'none'+ narrow re-enables).sandbox=""iframe (opaque origin, no JS, no top-nav, no forms, no popups).CI tripwire still in place:
html-renderer.test.tsassertssandboxstays empty.The chrome bar was a visual disclosure, not a security boundary.
Diff
Test plan
npm run typecheck,npm run lint,npm test(237 pass) — green