Unified search: error / last-known-good rendering affordances#5238
Merged
habdelra merged 2 commits intoJun 15, 2026
Merged
Conversation
Extend the v2 <SearchResults> consumer with the terminal error rung of the per-result resolution chain: prefer good html, else last-known-good html (inert, non-hydratable), else the live item, else the host error component. - add `error?: ErrorEntry` to the item meta wire types — the doc an item carries when it stands in for a card that failed to render - add SearchResultError, the inert, non-hydratable host error component - HydratableCard renders it as the terminal fallback branch; thread @Errordoc through the entry curry - RenderableSearchEntry.isError now covers an error-doc item and exposes the doc; an error item is never deposited into the Store (the render-side inflate skips it, and inflateSearchEntryItem no-ops on meta.error) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the v2 <SearchResults> host consumer to handle the terminal “error” rung of the per-result resolution chain, rendering a non-hydratable error tile when neither usable HTML nor a renderable live item is available.
Changes:
- Adds
meta.error?: ErrorEntryto card and file-meta resource metas to carry an error document onitemserializations. - Introduces
SearchResultErrorand threadserrorDocthroughRenderableSearchEntry→hydratableEntryComponent→HydratableCardas the terminal fallback branch. - Ensures error items are never inflated into the Store (both via render-side inflate skip and a StoreService guard), and adds integration tests for the new rung.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/runtime-common/resource-types.ts | Adds meta.error?: ErrorEntry to card/file-meta metas so error docs can ride on item serializations. |
| packages/host/app/components/card-search/search-result-error.gts | Adds the inert, non-hydratable error-tile component used as the terminal rendering branch. |
| packages/host/app/components/card-search/hydratable-card.gts | Adds a terminal {{else if @isError}} branch to render SearchResultError when nothing else is renderable. |
| packages/host/app/lib/hydratable-entry-component.ts | Threads @errorDoc through the curried entry component into HydratableCard. |
| packages/host/app/components/card-search/search-results.gts | Extends RenderableSearchEntry error detection to include item.meta.error, exposes errorDoc, and skips inflating error items. |
| packages/host/app/services/store.ts | Prevents inflating search-entry items that carry meta.error. |
| packages/host/tests/integration/components/search-results-test.gts | Adds coverage for error-item and bare-error-rendering fall-through to the host error component and “never hydrate / never store” behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
ErrorEntry wraps SerializedError and belongs beside it in error.ts. Moving it there lets resource-types.ts import it from error.ts directly instead of from the index barrel, so a foundational type module no longer depends on the barrel. index.ts re-exports it, so package consumers are unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
lukemelia
approved these changes
Jun 15, 2026
habdelra
changed the base branch from
cs-11437-unified-search-searchresults-component-host-consumer-v2
to
main
June 15, 2026 21:42
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.
Extends the v2
<SearchResults>consumer with the error rung of the per-result resolution chain. Phase 1 of the unified-search project. Additive — it adds a terminal rendering branch and changes no existing behavior. Stacked on #5237.The resolution chain
Each
search-entryresolves, in order:html— render inert, hydrate lazily on interaction (unchanged);html— an error rendering (html.attributes.isError) that still carries HTML; render it inert and non-hydratable (unchanged);item— no usable HTML; render the live serialization (unchanged);SearchResultError, an inert, non-hydratable tile that surfaces the error doc.Rung 4 fires in two cases: an
itemserialization carrying an error doc inmeta.error(the live item can't render), or an error rendering with no last-known-good HTML and no item. The component shows the error doc's title/message, or a generic message when no doc rode along.What changed
CardResourceMeta/FileMetaResourceResourceMetagainerror?: ErrorEntry— the wire field anitemcarries when it stands in for a card that failed to render.SearchResultError— the compact, non-hydratable host error component.HydratableCardtakes@errorDocand rendersSearchResultErroras the terminal{{else}}branch;hydratable-entry-componentthreads it through the curry.RenderableSearchEntry.isErrornow also covers an item with an error doc, and exposeserrorDoc. An error item is never deposited into the Store (the render-side inflate skips it, andStoreService.inflateSearchEntryItemalso no-ops onmeta.error).Tests
search-results-test.gtsgains coverage for each rung — good html (existing), last-known-good inert + non-hydratable (existing), live-item fallback (existing), and the host error component (new): an error item renders the tile, surfaces its message, never hydrates, and never enters the Store; a bare error rendering with no last-known-good HTML shows the generic message.