Skip to content

Unified search: error / last-known-good rendering affordances#5238

Merged
habdelra merged 2 commits into
mainfrom
cs-11440-unified-search-error-last-known-good-rendering-affordances
Jun 15, 2026
Merged

Unified search: error / last-known-good rendering affordances#5238
habdelra merged 2 commits into
mainfrom
cs-11440-unified-search-error-last-known-good-rendering-affordances

Conversation

@habdelra

Copy link
Copy Markdown
Contributor

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-entry resolves, in order:

  1. good html — render inert, hydrate lazily on interaction (unchanged);
  2. last-known-good html — an error rendering (html.attributes.isError) that still carries HTML; render it inert and non-hydratable (unchanged);
  3. live item — no usable HTML; render the live serialization (unchanged);
  4. host error componentnew: nothing renderable is left, so render SearchResultError, an inert, non-hydratable tile that surfaces the error doc.

Rung 4 fires in two cases: an item serialization carrying an error doc in meta.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 / FileMetaResourceResourceMeta gain error?: ErrorEntry — the wire field an item carries when it stands in for a card that failed to render.
  • SearchResultError — the compact, non-hydratable host error component.
  • HydratableCard takes @errorDoc and renders SearchResultError as the terminal {{else}} branch; hydratable-entry-component threads it through the curry.
  • RenderableSearchEntry.isError now also covers an item with an error doc, and exposes errorDoc. An error item is never deposited into the Store (the render-side inflate skips it, and StoreService.inflateSearchEntryItem also no-ops on meta.error).

Tests

search-results-test.gts gains 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.

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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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?: ErrorEntry to card and file-meta resource metas to carry an error document on item serializations.
  • Introduces SearchResultError and threads errorDoc through RenderableSearchEntryhydratableEntryComponentHydratableCard as 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.

Comment thread packages/runtime-common/resource-types.ts
@github-actions

github-actions Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Preview deployments

Host Test Results

    1 files      1 suites   1h 54m 6s ⏱️
3 075 tests 3 060 ✅ 15 💤 0 ❌
3 094 runs  3 079 ✅ 15 💤 0 ❌

Results for commit e38aba0.

Realm Server Test Results

    1 files      1 suites   9m 21s ⏱️
1 715 tests 1 715 ✅ 0 💤 0 ❌
1 808 runs  1 808 ✅ 0 💤 0 ❌

Results for commit e38aba0.

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>
@habdelra
habdelra requested a review from a team June 15, 2026 14:38
@habdelra
habdelra changed the base branch from cs-11437-unified-search-searchresults-component-host-consumer-v2 to main June 15, 2026 21:42
@habdelra
habdelra merged commit e49743f into main Jun 15, 2026
72 of 73 checks passed
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.

3 participants