feat: move session sharing and collab rooms into a plugin (B12)

This commit is contained in:
LukeGus committed 2026-09-23 23:42:46 -05:00
1 parent 791d8656a1
commit a276f6898c
207 files changed
+35771 -11072

No files matched your search

@@ -784,8 +784,30 @@ const TerminalInner = forwardRef<TerminalHandle, SSHTerminalProps>(
openSidePanel: (panelId, props) =>
setDock({ id: panelId, props: props ?? {} }),
runCommand: handleRunCommandInTerminal,
getShareTarget: () =>
isConnected &&
!isQuickConnect &&
!hostConfig.joinShareId &&
typeof hostConfig.id === "number" &&
sessionIdRef.current
? {
hostId: hostConfig.id,
sessionId: sessionIdRef.current,
protocol: "ssh" as const,
tabInstanceId: hostConfig.instanceId,
}
: null,
}),
[host, terminal, handleRunCommandInTerminal],
[
host,
terminal,
handleRunCommandInTerminal,
isConnected,
isQuickConnect,
hostConfig.joinShareId,
hostConfig.id,
hostConfig.instanceId,
],
);
const overlayProps = useMemo<TerminalOverlayProps>(
@@ -1423,27 +1445,8 @@ const TerminalInner = forwardRef<TerminalHandle, SSHTerminalProps>(
onOpenFileManager?.("/");
}
},
getShareTarget: () =>
isConnected &&
!isQuickConnect &&
!hostConfig.joinShareId &&
typeof hostConfig.id === "number" &&
sessionIdRef.current
? {
hostId: hostConfig.id,
sessionId: sessionIdRef.current,
protocol: "ssh" as const,
tabInstanceId: hostConfig.instanceId,
}
: null,
}),
[
isConnected,
terminal,
isQuickConnect,
hostConfig.joinShareId,
hostConfig.id,
],
[isConnected, terminal],
);
function getCopyOnSelect() {
@@ -29,6 +29,16 @@ export interface TerminalSlotApi {
openSidePanel: (panelId: string, props?: Record<string, unknown>) => void;
/** Types a command into the session and runs it. */
runCommand: (command: string) => void;
/**
* What sharing this session needs, or null while there is nothing to share
* (not connected yet, a quick connect, or a session joined from a share).
*/
getShareTarget: () => {
hostId: number;
sessionId: string;
protocol: "ssh";
tabInstanceId?: string;
} | null;
}
export interface TerminalToolbarStatusProps {
@@ -33,11 +33,4 @@ export interface TerminalHandle {
notifyResize: () => void;
refresh: () => void;
getApplicationCursorKeysMode: () => boolean;
/** What the shell's share action needs, or null while there is nothing to share. */
getShareTarget: () => {
hostId: number;
sessionId: string;
protocol: "ssh";
tabInstanceId?: string;
} | null;
}