frontend: suppress network banner params unneeded after runtime lock refactor

This commit is contained in:
2026-07-26 15:12:14 +02:00
parent e5bafc30e7
commit e7bf1d3666

View File

@ -39,7 +39,6 @@ import { FitAddon } from "@xterm/addon-fit";
import "@xterm/xterm/css/xterm.css"; import "@xterm/xterm/css/xterm.css";
import { useGateways } from "@/app/di"; import { useGateways } from "@/app/di";
import type { ResolvedAgentSystemPermissions } from "@/domain";
import type { import type {
OpenTerminalOptions, OpenTerminalOptions,
ReattachResult, ReattachResult,
@ -114,8 +113,6 @@ interface TerminalViewProps {
* it never remounts/reopens the terminal. * it never remounts/reopens the terminal.
*/ */
refitSignal?: number; refitSignal?: number;
/** Optional resolved system permissions for this agent/cell. */
systemPermissions?: ResolvedAgentSystemPermissions | null;
} }
/** /**
@ -147,7 +144,6 @@ export function TerminalView({
portal, portal,
onReady, onReady,
refitSignal, refitSignal,
systemPermissions,
}: TerminalViewProps) { }: TerminalViewProps) {
const { terminal } = useGateways(); const { terminal } = useGateways();
const containerRef = useRef<HTMLDivElement | null>(null); const containerRef = useRef<HTMLDivElement | null>(null);
@ -432,15 +428,6 @@ export function TerminalView({
refitRef.current?.(); refitRef.current?.();
}, [refitSignal]); }, [refitSignal]);
const showNetworkBanner =
systemPermissions != null &&
(systemPermissions.runtimeLock.state === "locked" ||
systemPermissions.effective === "deny");
const networkReason =
systemPermissions?.runtimeLock.reason ??
systemPermissions?.control.reason ??
"Le réseau est interdit pour cette cellule.";
return ( return (
<div <div
data-testid="terminal-view" data-testid="terminal-view"
@ -453,35 +440,6 @@ export function TerminalView({
> >
{/* xterm mounts into this inner node; the error banner is a sibling so {/* xterm mounts into this inner node; the error banner is a sibling so
React never fights xterm over the same subtree. */} React never fights xterm over the same subtree. */}
<<<<<<< HEAD
<div ref={containerRef} style={{ width: "100%", height: "100%" }} />
{showNetworkBanner && (
<div
role="status"
data-testid="terminal-network-banner"
style={{
position: "absolute",
top: 8,
left: 8,
right: 8,
padding: "0.5rem 0.75rem",
border: "1px solid rgba(245, 158, 11, 0.45)",
borderRadius: 6,
background: "rgba(24, 24, 27, 0.94)",
color: "var(--color-warning, #f59e0b)",
fontSize: 12,
fontFamily:
'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace',
whiteSpace: "pre-wrap",
wordBreak: "break-word",
zIndex: 2,
}}
>
{systemPermissions.runtimeLock.state === "locked"
? "Réseau verrouillé par le runtime."
: "Réseau interdit pour cet agent."}{" "}
{networkReason}
=======
<div <div
ref={containerRef} ref={containerRef}
data-testid="terminal-xterm-container" data-testid="terminal-xterm-container"
@ -512,7 +470,6 @@ export function TerminalView({
}} }}
> >
Préparation du terminal Préparation du terminal
>>>>>>> main
</div> </div>
)} )}
{openError && ( {openError && (