PR_26171_ALPHA_046 game hub table standard rebuild#26
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f7acdbb0d5
ℹ️ 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".
| setStatusLog("Game Hub project details are temporarily unavailable. Refresh the page or try again shortly."); | ||
| const activeGame = normalizeGame(repository.getActiveGame(), "Active project"); | ||
| const userKey = currentSessionUserKey(); | ||
| const listResult = repository.listGames(userKey ? { userKey } : {}); |
There was a problem hiding this comment.
Include opened projects when filtering the table
When an authenticated user whose key is not the repository default owner creates a project, createGame stores it under the default owner unless an ownerKey is passed. This new table filter then calls listGames({ userKey: currentSessionUserKey() }), so the just-created/opened active project is omitted from the table, state.expandedGameId is cleared, and the UI can say it was created/opened while rendering no row for it. This also breaks explicit Idea Board handoffs for non-default signed-in users; either create with the session owner or include the active/opened project when filtering.
Useful? React with 👍 / 👎.
| if (updated) { | ||
| return updated; | ||
| } | ||
| return new Date().toISOString().slice(0, 10); |
There was a problem hiding this comment.
Stop defaulting missing updates to today
For any project that lacks updated, updatedAt, or lastUpdated (including the existing seeded records and any persisted records created before this field exists), this fallback shows the page-load date in the Updated column. That value changes every day even when the project was not modified, so the table reports false freshness; render an empty/unknown value or persist a real updated timestamp instead.
Useful? React with 👍 / 👎.
| if (!games.length) { | ||
| const row = document.createElement("tr"); | ||
| const tableCell = document.createElement("td"); | ||
| const countCell = document.createElement("td"); | ||
| const cell = document.createElement("td"); | ||
| cell.colSpan = 6; | ||
| cell.textContent = "No projects yet. Create a project to get started."; |
There was a problem hiding this comment.
Distinguish load failures from empty projects
When repository.listGames returns an error, normalizeGameList converts it to [], so this branch renders the same empty-state row used for a real empty list (and the later status still says projects loaded). During a temporary API or persistence failure, creators will see “No projects yet” and may think their projects are gone; preserve an error state and render an unavailable message instead of the create-empty prompt.
Useful? React with 👍 / 👎.
| button.type = "button"; | ||
| button.dataset.gameDelete = game.id; | ||
| button.textContent = "Delete"; | ||
| button.disabled = !projectRecordsSaveAllowed(); |
There was a problem hiding this comment.
Avoid per-row session requests while rendering
projectRecordsSaveAllowed() calls getSessionCurrent(), which goes through the synchronous server API client, and this button is created once for every project row. Rendering a large Projects table therefore issues one blocking session request per row in addition to the other session checks, stalling the page as the list grows; compute the save permission once per render and pass it into row/button creation.
Useful? React with 👍 / 👎.
…me-hub-table-standard-rebuild # Conflicts: # docs_build/dev/reports/codex_changed_files.txt # docs_build/dev/reports/codex_review.diff
|
OWNER-approved cleanup: closing as superseded by current Game Hub path and merged Game Hub consolidation; old game-workspace path is no longer target direction. Branch retained; no branch deletion performed. |
Summary
Validation
node --check toolbox/game-workspace/game-workspace.jsnode --check tests/playwright/tools/GameWorkspaceMockRepository.spec.mjsgit diff --checknpx playwright test tests/playwright/tools/GameWorkspaceMockRepository.spec.mjs --project=playwright --workers=1 --reporter=line(12 passed before latest-main merge; 12 passed after conflict resolution)npm run test:workspace-v2(workspace-contract lane, 5 passed before latest-main merge; 5 passed after conflict resolution)Merge Gate
Do not merge without explicit Team Alpha owner approval.