Skip to content

Conversation

@FadhlanR
Copy link
Contributor

@FadhlanR FadhlanR commented Dec 18, 2025

Previously we have the site-config card where user can select a card instance as alternate home page in host mode. The selected site-config card is stored in hostHome property of .realm.json and is retrieved by the home-page-resolver service to redirect user to the alternate home page if it exists. In other words, in that approach the site-config card is only the data source, while the routing happens in the host. We also wanted to provide capability where user can have an alternate home page in interact submode (alternate index card). This requires implementing another config card and improving the routing in the host.

In this PR, we implemented a new approach by introducing index card. Instead of having two different config cards for alternate home page in host mode and interact submode, with index card we can store those selected cards in linksTo fields. And also the routing happens directly in this card; we just need to add new properties: mode and submode in cardContext. Based on that, the index card can determine which card to be displayed to the user.

Screen.Recording.2025-12-18.at.14.56.08.mov

@github-actions
Copy link

Preview deployments

@github-actions
Copy link

github-actions bot commented Dec 18, 2025

Host Test Results

    1 files  ±    0      1 suites  ±0   3h 45m 0s ⏱️ + 2h 10m 23s
1 832 tests +  151  1 806 ✅ +  140  14 💤 ± 0   2 ❌ + 2  10 🔥 +9 
3 616 runs  +1 921  3 566 ✅ +1 889  28 💤 +14  12 ❌ +10  10 🔥 +8 

For more details on these failures and errors, see this check.

Results for commit d97b597. ± Comparison against base commit 361de3e.

This pull request removes 23 and adds 174 tests. Note that renamed tests count towards both.
Chrome ‑ Acceptance | AI Assistant tests: defaults to anthropic/claude-sonnet-4.5 in code mode
Chrome ‑ Acceptance | AI Assistant tests: defaults to the system card default in interact mode
Chrome ‑ Acceptance | AI Assistant tests: switching back to interact mode uses the system default model
Chrome ‑ Acceptance | site config home page > host mode: host mode uses home card from site config
Chrome ‑ Acceptance | site config home page > host submode: host submode updates primary card after home page change
Chrome ‑ Acceptance | site config home page > host submode: host submode uses home card from site config
Chrome ‑ Acceptance | site config home page > set site config command > when site config file does not exist: user can create a site config via stack menu
Chrome ‑ Acceptance | site config home page > set site config command > when site config file exists: user can update existing site config via stack menu
Chrome ‑ Acceptance | site config home page > site config menu visibility: does not show menu for primary site config card
Chrome ‑ Integration | Command | host command schema generation test > command schema generation: getInputJsonSchema for SetSiteConfigCommand
…
Chrome ‑ Acceptance | AI Assistant tests: defaults to the system card default regardless of submode
Chrome ‑ Acceptance | code-submode | card playground > single realm: head format preview renders for card definitions in playground
Chrome ‑ Acceptance | index card home resolution > host mode: host mode renders hostHome
Chrome ‑ Acceptance | index card home resolution > operator submodes: host submode uses hostHome and updates after edit
Chrome ‑ Acceptance | index card home resolution > operator submodes: interact submode uses interactHome
Chrome ‑ Global error: Uncaught TypeError: Failed to fetch at http://localhost:7357/assets/chunk.32dbb4e01b179bc44043.js, line 153748  While executing test: Acceptance | operator mode tests: visiting operator mode 
Chrome ‑ Global error: Uncaught TypeError: Failed to fetch at http://localhost:7357/assets/chunk.c8072bd71b20575b0eff.js, line 153748  While executing test: Integration | card-copy: can copy multiple cards 
Chrome ‑ Integration | Command | host command schema generation test > command schema generation: getInputJsonSchema for ListingUpdateSpecsCommand
Chrome ‑ Integration | ai-assistant-panel | codeblocks: it will render diff editor
Chrome ‑ Integration | ai-assistant-panel | codeblocks: it will render diff editor for a blank file
…

♻️ This comment has been updated with latest results.

@cardstack cardstack deleted a comment from chatgpt-codex-connector bot Dec 18, 2025
@cardstack cardstack deleted a comment from chatgpt-codex-connector bot Dec 18, 2025
@FadhlanR
Copy link
Contributor Author

FadhlanR commented Dec 18, 2025

@codex review this PR

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

