Default new realms to a Workspace index card#5587
Conversation
Host Test Results122 tests 122 ✅ 2m 30s ⏱️ Results for commit 675d1d1. Realm Server Test Results 1 files ±0 1 suites ±0 13m 6s ⏱️ +3s Results for commit 675d1d1. ± Comparison against earlier commit 1d5c822. |
create-realm seeds every new realm's index.json; point it at Workspace instead of CardsGrid so newly created realms open to the Workspace experience. The publish handler and prerender fast-path already recognize both cards (so a new realm still gets the prerendered default-index treatment on publish), and CardsGrid stays available for existing realms. Update the publish/unpublish tests: the default-index case now exercises Workspace, and the explicit case covers the legacy CardsGrid path so both recognized defaults stay tested. Fix software-factory comments that described the old CardsGrid default (the factory overwrites the index regardless). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
b07a65f to
4b29bc8
Compare
lukemelia
left a comment
There was a problem hiding this comment.
[Claude Code 🤖] Code review (high effort) — PR #5587
The diff itself is correct and internally consistent: the create-realm.ts adoptsFrom swap is the one behavioral change, and the realm-server publish tests were updated in step (the bespoke-index case correctly uses assert.notStrictEqual(..., true), and the publish handler's isDefaultRealmIndexAdoption already recognizes both CardsGrid and Workspace on the base branch).
The findings are about the downstream reach of flipping the default index — which is also why CI is red:
- (inline) Acceptance tests that assert the created realm's CardsGrid sidebar weren't updated —
matrix/tests/create-realm.spec.ts:35fails deterministically, and likely siblings. - (inline) Making the heavy Workspace card the default index broadens where its module graph is loaded — plausibly behind the Host Memory Baseline regression and the 'browser closed' crashes in the matrix shard.
Minor (not blocking): realm-server/tests/realm-routing-test.ts:190's comment ("The CardsGrid in index.json fires _federated-search") is now stale — the seeded index is a Workspace. The test should still pass if Workspace fires the same federated search during its prerender, but the comment should be refreshed.
CI status: Matrix Client Tests (1,3)/(3,3) + Matrix Playwright fail — create-realm.spec.ts is the deterministic, PR-caused one; Host Memory Baseline fails (see finding 2).
New realms default to a Workspace index card, so acceptance tests that assumed the CardsGrid index UI need updating: - Add data-test hooks to the Workspace card (index root + Home/Library/Activity tabs) so tests can assert against it — it had none. - showAllCards handles both index types: click CardsGrid's "All Cards" filter, or switch to the Workspace's Library tab (same live CardsGridLayout grid). - create-realm.spec asserts the created realm renders a Workspace index rather than CardsGrid's 3 filter buttons. - live-cards asserts the shared cards grid rather than the CardsGrid-only "All Cards" filter. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
[Claude Code 🤖] Migrated the matrix tests that assumed a CardsGrid index — pushed in ed3f3c1:
Two items intentionally left for you (not fixed):
I couldn't run the matrix suite locally (needs the full synapse/docker stack), so the pushed fixes are CI-verified — watch the next Matrix Client Tests run. |
The create-card flows in live-cards / skills / tools opened the chooser via CardsGrid's `[data-test-create-new-card-button]`, which the default Workspace index doesn't render. Use the operator-mode "New" button instead — its "Choose a card type..." item calls the same chooseCard(), so it opens the same card-chooser modal regardless of the realm's index card. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
[Claude Code 🤖] Update — the card-chooser coupling is fixed (1781bfe), superseding item 1 in my earlier note. The Still open:
All CI-verified on the next Matrix run. |
habdelra
left a comment
There was a problem hiding this comment.
[Claude Code 🤖] This review focused on how flipping the default realm index lands downstream — the seeding path, the recognizer it depends on, the acceptance-test migration, and the memory/render cost — since the behavioral change itself is a two-line swap.
Bottom line: the core change is correct and well-covered; no blocking correctness issue in the diff. One new latent test-flake (inline on showAllCards), plus the memory question — now the only red CI signal — still needs a confirm-benign before merge.
What lands right
- The seed swap in
create-realm.tsmatches the base recognizer exactly:isDefaultRealmIndexAdoption(handle-publish-realm.ts:62-89) accepts both CardsGrid and Workspace, so a freshly created realm still getsincludePrerenderedDefaultRealmIndexon publish.realm-index-boilerplate.tsalready speaks "CardsGrid or Workspace." Nothing on the seeding path was left assuming CardsGrid. - The publish suite is real regression coverage, not shape-only: the source realm is created through
/_create-realminbeforeEach, so the "default Workspace index" test exercises the handler default rather than a hand-seeded fixture. All three cases stay covered — default Workspace → flag set, bespokeCardDef→ flag not set (assert.notStrictEqual(..., true)), legacy CardsGrid → flag set. - The
showAllCardsLibrary path is semantically equivalent to CardsGrid's "All Cards": Workspace's defaulteverythingFilterreturns all cards exceptCards Grid/Workspaceindex instances, and every migrated caller asserts only non-index items, so the visible set matches.[data-test-cards-grid-cards]lives in the sharedcards-grid-layout.gts, so the assertion holds against either index. - The card-chooser rework is genuinely index-agnostic — the operator-mode New button → "Choose a card type…" calls the same
chooseCard()the CardsGrid+did. The matrix migration is complete; no spec still references[data-test-create-new-card-button].
Findings
- (inline,
packages/matrix/helpers/index.ts)showAllCardsswapped an auto-waiting.click()for a non-waiting.count(), so a slow index render makes it a silent no-op and the caller times out waiting for a grid that was never opened. Non-blocking, but it's a latent flake in the exact paths this change touches — see the thread for the mechanism and a one-line wait fix. - (non-blocking, needs a confirm) Making the heavier Workspace card the default index is the concern already open in the thread on
create-realm.ts. Fresh signal in its favor: Host Memory Baseline is now green on the head commit, which softens the host-side worry. What remains is the matrix "browser has been closed" crash — Matrix Client Tests (1,3) and (3,3) are the only red checks on the head commit. Worth attributing that crash from the uploaded Playwright trace (memory-driven vs. the separateregistration-with-tokenflake) before merging, since it's the last thing between this and green. - (minor, follow-up)
packages/realm-server/tests/realm-routing-test.ts— the deadlock-guard comment still reads "The CardsGrid in index.json fires_federated-search…", but the seeded default is now Workspace. The test uses a mock fixture so it still passes; the comment is just historical and reads as describing current behavior.
Recommendations
- Add the
waitForguard toshowAllCards(finding 1) so the helper can't no-op under a slow render. - Confirm the matrix "browser closed" crash is not caused by the heavier default index before merge (finding 2); Host Memory Baseline being green is reassuring but not conclusive for the matrix runner.
- Refresh the
realm-routing-test.tscomment to name Workspace (finding 3).
Generated by Claude Code
- showAllCards: .count() is point-in-time, so calling it right after a goto read 0 for both index affordances and silently no-op'd, leaving the grid unshown (live-cards:18). Wait for whichever affordance renders before branching; a bespoke index still no-ops (via a bounded waitFor). - skills: open the uploaded skill from the card grid by its id via the index-agnostic showAllCards, instead of the CardsGrid-only "Skill" type filter (data-test-filter-list-item), which the Workspace index doesn't render. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The seeded default realm index is a Workspace card, not CardsGrid; update the CS-11259 deadlock-guard comment in realm-routing-test to match. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
What
create-realm.tsseeds every new realm'sindex.json. Point it atWorkspaceinstead ofCardsGrid, so a newly created realm opens to the Workspace experience. This is the "replace CardsGrid" keystone — the card, the recognition, and the migration are only meaningful once the default flips.CardsGrid stays available for existing/bespoke realms; only the default for freshly created realms changes.
Depends on
Blast radius (audited)
The realm-server test helper
createRealmseeds its ownfileSystem, so it does not go through this handler — most realm-server tests are unaffected. Of the tests that hit the real/_create-realmendpoint:index-responsesandrealm-lifecycleseed their ownindex.json→ unaffected.realm-routing's deadlock guard uses a mock fixture, not a real create+prerender → unaffected (comment now slightly historical).publish-unpublishcreates its source realm via the endpoint and did rely on the default being CardsGrid → updated here: the default-index case now exercises Workspace, and the explicit case is repurposed to cover the legacy CardsGrid path, so both recognized defaults stay tested; the bespoke-index negative case is unchanged.Also fixed software-factory comments that described the old CardsGrid default (the factory overwrites the index regardless, so it's behavior-neutral).
Test plan
realm-server
ember-tsc, eslint, prettier clean. Not run locally — the realm-server publish/create suites need test-pg + their own prerender, which isn't wired up in this session; they run in CI. Given the default flip is behaviorally significant, CI's full realm-server + matrix suites (which create realms via/_create-realm) are the real confirmation. The publish test changes mirror the existing passing tests' structure.🤖 Generated with Claude Code