Fix move animation clipping beneath board border#191
Conversation
Co-authored-by: ProLoser <67395+ProLoser@users.noreply.github.com>
|
|
@copilot when moving from one side to the other side the piece starting animation position is off the edge of the screen |
|
@copilot some of the points are animating off the right edge of the screen now I don't think it was doing that before and now the animation is showing up below the pieces. İncrease the dialogue Z index |
…oard edge Co-authored-by: ProLoser <67395+ProLoser@users.noreply.github.com> Agent-Logs-Url: https://github.com/ProLoser/PeaceInTheMiddleEast/sessions/c49561ee-6e2b-40de-aa09-138d1478b152
The root cause was that Fixed in 592e9ad by:
The z-index fix ( |
…ise dialog z-index Co-authored-by: ProLoser <67395+ProLoser@users.noreply.github.com> Agent-Logs-Url: https://github.com/ProLoser/PeaceInTheMiddleEast/sessions/8ac6e086-2d7f-4433-8d84-2eb4f6fb9eac
Fixed in cad0af6 with three changes:
|
|
@copilot animating piece should be higher z index than regular board pieces but lower than dialogue |
…d pieces, below dialog Co-authored-by: ProLoser <67395+ProLoser@users.noreply.github.com> Agent-Logs-Url: https://github.com/ProLoser/PeaceInTheMiddleEast/sessions/00e647c5-2d2c-455e-b986-2a96d267be2a
Done in 5ff2963 — |
|
@copilot animation does not appear above border |
… the border Co-authored-by: ProLoser <67395+ProLoser@users.noreply.github.com> Agent-Logs-Url: https://github.com/ProLoser/PeaceInTheMiddleEast/sessions/ec66ed3b-3f8d-4976-a5f2-73d473c0e1e4
Fixed in 26dbae4. The overlay was positioned with |
There was a problem hiding this comment.
Pull request overview
Adjusts the board move animation overlay so animated pieces can render above the board border (without being clipped) while keeping the dialog UI layered above the animation.
Changes:
- Introduces
--board-borderand uses it for the board border width. - Expands the move animation overlay to the board border-box area and updates coordinate calculations accordingly.
- Moves
<MoveAnimation>to the end of#boardchildren and raises dialog z-index to keep dialogs above the overlay.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/index.tsx | Moves <MoveAnimation> to the end of the board DOM for paint order. |
| src/Dialogues/Dialogues.css | Raises dialog z-index to stay above the overlay. |
| src/Board/MoveAnimation.tsx | Aligns animation coordinate origin with the overlay’s new placement. |
| src/Board/MoveAnimation.css | Expands overlay via negative inset and sets overlay z-index/overflow. |
| src/Board/Board.css | Extracts border width into --board-border and uses it for the board border. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| .move-animation-overlay { | ||
| position: absolute; | ||
| inset: 0; | ||
| inset: calc(-1 * var(--board-border, 5vmin)); |
There was a problem hiding this comment.
inset: calc(-1 * var(--board-border)) may not actually expand the overlay because #board > * sets width: 100%/height: 100% for all direct children (including this absolute overlay). With abs-pos, specifying left/right/top/bottom and width/height is over-constrained, and the browser will ignore one side (typically right/bottom), leaving the overlay shifted but still clipped on the opposite edges. Consider overriding width/height back to auto (or excluding .move-animation-overlay from #board > *) so the inset can take effect on all sides.
| inset: calc(-1 * var(--board-border, 5vmin)); | |
| inset: calc(-1 * var(--board-border, 5vmin)); | |
| width: auto; | |
| height: auto; |

The move animation overlay had several problems: animated pieces were clipped at the content box edge and could not paint over the visual border; the overlay rendered below pieces because it appeared before the
<Point>elements in the DOM; and z-index layering was incorrect with the overlay below board pieces and the dialog too low.Changes
Board.css— Extracts border width into--board-border: 5vminCSS variableMoveAnimation.css— Usesinset: calc(-1 * var(--board-border, 5vmin))to expand the overlay to cover the full board border-box so animated pieces can paint over the visual border;overflow: hiddenclips at the outer board edge preventing off-screen overflow;z-index: 10places animated pieces above board pieces (z-index: auto) but below the dialog (z-index: 100)MoveAnimation.tsx— Updates the JS coordinate origin from the padding-box edge (boardRect + borderWidth) to the border-box edge (boardRect.left/top) to match the expanded overlay positionindex.tsx— Moves<MoveAnimation>to be the last child of#board(after all 24<Point>elements) so it paints on top of pieces via document orderDialogues.css— Raisesdialog { z-index }from1→100to keep the dialog clearly above the animation overlayOriginal prompt
📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.