RichMarkdown playground, card-embedding tests, and unresolved card reference UX#4362
Merged
RichMarkdown playground, card-embedding tests, and unresolved card reference UX#4362
Conversation
…ding Add a playground card in the experiments realm exercising the RichMarkdown field (standard markdown, GFM alerts, card references, math, mermaid, tables, code blocks, footnotes). Add two integration tests covering the full card-in-markdown rendering pipeline: one with absolute URLs and one with relative paths, both verifying that referenced cards actually render inside the markdown (not just that placeholders exist). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Preview deployments |
Unresolved :card[URL] and ::card[URL] references now show a muted Pill with a broken-link icon and the card type name instead of raw URL text. A CSS shimmer animation displays while linkedCards is still loading. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…states Merge resolved and unresolved slots into a single RenderSlot array to eliminate dual #in-element race. Add deferred setTimeout fallback for _modifierHasRun so in-app navigation correctly transitions from loading shimmer to error Pill. Remove vestigial el.firstChild.remove() calls that broke Glimmer text node markers. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…en Pills - Replace setTimeout(0) fallback with linkedCards.length > 0 check to avoid flashing broken Pills before cards resolve on fresh page load - Fix LinkOffIcon @width/@height to plain HTML attributes (TS2554) - Fix store.get<BaseDef> to untyped + as BaseDef cast (TS2344/TS2749) - Fix cardTypeName to filter '.' segments from relative paths like './Foo' - Add link-off icon to realm-indexing-test expected card references - Use MutationObserver in loading shimmer test for better regression detection Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves the RichMarkdown/BFM card-reference experience by adding a playground card, expanding coverage around card embedding/link resolution, and introducing a clearer unresolved-reference UI (loading shimmer → muted “broken link” Pill).
Changes:
- Add
cardTypeName()helper + shared tests, and wire those into realm-server’s test runner. - Update the base markdown template to render unresolved card refs as shimmer/loading placeholders and “not found” Pills (with LinkOff icon + type label).
- Add host integration/acceptance tests for inline/block embedding, relative references, and unresolved UX; add an experiments-realm playground card + sample content.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/runtime-common/tests/bfm-card-references-test.ts | Shared tests for cardTypeName() behavior. |
| packages/runtime-common/bfm-card-references.ts | Introduces cardTypeName() utility used by unresolved-ref UI. |
| packages/realm-server/tests/index.ts | Registers the new shared-test wrapper for realm-server runs. |
| packages/realm-server/tests/bfm-card-references-test.ts | Runs runtime-common shared tests in realm-server QUnit suite. |
| packages/host/tests/integration/realm-indexing-test.gts | Adds link-off icon to the integration test allowlist. |
| packages/host/tests/integration/components/rich-markdown-field-test.gts | Adds integration coverage for resolved/unresolved refs + loading transition behavior. |
| packages/host/tests/acceptance/markdown-file-def-test.gts | Updates acceptance expectations to assert new unresolved Pill UI. |
| packages/experiments-realm/rich-markdown-playground.gts | Adds a playground card for manual BFM/RichMarkdown testing. |
| packages/experiments-realm/rich-markdown-playground-1.json | Adds seeded playground content showcasing many markdown features. |
| packages/base/default-templates/markdown.gts | Implements shimmer loading + unresolved Pill rendering for card references. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
backspace
approved these changes
Apr 9, 2026
Contributor
backspace
left a comment
There was a problem hiding this comment.
I ran this locally, all worked as described
Parse absolute URLs via new URL() in cardTypeName to correctly handle query strings, fragments, and URLs without an id segment. Filter out ".." segments for relative paths. Fix missing space in playground title. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
Unresolved card reference UX
When a
:card[URL]or::card[URL]reference can't be resolved, it now shows a styled Pill indicator instead of raw URL text::emptypseudo-class, no JS needed)Test plan
cardTypeNameutility (realm-server test runner):card[...]refs, verify shimmer → resolved card or Pill🤖 Generated with Claude Code
Screen.Recording.2026-04-08.at.7.08.58.PM.mov