mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-10-09 15:58:34 +00:00
636f4d7037
Keep the compose bar inside the terminal workspace so SFTP side panels stay full height, refit xterm when the bar toggles, and remeasure split-pane geometry when side panels open or close. Co-authored-by: Cursor <cursoragent@cursor.com>
39 lines
1.4 KiB
TypeScript
39 lines
1.4 KiB
TypeScript
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
import React, { memo } from 'react';
|
|
|
|
import { TerminalLayerFocusSidebarSection } from './TerminalLayerFocusSidebarSection';
|
|
import { TerminalLayerSidePanelSection } from './TerminalLayerSidePanelSection';
|
|
import { TerminalLayerWorkspaceSection } from './TerminalLayerWorkspaceSection';
|
|
import { terminalLayerViewCtxEqual } from './terminalLayerViewMemo';
|
|
import { useTerminalHostTreeLayoutWidth } from '../../application/state/terminalHostTreeStore';
|
|
|
|
type TerminalLayerViewContext = Record<string, any>;
|
|
|
|
function TerminalLayerViewInner({ ctx }: { ctx: TerminalLayerViewContext }) {
|
|
const hostTreeLayoutWidth = useTerminalHostTreeLayoutWidth();
|
|
|
|
return (
|
|
<div
|
|
ref={ctx.workspaceOuterRef}
|
|
className="absolute inset-0 bg-background flex min-h-0"
|
|
data-section="terminal-workspace"
|
|
style={{
|
|
visibility: ctx.isTerminalLayerVisible ? 'visible' : 'hidden',
|
|
pointerEvents: ctx.isTerminalLayerVisible ? 'auto' : 'none',
|
|
zIndex: ctx.isTerminalLayerVisible ? 10 : 0,
|
|
left: hostTreeLayoutWidth,
|
|
}}
|
|
>
|
|
<TerminalLayerSidePanelSection ctx={ctx} />
|
|
<TerminalLayerFocusSidebarSection ctx={ctx} />
|
|
<TerminalLayerWorkspaceSection ctx={ctx} />
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export const TerminalLayerView = memo(
|
|
TerminalLayerViewInner,
|
|
(prev, next) => terminalLayerViewCtxEqual(prev.ctx, next.ctx),
|
|
);
|
|
TerminalLayerView.displayName = 'TerminalLayerView';
|