Skip to content

fix(web): let HTML pages fill the full viewport#20

Merged
alextnetto merged 1 commit into
mainfrom
html-fullbleed
May 16, 2026
Merged

fix(web): let HTML pages fill the full viewport#20
alextnetto merged 1 commit into
mainfrom
html-fullbleed

Conversation

@alextnetto
Copy link
Copy Markdown
Member

Symptom

https://pagent.link/<id> for an HTML page renders as a narrow ~640 px column centered on a 1200 px viewport, with the body gradient showing on both sides. The agent's CSS (max-width, padding) further constrains the content inside the iframe, but the outer 640 px cap was ours.

Root cause

apps/web/index.html sets #app { max-width: 640px; margin: 0 auto; padding: ... } for A2UI/landing layouts. The home page already opts out via #app.is-home { max-width: none; margin: 0; padding: 0; }. HTML pages had no equivalent escape hatch and inherited the 640 px cap.

Fix

  • apps/web/main.ts: when format === 'html', add is-html to #app.
  • apps/web/index.html: extend the is-home cap-clearing rule to cover is-html.
#app.is-home,
#app.is-html {
  max-width: none;
  margin: 0;
  padding: 0;
}

Test plan

  • npm run typecheck, npm test (237 pass), npm run build:web — green
  • After merge + Vercel deploy: open an HTML page on a wide viewport and confirm the iframe fills the full width
  • A2UI pages render unchanged (still 640 px column, centered)

The shell's `#app` container has a `max-width: 640px` cap (set in
index.html for A2UI/landing layouts). HTML pages were inheriting it
and rendering as a narrow ~640px column with the body gradient
showing on both sides, regardless of viewport width.

Fix: flip an `is-html` class on `#app` when the format is HTML, and
add it to the existing `#app.is-home, #app.is-html` rule that clears
the cap. Same escape hatch the home page already uses via `is-home`.

No security implications. Iframe sandbox, CSP, sanitizer, chrome bar
all unchanged. The agent's own page CSS (max-width, padding) still
applies inside the iframe — this just removes our renderer's outer
constraint on the iframe itself.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
pagent Ready Ready Preview, Comment May 16, 2026 0:08am

Request Review

@alextnetto alextnetto merged commit 922c016 into main May 16, 2026
3 checks passed
@alextnetto alextnetto deleted the html-fullbleed branch May 16, 2026 00:09
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.

1 participant