feat(ext/popup): session expiry listener, open-vault links, Shift+F shortcut

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
adlee-was-taken
2026-04-27 15:46:32 -04:00
parent 101f0093a4
commit 7e0950e364
3 changed files with 39 additions and 8 deletions

View File

@@ -2,7 +2,7 @@
/// type-iconed rows. Clicking a row fetches the full Item and navigates
/// to the detail view.
import { getState, setState, sendMessage, navigate, escapeHtml } from '../popup';
import { getState, setState, sendMessage, navigate, escapeHtml, openVaultTab } from '../popup';
import type { ItemId, ItemType, ManifestEntry, Item } from '../../shared/types';
/// Extract the display hostname from an icon_hint or fallback to the first tag.
@@ -66,6 +66,7 @@ export function renderItemList(app: HTMLElement): void {
<button class="btn" id="new-btn" style="font-size:11px;">+ new</button>
<button class="btn" id="sync-btn" style="font-size:11px;">sync</button>
<span style="flex:1;"></span>
<button class="btn" id="vault-btn" style="font-size:11px;" title="Open vault (Shift+F)">&#x2934;</button>
<button class="btn" id="settings-btn" style="font-size:11px;">settings</button>
<button class="btn" id="lock-btn" style="font-size:11px;">lock</button>
</div>
@@ -92,6 +93,8 @@ export function renderItemList(app: HTMLElement): void {
wireRowClicks();
});
document.getElementById('vault-btn')?.addEventListener('click', () => openVaultTab());
document.getElementById('new-btn')?.addEventListener('click', () => {
setState({ newType: null });
navigate('add');
@@ -203,6 +206,12 @@ function handleListKeydown(e: KeyboardEvent): void {
return;
}
if (e.key === 'F' && e.shiftKey) {
e.preventDefault();
openVaultTab();
return;
}
const filtered = getFilteredEntries();
if (e.key === 'ArrowDown') {