feat(ext/popup): wire Document type into form + detail + list dispatchers

Document is no longer 'coming soon' — the type chooser unlocks it,
form dispatcher routes to documentType.renderForm, detail dispatcher
routes to documentType.renderDetail. teardown chains include documentType.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
adlee-was-taken
2026-04-25 20:46:26 -04:00
parent 9c481422ad
commit ab36dbd31a
3 changed files with 7 additions and 3 deletions

View File

@@ -9,6 +9,7 @@ import * as identity from './types/identity';
import * as card from './types/card';
import * as key from './types/key';
import * as totp from './types/totp';
import * as documentType from './types/document';
export function renderItemForm(app: HTMLElement, mode: 'add' | 'edit'): void {
login.teardown(); // detail-view's ticker/listener don't leak into form
@@ -17,6 +18,7 @@ export function renderItemForm(app: HTMLElement, mode: 'add' | 'edit'): void {
card.teardown();
key.teardown();
totp.teardown();
documentType.teardown();
const state = getState();
const existing = mode === 'edit' ? state.selectedItem : null;
const type: ItemType = existing?.type ?? state.newType ?? 'login';
@@ -28,7 +30,7 @@ export function renderItemForm(app: HTMLElement, mode: 'add' | 'edit'): void {
case 'card': return card.renderForm(app, mode, existing);
case 'key': return key.renderForm(app, mode, existing);
case 'totp': return totp.renderForm(app, mode, existing);
case 'document': return renderComingSoon(app, type);
case 'document': return documentType.renderForm(app, mode, existing);
}
}