Skip to content

🐛 Fix Copilot review issues from PR #4110#4133

Merged
clubanderson merged 1 commit intomainfrom
fix/4110-copilot
Apr 1, 2026
Merged

🐛 Fix Copilot review issues from PR #4110#4133
clubanderson merged 1 commit intomainfrom
fix/4110-copilot

Conversation

@clubanderson
Copy link
Copy Markdown
Collaborator

Summary

Addresses Copilot review comments left on merged PR #4110:

  • KubeCraft.tsxgetGridCoords() now guards against zero-size bounding rect (rect.width/height <= 0) to prevent NaN from breaking bounds checking
  • KubeCraft.tsx — Canvas coordinate scaling now accounts for objectFit: 'contain' letterboxing/pillarboxing in expanded mode, so clicks in padded areas are correctly rejected instead of mapping to wrong tiles
  • KubeChess.tsx — Fixed off-by-one in minimax position limit check: changed > to >= so the search cannot exceed MAX_POSITIONS_EVALUATED

Note: The Copilot comment about auto-qa.yml being bundled in #4110 is a scoping observation, not a code defect — no action needed.

Test plan

  • Open KubeCraft card, expand it, and verify clicking/drawing works correctly at edges and in letterboxed areas
  • Collapse KubeCraft and verify normal-size drawing still works
  • Open KubeChess card and play a game to verify AI still responds correctly
  • TypeScript compiles cleanly (npx tsc --noEmit passes)

- 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>
Copilot AI review requested due to automatic review settings April 1, 2026 13:05
@kubestellar-prow kubestellar-prow bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Apr 1, 2026
@kubestellar-prow
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign mikespreitzer for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@netlify
Copy link
Copy Markdown

netlify bot commented Apr 1, 2026

Deploy Preview for kubestellarconsole ready!

Name Link
🔨 Latest commit 80a1c0a
🔍 Latest deploy log https://app.netlify.com/projects/kubestellarconsole/deploys/69cd1801b296af00089c8ec6
😎 Deploy Preview https://deploy-preview-4133.console-deploy-preview.kubestellar.io
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@clubanderson clubanderson merged commit e887dff into main Apr 1, 2026
17 of 18 checks passed
@kubestellar-prow kubestellar-prow bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Apr 1, 2026
@kubestellar-prow kubestellar-prow bot deleted the fix/4110-copilot branch April 1, 2026 13:05
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 respect MAX_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.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

Thank you for your contribution! Your PR has been merged.

Check out what's new:

Stay connected: Slack #kubestellar-dev | Multi-Cluster Survey

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

👋 Hey @clubanderson — thanks for opening this PR!

🤖 This project is developed exclusively using AI coding assistants.

Please do not attempt to code anything for this project manually.
All contributions should be authored using an AI coding tool such as:

This ensures consistency in code style, architecture patterns, test coverage,
and commit quality across the entire codebase.


This is an automated message.

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

Labels

dco-signoff: yes Indicates the PR's author has signed the DCO. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants