-
Notifications
You must be signed in to change notification settings - Fork 12
Introduce index card #3738
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Introduce index card #3738
Conversation
Preview deployments |
Host Test Results 1 files ± 0 1 suites ±0 3h 45m 0s ⏱️ + 2h 10m 23s 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.♻️ This comment has been updated with latest results. |
|
@codex review this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
boxel/packages/host/app/routes/index.gts
Lines 70 to 74 in 60fc95e
| if (this.hostModeService.isActive) { | |
| let normalizedPath = params.path ?? ''; | |
| let cardUrl = `${this.hostModeService.hostModeOrigin}/${normalizedPath}`; | |
| return this.store.get(cardUrl); |
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".
This PR tends to not backwards compatibality.
Backward compatibility is not a priority here and legacy realms will simply revert to the standard card grid. |
backspace
left a comment
There was a problem hiding this 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 🤩
There was a problem hiding this 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.
Previously we have the
site-configcard where user can select a card instance as alternate home page in host mode. The selectedsite-configcard is stored inhostHomeproperty of.realm.jsonand is retrieved by thehome-page-resolverservice 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