From fd7d40aa1addd20f5a09478ecd2b69619361c5a0 Mon Sep 17 00:00:00 2001 From: Georges-Antoine Assi Date: Sun, 21 Jun 2026 17:55:33 -0400 Subject: [PATCH] docs(v2): note the gallery ratio cache is intentionally unbounded ratioByRomId is keyed by rom id so a re-visited platform/collection re-packs instantly without re-waiting on image loads. It's never pruned, but each entry is two numbers (a few hundred KB even at tens of thousands of distinct ROMs), so an LRU ceiling isn't worth it. Document the choice so it reads as deliberate. Co-Authored-By: Claude Opus 4.8 (1M context) --- frontend/src/v2/components/Gallery/GalleryShell.vue | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/frontend/src/v2/components/Gallery/GalleryShell.vue b/frontend/src/v2/components/Gallery/GalleryShell.vue index acaadf66e..845c4dc1b 100644 --- a/frontend/src/v2/components/Gallery/GalleryShell.vue +++ b/frontend/src/v2/components/Gallery/GalleryShell.vue @@ -269,6 +269,12 @@ const coverAspectRatio = computed(() => // each cover's ratio once its image loads; the flow-packer reads them via // `ratioAt(position)`. Updates are batched behind `ratioVersion` so a burst // of image loads triggers a single re-pack instead of one per cover. +// +// Intentionally unbounded for the page's lifetime: keeping it by rom id is +// what lets a re-visited platform/collection re-pack instantly without +// waiting on image loads again. Each entry is two numbers, so even a user +// browsing tens of thousands of distinct ROMs costs a few hundred KB — not +// worth an LRU ceiling. Reset happens naturally on a full page reload. const ratioByRomId = new Map(); const ratioVersion = ref(0); let ratioBumpTimer: ReturnType | null = null;