Skip to content

fix: fullpage sizes to its container; viewport only as attribute-gated fallback#21

Merged
brentrager merged 1 commit into
mainfrom
SMOODEV-fullpage-container-sizing
Jul 2, 2026
Merged

fix: fullpage sizes to its container; viewport only as attribute-gated fallback#21
brentrager merged 1 commit into
mainfrom
SMOODEV-fullpage-container-sizing

Conversation

@brentrager

Copy link
Copy Markdown
Contributor

Bug

:host and .panel.fullpage both pinned min-height: 100vh, so mountFullPageChat into a fixed-height overflow: hidden container overflowed it and clipped the composer out of view — visitors saw only the example-prompt chips with no way to type. Hit live on chakrabpc.com/transformation-posture (widget 0.10.0); the page is running an interim ::part(panel) override until this lands.

Fix

  • Fullpage :host becomes a flex column filling its box (height: 100%, no viewport unit); the render container gets a .wrap class (flex: 1; min-height: 0) so the host's box flows down; .panel.fullpage is flex: 1 — never a hardcoded 100vh.
  • Bare full-page routes still fill the viewport: syncViewportFallback() probes at render (with .wrap hidden, height:100% of a sized container still resolves >0; an auto-height <body> collapses to ~0) and only then sets data-viewport-fallback, whose CSS applies min-height: 100dvh.
  • Compatible with page-side ::part(panel) overrides (no double-apply breakage).

Tests

  • styles.test.ts: fullpage CSS has no unconditional min-height: 100vh; ships the attribute-gated 100dvh rule + .wrap chain + .panel.fullpage { flex: 1 }.
  • element.test.ts (new describe fullpage container sizing): .wrap .panel.fullpage renders; sized container (mocked clientHeight) → no fallback attribute; heightless mount → fallback attribute set.
  • pnpm check green: typecheck + 108 tests + build.

🤖 Generated with Claude Code

…d fallback

:host and .panel.fullpage both pinned min-height:100vh, so mountFullPageChat
into a fixed-height overflow-hidden box overflowed it and clipped the composer
(visitors saw only example-prompt chips — no text input; hit live on
chakrabpc.com/transformation-posture). The host now hands its box down a .wrap
flex chain (.panel.fullpage flex:1), and data-viewport-fallback — set only when
a probe finds the container gives the host no resolved height (bare <body>
mounts) — restores min-height:100dvh for full-page routes. ::part(panel)
overrides remain compatible.
@changeset-bot

changeset-bot Bot commented Jul 2, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e2516a0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@smooai/chat-widget Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@brentrager brentrager merged commit 4de7ec2 into main Jul 2, 2026
1 check passed
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