PR_26171_ALPHA_047-game-hub-canonical-path-journey-handoff#32
Conversation
e7cabc3 to
0f87505
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 53669d221d
ℹ️ 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".
| const gameId = String(game?.id || "").trim(); | ||
| return !gameId || gameId === GAME_JOURNEY_ROUTE_GAME_ALIAS | ||
| ? GAME_JOURNEY_KEYS.game | ||
| : `game-hub:${gameId}`; |
There was a problem hiding this comment.
Scope recommended targets to the active game
When a non-demo Game Hub project is opened in Game Journey, this new game-hub:<id> key is used when updateRecommendedTarget creates the item, but findRecommendedTargetItem still only reads items whose gameKey is GAME_JOURNEY_KEYS.game. As a result, saving a recommended target for any source-linked/new Game Hub project returns the old default value and each save creates another hidden duplicate instead of updating the saved value.
Useful? React with 👍 / 👎.
| if (gameId) { | ||
| routeForcesNoActiveGame = false; | ||
| repository.openGame(gameId); |
There was a problem hiding this comment.
Seed source notes for active-game navigation
When a source-linked Game Hub project is already active and the creator opens Game Journey from the header/global Toolbox link without a ?game= parameter, this block is skipped, so repository.openGame() never runs and the source idea notes are never converted into Journey rows. The page still shows the active project via routedActiveGame(), but the required Source Idea items are missing unless the user entered through the Game Hub button that appends the query string.
Useful? React with 👍 / 👎.
| return []; | ||
| } | ||
|
|
||
| const ownerKey = safeCurrentUserKey(); |
There was a problem hiding this comment.
Avoid owning source handoff notes by the first opener
When a source-linked project is opened in Journey by a guest or a different collaborator before the project owner, safeCurrentUserKey() makes the generated Source Idea note owned by that opener (or the system user). Since notes are only listed for their owner/admin and the slug now exists, the actual project owner can later see no Source Idea handoff note and no replacement is created; use the project owner or shared visibility instead of the current opener.
Useful? React with 👍 / 👎.
| }, | ||
| { | ||
| "id": "game-workspace", | ||
| "id": "game-hub", |
There was a problem hiding this comment.
Preserve legacy Game Hub votes
When upgrading an environment that already has toolbox_votes rows for the old game-workspace tool id, changing the registry id to game-hub makes the vote snapshot count only rows whose toolId is game-hub, so all existing Game Hub votes disappear and users can cast a second vote under the new id. Add a migration/alias for game-workspace vote rows before switching the canonical id.
Useful? React with 👍 / 👎.
| "requires": [ | ||
| "game-workspace" | ||
| "game-hub" | ||
| ], |
There was a problem hiding this comment.
Sync renamed planning dependencies
When an existing database already has toolbox_tool_planning rows, the runtime preserves each row's existing requires array and only source-syncs progressChecklist, so Game Journey/Game Design/Tags planning rows can continue to require the retired game-workspace id even though the active registry now requires game-hub. This leaves registry snapshots and dependency gates pointing at a filtered-out tool after the rename.
Useful? React with 👍 / 👎.
cdf9741 to
9514b00
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9514b0053d
ℹ️ 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".
| await page.evaluate(() => { | ||
| const source = document.querySelector("[data-toolbox-votes-tool-id='build-game']"); | ||
| const target = document.querySelector("[data-toolbox-votes-tool-id='game-workspace']"); | ||
| const target = document.querySelector("[data-toolbox-votes-tool-id='game-hub']"); |
There was a problem hiding this comment.
Update the earlier Game Hub route assertions
This selector was updated to the new game-hub id, but the same ToolboxRoutePages.spec.mjs test still asserts the old /toolbox/game-workspace/index.html link and the old 16/44 tool counts earlier in the flow. With the registry now exposing only the canonical game-hub row, this spec fails before it reaches the updated drag/drop selector, so the route/count expectations in this test need to be updated together.
Useful? React with 👍 / 👎.
| const gameId = params.get("game"); | ||
| if (gameId === "none") { | ||
| repository.clearActiveGame(); | ||
| routeForcesNoActiveGame = true; |
There was a problem hiding this comment.
Gate no-active routes before repository writes
When ?game=none is used, this now leaves the repository's active game in place and only masks routedActiveGame()/routedNotes(). Other game-scoped paths still call the repository directly (for example recent activity and recommended-target inputs), so an authenticated user on the “No active game” route can still see/write the hidden active game’s Journey data despite the page saying editing is disabled.
Useful? React with 👍 / 👎.
| "path": "game-hub", | ||
| "folderName": "game-hub", | ||
| "entryPoint": "game-hub/index.html", |
There was a problem hiding this comment.
Preserve the old Game Workspace route
Changing the registry path here is correct for the new canonical route, but the diff also deletes toolbox/game-workspace/index.html and I found no remaining redirect/stub for that URL. Existing bookmarks or links to the previously active Game Hub page now 404 instead of forwarding to /toolbox/game-hub/index.html; keep the new route canonical, but leave the retired route as a non-active redirect/compat page.
Useful? React with 👍 / 👎.
9514b00 to
1cc7838
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1cc7838760
ℹ️ 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".
| if (isLegacyGameWorkspaceToolId(normalizedToolKey(rows[index]))) { | ||
| rows.splice(index, 1); |
There was a problem hiding this comment.
Preserve legacy Game Hub metadata before deleting it
When upgrading a database that already has the Game Hub metadata row under the old game-workspace key, this splice drops that row before the sync can reuse its non-source-controlled fields. Any admin-maintained metadata such as Toolbox vote order/group is then reset to the new game-hub registry defaults, unlike other tools whose existing rows are normalized in place; migrate/re-key the legacy row instead of discarding it.
Useful? React with 👍 / 👎.
Summary
toolbox/game-workspace/totoolbox/game-hub/, including active scripts, route metadata, navigation, tests, and creator-facing labels.Team Alpha Approval
PR_26171_ALPHA_047-game-hub-canonical-path-journey-handoff.Validation
node --check toolbox/game-hub/game-hub.jsnode --check toolbox/game-hub/game-hub-api-client.jsnode --check toolbox/idea-board/index.jsnode --check toolbox/game-journey/game-journey.jsnode --check src/dev-runtime/persistence/tool-repositories/game-journey-mock-repository.jsnode --check src/dev-runtime/server/local-api-router.mjsnpm run test:workspace-v2, 5 passedgit diff --checkFinal Rebase
origin/mainat1451a1173.Completion Gate
docs_build/dev/reports/codex_review.diff,docs_build/dev/reports/codex_changed_files.txt.tmp/.