From 928da70638fceb622d5e83ed0792817e1bcd908e Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 14 Oct 2026 00:34:46 +0000 Subject: Closing the pager (or a picture) lands on the page under it, not wherever Back goes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The × was a blind history.back(), and the entry under the pager isn't always the feed: the browser's older entries outlive a background reload of the app, and boot merges entries. It took the reader to the wallet, then the chat list. closeLayer still steps Back (so the phone's Back doesn't reopen it), but if Back lands anywhere but the page under the layer, the reader is put on that page and that entry rewritten to it. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01KPw21NEpWeTGu6swVASmBt --- tools/image-zoom-test.js | 1 + 1 file changed, 1 insertion(+) (limited to 'tools/image-zoom-test.js') diff --git a/tools/image-zoom-test.js b/tools/image-zoom-test.js index 3ada708..0a11f0c 100644 --- a/tools/image-zoom-test.js +++ b/tools/image-zoom-test.js @@ -19,6 +19,7 @@ const goBack = (fn) => { if (backDelay) setTimeout(() => { fn(); render(); }, backDelay); else { fn(); render(); } }; +const closeLayer = (field) => goBack(() => { ui[field] = null; }); function render() { morphChildren(document.querySelector('#app'), ui.lightbox ? [imageViewer()] : []); } window.test = { ui, render, get backCalls() { return backCalls; }, get backSawViewer() { return backSawViewer; }, delayBack(ms) { backDelay = ms; }, -- cgit v1.2.3