From 5ddd57896a5546ac3e048e3ab953274c6bdc83fa Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Mon, 3 Aug 2026 23:43:25 -0700 Subject: [PATCH] test(runtime): type the payload-size fixture arrays for tsc --- .../terminal-list-payload-size.test.ts | 55 ++++++++++++++++--- 1 file changed, 46 insertions(+), 9 deletions(-) diff --git a/src/main/runtime/terminal-list-payload-size.test.ts b/src/main/runtime/terminal-list-payload-size.test.ts index 1ff3811e12f..f1a9161b621 100644 --- a/src/main/runtime/terminal-list-payload-size.test.ts +++ b/src/main/runtime/terminal-list-payload-size.test.ts @@ -55,21 +55,58 @@ const makeStore = () => ({ }) }) +type PaneLayout = + | { type: 'leaf'; leafId: string } + | { type: 'split'; direction: 'vertical'; first: PaneLayout; second: PaneLayout } + +type GraphTab = { + tabId: string + worktreeId: string + title: string + activeLeafId: string + layout: PaneLayout +} + +type GraphLeaf = { + tabId: string + worktreeId: string + leafId: string + paneRuntimeId: number + ptyId: string + title: string +} + +type MobileTab = { + type: 'terminal' + id: string + title: string + parentTabId: string + leafId: string + ptyId: string + parentLayout: { + root: PaneLayout + activeLeafId: string + expandedLeafId: string | null + ptyIdsByLeafId: Record + } + isActive: boolean +} + function buildLoadedRuntime(): OrcaRuntimeService { const runtime = new OrcaRuntimeService(makeStore() as never) - const tabs = [] - const leaves = [] - const mobileTabs = [] + const tabs: GraphTab[] = [] + const leaves: GraphLeaf[] = [] + const mobileTabs: MobileTab[] = [] for (let tab = 0; tab < TAB_COUNT; tab += 1) { const tabId = tabIdFor(tab) const first = leafIdFor(tab * PANES_PER_TAB) const second = leafIdFor(tab * PANES_PER_TAB + 1) - const root = { - type: 'split' as const, - direction: 'vertical' as const, - first: { type: 'leaf' as const, leafId: first }, - second: { type: 'leaf' as const, leafId: second } + const root: PaneLayout = { + type: 'split', + direction: 'vertical', + first: { type: 'leaf', leafId: first }, + second: { type: 'leaf', leafId: second } } tabs.push({ tabId, @@ -90,7 +127,7 @@ function buildLoadedRuntime(): OrcaRuntimeService { title: titleFor(index) }) mobileTabs.push({ - type: 'terminal' as const, + type: 'terminal', id: `${tabId}::${leafId}`, title: titleFor(index), parentTabId: tabId,