refactor(ext/shared): move View + PopupState to shared/popup-state.ts
Foundation for Plan C Phase 1: shared/state.ts (next task) needs to import PopupState without creating a popup->shared circular dep. popup.ts now re-exports from the new location so existing callers don't break in this task. Task 1.4 will sweep them onto the canonical import path. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -67,29 +67,8 @@ function parseUrlParams(): { view?: View; type?: string; id?: string } | null {
|
||||
|
||||
// --- State ---
|
||||
|
||||
export type View = 'locked' | 'list' | 'detail' | 'add' | 'edit' | 'settings' | 'settings-vault' | 'trash' | 'devices' | 'field-history';
|
||||
|
||||
export interface PopupState {
|
||||
view: View;
|
||||
entries: Array<[ItemId, ManifestEntry]>;
|
||||
selectedId: ItemId | null;
|
||||
selectedItem: Item | null;
|
||||
selectedIndex: number;
|
||||
searchQuery: string;
|
||||
activeGroup: string | null;
|
||||
error: string | null;
|
||||
loading: boolean;
|
||||
// Captured tab snapshot taken at popup-open. Used by fill_credentials
|
||||
// to guard against TOCTOU navigation — the SW re-checks this URL's
|
||||
// hostname against the tab's live URL before forwarding fill_credentials
|
||||
// to the content script. See router/popup-only.ts#handleFillCredentials.
|
||||
capturedTabId: number | null;
|
||||
capturedUrl: string;
|
||||
newType: import('../shared/types').ItemType | null;
|
||||
vaultSettings: import('../shared/types').VaultSettings | null;
|
||||
generatorDefaults: import('../shared/types').GeneratorRequest | null;
|
||||
historyItemId: import('../shared/types').ItemId | null;
|
||||
}
|
||||
export type { View, PopupState } from '../shared/popup-state';
|
||||
import type { View, PopupState } from '../shared/popup-state';
|
||||
|
||||
let currentState: PopupState = {
|
||||
view: 'locked',
|
||||
|
||||
Reference in New Issue
Block a user