Something went wrong. Try again.
View your browser history as a graph
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455/** * The single record type at the heart of History Graph. * * A `Visit` is one navigation to one URL, at one moment, in one tab. * The tree/graph is implicit: `parentId` is the edge from this visit back to * the visit that caused it (the link you clicked, the tab that opened it...). * `parentId === null` means this visit is the ROOT of a branch — e.g. you typed * a URL or used a bookmark, starting a fresh line of browsing. * * The shape is intentionally flat and additive: new optional fields can be * added over time without migrations, and every renderer reads the same store. */export interface Visit { /** Stable unique id (uuid). */ id: string; /** The committed URL of this navigation. */ url: string; /** Page title, filled in lazily once the tab reports it. */ title?: string; /** Favicon URL, filled in lazily. */ faviconUrl?: string; /** Epoch milliseconds at which the navigation committed. */ ts: number; /** Chrome tab id this navigation happened in. */ tabId: number; /** Edge to the causing visit, or null for a branch root. */ parentId: string | null; /** chrome.webNavigation transitionType, e.g. "link" | "typed" | "reload". */ transition: string; /** chrome.webNavigation transitionQualifiers, e.g. ["forward_back"]. */ qualifiers: string[];
// --- Room to grow (not populated by the MVP) --- /** * Stable logical-tab id, used to group a tab's visits even across a reopen. * Only stamped on tabs that were *reopened* from a closed tab's node (it * carries the original tab's group key, so the restored tab rejoins the old * subtree's group). Absent on normal tabs, which group by `tabId`. Grouping is * therefore always `tabKey ?? String(tabId)` — see `tabGroupOf`. */ tabKey?: string; /** Browsing-session grouping. */ sessionId?: string; /** Dwell time on the page, once we measure it. */ durationMs?: number;}
/** * A view-model node: a Visit plus its resolved children. This is what the * query layer hands to renderers, so no renderer ever touches storage directly. */export interface VisitNode extends Visit { children: VisitNode[];}