Select the types of activity you want to include in your feed.
fix(pagestream): single Esc closes page after card flipping
Track when page:navigate is used for pagestream card flipping. On Esc, skip accumulated webview history and close the window immediately instead of requiring one Esc per navigation entry.
···847847 }
848848}, api.scopes.GLOBAL);
849849850850-// Navigate to a new URL (used by pagestream to flip between cards)
850850+// Navigate to a new URL (used by pagestream to flip between cards).
851851+// Tracks the original URL so Escape can skip accumulated history.
852852+let pagestreamOriginalUrl = null;
853853+851854api.subscribe('page:navigate', (msg) => {
852855 if (msg.windowId != null && msg.windowId !== myWindowId) return;
853856 const url = msg.url;
854857 if (url) {
855858 DEBUG && console.log('[page] page:navigate:', url);
859859+ if (!pagestreamOriginalUrl) pagestreamOriginalUrl = webview.getURL();
856860 webview.loadURL(url);
857861 navbar.setUrl(url);
858862 }
···887891// --- Escape handling ---
888892889893api.escape.onEscape(() => {
894894+ // If pagestream was flipping through cards, skip all accumulated history
895895+ // and let backend close the window (return to pagestream)
896896+ if (pagestreamOriginalUrl) {
897897+ pagestreamOriginalUrl = null;
898898+ DEBUG && console.log('[page] ESC: pagestream browsing, closing window');
899899+ return { handled: false }; // let backend close
900900+ }
890901 if (webview.canGoBack()) {
891902 DEBUG && console.log('[page] ESC: webview going back');
892903 webview.goBack();