Skip to content

fix: mobile moves-by-rating freeze and npm test exit code - #315

Open
sushanth-dev wants to merge 2 commits into
CSSLab:mainfrom
sushanth-dev:fix/easy-issues-177-291
Open

sushanth-dev wants to merge 2 commits into
CSSLab:mainfrom
sushanth-dev:fix/easy-issues-177-291

Conversation

@sushanth-dev

Copy link
Copy Markdown

Two small, independent fixes for open issues.

#291 Moves by rating not updated in mobile view

MovesByRating deliberately freezes its displayed series and only re-syncs when positionKey changes:

useEffect(() => {
  if (!moves?.length || !positionKey) return
  setDisplayedMoves(moves)
  setDisplayedColorSanMapping(colorSanMapping)
  setDisplayedPositionKey(positionKey)
}, [moves, colorSanMapping, positionKey])

The mobile call site in src/pages/analysis/[...id].tsx passed moves and colorSanMapping but not positionKey, so that guard short-circuited on every render and the chart kept showing the starting position's probabilities. The desktop path is unaffected because AnalysisSidebar already passes positionKey. This passes it on mobile too, under the same guard already used for the other two props.

Verified in a browser by mounting the component twice against identical, changing moves. Without positionKey the Y axis stayed at 0-60% and the area paths were byte-identical after the position changed, which is the reported freeze. With positionKey the axis moved to 0-100% and the paths changed.

I could not exercise the real analysis flow end to end: every dock2.csslab.ca/api/* endpoint currently returns 404, including /api/v1/analysis/analysis_list/FkgYSri1, so the page redirects to /401 locally.

#177 CI Passes with errors?

npm test ran bare jest, which found no file matching testMatch among 240 checked files and exited 1. Commit 93b3482 removed the CI test job to work around that. Jest's own suggested --passWithNoTests makes the script report the truth instead: the suite runs and reports zero tests. npm test now exits 0.

This only fixes the script. Re-adding a test step to .github/workflows/ci.yml is left to the maintainers, since removing it was deliberate.

Verification

  • npm test: was exit 1 with "No tests found", now exit 0
  • npx tsc --noEmit: exit 0
  • npx eslint on the changed file: no issues
  • npm run build: exit 0, all 26 routes built

No security, schema, or performance implications. No new dependencies.

Related dead code, not changed

src/pages/openings/index.tsx carries the same missing-positionKey defect but is unreachable: next.config.js permanently 308-redirects /openings to /drills, so that page component never renders. The same fix was applied, the redirect confirmed, and the edit reverted rather than ship an unverifiable change.

src/components/Openings/OpeningDrillAnalysis.tsx has the same defect and is exported from the Openings barrel but never imported or rendered anywhere.

Both are dead code and were left alone rather than deleted. Happy to remove them in a separate change if that is wanted.

🤖 Generated with Claude Code

sushanth-dev and others added 2 commits September 19, 2026 13:03
MovesByRating freezes its displayed series unless it is given a
positionKey, so the mobile call site in the analysis page kept rendering
the starting position's probabilities. Desktop was unaffected because
AnalysisSidebar already passes positionKey; mobile did not. Pass it under
the same guard used for moves and colorSanMapping.

Refs CSSLab#291

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
npm test ran jest with no file matching testMatch, so it printed "No
tests found" and exited 1. The CI test job was deleted to work around
that. Jest's own suggested --passWithNoTests makes the script report the
truth instead: the suite runs and reports zero tests.

Refs CSSLab#177

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Sep 19, 2026

Copy link
Copy Markdown

@sushanth-dev is attempting to deploy a commit to the Maia Platform Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant