PR_26171_044 Idea Board Game Hub project flow#22
Conversation
…ea-board-game-hub-project-flow # Conflicts: # docs_build/dev/reports/codex_changed_files.txt # docs_build/dev/reports/codex_review.diff
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2a38796f81
ℹ️ 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".
| return; | ||
| } | ||
| const repository = gameHubProjectRepository(); | ||
| const project = repository.createGame({ |
There was a problem hiding this comment.
Gate Create Project on an authenticated session
In a fresh Idea Board session with no selected session user, Ready ideas still show Create Project, but this new call goes through the Game Hub createGame save method. The Local API rejects Game Hub save methods when sessionUserKey is empty, so the primary handoff fails for unauthenticated users with a generic retry message instead of prompting sign-in or disabling the action like Game Hub does.
Useful? React with 👍 / 👎.
| " ", | ||
| actionButton("Delete", "delete", "ideaBoardIdeaAction"), | ||
| ); | ||
| } else if (isProject(record)) { |
There was a problem hiding this comment.
Prevent manual Project statuses without project ids
When a user uses the existing status dropdown to save a new or edited idea as Project instead of pressing Create Project, the record has no projectId. This branch now hides Edit/Delete and shows only Open in Game Hub/Archive; Open immediately refuses because openProject requires projectId, leaving the idea stranded as a read-only project with no linked Game Hub record.
Useful? React with 👍 / 👎.
| populateSelect(elements.currentUserRoleInput, GAME_WORKSPACE_MEMBER_ROLES); | ||
| const requestedGameId = new URL(window.location.href).searchParams.get("game"); | ||
| if (requestedGameId) { | ||
| const openedGame = repository.openGame(requestedGameId); |
There was a problem hiding this comment.
Validate deep-linked games against membership
When ?game= is present, this opens the supplied id directly instead of resolving it through the same membership-scoped listGames({ userKey }) path used to build the Open Games buttons. Because game ids are predictable slugs/counters, a guest or unrelated signed-in user can load another Game Hub project by URL and view its Project Information and Source Idea, bypassing the visible game-list scope.
Useful? React with 👍 / 👎.
| const project = repository.createGame({ | ||
| name: record.idea, | ||
| purpose: "Game", | ||
| sourceIdea: projectSourceIdea(record), | ||
| status: "Planning", |
There was a problem hiding this comment.
Create projects under the signed-in user
For authenticated users other than the default seed creator, this handoff omits an owner/member key, so createGame falls back to GAME_WORKSPACE_DEFAULT_OWNER_USER_KEY and adds only that user as a member. The project created from Idea Board is then attributed to User 1 in Game Hub instead of the creator who clicked Create Project, and the actual creator is not added as a member.
Useful? React with 👍 / 👎.
| } else { | ||
| setStatusLog("That Game Hub project could not be found."); |
There was a problem hiding this comment.
Do not fall back to the previous game for stale links
If the ?game= id no longer exists, for example after the linked Game Hub project was deleted while the Idea Board row or bookmarked URL remains, openGame returns null but leaves the repository's existing active game untouched. The message says the project could not be found, then renderWorkspace() displays whatever game was already active (usually Demo Game), so stale Open in Game Hub links can show the wrong project as if it were the target.
Useful? React with 👍 / 👎.
Summary
Create Projectthrough the existing Game Hub repository contract.Open in Game Hubplus archive/restore behavior.Validation
node --check toolbox/idea-board/index.jsnode --check toolbox/game-workspace/game-workspace.jsnode --check toolbox/game-workspace/game-workspace-api-client.jsnode --check src/dev-runtime/persistence/tool-repositories/game-workspace-mock-repository.jsnode --check tests/playwright/tools/IdeaBoardTableNotes.spec.mjsnode --check tests/playwright/tools/ToolboxRoutePages.spec.mjsnode --check tests/playwright/tools/GameWorkspaceMockRepository.spec.mjsnpx playwright test tests/playwright/tools/IdeaBoardTableNotes.spec.mjs --project=playwright --workers=1 --reporter=linenpx playwright test tests/playwright/tools/ToolboxRoutePages.spec.mjs --project=playwright --workers=1 --reporter=line --grep "Idea Board launches"npx playwright test tests/playwright/tools/GameWorkspaceMockRepository.spec.mjs --project=playwright --workers=1 --reporter=line --grep "Game Hub"npm run test:workspace-v2git diff --check