Skip to content

🐛 fix: address Copilot review feedback on #3963#3964

Merged
clubanderson merged 1 commit intomainfrom
fix/copilot-feedback-3963
Mar 31, 2026
Merged

🐛 fix: address Copilot review feedback on #3963#3964
clubanderson merged 1 commit intomainfrom
fix/copilot-feedback-3963

Conversation

@clubanderson
Copy link
Copy Markdown
Collaborator

Addresses Copilot review comments on #3963: reset dialog on mission change, round ResizeObserver values, allow game downscaling on small viewports.

- Reset save resolution dialog when active mission changes (prevents
  stale dialog reopening for a different mission)
- Round ResizeObserver dimensions and skip no-op updates to avoid
  unnecessary rerenders and loop warnings
- Allow game scaling below 1x so games fit small viewports
- Allow 2048 cell size below default when expanded container is small

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
Copilot AI review requested due to automatic review settings March 31, 2026 13:02
@kubestellar-prow kubestellar-prow bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Mar 31, 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 clubanderson 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

@kubestellar-prow kubestellar-prow bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Mar 31, 2026
@netlify
Copy link
Copy Markdown

netlify bot commented Mar 31, 2026

Deploy Preview for kubestellarconsole ready!

Name Link
🔨 Latest commit 060359e
🔍 Latest deploy log https://app.netlify.com/projects/kubestellarconsole/deploys/69cbc5f9cdf7690008c8b5de
😎 Deploy Preview https://deploy-preview-3964.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 36ff8ea into main Mar 31, 2026
20 of 21 checks passed
@kubestellar-prow kubestellar-prow bot deleted the fix/copilot-feedback-3963 branch March 31, 2026 13:03
@github-actions
Copy link
Copy Markdown
Contributor

👋 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.

@github-actions
Copy link
Copy Markdown
Contributor

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

Check out what's new:

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

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

This PR follows up on Copilot review feedback from #3963 by tightening UI state handling in the mission sidebar and improving arcade game resizing behavior in expanded cards.

Changes:

  • Reset “Save Resolution” dialog state when the active mission changes, and only mount the dialog when open.
  • Round ResizeObserver container measurements and avoid state updates when dimensions are unchanged.
  • Update 2048 and Snake sizing logic to better support resizing in expanded views.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
web/src/components/layout/mission-sidebar/MissionSidebar.tsx Resets and gates SaveResolutionDialog rendering to avoid stale dialog state across mission switches.
web/src/components/cards/CardWrapper.tsx Rounds observed container dimensions and avoids redundant containerSize state updates.
web/src/components/cards/Game2048.tsx Allows expanded-mode cell size to shrink when space is limited, with guards for invalid/negative sizing.
web/src/components/cards/KubeSnake.tsx Adjusts computed scale to permit downscaling, but currently does not apply scaling when < 1 and can compute invalid negative scales.

Comment on lines 49 to 54
const canvasScale = (() => {
if (!isExpanded || containerSize.width === 0 || containerSize.height === 0) return 1
const availW = containerSize.width
const availH = containerSize.height - SNAKE_CHROME_HEIGHT
return Math.max(1, Math.min(availW / DEFAULT_CANVAS_SIZE, availH / DEFAULT_CANVAS_SIZE))
return Math.min(availW / DEFAULT_CANVAS_SIZE, availH / DEFAULT_CANVAS_SIZE)
})()
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

canvasScale can now be < 1 (or even negative when containerSize.height < SNAKE_CHROME_HEIGHT), but the render logic only applies width/height + transform: scale(...) when canvasScale > 1. As a result, expanded Snake still won’t downscale on small viewports (and a negative scale could cause invalid layout). Clamp the computed scale to a positive minimum and apply scaling whenever isExpanded and canvasScale !== 1 (or otherwise ensure the canvas fits when canvasScale < 1).

Copilot uses AI. Check for mistakes.
@clubanderson
Copy link
Copy Markdown
Collaborator Author

🔄 Auto-Applying Copilot Code Review

Copilot code review found 0 code suggestion(s) and 1 general comment(s).

Also address these general comments:

  • web/src/components/cards/KubeSnake.tsx (line 54): canvasScale can now be < 1 (or even negative when containerSize.height < SNAKE_CHROME_HEIGHT), but the render logic

Push all fixes in a single commit. Run cd web && npm run build && npm run lint before committing.


Auto-generated by copilot-review-apply workflow.

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/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants