/** * Control+Tab in the desktop app: switch between recently viewed chats, most * recent first, as ⌘Tab switches apps. The list spans the person's workspaces, * so it also jumps between chats in different workspaces. A quick press goes back to the previous * chat (press again to return); holding Control shows the list, each Tab moves * down it (Shift+Tab up), and releasing Control opens the highlighted chat. * * Past the chats someone opened, the list carries on through the other chats * the app knows, most recently active first, so holding Tab keeps going back * in time. The list is read when the switcher opens and only ever grows at * the end (as more chats load), so it holds still while the person cycles. * * Every chat the person opened is there, sub-agent chats included: someone * who works in a sub-agent's chat expects Control+Tab to take them back to * it. The carry-on part lists only their own chats (and sub-agent chats they * pinned), since a workspace can hold far more sub-agent chats than chats. */ import { type ChatDirectorySnapshot } from "./chat-directory.js"; /** At most this many chats; older ones are a search away in ⌘K. */ export declare const SWITCHER_LIMIT = 100; /** A press shorter than this switches without ever drawing the list. */ export declare const SWITCHER_SHOW_DELAY_MS = 140; export type ChatSwitcherState = Readonly<{ /** Chats in the order shown: recently viewed first, then recently active. */ ids: readonly string[]; /** How many of `ids`, from the front, are chats the person opened recently. */ viewed: number; /** The highlighted chat. */ index: number; /** Whether the list is drawn (after the delay, or once Tab is pressed again). */ visible: boolean; }>; type SwitcherDirectory = Pick; /** * The chats to switch between: the open chat (when there is one), the other * recently viewed chats, then the rest the app knows by latest activity. * Null when there is nowhere to switch to. */ export declare function openChatSwitcher(directory: SwitcherDirectory, currentChatId: string | null, backwards: boolean, /** Whether a workspace is still open to the person; chats elsewhere are left out. */ reachable?: (workspaceId: string) => boolean): ChatSwitcherState | null; /** * Chats that loaded while the list is open join at its end, so nothing the * person is looking at moves. The same state when there is nothing new. */ export declare function extendChatSwitcher(state: ChatSwitcherState, directory: SwitcherDirectory, reachable?: (workspaceId: string) => boolean): ChatSwitcherState; /** Tab moves down the list and Shift+Tab up, wrapping at the ends. */ export declare function stepChatSwitcher(state: ChatSwitcherState, step: 1 | -1): ChatSwitcherState; /** Control+Tab exactly: no ⌘, no ⌥ (Shift reverses). */ export declare function isSwitcherKey(event: Pick): boolean; export {};