perf: defer terminal menu pane lookups (#3946)

This commit is contained in:
Neil
2026-05-30 14:26:12 -07:00
committed by GitHub
parent d23cd0e451
commit 5f84e6d5b5
@@ -272,8 +272,11 @@ export function useTerminalPaneContextMenu({
setOpen(true)
}
const paneCount = managerRef.current?.getPanes().length ?? 1
const menuPaneId = resolveMenuPane()?.id ?? null
// Why: PaneManager.getPanes() allocates public pane wrappers. Closed menus
// do not need pane counts or target identity, so avoid that work on every
// render across hundreds of mounted terminal tabs.
const paneCount = open ? (managerRef.current?.getPanes().length ?? 1) : 1
const menuPaneId = open ? (resolveMenuPane()?.id ?? null) : null
return {
open,