Render embed chooser current-target tile as a fitted card#5516
Render embed chooser current-target tile as a fitted card#5516FadhlanR wants to merge 2 commits into
Conversation
The markdown embed chooser's edit-mode current-target tile showed only a text label (filename for files, title for cards). Render the placed card/file itself in its fitted template instead — a compact Double Strip chip — reusing the existing MarkdownEmbedPreview so both cards and files render fitted and a broken preload shows the compact broken-link visual. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Preview deploymentsHost Test Results 1 files ±0 1 suites ±0 3h 5m 19s ⏱️ - 2m 42s Results for commit 069be4e. ± Comparison against earlier commit 8b16d3e. Realm Server Test Results 1 files ±0 1 suites ±0 17m 17s ⏱️ -18s Results for commit 069be4e. ± Comparison against earlier commit 8b16d3e. |
The current-target label this comment described was replaced by the fitted chip render; the arg now only feeds the pane's directive serialization. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Updates the markdown embed chooser’s edit-mode “current target” tile so it renders the placed card/file itself as a compact fitted chip (instead of a plain text label), aligning the tile behavior with the existing embed preview rendering path.
Changes:
- Replaces the current-target text label with a fixed-size (250×65) fitted
MarkdownEmbedPreviewrender, including broken-ref rendering. - Removes now-unused label/URL-relativization helpers and related import.
- Updates integration tests to assert the fitted chip rendering for resolved card + resolved file, and to assert the compact broken-link visual for broken preloads.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| packages/host/app/components/markdown-embed-chooser/tab-panel.gts | Renders the edit-mode current-target tile via MarkdownEmbedPreview in a fixed fitted footprint; removes obsolete label/relativization code; adjusts styling for the new preview element. |
| packages/host/tests/integration/components/markdown-embed-chooser-modal-test.gts | Updates broken-preload assertions for the tile and adds coverage for resolved card/file current-target chips rendering in fitted format. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // The current-target tile renders the placed card/file as a compact fitted | ||
| // chip — a fixed Double Strip (250×65), independent of the format the user | ||
| // picks for the actual embed in the preview pane. It's an identity marker for | ||
| // "what's placed here now", not the embed being configured. | ||
| private get currentTileSize(): BfmSizeSpec { | ||
| return { format: 'fitted', width: 250, height: 65 }; | ||
| } |
| <MarkdownEmbedPreview | ||
| class='markdown-embed-chooser-tab-panel__current-preview' | ||
| @target={{this.selectedTarget}} | ||
| @format='fitted' | ||
| @sizeSpec={{this.currentTileSize}} |
| /* The fitted chip carries its own fixed footprint; keep it from | ||
| stretching to the centered column's cross axis. */ | ||
| .markdown-embed-chooser-tab-panel__current-preview { | ||
| flex: 0 0 auto; | ||
| } |
Summary
In the markdown embed chooser's edit mode, the current-target tile (above the Replace / Remove buttons) showed only a text label — the filename for files, the card title for cards. Per the design, it should render the placed card/file itself in its fitted template — a compact "Double Strip" chip (thumbnail + title).
This replaces the text label with the resolved target rendered fitted, reusing the existing
MarkdownEmbedPreviewcomponent. Both cards and files render through the same fitted path, and a broken/unresolvable preload shows the compact broken-link visual in the tile. The tile's fitted size is fixed (it's an identity chip); the format dropdown on the right still drives the larger preview pane independently.Resolves CS-12110. The ticket originally proposed showing the name plus a relativized URL; the design instead calls for the fitted card render, which is what this implements.
Changes
packages/host/app/components/markdown-embed-chooser/tab-panel.gts— drop thecurrentTargetLabel/toDisplayUrltext-label getters (and the now-unusedmaybeRelativeReferenceimport); renderMarkdownEmbedPreviewat a fixed fitted 250×65 with the tile's existing broken-ref args.packages/host/tests/integration/components/markdown-embed-chooser-modal-test.gts— the broken-ref test now asserts the compact broken visual in the tile; new tests cover a resolved card and a resolved file each rendering fitted.Testing
markdown-embed-chooser-modal(14),codemirror embed toolbar(8), and themarkdown embed chooseracceptance suite (4) all pass headless against the realm stack.lint:types, eslint, and template-lint are clean.Before
After