Skip to content

Remove VirtualNetwork from other Markdown pill rendering#5393

Open
backspace wants to merge 2 commits into
server-endpoint-rris-cs-11458from
instance-id-rri-cs-11734
Open

Remove VirtualNetwork from other Markdown pill rendering#5393
backspace wants to merge 2 commits into
server-endpoint-rris-cs-11458from
instance-id-rri-cs-11734

Conversation

@backspace

Copy link
Copy Markdown
Contributor

Based on #5390.

@backspace backspace force-pushed the server-endpoint-rris-cs-11458 branch from abac808 to 934330c Compare July 3, 2026 00:23
@backspace backspace force-pushed the instance-id-rri-cs-11734 branch from 29cab01 to c26ecaa Compare July 3, 2026 00:23
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Preview deployments

Host Test Results

    1 files  ±  0      1 suites  ±0   2h 21m 41s ⏱️ - 14m 1s
3 209 tests  - 168  3 195 ✅  - 167  13 💤  - 2  0 ❌ ±0  1 🔥 +1 
3 227 runs   - 169  3 212 ✅  - 169  13 💤  - 2  1 ❌ +1  1 🔥 +1 

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 ⏱️
1 674 tests 1 674 ✅ 0 💤 0 ❌
1 753 runs  1 753 ✅ 0 💤 0 ❌

Results for commit 7d1d02a.

@backspace backspace force-pushed the instance-id-rri-cs-11734 branch 4 times, most recently from 31954c1 to 4c54bad Compare July 3, 2026 19:41
@backspace backspace force-pushed the server-endpoint-rris-cs-11458 branch from 06a075b to 12ca4b7 Compare July 3, 2026 20:01
@backspace backspace force-pushed the instance-id-rri-cs-11734 branch from 4c54bad to b3c2d8a Compare July 3, 2026 20:01
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>
@backspace backspace force-pushed the instance-id-rri-cs-11734 branch from b3c2d8a to 1dba7a9 Compare July 3, 2026 21:23
@backspace backspace marked this pull request as ready for review July 3, 2026 22:16

@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: 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".

Comment on lines +186 to +188
// 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;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

addressed in e05e909

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>
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