if (this.hostModeService.isActive) {
let normalizedPath = params.path ?? '';
let cardUrl = `${this.hostModeService.hostModeOrigin}/${normalizedPath}`;
return this.store.get(cardUrl);

P1 Badge Host-mode ignores existing hostHome configuration

In host mode the index route now simply fetches the requested path and renders that card (lines 70-74) and the former home-page-resolver lookup was removed in this commit, so .realm.json hostHome values are no longer consulted. Existing realms that previously set an alternate landing page via setHostHome will now serve the default index/card grid instead until someone manually edits the new IndexCard to include the same link, which breaks previously configured host home pages after deploy.

ℹ️ 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".

@FadhlanR FadhlanR marked this pull request as ready for review December 18, 2025 10:05
@FadhlanR FadhlanR requested review from a team, ef4 and lukemelia December 18, 2025 10:05
@cardstack cardstack deleted a comment from chatgpt-codex-connector bot Dec 18, 2025
@FadhlanR
Copy link
Contributor Author

FadhlanR commented Dec 18, 2025

💡 Codex Review

if (this.hostModeService.isActive) {
let normalizedPath = params.path ?? '';
let cardUrl = `${this.hostModeService.hostModeOrigin}/${normalizedPath}`;
return this.store.get(cardUrl);

P1 Badge Host-mode ignores existing hostHome configuration
In host mode the index route now simply fetches the requested path and renders that card (lines 70-74) and the former home-page-resolver lookup was removed in this commit, so .realm.json hostHome values are no longer consulted. Existing realms that previously set an alternate landing page via setHostHome will now serve the default index/card grid instead until someone manually edits the new IndexCard to include the same link, which breaks previously configured host home pages after deploy.

ℹ️ About Codex in GitHub

This PR tends to not backwards compatibality.

💡 Codex Review

if (this.hostModeService.isActive) {
let normalizedPath = params.path ?? '';
let cardUrl = `${this.hostModeService.hostModeOrigin}/${normalizedPath}`;
return this.store.get(cardUrl);

P1 Badge Host-mode ignores existing hostHome configuration
In host mode the index route now simply fetches the requested path and renders that card (lines 70-74) and the former home-page-resolver lookup was removed in this commit, so .realm.json hostHome values are no longer consulted. Existing realms that previously set an alternate landing page via setHostHome will now serve the default index/card grid instead until someone manually edits the new IndexCard to include the same link, which breaks previously configured host home pages after deploy.

ℹ️ About Codex in GitHub

Backward compatibility is not a priority here and legacy realms will simply revert to the standard card grid.

Copy link
Contributor

@backspace backspace left a comment

Choose a reason for hiding this comment

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

This seems like a great improvement, I was uneasy with the front-end being responsible for this work, pushing it into the index card itself is an elegant solution 🤩

Copy link
Contributor

Copilot AI left a comment

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 introduces a new IndexCard to replace the site-config card for home page resolution. Instead of storing the home page configuration in .realm.json and using a separate home-page-resolver service, the new approach uses the index card's linksTo fields (interactHome, hostHome, cardsGrid) to configure alternate home pages. The index card determines which card to display based on new mode and submode properties added to the card context.

  • Replaced site-config based routing with IndexCard-based routing that uses card context properties
  • Removed home-page-resolver service and set-site-config command, simplifying the architecture
  • Added mode/submode context properties to enable cards to render differently based on runtime context

Reviewed changes

Copilot reviewed 25 out of 25 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/base/index.gts Introduces the new IndexCard with conditional rendering based on mode/submode context
packages/base/index.json Card instance data for the base realm's index card
packages/base/cards-grid.gts Updates filter to exclude IndexCard from grid view, adds unused lodash import
packages/base/cards-grid.json New card instance for the cards grid
packages/base/card-api.gts Adds optional mode/submode properties to CardContext interface
packages/base/site-config.gts Removes the deprecated SiteConfig card implementation
packages/base/cards/site.json Removes the deprecated site config card spec
packages/host/app/templates/index.gts Passes mode and submode to card context
packages/host/app/routes/index.gts Removes beforeModel hook and home page resolution logic
packages/host/app/services/home-page-resolver.ts Removes the entire home-page-resolver service
packages/host/app/commands/set-site-config.ts Removes the command for setting site config
packages/host/app/commands/index.ts Removes registration of set-site-config command
packages/host/app/components/operator-mode/container.gts Adds mode and submode to card context
packages/host/app/components/operator-mode/host-submode.gts Removes ensureHomePageCardTask and loading state
packages/host/app/components/operator-mode/stack-item.gts Excludes index card linksTo fields from overlay actions
packages/host/app/components/operator-mode/code-submode/playground/playground-panel.gts Excludes index card linksTo fields from overlay display
packages/host/app/components/operator-mode/card-renderer-panel/index.gts Excludes index card linksTo fields from overlay display
packages/host/app/resources/element-tracker.ts Adds exclude option to filter method
packages/host/tests/acceptance/site-config-test.gts Removes old site-config tests
packages/host/tests/acceptance/index-home-test.gts Adds comprehensive tests for index card home resolution
packages/realm-server/server.ts Updates realm creation to initialize with IndexCard instead of CardsGrid
packages/realm-server/tests/server-endpoints-test.ts Updates expected index counts to reflect new index card
packages/experiments-realm/index.json Updates to use IndexCard instead of CardsGrid
packages/experiments-realm/cards-grid.json New CardsGrid card instance
packages/experiments-realm/ShoppingCart/23cf6d49-0034-474d-a68a-91143a0dd232.json Restructures JSON to move meta before attributes

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

4 participants