Lift the hovered card over a cached grid (#88)

The card under the pointer or the keyboard rises over its grid in about
0.35 s: 10 px with a gold glow, 4 px without for a greyed card, the
illustration zooming to 107 % inside it while the caption fades and the
sheet slides up over the lower half. Leaving it mid-way starts from where
it is; a wheel drops it at once; in the hand a veil lays on the other
cards. With Windows animations off the sheet shows without sliding and
the card stays put.

The grids never change on hover or focus any more: they record where
they placed their visible cards, and the page draws the lifted cards in
a deferred layer over them, asking for frames only while one moves.
Structural tests check that a hover, through its animation, draws no
grid, builds no card and computes no statistics.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WYQB8paBcLk67XoAUYARBK
This commit is contained in:
nessarandClaude Opus 5.5 committed 2026-11-21 19:18:31 +01:00
1 parent c2d6296723
commit b78be1ff0b
10 files changed
+982 -127

No files matched your search

+2 -2
View File
@@ -29,7 +29,7 @@ Les trois marques portent sur le Défi d’un Compte pour une Saison, tous Forma
Une seule Partie peut donner les trois marques. Une 2ᵉ place en Arena 3×6 donne la coche « Victoire » et laisse le champion dans « Restants ».
Au survol ou au focus clavier, la fiche du champion apparaît en glissant sur le bas de la carte et affiche ses Parties, ses Victoires, son meilleur Placement, ses Tentatives et ses points de maîtrise. Pour un champion validé, elle affiche aussi **la date du premier top 1 de la saison**. Un top 1 ultérieur conserve cette date. Les Tentatives s’arrêtent à la Partie de validation incluse.
Au survol ou au focus clavier, la fiche du champion apparaît en glissant sur la moitié basse de la carte et affiche ses Parties, ses Victoires, son meilleur Placement, ses Tentatives et ses points de maîtrise. Pour un champion validé, elle affiche aussi **la date du premier top 1 de la saison**. Un top 1 ultérieur conserve cette date. Les Tentatives s’arrêtent à la Partie de validation incluse.
### Pendant la sélection Arena
@@ -59,7 +59,7 @@ Cette section décrit l’identité « L’Anneau ». [La page de référence](p
- Fin d’une Partie suivie en direct. Un top 1 déclenche la comète, la bannière et « Validé ». Une nouvelle Marque fait monter la graduation d’un cran et remplit la coche. Sinon, la graduation clignote et la ligne « Dernière Partie » apparaît en fondu. L’animation est différée jusqu’à ce que « Défi » soit visible, elle ne joue que la plus forte des Parties terminées entre-temps, et elle est abandonnée si une sélection commence. Les Parties importées ou lues dans l’historique n’animent rien.
- Entrée en sélection : balayage, titre, cartes distribuées. Sortie : les cartes se retirent.
- Transitions entre « Défi » et « Statistiques » : l’écran sortant passe sous un voile de la couleur du fond (≈ 130 ms), puis l’entrant en sort (≈ 280 ms). La barre du haut ne bouge pas. Changer d’onglet pendant une transition repart de là où en est le voile. Les sélecteurs de Saison et de Format sont sur la ligne du titre « Statistiques », sous le voile : la barre du haut, commune aux deux onglets, garde sa hauteur. Pas de glissement : déplacer l’écran redessinerait à chaque image la grille, l’anneau et les graphiques, qui sont en cache.
- Survol : le même sur toutes les cartes. Le voile sur les cartes voisines ne s’applique que dans la main de la sélection.
- Survol et focus clavier : le même sur toutes les cartes (grille de l’accueil, main de la sélection, « Autres champions »), en ≈ 350 ms. Une carte jouable monte de 10 px avec une ombre dorée ; une carte grisée monte de 4 px, sans ombre dorée. L’illustration zoome à 107 % dans la carte, qui garde sa taille, pendant que le nom et les coches s’effacent et que la fiche glisse depuis le bas. Quitter une carte en cours d’animation repart de là où elle en est. Une molette la repose aussitôt. Le voile sur les cartes voisines ne s’applique que dans la main de la sélection. Réglage Windows coupé : la fiche apparaît sans glisser et la carte ne monte pas.
- Limites de GPUI, sans le modifier (ADR-0004) : pas de rotation, pas d’espacement des lettres animé, une montée de la carte au lieu d’un grossissement, un voile au lieu d’un filtre ou d’un fondu de l’écran entier.
### Page « Statistiques »
+1
View File
@@ -48,6 +48,7 @@ The identity (ring, banner, animations; `docs/interface.md`) follows the same ru
- **Animations are triggered by an event** (end of a followed Match, champ select entering or leaving, card hover, tab change) and **draw nothing at rest**. No timer or loop keeps a frame going once an animation is over, and none runs while the window is hidden or minimised. They follow the Windows « Show animations » setting.
- **The foundation** (`crates/app/src/motion.rs`, with the page saying when « Défi » is visible, #86) decides whether the app animates, and when. The Windows setting reaches GPUI's `App::reduce_motion`: gpui-base reads it at start, and the window's own `WM_SETTINGCHANGE` for `SPI_SETCLIENTAREAANIMATION` reads it again, with no polling. When it is off, a tab switch shows its end state at once, and an animation asked for is not played; turning it off ends a transition running and drops the animation waiting, as soon as Windows says so (`AnimationSetting`). An animation asked for while « Défi » is not visible (window minimised or hidden in the notification area, « Statistiques », « Paramètres » or a champ select in front) waits in `Deferred`: only the strongest is kept, it plays once when « Défi » shows again, and a champ select that starts abandons it.
- **Tab transitions lay a veil, never move the screen.** A cached view's cache key holds its bounds and its opacity, so fading or sliding the screen itself would draw the grid, the ring and the charts again at every frame and build the cards again. The veil, of the page's background, covers the screen leaving (130 ms) then lifts off the one arriving (280 ms). Each frame is asked for by the transition itself (`on_next_frame`), and none once the veil is lifted. A window hidden during a transition ends it at once. The champion table is a cached view too, laid out by the space the page gives it, so the veil's frames do not draw it. The screen arriving is prepared (its rows copied and sorted, its cards built) only when it is shown, so a switch undone under the veil prepares nothing. Structural tests check that a transition draws neither the grid, the ring nor the table again, builds no card, recomputes no statistics, and asks for no frame at rest. The charts arriving play gpui-kit's own short entry, as after any switch.
- **A card hovered is drawn over its grid, which stays cached** (#88). The cards of a grid never change on hover or focus: the page draws the card under the pointer or the keyboard (and those settling back) lifted over the grid, in a deferred layer painted after the page, from where the grid last placed it (`card_lift.rs`). The grid records its visible cards' bounds while it lays out its rows, so drawing them over it reads no layout. The layer covers each lifted card's place with the page's background, and in the hand lays the veil on the other cards. Each frame is asked for by the page's render while a card moves (`request_animation_frame`), and none once they are still. A wheel drops the grid's lifted cards at once, a tab switch or « Paramètres » drops them all, and a hidden window or the setting turned off shows their end state at once. Structural tests check that hovering a card, through its whole animation, draws none of the grid, builds no card and computes no statistics, and that no frame is asked for at rest. A zoomed illustration overflows the card and is cut square by GPUI's rectangular clip: a frame of the page's background rounds its corners again, which nicks the gold glow by a few pixels at each corner.
- **Two splashes decoded at most**: the one shown and the one replacing it. All splashes are downloaded in the background, at low priority, after the card portraits, and kept on disk.
- During champ select, the Anvil grid is cached at the height of its card rows. The capture replay checks that a splash fade builds no cards and that traversing the hand and « Autres champions » keeps at most two decoded splashes. The latest hovered card takes over when the current fade finishes.
- **The ring is a cached view**, laid out from its style alone. A structural test guards it: hovering a card, scrolling the grid or an animation on another part does not render the ring; only a change of what it shows (the champions' state, their order, the selection) or its own animation does. Its gain is checked at the next release benchmark.