Skip to content

Migrate experiments-realm card source to the v2 search surface#5290

Open
habdelra wants to merge 3 commits into
mainfrom
worktree-cs-11587-codemod-sweep
Open

Migrate experiments-realm card source to the v2 search surface#5290
habdelra wants to merge 3 commits into
mainfrom
worktree-cs-11587-codemod-sweep

Conversation

@habdelra

Copy link
Copy Markdown
Contributor

Runs the @context search 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.prerenderedCardSearchComponent and onto the v2 @context.searchResultsComponent (<SearchResults>) surface.

Only experiments-realm carries prerendered-card-search usages. base declares the (deprecated) @context member itself — left in place for the later cleanup — and catalog / skills-realm have none.

Codemod-migrated

  • components/grid.gts — the v1 query is adapted through searchEntryWireQueryFromQuery, <:response> becomes {{#each results.entries}}, and rows are addressed by id.

Hand-migrated (shapes the codemod can't transform mechanically)

  • components/card-list.gts — its loop yields each row to a :meta block instead of a direct {{#each}}. 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 instead of being iterated directly. Both now take RenderableSearchEntryLike[] and address rows by id.
  • blog-app.gts — its CardList :meta consumer reads the yielded row's id.

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

  • Every changed .gts transpiles through the realm's own gjsToPlaceholderJS + babel lowering — the path that indexes and serves card source.
  • ember-template-lint passes.
  • The codemod is idempotent: a second run is a no-op.
  • The migrated surface matches the v2 pattern already shipped in base/components/card-list.gts.

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>

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

Comment thread packages/experiments-realm/components/card-list.gts

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 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 prerenderedCardSearchComponent usage with searchResultsComponent and iterate results.entries keyed by id.
  • Introduce searchResultsQuery getters that adapt legacy Query via searchEntryWireQueryFromQuery, including v2 htmlQuery binding for embedded format where needed.
  • Update downstream consumers (e.g. blog admin meta) to use card.id instead of card.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.

Comment thread packages/experiments-realm/app-card.gts Outdated
Comment thread packages/experiments-realm/components/grid.gts
Comment thread packages/experiments-realm/components/card-list.gts
habdelra and others added 2 commits June 19, 2026 10:04
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>
@habdelra habdelra requested a review from a team June 19, 2026 14:18
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