fix(hub): keep the inbox scroll position when a row is ticked

A tick redraws every inbox row and refocuses the ticked checkbox. At
390 the 258 px tall inbox then scrolled 9 px although no row, the head
or the list changed height. toggle() now restores the scroll position
after the redraw and the refocus.

🎯 Fix: 85 %
💥 Break: 2 %
💸 Tokens: –
⏱️ Velocity: –
🛡️ Security: 100 %
🏆 Score: 83
🚦 Gate: ⛔ fix 85 % < 90

Created-with: https://s.veen.world/skills
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kevin Veen-BirkenbachandClaude Opus 5.5 committed 2026-11-23 14:23:28 +00:00
1 parent f23ed40f0e
commit d0f3393654
1 file changed
+2
+2
View File
@@ -248,12 +248,14 @@
const key = keyOf(item);
flip(key);
ui.cursor = Math.max(visibleInbox().findIndex((entry) => keyOf(entry) === key), 0);
const top = inboxDom.scrollTop;
drawInbox();
drawGrant();
const box = inboxDom.querySelector(`.item[data-index="${ui.cursor}"] > input[type="checkbox"]`);
if (refocus && box) {
box.focus({preventScroll: true});
}
inboxDom.scrollTop = top;
}
function reviewsPill(item) {