🐛 Fix Copilot review issues from PR #4110#4133
Conversation
- KubeCraft: guard getGridCoords against zero-size bounding rect to prevent NaN - KubeCraft: account for objectFit:contain letterboxing in expanded mode so clicks in padded areas are correctly rejected instead of mapping to wrong tiles - KubeChess: fix off-by-one in minimax position limit (use >= instead of >) Signed-off-by: Andrew Anderson <andy@clubanderson.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
✅ Deploy Preview for kubestellarconsole ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
Fixes issues raised in Copilot review comments from merged PR #4110 by hardening coordinate mapping in KubeCraft and tightening the minimax evaluation limit in KubeChess.
Changes:
- Added zero-size
getBoundingClientRect()guard in KubeCraft to prevent NaN coordinate calculations. - Updated KubeCraft click-to-grid mapping to account for
objectFit: 'contain'letterboxing/pillarboxing in expanded mode. - Fixed an off-by-one in KubeChess minimax position limit check (
>→>=) to respectMAX_POSITIONS_EVALUATED.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| web/src/components/cards/KubeCraft.tsx | Prevents invalid grid coords (NaN / padded-area clicks) by guarding rect size and computing actual rendered content bounds in expanded mode. |
| web/src/components/cards/KubeChess.tsx | Ensures minimax bails out at the configured evaluation cap to avoid exceeding the intended limit. |
|
Thank you for your contribution! Your PR has been merged. Check out what's new:
Stay connected: Slack #kubestellar-dev | Multi-Cluster Survey |
|
👋 Hey @clubanderson — thanks for opening this PR!
This is an automated message. |
Summary
Addresses Copilot review comments left on merged PR #4110:
getGridCoords()now guards against zero-size bounding rect (rect.width/height <= 0) to prevent NaN from breaking bounds checkingobjectFit: 'contain'letterboxing/pillarboxing in expanded mode, so clicks in padded areas are correctly rejected instead of mapping to wrong tiles>to>=so the search cannot exceedMAX_POSITIONS_EVALUATEDNote: The Copilot comment about
auto-qa.ymlbeing bundled in #4110 is a scoping observation, not a code defect — no action needed.Test plan
npx tsc --noEmitpasses)