experiments in a post-browser web
10
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(groups): ESC from group page closes window, ESC to groups list focuses last group

+23 -3
+8
app/page/page.js
··· 1249 1249 webview.goBack(); 1250 1250 return { handled: true }; 1251 1251 } 1252 + // In group mode, ESC at root should close this page and return to the group view. 1253 + // The backend escPolicy returns 'nothing' for content windows in active sessions, 1254 + // so we must close the window directly from the renderer. 1255 + if (currentMode === 'group') { 1256 + DEBUG && console.log('[page] ESC: group mode at root, closing window'); 1257 + window.close(); 1258 + return { handled: true }; 1259 + } 1252 1260 DEBUG && console.log('[page] ESC: at root, letting backend decide'); 1253 1261 return { handled: false }; 1254 1262 });
+15 -3
extensions/groups/home.js
··· 85 85 untaggedCount: 0, 86 86 selectedIndex: 0, 87 87 searchQuery: '', 88 - showAllTags: false 88 + showAllTags: false, 89 + lastViewedTagId: null 89 90 }; 90 91 91 92 // Expose state for debugging in tests ··· 601 602 * Show the groups (tags) view 602 603 */ 603 604 const showGroups = async () => { 605 + // Remember which group was being viewed so we can focus it in the list 606 + if (state.currentTag) { 607 + state.lastViewedTagId = state.currentTag.id; 608 + } 604 609 state.view = VIEW_GROUPS; 605 610 state.currentTag = null; 606 611 state.searchQuery = ''; ··· 694 699 } 695 700 } 696 701 697 - // Reset selection 698 - state.selectedIndex = 0; 702 + // Select the last-viewed group if returning from addresses view, otherwise reset to 0 703 + if (state.lastViewedTagId) { 704 + const cards = Array.from(container.querySelectorAll('peek-card')); 705 + const targetIndex = cards.findIndex(card => card.dataset.tagId === String(state.lastViewedTagId)); 706 + state.selectedIndex = targetIndex >= 0 ? targetIndex : 0; 707 + state.lastViewedTagId = null; 708 + } else { 709 + state.selectedIndex = 0; 710 + } 699 711 updateSelection(); 700 712 }; 701 713