mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-09-24 15:49:09 +00:00
57af825706
Stop AppView from re-subscribing to activeTabId so shell composition no longer rebuilds on every top-tab click; move plugin keybindings and host editor surface visibility into leaf subscribers. Patch session-restore activeTabId without re-serializing every session on tab switches, defer chrome theme CSS work with fingerprint short-circuit + rAF, let terminal workspace chrome read active workspace from the live store, apply TopTabs presentation per tab, and keep hibernate wake chunked/idle with leaner focus scheduling.
41 lines
1.1 KiB
TypeScript
41 lines
1.1 KiB
TypeScript
import React, { useMemo } from 'react';
|
|
|
|
import { PluginContributionHost } from '../../components/plugins/PluginContributionHost';
|
|
import type { TerminalSession, Workspace } from '../../types';
|
|
import { useActiveTabId } from '../state/activeTabStore';
|
|
import { resolveActivePluginKeybindingContext } from '../state/pluginContributionContexts';
|
|
|
|
/**
|
|
* Leaf host for plugin keybindings so AppView does not subscribe to activeTabId.
|
|
* Tab switches only re-render this small surface (and plugin lifecycle), not the shell.
|
|
*/
|
|
export function AppPluginKeybindingHost({
|
|
locale,
|
|
theme,
|
|
themeTokens,
|
|
sessions,
|
|
workspaces,
|
|
}: {
|
|
locale: string;
|
|
theme: string;
|
|
themeTokens?: Record<string, string>;
|
|
sessions: TerminalSession[];
|
|
workspaces: Workspace[];
|
|
}) {
|
|
const activeTabId = useActiveTabId();
|
|
const keybindingContext = useMemo(() => resolveActivePluginKeybindingContext({
|
|
activeTabId,
|
|
sessions,
|
|
workspaces,
|
|
}), [activeTabId, sessions, workspaces]);
|
|
|
|
return (
|
|
<PluginContributionHost
|
|
locale={locale}
|
|
theme={theme}
|
|
themeTokens={themeTokens}
|
|
keybindingContext={keybindingContext}
|
|
/>
|
|
);
|
|
}
|