Change search hydration to support prefix RRIs#5441
Conversation
Preview deploymentsHost Test Results 1 files ± 0 1 suites ±0 2h 52m 41s ⏱️ + 10m 26s Results for commit 46f6eed. ± Comparison against earlier commit 4fb30c2. Realm Server Test Results 1 files ± 0 1 suites ±0 11m 23s ⏱️ -32s Results for commit 46f6eed. ± Comparison against earlier commit 4fb30c2. |
aa4d269 to
4fb30c2
Compare
…(CS-11734) Instance and file-meta GET responses arrive with canonical ids (RRI prefix form for mapped realms, via the realm server's boundary serialization), but search item resources hydrate with the index's URL-form ids — so an instance's id spelling depended on which path loaded it. The base MarkDownTemplate keys its pill slots by card.id and looks up by the RRI-resolved reference, so search-hydrated cards in mapped realms never matched their pill and the reference rendered unresolved. Unresolve the id once at the search-hydration boundary so both load paths agree. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ealm Covers the whole reference chain the RRI migration converges on: markdown extracts the ref in RRI space, the query-backed linkedCards field searches by it, the search-hydrated instance id is canonical, and the pill slot matches — so the referenced card's atom renders. Guards the two regressions that each individually broke this: the client filter matcher dropping URL-form ids against RRI filter values, and search-hydrated ids disagreeing with the RRI-resolved slot key. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…CS-11739) The CardStore interface exposed the VirtualNetwork object itself; its one remaining consumer, resolveInstanceURL, only ever needed a resolved URL. Replace the member with resolveURL(reference, base): stores expose URL-resolution capability — never the network — so card code can satisfy real-URL boundaries (<img src>, new URL()) without holding realm mappings. Each store keeps its VirtualNetwork private, used only by its loadCardDocument / loadFileMetaDocument fetch boundary and the resolveURL implementation. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
4fb30c2 to
46f6eed
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates the Card API’s store boundary so card code can resolve references to fetchable URLs without being handed the VirtualNetwork object, and adjusts host-side search hydration so cards hydrated via _search use canonical (prefix/RRI) instance ids. This supports correct Rich Markdown “pill” rendering in prefix-mapped realms by keeping instance identity stable regardless of hydration path.
Changes:
- Replace
CardStore.virtualNetworkwithCardStore.resolveURL(reference, base?)and update store implementations/wrappers accordingly. - Canonicalize
_search-hydrated resource ids in the host store to prefix/RRI form viavirtualNetwork.unresolveURL(...). - Add an integration test that exercises Rich Markdown card-ref pills in a prefix-mapped realm end-to-end.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/base/card-api.gts | Changes the CardStore interface to expose resolveURL() instead of virtualNetwork, and updates resolveInstanceURL + fallback store behavior. |
| packages/host/app/services/store.ts | Canonicalizes _search-hydrated resource ids to prefix/RRI form during hydration to keep identity consistent. |
| packages/host/app/services/render-service.ts | Updates CardStoreWithErrors to implement the new resolveURL() boundary. |
| packages/host/app/lib/gc-card-store.ts | Updates CardStoreWithGarbageCollection to implement the new resolveURL() boundary. |
| packages/host/tests/integration/field-configuration-test.gts | Updates the test CardStore stub to match the new resolveURL() interface. |
| packages/host/tests/integration/components/rich-markdown-field-test.gts | Adds an integration test covering relative :card[...] refs in a prefix-mapped realm and verifies pill rendering. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This is the last virtual network use in card API related to Markdown pills.