fix: replace transition: all with specific properties for GPU compositing#1329
fix: replace transition: all with specific properties for GPU compositing#1329itsalaidbacklife merged 28 commits intomainfrom
Conversation
…ting Fixes rendering glitches on Intel Macs where the UI fragments during card animations due to GPU compositor overload. - Replace transition: all with specific animated properties - Add CSS custom properties for transition durations - Add prefers-reduced-motion support - Fix malformed CSS (missing 's' unit in two transitions) - Remove unused .gameCard class Resolves #1328
There was a problem hiding this comment.
Pull request overview
This PR fixes severe rendering glitches on Intel MacBooks caused by excessive GPU compositor layer creation from transition: all declarations. The fix replaces all instances with specific transition properties to reduce GPU overhead.
Changes:
- Replaced all
transition: allwith specific animated properties (opacity, transform, rotate, etc.) - Added CSS custom properties
--transition-duration: 1sand--transition-duration-fast: 0.3s - Implemented
prefers-reduced-motionmedia query support to disable animations for accessibility - Fixed two instances of malformed CSS (missing
sunit on transition durations) - Removed unused
.gameCardclass
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/App.vue | Added CSS custom properties for transition durations and prefers-reduced-motion support |
| src/routes/game/GameView.vue | Updated .transition-all class, deck expansion, and turn indicator transitions; removed unused .gameCard class; fixed malformed CSS |
| src/routes/game/components/GameCard.vue | Updated scuttled card, frozen effect, and card flip transitions |
| src/routes/game/components/ScrapPile.vue | Updated main scrap pile, card entry/exit, and three-card transitions; fixed malformed CSS |
| src/routes/game/components/MoveChoiceCard.vue | Updated move choice card hover transition |
| src/components/PlayerReadyIndicator.vue | Updated card rotation transition |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Set autoImport: true in vite.config.mjs - Remove global component/directive imports from vuetify.js - Reduces CSS bundle from ~810KB to ~640KB (~21% reduction)
Color renames (semantic naming for what they represent in the game): - surface-1 → game-board (the playing surface) - surface-2 → game-card (the card material) - newSecondary → casual (casual game mode) - gold → forfeit (opponent left/abandoned state) Cleanup: - Remove 15+ unused color variants from Vuetify theme - Remove duplicate CSS color variables from App.vue Duration system (prefers-reduced-motion support): - Add bucketed duration variables: instant, fast, normal, slow, slower - Update hardcoded animation durations to use variables - All animations now respect prefers-reduced-motion
- Create shared transitions.scss with Vue transition classes - Add Transitions.json constants for consistent naming - Rename transitions: slide-below→slide-down, slide-above→slide-up, in-below-out-left→slide-down-left, in-above-out-below→slide-up-down - Add semantic Vuetify theme colors (text-light, text-dark, shadow, history-panel, quote-bg, quote-text, table-row, table-row-active, stats-link) - Add CSS font-family variables (--font-heading, --font-body, etc.) - Fix GPU compositing: use transform instead of right/top in animations - Add content-visibility and contain properties for render performance - Remove ~50 duplicate CSS lines across components
seriouslysean
left a comment
There was a problem hiding this comment.
Notes on the changes
Added utils/ThemeColors.json for consistent color name usage. Updated e2e tests to use constants instead of hardcoded strings.
Prevents memory leak when navigating away from game
seriouslysean
left a comment
There was a problem hiding this comment.
Resize handler fix
Added contain: var(--contain-isolated) to isolated components for render performance. Applied to GameCard, overlays, and game UI.
Moved multi-condition check to isGameUnavailable computed for clarity
…rface-light, fix CSS bugs - Rename game-board -> surface-dark and game-card -> surface-light across all components, tests, and constants (per PR review feedback) - Rename tableRowBackground computed to backgroundColor in BaseLineChart - Fix double semicolon typo in MoveChoiceCard - Fix invalid CSS rotate syntax (rotate: y -90deg -> rotate: 0 1 0 -90deg) in ScrapPile
Avoid collision with Vuetify's built-in surface-* color namespace. base-dark/base-light matches the existing text-dark/text-light convention and stays context-neutral.
|
@itsalaidbacklife went with |
The removal of transition-all also removed the transform transition needed for Vue's TransitionGroup FLIP move animations. Add explicit -move classes that only transition transform (GPU-composited).
Issue number
Summary
Addresses the rendering glitches on Intel Macs where the UI fragments during card animations. We think the root cause is
transition: allcreating too many GPU compositor layers, so this should help.Main changes:
transition: allwith specific properties everywhereprefers-reduced-motionsupportAlso bumped Vuetify and enabled tree-shaking while I was in there @itsalaidbacklife
Please check the following
Please describe additional details for testing this change
Play a game and make sure card animations still work. Flip cards, check scrap pile, etc. If you can test with DevTools Performance tab open that'd be ideal