From 97c2fac1279b61b895dec9035cfbaaf013a773e3 Mon Sep 17 00:00:00 2001 From: yetone Date: Tue, 6 Oct 2026 14:03:10 +0800 Subject: [PATCH] =?UTF-8?q?usage:=20the=20Sessions=20calendar=20refits=20o?= =?UTF-8?q?n=20the=20next=20frame,=20not=20inside=20its=20ResizeObserver's?= =?UTF-8?q?=20call=20=E2=80=94=20sessions-overview's=20WebKit=20en=20case?= =?UTF-8?q?=20failed=20about=202=20runs=20in=203=20with=20the=20page=20err?= =?UTF-8?q?or=20"ResizeObserver=20loop=20completed=20with=20undelivered=20?= =?UTF-8?q?notifications".=20sessCalWidth=20called=20the=20chart's=20fitCa?= =?UTF-8?q?l=20in=20the=20observer's=20own=20call;=20when=20the=20room=20f?= =?UTF-8?q?or=20the=20weeks=20changed,=20the=20calendar=20was=20put=20agai?= =?UTF-8?q?n=20with=20more=20or=20fewer=20leading=20cells,=20the=20card's?= =?UTF-8?q?=20height=20moved=20(1028x187=20=E2=86=92=201028x190,=20read=20?= =?UTF-8?q?from=20a=20probe=20that=20logged=20each=20observer's=20entries)?= =?UTF-8?q?,=20and=20the=20observer=20was=20owed=20that=20change=20in=20th?= =?UTF-8?q?e=20same=20frame,=20which=20WebKit=20reports=20as=20the=20loop?= =?UTF-8?q?=20error.=20The=20refit=20now=20waits=20for=20the=20next=20anim?= =?UTF-8?q?ation=20frame,=20once=20per=20chart=20however=20many=20sizes=20?= =?UTF-8?q?arrive;=20a=20calendar=20drawn=20or=20redrawn=20still=20fits=20?= =?UTF-8?q?at=20once=20(renderSessChart=20calls=20fitCal=20itself).=20sess?= =?UTF-8?q?ions-overview=20passes=2010/10=20in=20WebKit=20and=2010/10=20in?= =?UTF-8?q?=20Chromium,=20en=20and=20zh=20(it=20failed=203=20of=204=20WebK?= =?UTF-8?q?it=20runs=20before);=20sessions-calendar-fill,=20sessions-today?= =?UTF-8?q?,=20sessions-overview=20and=20the=20other=20sessions-*=20tests?= =?UTF-8?q?=20and=20click-scroll=20pass=20in=20both,=20except=20sessions-t?= =?UTF-8?q?alk's=20WebKit=20"opening=20Continue=20in=20moved=20the=20page"?= =?UTF-8?q?=20(179=20vs=20184),=20which=20fails=20the=20same=20on=20origin?= =?UTF-8?q?/main=20b45fe28c=20and=20is=20not=20this=20change.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/gui/assets/app.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/internal/gui/assets/app.js b/internal/gui/assets/app.js index df31830e..c2ace878 100644 --- a/internal/gui/assets/app.js +++ b/internal/gui/assets/app.js @@ -15964,7 +15964,13 @@ const SESS_WEEK = 20, SESS_WEEK_MAX = 24; // wide card and left the rest empty. The weeks before the range come in as // empty cells, GitHub's way, up to a year in all, and the cells grow a little // to take what is left; a narrow card gets none and its cells shrink. -const sessCalWidth = new ResizeObserver((es) => { for (const e of es) e.target.fitCal?.(); }); +// It fits on the next frame: a calendar put again changes the card's height, +// which this would be told of in the same call, a ResizeObserver loop. +const sessCalWidth = new ResizeObserver((es) => { + for (const { target: chart } of es) { + if (!chart.fitFrame) chart.fitFrame = requestAnimationFrame(() => { chart.fitFrame = 0; chart.fitCal?.(); }); + } +}); function sessCalFit(chart, days, value, tip) { const wrap = chart.querySelector(".sess-cal-wrap"), cal = wrap?.querySelector(".sess-cal"); if (!cal || !wrap.clientWidth) return;