Migrate experiments-realm card source to the v2 search surface#5290
Migrate experiments-realm card source to the v2 search surface#5290habdelra wants to merge 3 commits into
Conversation
Move the first-party realm card source off the deprecated
`@context.prerenderedCardSearchComponent` and onto the v2
`@context.searchResultsComponent` (`<SearchResults>`) surface, via the
`@context` search codemod plus hand-fixes for the shapes it cannot
transform mechanically.
Only experiments-realm carries prerendered-card-search usages: base
declares the (deprecated) `@context` member itself, and catalog /
skills-realm have none.
- components/grid.gts — codemod-migrated: the query is adapted through
`searchEntryWireQueryFromQuery`, `<:response>` becomes
`{{#each results.entries}}`, and rows are addressed by `id`.
- components/card-list.gts — its loop yields each row to a `:meta` block,
so it has no direct `{{#each}}` the codemod can reshape. The block now
yields a `RenderableSearchEntryLike`; the `embedded` format is bound
through the query's `htmlQuery` field.
- app-card.gts — the result list is handed to the local `TableView` /
`CardsGrid` components, so it is not a direct `{{#each}}` either. Those
components now take `RenderableSearchEntryLike[]` and address rows by
`id`.
- blog-app.gts — its `CardList` `:meta` consumer reads the yielded row's
`id`.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 95bd7af844
ℹ️ 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".
There was a problem hiding this comment.
Pull request overview
This PR migrates experiments-realm card source off the deprecated @context.prerenderedCardSearchComponent surface and onto the v2 @context.searchResultsComponent (<SearchResults>) surface, adapting v1 Query inputs to the v2 SearchEntryWireQuery shape and updating consumers to use v2 row identities (id).
Changes:
- Replace
prerenderedCardSearchComponentusage withsearchResultsComponentand iterateresults.entrieskeyed byid. - Introduce
searchResultsQuerygetters that adapt legacyQueryviasearchEntryWireQueryFromQuery, including v2htmlQuerybinding for embedded format where needed. - Update downstream consumers (e.g. blog admin meta) to use
card.idinstead ofcard.url.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| packages/experiments-realm/components/grid.gts | Migrates grid rendering to v2 search results and adapts incoming query to SearchEntryWireQuery. |
| packages/experiments-realm/components/card-list.gts | Migrates card list to v2 search results, updates yielded row type to RenderableSearchEntryLike, and binds embedded format via htmlQuery. |
| packages/experiments-realm/blog-app.gts | Updates CardList meta consumer to use v2 row identity (card.id). |
| packages/experiments-realm/app-card.gts | Migrates the app card’s internal search rendering to v2 results and updates row identity usage from url to id. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Gate the table/grid on results.entries.length so the loading state and an empty children render (CardsGrid's "No cards available") aren't shown at the same time during the initial load; show the loading affordance only while the first results are still empty. Stale entries continue to render during a live re-fetch. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Rename the local component alias from PrerenderedCardSearch to SearchResults so it reflects the v2 `@context.searchResultsComponent` surface it now points at, rather than the deprecated v1 name. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Runs the
@contextsearch codemod across the first-party realms (base, experiments, catalog, skills) and hand-fixes the usages it can't transform mechanically, moving experiments-realm card source off the deprecated@context.prerenderedCardSearchComponentand onto the v2@context.searchResultsComponent(<SearchResults>) surface.Only experiments-realm carries prerendered-card-search usages.
basedeclares the (deprecated)@contextmember itself — left in place for the later cleanup — andcatalog/skills-realmhave none.Codemod-migrated
components/grid.gts— the v1 query is adapted throughsearchEntryWireQueryFromQuery,<:response>becomes{{#each results.entries}}, and rows are addressed byid.Hand-migrated (shapes the codemod can't transform mechanically)
components/card-list.gts— its loop yields each row to a:metablock instead of a direct{{#each}}. The block now yields aRenderableSearchEntryLike; theembeddedformat is bound through the query'shtmlQueryfield.app-card.gts— the result list is handed to the localTableView/CardsGridcomponents instead of being iterated directly. Both now takeRenderableSearchEntryLike[]and address rows byid.blog-app.gts— itsCardList:metaconsumer reads the yielded row'sid.Hydration mode is left at the codemod default (
hover): rows paint inert prerendered HTML at rest — identical to the prior behavior — and hydrate to a live card on hover.Verification
.gtstranspiles through the realm's owngjsToPlaceholderJS+ babel lowering — the path that indexes and serves card source.ember-template-lintpasses.base/components/card-list.gts.