Address review of the champ select page scroll
CI / core (pull_request) Successful in 47s
CI / core (push) Successful in 45s

- Draw the section's grid again once the draw that moved it is over: a notify
  inside a draw dirties nothing for the next one, so its rows stayed those of
  the former place.
- Keep the first row of a grid wholly below the window built, so that Tab from
  the search enters it, and scroll the page to any card the keyboard focuses.
- Leave the scrollbar its own lane in the Anvil and « Autres champions »
  sections, so it no longer covers the sort selector, and make it a view of
  its own so that its fade does not draw the whole page.
- Store the page's Paging once; correct the performance notes on scrolling.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit was merged in pull request #104.
This commit is contained in:
nessarandClaude Sonnet 5.5 committed 2026-11-22 19:18:35 +01:00
1 parent 15feaee8bf
commit 2c9ca4552c
13 files changed
+151 -69

No files matched your search

+13 -8
View File
@@ -1,9 +1,8 @@
//! The card grid: all the cards a list shows, in rows of the same count, only the visible rows
//! built (a grid that scrolls by itself, or one the page scrolls). It is its own view because it
//! owns the scrolling and the hover of its cards, and the
//! portraits they show (`card_images`). Its cards never change on hover or focus: the card under
//! the pointer or the keyboard is drawn lifted over the grid (`card_lift`), from where the grid
//! last placed it.
//! owns the hover of its cards, the scrolling of its list when it has one, and the portraits they
//! show (`card_images`). Its cards never change on hover or focus: the card under the pointer or
//! the keyboard is drawn lifted over the grid (`card_lift`), from where the grid last placed it.
use std::collections::HashMap;
use std::ops::Range;
@@ -306,7 +305,13 @@ impl CardGrid {
.w_full()
.h(px(metrics.card_height + metrics.gap))
.pb(px(metrics.gap))
.pr(Scrollbar::width())
// The lane of the list's scrollbar; the page's column leaves its own to the grids it
// scrolls.
.pr(if self.fit_content || self.paged.is_some() {
Pixels::ZERO
} else {
Scrollbar::width()
})
.gap(px(metrics.gap))
// Only a row painted is laid out here, not one `uniform_list` merely measures.
.on_children_prepainted(move |bounds, window, _| {
@@ -403,9 +408,9 @@ impl Render for CardGrid {
// content since. Not laid out yet, the grid is taken to start at the top of the window,
// where the header clicked to open it leaves it: the next frame knows.
let scrolled = -paging.scroll.offset().y;
let shown = paging.scroll.bounds().size.height;
let viewport = if shown > Pixels::ZERO {
shown
let last_height = paging.scroll.bounds().size.height;
let viewport = if last_height > Pixels::ZERO {
last_height
} else {
window.viewport_size().height
};
+26 -10
View File
@@ -42,6 +42,9 @@ impl CardGrid {
let gained = cx.on_focus_in(&handle, window, move |grid, window, cx| {
if window.last_input_was_keyboard() {
grid.hover_by(Some(id), true, cx);
// Tab came from outside the grid too: the page is to show the card.
let position = grid.position_of(id);
grid.reveal_in_page(position, window, cx);
}
});
let lost = cx.on_focus_out(&handle, window, move |grid, _, _, cx| {
@@ -80,17 +83,30 @@ impl CardGrid {
cx.propagate();
return;
};
if !self.fit_content {
let metrics = Metrics::of(window.viewport_size().width);
let row = target / metrics.columns;
if self.paged.is_some() {
let top = px(metrics.row_height() * row as f32);
let bottom = top + px(metrics.card_height);
cx.emit(RevealRow { top, bottom });
} else {
self.scroll.scroll_to_item(row, ScrollStrategy::Nearest);
}
if self.paged.is_some() {
self.reveal_in_page(Some(target), window, cx);
} else if !self.fit_content {
let columns = Metrics::of(window.viewport_size().width).columns;
self.scroll
.scroll_to_item(target / columns, ScrollStrategy::Nearest);
}
window.focus(&handle, cx);
}
/// Where the card with this id is among the cards shown.
fn position_of(&self, id: u32) -> Option<usize> {
let is_it = |&ix: &usize| self.cards.get(ix).is_some_and(|card| card.id == id);
self.shown.iter().position(is_it)
}
/// A paged grid asks the page to scroll to the row of the card at this position.
fn reveal_in_page(&mut self, position: Option<usize>, window: &Window, cx: &mut Context<Self>) {
let (Some(position), true) = (position, self.paged.is_some()) else {
return;
};
let metrics = Metrics::of(window.viewport_size().width);
let top = px(metrics.row_height() * (position / metrics.columns) as f32);
let bottom = top + px(metrics.card_height);
cx.emit(RevealRow { top, bottom });
}
}
+6 -2
View File
@@ -1,5 +1,5 @@
use gpui_kit::component::scroll::Scrollbar;
use gpui_kit::Pixels;
use gpui_kit::component::scroll::Scrollbar;
use crate::card::ASPECT;
use crate::page::PAGE_PADDING;
@@ -62,7 +62,8 @@ impl Metrics {
/// Which rows of a grid of `rows` rows, `row_height` tall each, a viewport shows: the grid's top
/// is `top` down the scrolled content, which is scrolled `scrolled`, and the viewport is
/// `viewport` tall. A row shown in part counts.
/// `viewport` tall. A row shown in part counts. A grid wholly below the window keeps its first
/// row built: the keyboard enters the grid there (Tab from the search), and the page scrolls to it.
pub(super) fn rows_in_view(
rows: usize,
row_height: Pixels,
@@ -73,6 +74,9 @@ pub(super) fn rows_in_view(
let row_height = row_height.as_f32().max(1.);
let above = (scrolled - top).as_f32();
let below = above + viewport.as_f32();
if below <= 0. {
return 0..rows.min(1);
}
let first = ((above.max(0.) / row_height).floor() as usize).min(rows);
let last = ((below.max(0.) / row_height).ceil() as usize).min(rows);
first..last.max(first)
+2
View File
@@ -30,6 +30,8 @@ fn the_rows_in_view_are_those_the_window_shows_even_in_part() {
assert_eq!(rows(100.), 0..3);
// Inside it: the rows cut by either edge count.
assert_eq!(rows(400.), 1..6);
// Wholly below the window: its first row, for the keyboard to enter by.
assert_eq!(rows_in_view(10, px(100.), px(900.), px(0.), px(400.)), 0..1);
// Past its end: nothing.
assert_eq!(rows(2000.), 10..10);
// No row.
+10 -9
View File
@@ -3,7 +3,7 @@
use crate::banner_art::BannerArt;
use crate::card::Card;
use crate::card_grid::{CardGrid, CardHovered};
use crate::card_grid::{CardGrid, CardHovered, Paging};
use crate::card_lift::Lifts;
use crate::champion_table::ChampionTable;
use crate::motion::{Deferred, Fade, FadePhase, MatchAnimation, MatchEnd};
@@ -22,8 +22,8 @@ use gpui_kit::component::{ActiveTheme as _, StyledExt as _};
use gpui_kit::prelude::FluentBuilder as _;
use gpui_kit::*;
use profiling::shown;
use scrollbar::PageScrollbar;
use statistics::ChartsRow;
use std::cell::Cell;
use std::collections::HashMap;
use std::rc::Rc;
use std::sync::Arc;
@@ -38,6 +38,7 @@ mod hover;
mod lifecycle;
mod playback;
mod profiling;
mod scrollbar;
mod setup;
mod statistics;
mod worker_messages;
@@ -292,15 +293,15 @@ pub struct Page {
/// The champions without an Anvil (all of them when the list is unknown), only built while
/// the section is open: a virtualized grid, which the champ select's scrolling moves.
others_grid: Entity<CardGrid>,
/// The scrolling of the whole champ select: the banner, the Anvil champions and the section.
champ_select_scroll: ScrollHandle,
/// How far down the scrolled content the section's grid starts, as its last layout put it:
/// what says which of its rows the window shows. None until it was laid out.
others_top: Rc<Cell<Option<Pixels>>>,
/// The scrolling of the whole champ select (the banner, the Anvil champions and the section),
/// and where the section's grid starts in it, which says the rows of the grid in view.
paging: Paging,
/// Its scrollbar, a view of its own for the fade.
champ_select_scrollbar: Entity<PageScrollbar>,
/// The section's header button, which the keyboard reaches.
others_focus: FocusHandle,
/// Lights the ring's tick of the card hovered in « Autres champions », and lifts it; its grid
/// is made again at each fold.
/// Lights the ring's tick of the card hovered in « Autres champions », lifts it, and scrolls the
/// champ select to the card the keyboard reaches; its grid is made again at each fold.
others_hover: [Subscription; 3],
_subscriptions: Vec<Subscription>,
_listener: Task<()>,
+1 -1
View File
@@ -74,7 +74,7 @@ impl Page {
// A new champ select starts with « Autres champions » folded and searchless, at the
// top of the page.
self.fold_others(window, cx);
self.champ_select_scroll.set_offset(point(px(0.), px(0.)));
self.paging.scroll.set_offset(point(px(0.), px(0.)));
self.reload_in_background(window, cx);
// Nor does the banner keep the previous scope's Challenge while the new one
// loads: its Season, its ticks and its splash go with the statistics.
+5 -8
View File
@@ -1,5 +1,5 @@
use crate::card::Card;
use crate::card_grid::{CardGrid, Paging, RevealRow};
use crate::card_grid::{CardGrid, RevealRow};
use crate::page::{Page, home};
use arena_tracker_core::{ChampSelect, ChampionRow, ChampionSearch};
use gpui_kit::*;
@@ -11,11 +11,8 @@ impl Page {
fn new_others_grid(&mut self, cx: &mut Context<Self>) {
let replaced = self.others_grid.entity_id();
// The new grid is not laid out: the old one's place is not its own.
self.others_top.set(None);
let paging = Paging {
scroll: self.champ_select_scroll.clone(),
top: self.others_top.clone(),
};
self.paging.top.set(None);
let paging = self.paging.clone();
self.others_grid = cx.new(|_| CardGrid::paged(paging));
self.others_hover = Self::light_and_reveal(&self.others_grid, cx);
self.lifts.drop_grid(replaced);
@@ -36,10 +33,10 @@ impl Page {
/// Scrolls the champ select the least that shows the row of « Autres champions » the
/// keyboard reached.
fn reveal(&mut self, row: RevealRow, cx: &mut Context<Self>) {
let Some(grid_top) = self.others_top.get() else {
let Some(grid_top) = self.paging.top.get() else {
return;
};
let scroll = &self.champ_select_scroll;
let scroll = &self.paging.scroll;
let (top, bottom) = (grid_top + row.top, grid_top + row.bottom);
let (scrolled, viewport) = (-scroll.offset().y, scroll.bounds().size.height);
let to = if top < scrolled {
+13 -7
View File
@@ -6,6 +6,7 @@ use crate::page::{
use crate::theme::heading;
use gpui_kit::base::Button as BaseButton;
use gpui_kit::component::input::Input;
use gpui_kit::component::scroll::Scrollbar;
use gpui_kit::component::{ActiveTheme as _, Icon, IconName, Sizable as _, StyledExt as _};
use gpui_kit::prelude::FluentBuilder as _;
use gpui_kit::*;
@@ -41,6 +42,8 @@ impl Page {
div()
.v_flex()
.gap_3()
// The scrollbar's lane: the sort selector does not go under it.
.pr(Scrollbar::width())
.child(
div()
.h_flex()
@@ -128,6 +131,7 @@ impl Page {
.v_flex()
.w_full()
.gap_3()
.pr(Scrollbar::width())
.child(
BaseButton::new("others-toggle")
.track_focus(&self.others_focus)
@@ -177,19 +181,21 @@ impl Page {
.into_any_element(),
None => grid.clone().into_any_element(),
};
let (scroll, top, grid) = (
self.champ_select_scroll.clone(),
self.others_top.clone(),
grid.downgrade(),
);
let (paging, grid) = (self.paging.clone(), grid.downgrade());
div()
.w_full()
.on_children_prepainted(move |bounds, _, cx| {
.on_children_prepainted(move |bounds, window, cx| {
let Some(bounds) = bounds.first() else { return };
let (scroll, top) = (&paging.scroll, &paging.top);
let now = bounds.origin.y - scroll.bounds().origin.y - scroll.offset().y;
if top.get().is_none_or(|was| (was - now).abs() > px(0.5)) {
top.set(Some(now));
grid.update(cx, |_, cx| cx.notify()).ok();
// The grid built its rows from the former place: it is drawn again, once this
// draw is over, as a change noted during a draw dirties nothing for the next.
let grid = grid.clone();
window.defer(cx, move |_, cx| {
grid.update(cx, |_, cx| cx.notify()).ok();
});
}
})
.child(shown)
+3 -12
View File
@@ -2,7 +2,6 @@
use arena_tracker_core::{SeasonScope, StateFilter, Statistics};
use gpui_kit::component::input::Input;
use gpui_kit::component::scroll::Scrollbar;
use gpui_kit::component::select::Select;
use gpui_kit::component::tab::{Tab, TabBar};
use gpui_kit::component::{ActiveTheme as _, Icon, IconName, Sizable as _, StyledExt as _};
@@ -160,7 +159,7 @@ impl Page {
if shown("others") && self.stats_notice().is_none() {
column = column.child(self.others_area(window.viewport_size().width, cx));
}
// One scrolling for all of it, with its scrollbar in the lane the cards leave.
// One scrolling for all of it, with its scrollbar in the lane the sections leave.
return vec![
div()
.relative()
@@ -174,17 +173,9 @@ impl Page {
.id("champ-select")
.size_full()
.overflow_y_scroll()
.track_scroll(&self.champ_select_scroll),
)
.child(
div()
.absolute()
.top_0()
.right_0()
.bottom_0()
.w(Scrollbar::width())
.child(Scrollbar::vertical(&self.champ_select_scroll)),
.track_scroll(&self.paging.scroll),
)
.child(self.champ_select_scrollbar.clone())
.into_any_element(),
];
}
+21
View File
@@ -0,0 +1,21 @@
use gpui_kit::component::scroll::Scrollbar;
use gpui_kit::*;
/// The scrollbar of the champ select's scrolling, in the lane on the right of its column. It is
/// its own view for the scrollbar's fade: the frames it asks for are drawn for this view, not the
/// whole page.
pub(in crate::page) struct PageScrollbar {
pub(in crate::page) scroll: ScrollHandle,
}
impl Render for PageScrollbar {
fn render(&mut self, _: &mut Window, _: &mut Context<Self>) -> impl IntoElement {
div()
.absolute()
.top_0()
.right_0()
.bottom_0()
.w(Scrollbar::width())
.child(Scrollbar::vertical(&self.scroll))
}
}
+9 -7
View File
@@ -1,3 +1,4 @@
use super::scrollbar::PageScrollbar;
use super::statistics::ChartsRow;
use super::{
ALL_FORMATS, ALL_SEASONS, AccountItem, Launch, MatchPlayback, Page, SORTS, Tab, home, now_ms,
@@ -72,13 +73,14 @@ impl Page {
let anvil_grid = cx.new(|_| CardGrid::fit_content());
let others_search_input =
cx.new(|cx| InputState::new(window, cx).placeholder("Rechercher"));
let champ_select_scroll = ScrollHandle::new();
let others_top = Rc::new(Cell::new(None));
let paging = Paging {
scroll: champ_select_scroll.clone(),
top: others_top.clone(),
scroll: ScrollHandle::new(),
top: Rc::new(Cell::new(None)),
};
let others_grid = cx.new(|_| CardGrid::paged(paging));
let champ_select_scrollbar = cx.new(|_| PageScrollbar {
scroll: paging.scroll.clone(),
});
let others_grid = cx.new(|_| CardGrid::paged(paging.clone()));
let others_focus = cx.focus_handle().tab_stop(true);
let ring = cx.new(|_| Ring::new());
let banner_art = BannerArt::new(cx);
@@ -282,8 +284,8 @@ impl Page {
others_search: ChampionSearch::new(""),
others_search_input,
others_grid,
champ_select_scroll,
others_top,
paging,
champ_select_scrollbar,
others_focus,
others_hover,
_subscriptions: subscriptions,
@@ -2,7 +2,7 @@
//! champions » move together, and the grid of the section builds only the rows in view.
use super::champ_select_fixtures::{click_others, frames, send};
use super::page_fixtures::{champions, draw, open_page_in_season, show, statistics};
use super::page_fixtures::{champions, draw, open_page_in_season, press, show, statistics};
use crate::card_grid::RevealRow;
use crate::page::Page;
use gpui_kit::{
@@ -29,7 +29,7 @@ fn wheel(window: &mut VisualTestContext, y: f32) {
}
fn scrolled(page: &Entity<Page>, window: &mut VisualTestContext) -> Pixels {
page.read_with(window, |p, _| -p.champ_select_scroll.offset().y)
page.read_with(window, |p, _| -p.paging.scroll.offset().y)
}
#[gpui::test]
@@ -82,9 +82,9 @@ async fn the_keyboard_reaches_a_row_the_page_scrolls_to(cx: &mut TestAppContext)
let (page, mut window) = open_others(cx);
let grid = page.read_with(&window, |p, _| p.others_grid.clone());
let top = page
.read_with(&window, |p, _| p.others_top.get())
.read_with(&window, |p, _| p.paging.top.get())
.expect("the grid was not laid out");
let viewport = page.read_with(&window, |p, _| p.champ_select_scroll.bounds().size.height);
let viewport = page.read_with(&window, |p, _| p.paging.scroll.bounds().size.height);
let reach = |window: &mut VisualTestContext, top: f32, bottom: f32| {
window.update(|_, cx| {
grid.update(cx, |_, cx| {
@@ -106,3 +106,40 @@ async fn the_keyboard_reaches_a_row_the_page_scrolls_to(cx: &mut TestAppContext)
reach(&mut window, 100., 400.);
assert_eq!(scrolled(&page, &mut window), top);
}
// The grid starts under the window: it keeps its first row built, so that Tab from the search
// reaches a card, and the page scrolls to it.
#[gpui::test]
async fn tab_from_the_search_enters_a_grid_below_the_window(cx: &mut TestAppContext) {
let (page, mut window) = open_others(cx);
let (top, viewport) = page.read_with(&window, |p, _| {
(
p.paging.top.get().unwrap(),
p.paging.scroll.bounds().size.height,
)
});
assert!(
top > viewport,
"the grid is in view: {top:?} in {viewport:?}"
);
assert_eq!(scrolled(&page, &mut window), px(0.));
let input = page.read_with(&window, |p, _| p.others_search_input.clone());
window.update(|w, cx| input.update(cx, |input, cx| input.focus(w, cx)));
for _ in 0..3 {
if scrolled(&page, &mut window) > px(0.) {
break;
}
press(&mut window, "tab");
}
draw(&mut window);
assert!(scrolled(&page, &mut window) > px(0.));
let card = window
.debug_bounds("card-1")
.expect("the card is not shown");
let height = window.update(|window, _| window.viewport_size().height);
assert!(
card.origin.y >= px(0.) && card.bottom() <= height,
"{card:?}"
);
}
+1 -1
View File
@@ -37,7 +37,7 @@ Budgets are checked by a **full benchmark before each major release** (X.0.0; ot
- **Champion table hover**: `powershell.exe -ExecutionPolicy Bypass -File scripts/hover-probe.ps1 -Title "Arena Tracker"` from WSL, with the « Statistiques » tab showing the table under the default band (adjust `-Top` and `-Bottom` otherwise). The app opens on « Défi »: open « Statistiques » first, as the band targets its table. After an idle phase, it posts synthetic mouse moves across table rows 240 times per second without touching the real cursor. Compare `HOVER cpu` with `IDLE cpu`; `HOVER ping` shows how long input waits behind the UI thread while hovering (budget 1). The default band is `-X 0.25 -Top 0.62 -Bottom 0.95 -Step 0.04` (fractions of the client area, about one row per move in a window at least 800 px tall). Leave the real cursor still over the window, outside the table: when it is outside the window, GPUI sees each synthetic move as the mouse entering then leaving, and refreshes the whole window, bypassing cached views.
- **Where a frame goes**: build with `scripts/prod build --features profile` (never for everyday use) and start the app with `ARENA_TRACKER_PROFILE=<file.csv>` (from WSL, pass it through `WSLENV`, e.g. `WSLENV=ARENA_TRACKER_PROFILE/p:ARENA_TRACKER_HIDE`). Every second it appends the frames GPUI drew (`draw`: total, `request_layout`, `prepaint`, `paint` in ms), their presentation (`present`) and the views' own time (`view`, recorded by GPUI from 0.5 ms). `ARENA_TRACKER_HIDE=<parts>`, read at start, removes parts of the page so that a part's cost is the difference with the full page under the hover probe: `header`, `banners` (both tabs), then for « Statistiques » `statistics-title` (the page title), `tiles`, `placements`, `completed`, `attempts` (the three charts keep their height), `tabs`, `table`, and for « Défi » `banner` (the banner, on the home and during a champ select: ring, Season, counter-title, its two lines and the splash; it replaces `home-header`, and is not `banners`, the status messages), `home-tools` (the heading row: title, count, filters and search), `cards` (the card grid), and during an Arena champ select `anvil` (the Anvil champions heading and row, which take the place of `home-tools` and `cards`), then `others` (the « Autres champions » section: its header and, when open, its search and grid).
- **Memory**: working set of `arena-tracker.exe` in Task Manager, or `Get-Process arena-tracker` in PowerShell, once the page is fully loaded.
- **CI cannot check budgets**: its runner is Linux without a GPU, and the app only builds on Windows (ADR-0003). When a change relies on cached views to stay within budget, a structural test (for example, "hovering the table does not render the charts") guards it instead of a timed test. The charts row is a cached view (#31), and « Défi » never renders it (a structural test guards that too). The home's card grid is the second (#72) and the « Autres champions » grid, while the section is open, the third: their size comes from their style, and structural tests check that hovering outside it does not render its cards and that hovering or scrolling it recomputes no statistics. The champ select scrolls as one page: the « Autres champions » grid is as tall as all its rows and holds no scrolling of its own, it builds only the rows the page's scrolling has in view (read at its own render, after the page's scrolling is held within its content), and a structural test checks that a scroll to the end builds at most a few rows of cards. The page's own render now runs at each wheel step there, as it already did in a window too short for the column: its ring and grids are cached views, and its cost is for the next release benchmark to check. Each card grid reads its portraits through its own image cache, never GPUI's app-wide one, and keeps only those of the cards it paints (#77): structural tests check that scrolling drops the others, from the GPU atlas too, and that hovering outside the grid drops none; a grid that stops being shown (the home grid under « Statistiques » or during a champ select, the Anvil champions row once it ends) gives all its portraits back. The banner's ring is the fourth (#84), as wide as the window width gives: structural tests check that hovering or scrolling the grid draws it again only for the tick that lights up or goes out, that drawing it alone neither draws the grid nor builds a card, and that its fixed shapes are tessellated once per set of ticks and size, a hover tessellating only the lit tick and a scroll that moves it none. The banner decodes its splash itself, never through GPUI's app-wide cache, one at a time on GPUI's low-priority queue at below-normal thread priority: structural tests check that it holds two at most (the one shown and the one decoding; a splash asked for meanwhile waits), gives back the one replaced, from the GPU atlas too, and holds none under « Statistiques », behind « Paramètres » (with the grids' portraits), scrolled out of view in a low window, or without an illustration. A cached view is laid out from its style alone, never its content, so only a part whose size does not depend on its content can be one. A view that is not cached renders again with its parent and saves nothing, while its state must be kept in sync; a window move bypasses every cache.
- **CI cannot check budgets**: its runner is Linux without a GPU, and the app only builds on Windows (ADR-0003). When a change relies on cached views to stay within budget, a structural test (for example, "hovering the table does not render the charts") guards it instead of a timed test. The charts row is a cached view (#31), and « Défi » never renders it (a structural test guards that too). The home's card grid is the second (#72) and the « Autres champions » grid, while the section is open, the third: their size comes from their style, and structural tests check that hovering outside it does not render its cards and that hovering or scrolling it recomputes no statistics. The champ select scrolls as one page: the « Autres champions » grid is as tall as all its rows and holds no scrolling of its own, it builds only the rows the page's scrolling has in view (read at its own render, after the page's scrolling is held within its content), and a structural test checks that a scroll to the end builds at most a few rows of cards. A grid wholly below the window keeps its first row built, for the keyboard to enter by (the page then scrolls to the card focused). Scrolling is no longer free of the page, though: a cached view is reused only while its bounds stay the same, and a scroll moves them, so each wheel step renders the page and draws again the ring, the Anvil hand and the « Autres champions » grid (as it already did in a window too short for the column); the scrollbar is its own view, so its fade draws no more than itself. The release benchmark must measure scrolling a champ select, and ratchet or fix the cost it finds. Each card grid reads its portraits through its own image cache, never GPUI's app-wide one, and keeps only those of the cards it paints (#77): structural tests check that scrolling drops the others, from the GPU atlas too, and that hovering outside the grid drops none; a grid that stops being shown (the home grid under « Statistiques » or during a champ select, the Anvil champions row once it ends) gives all its portraits back. The banner's ring is the fourth (#84), as wide as the window width gives: structural tests check that hovering or scrolling the grid draws it again only for the tick that lights up or goes out, that drawing it alone neither draws the grid nor builds a card, and that its fixed shapes are tessellated once per set of ticks and size, a hover tessellating only the lit tick and a scroll that moves it none. The banner decodes its splash itself, never through GPUI's app-wide cache, one at a time on GPUI's low-priority queue at below-normal thread priority: structural tests check that it holds two at most (the one shown and the one decoding; a splash asked for meanwhile waits), gives back the one replaced, from the GPU atlas too, and holds none under « Statistiques », behind « Paramètres » (with the grids' portraits), scrolled out of view in a low window, or without an illustration. A cached view is laid out from its style alone, never its content, so only a part whose size does not depend on its content can be one. A view that is not cached renders again with its parent and saves nothing, while its state must be kept in sync; a window move bypasses every cache.
GPUI and gpui-component are not modified to meet a budget: the app's own rendering cost is the lever (ADR-0004).