Remove VirtualNetwork from other Markdown pill rendering#5393
Remove VirtualNetwork from other Markdown pill rendering#5393backspace wants to merge 2 commits into
Conversation
abac808 to
934330c
Compare
29cab01 to
c26ecaa
Compare
Preview deploymentsHost Test Results 1 files ± 0 1 suites ±0 2h 21m 41s ⏱️ - 14m 1s Results for commit e05e909. ± Comparison against earlier commit 1dba7a9. For more details on these errors, see this check. Realm Server Test Results 1 files 1 suites 9m 17s ⏱️ Results for commit 7d1d02a. |
31954c1 to
4c54bad
Compare
06a075b to
12ca4b7
Compare
4c54bad to
b3c2d8a
Compare
With the realm serving instance ids in canonical form (CS-11458), card.id / file.id are canonical, so the base MarkdownTemplate can resolve BFM reference slots in RRI space (resolveRRIReference) and match its loaded-instance map keys without a VirtualNetwork. Drops rich-markdown's per-component virtualNetwork getter and the @cardReferenceVirtualNetwork thread, simplifies baseUrl to the canonical id as-is (no toURL), and removes the last virtualNetworkFor consumer in the markdown display path. Stacked on the CS-11458 serve change; not valid without it. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
b3c2d8a to
1dba7a9
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1dba7a99b4
ℹ️ 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".
| // Instance ids are canonical (prefix form for mapped realms, URL for | ||
| // unmapped), so the reference base is the id as-is — no VirtualNetwork. | ||
| return typeof rel === 'string' ? rel : rel.href; |
There was a problem hiding this comment.
Preserve relative refs in compose live preview
When this edit-view baseUrl is a prefix-form RRI (the case this change is targeting), CodeMirrorEditor still resolves widget targets with its old resolveUrl helper, which only handles prefix bases when @cardReferenceVirtualNetwork is provided (packages/base/codemirror-editor.gts:101-121, 855-864). Since this caller no longer passes the virtual network and now returns @scope/realm/... as-is, a relative embed such as :card[./Pet/mango] falls through to the catch path as the raw ./Pet/mango; the compose-mode getCards in:{id} query then cannot find the referenced card, so live preview shows unresolved widgets even though the preview/isolated MarkdownTemplate path resolves correctly. Either keep passing the VN here or update CodeMirrorEditor to use the same RRI resolver before dropping the prop.
Useful? React with 👍 / 👎.
The RichMarkdownField edit view stopped passing @cardReferenceVirtualNetwork
and now hands CodeMirrorEditor a prefix-form RRI base, but CodeMirrorEditor's
resolveUrl still used new URL(raw, baseUrl) without a VN — which throws on a
prefix base, so a relative embed like :card[./Pet/mango] fell through to the
raw ref. The compose-mode getCards in:{id} query then matched nothing and the
live preview showed unresolved widgets (the isolated/display MarkDownTemplate
path already resolved correctly).
Resolve refs in RRI space via resolveRRIReference, matching the MarkDownTemplate
path: a prefix base yields RRI, a URL base yields URL, and either matches the
indexed card since in:{id} expands prefix ids to their URL forms index-side.
Drops the now-unused cardReferenceVirtualNetwork prop.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Based on #5390.