refactor(renderer): drop the local narrowMapByKeys copy in favour of the exported one

This commit is contained in:
Jinwoo-H
2026-09-17 16:48:31 -04:00
parent 905ae7b290
commit 4d4bf2cf94
@@ -24,6 +24,7 @@ import type {
import {
captureMountedTerminalSurfaces,
narrowedEntriesEqual,
narrowMapByKeys,
narrowRecordByKeys
} from './mobile-session-capture'
import {
@@ -208,24 +209,6 @@ export function buildMobileSessionWorktreeInputs(
}
}
function narrowMapByKeys<T>(
source: ReadonlyMap<string, T>,
keys: readonly string[]
): ReadonlyMap<string, T> {
if (source.size === 0 || keys.length === 0) {
return EMPTY_NARROWED_BY_KEY
}
let narrowed: Map<string, T> | null = null
for (const key of keys) {
if (!source.has(key)) {
continue
}
narrowed ??= new Map<string, T>()
narrowed.set(key, source.get(key) as T)
}
return narrowed ?? EMPTY_NARROWED_BY_KEY
}
export function buildMobileLaunchDraftsByPaneKey(args: {
terminalTabs: AppState['tabsByWorktree'][string]
terminalLayoutByTabId: MobileSessionWorktreeInputs['terminalLayoutByTabId']