Render BFM embeds across the full format × placement matrix#5603
Open
FadhlanR wants to merge 1 commit into
Open
Render BFM embeds across the full format × placement matrix#5603FadhlanR wants to merge 1 commit into
FadhlanR wants to merge 1 commit into
Conversation
Embedding a card or file in a markdown field only rendered correctly for
the default format+placement combos. `isolated` collapsed to nothing (its
default template lays out at height: 100%), inline `embedded` collapsed in
a shrink-wrapping inline-block, and non-default combos were unverified.
Add a shared `bfmResolvedEmbedStyle(format, kind, fittedSizeStyle)` helper
that hands every non-atom resolved embed a definite footprint so it can no
longer collapse: inline embedded 16rem×9.375rem, inline isolated
24rem×18.75rem, block isolated a growable `min-height: 18.75rem`, and fitted
its requested dimensions plus `overflow: hidden`. Apply it in all four
render surfaces — the saved MarkdownTemplate, the operator-mode preview
panel, the CodeMirror source editor, and the embed chooser preview (which
previously carried its own copy of this logic) — so footprints stay in
lockstep everywhere.
Plain `MarkdownField` (a StringField) has no relationship to resolve embeds,
so its directives stay unresolved by design; documented at the class.
Cover the full card and file × {atom, embedded, fitted, isolated} ×
{inline, block} matrix on the saved render path, plus a unit test for the
helper and updated CodeMirror-editor footprint assertions.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Preview deploymentsHost Test Results 1 files 1 suites 3h 2m 8s ⏱️ Results for commit e716096. For more details on these errors, see this check. Realm Server Test Results 1 files 1 suites 13m 48s ⏱️ Results for commit e716096. |
FadhlanR
marked this pull request as ready for review
July 24, 2026 13:05
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.
Summary
Embedding a card or file in a markdown field only rendered correctly for the default format+placement combos. Notably
isolateddisplayed nothing in either placement, inlineembeddedcollapsed, and several other combos were unverified.Root cause: across every render surface, a resolved embed slot was only given a sizing style when
format === 'fitted'. Theisolatedand inlineembeddeddefault templates lay out atwidth/height: 100%, which resolves against a shrink-wrapping inline-block (or an unbounded block) and collapses to zero — the instance was in the DOM but invisible.Change
bfmResolvedEmbedStyle(format, kind, fittedSizeStyle)inpackages/runtime-common/bfm-card-references.tshands every non-atom resolved embed a definite footprint:embedded→16rem × 9.375remisolated→24rem × 18.75remisolated→ growablemin-height: 18.75remfitted→ its requested dimensions +overflow: hiddenpackages/base/default-templates/markdown.gts(saved / isolated / embedded-nested)packages/host/app/components/operator-mode/preview-panel/rendered-markdown.gts(preview panel)packages/host/app/lib/codemirror-context.ts(CodeMirror source editor)packages/host/app/components/markdown-embed-chooser/preview/index.gts(chooser preview)MarkdownField(aStringField) has no relationship to resolve embeds, so its directives stay unresolved by design — documented at the class.Matrix now covered
For card and file, each of
atom/embedded/fitted/isolated, in both inline and block placement (16 combinations).Tests
bfmResolvedEmbedStyle.MarkdownTemplaterender path + isolated/embedded footprint assertions (rich-markdown-field-test.gts).markdown-file-def-test.gts).codemirror-editor-test.gts).Verification
ember-tsc(glint) + eslint clean on all changed files. Verified live in the dev stack againstexperiments/bfm-showcase.md: blockisolatednow renders the full Author card (name/title/quote/portrait) instead of nothing; inline atom, block embedded, all fitted variants (strip / double-wide-strip / tile / compact-card), and file embeds (inline atom + block embedded image) all render correctly.🤖 Generated with Claude Code