Skip to content

Let a fill-height isolated template fill the host-mode top card instead of collapsing to its padding - #6051

Open
tintinthong wants to merge 1 commit into
mainfrom
fix/host-mode-top-card-height
Open

Let a fill-height isolated template fill the host-mode top card instead of collapsing to its padding#6051
tintinthong wants to merge 1 commit into
mainfrom
fix/host-mode-top-card-height

Conversation

@tintinthong

Copy link
Copy Markdown
Contributor

The bug, as a user sees it

Publish a realm whose card looks fine in operator mode, open it on the *.boxel.space site with ?hostModeStack=[…], and the top stack card renders as a ~150px strip across the top of the page: the card's ground colour, its top padding, one link chip that overflowed a zero-height layout, and the close button. The headline never appears. Underneath, the pinned tile on the workspace Home shows the same card rendering perfectly — so it isn't the card's data, it's the container it was handed.

Reproduced with a poster card whose isolated root is height: 100%; container-type: size (type sized in cqh). Any isolated template that fills its container hits it; the realm's test Pet card (.pet-isolated { height: 100% }) is enough.

Why the top card is height: auto

#3934 (65e8163504, host mode stack layering and scroll update) made the host-mode top card content-sized with an 80cqh floor, and moved scrolling to .inner so a published page scrolls like a page instead of showing a scrollbar inside the card. That's the right call for a published site — a long document should grow.

The symmetry it broke: operator mode's stack item hands every card a definite height (height: calc(100% - Npx)) and its .stack-item-card is a grid that propagates that height down the chain (see the comment block at operator-mode/stack-item.gts ~L1242: "Propagate height through the chain…"). Host mode's @media print rules restore exactly that definite contract for printing. So the same isolated format meets two contracts, and nothing in the chain below can tell which one it's in.

The specific CSS fact: a percentage height never resolves against min-height. height: 100% on a child of an auto-height box computes to auto even when that box has a floor. Under container-type: size content contributes nothing, so the root has literally no height.

The fix

Make the stack item a single-row grid:

.host-mode-stack-item {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
}

A grid area is definite for its item even when the grid's own height is auto, so the row hands .stack-item-card the floor when content is short — and still grows when content is tall. height: auto, the 80cqh floor and the page-scroll behaviour from #3934 are untouched. Every layer below already passes height: 100% down (.boxel-card-container, .field-component-card.isolated-format), so this is the one missing link.

Measured through the real element chain (stack item → .stack-item-cardCardContainer.host-mode-cardfield-component-card.isolated-format → root) at a 490px floor:

case before after
root height: 100% + container-type: size 48px (padding only) 490px (the floor)
Pet root height: 100% collapsed to its <h2> 490px
long document, 25 paragraphs 823px 823px — still grows

Test

Adds an acceptance test in host-mode-test.gts that stacks Pet/mango and asserts its height: 100% root fills the stack item's content box (item height minus its paddings) and is taller than its own <h2>. The assertion is relative, so it holds under #ember-testing scaling and any floor value.

I was not able to run the host acceptance suite locally from this checkout — relying on CI for the end-to-end confirmation; the chain measurements above are from a standalone reproduction of the exact DOM/CSS chain in Chrome.

🤖 Generated with Claude Code

…ad of collapsing to its padding

Since #3934 the top card of the host-mode stack is content-sized
(`height: auto`) with an 80cqh floor, so a published page scrolls as a
page. Operator mode hands its stack item a definite height instead. The
same isolated template therefore meets two sizing contracts, and one of
them silently breaks it: a percentage height never resolves against
`min-height`, so a root that fills its container (`height: 100%`,
`container-type: size`, cqh units) has nothing to fill in host mode and
collapses to its padding — a ~150px strip showing whatever overflowed.

Make the stack item a single-row grid. A grid area is definite for its
item even when the grid's own height is auto, so the `1fr` row hands
`.stack-item-card` the floor when content is short and still grows when
content is tall. Every layer below already passes `height: 100%` down
(`.boxel-card-container`, `.field-component-card.isolated-format`), so
the fix is the one missing link; `height: auto` and the page-scroll
behaviour stay as they are.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 9, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-09T15:28:44.903941Z ebee1bf PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ebee1bfb01

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +227 to +228
display: grid;
grid-template-rows: minmax(0, 1fr);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Give the grid a real block-size floor

The top item still receives height: auto from styleForStackedCard, and neither this rule nor its ancestors set the claimed min-height/80cqh floor on the absolutely positioned item. With an indefinite grid height, the 1fr track is intrinsically sized from the card's content; making it a grid therefore leaves the Pet root at its <h2> height, so the new assertion at lines 719–721 fails and fill-height production cards remain collapsed. Add an actual viewport-relative minimum/definite block-size before relying on the grid track to propagate it.

Useful? React with 👍 / 👎.

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Preview deployments

Host Test Results

    1 files      1 suites   2h 5m 13s ⏱️
4 674 tests 4 659 ✅ 14 💤 0 ❌ 1 🔥
4 689 runs  4 673 ✅ 14 💤 1 ❌ 1 🔥

Results for commit ebee1bf.

For more details on these errors, see this check.

Realm Server Test Results

    1 files    203 suites   1h 17m 29s ⏱️
2 653 tests 2 653 ✅ 0 💤 0 ❌
2 692 runs  2 692 ✅ 0 💤 0 ❌

Results for commit ebee1bf.

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