an open-source alternative to the dots, bots and muses of the world, run an office of claude code/codex like agents on your laptop, sandboxes or anywhere, uses your existing subscriptions
HTML agent-harnessagent-orchestrationagentsai-agentsautonomous-agentsclaude-codecodexcoding-agentsdesktop-appdeveloper-toolselectrongemini-cliharnessharness-engineeringlocal-firstmemorymulti-agentopencodeorchestrationtypescript
fix(fullscreen): surface notes and modals
Vyapak Goyal6737eb264879
diff --git a/src/renderer/src/components/AddAgentModal.tsx b/src/renderer/src/components/AddAgentModal.tsxindex 562ed6ff..7886bc00 100644--- a/src/renderer/src/components/AddAgentModal.tsx+++ b/src/renderer/src/components/AddAgentModal.tsx@@ -1,4 +1,4 @@-import { useState } from 'react';+import { useEffect, useState } from 'react';import { PixelPanel } from './PixelPanel';import { PixelButton } from './PixelButton';import { SpritePortrait } from './SpritePortrait';@@ -87,6 +87,19 @@ export function AddAgentModal({ onClose, config }: AddAgentModalProps) {const [error, setError] = useState<string | undefined>();const [busy, setBusy] = useState(false);+ // Close only the modal on Esc. Capture prevents the fullscreen terminal's+ // window-level handler from also closing the view underneath.+ useEffect(() => {+ const onKey = (e: KeyboardEvent) => {+ if (e.key !== 'Escape') return;+ e.preventDefault();+ e.stopImmediatePropagation();+ onClose();+ };+ window.addEventListener('keydown', onKey, true);+ return () => window.removeEventListener('keydown', onKey, true);+ }, [onClose]);+// Zero-step resume: when a session id is entered, look up the cwd it originally// ran in (from the transcript) and pre-fill the Folder so the user doesn't have// to find the worktree. They can still override the folder afterwards. Runs on@@ -188,7 +201,9 @@ export function AddAgentModal({ onClose, config }: AddAgentModalProps) {position: 'fixed', inset: 0,background: 'rgba(26, 19, 32, 0.6)',display: 'flex', alignItems: 'center', justifyContent: 'center',- zIndex: 100+ // Must sit above fullscreen terminal/file overlays (250/280) and their+ // hover popovers. The fullscreen Add Agent button uses this same modal.+ zIndex: 500}}><div onClick={(e) => e.stopPropagation()} style={{ width: 600, maxWidth: '92vw' }}>diff --git a/src/renderer/src/components/FullscreenTerminal.tsx b/src/renderer/src/components/FullscreenTerminal.tsxindex 92ddb8f7..6902b1ad 100644--- a/src/renderer/src/components/FullscreenTerminal.tsx+++ b/src/renderer/src/components/FullscreenTerminal.tsx@@ -1,4 +1,5 @@-import { useEffect } from 'react';+import { useEffect, useRef, useState } from 'react';+import { createPortal } from 'react-dom';import { PixelBadge } from './PixelBadge';import { PixelButton } from './PixelButton';import { PtyTerminalView } from './PtyTerminalView';@@ -16,6 +17,8 @@ export function FullscreenTerminal() {const setFullscreen = useStore(s => s.setFullscreen);const select = useStore(s => s.select);const setAddAgentOpen = useStore(s => s.setAddAgentOpen);+ const addAgentOpen = useStore(s => s.addAgentOpen);+ const setAgentNote = useStore(s => s.setAgentNote);const archiveAgent = useStore(s => s.archiveAgent);const updateAgent = useStore(s => s.updateAgent);@@ -26,13 +29,16 @@ export function FullscreenTerminal() {useEffect(() => {const onKey = (e: KeyboardEvent) => {if (e.key === 'Escape') {+ // A modal above fullscreen owns the interaction until it closes. Without+ // this guard, Esc from the Add Agent form unexpectedly exits fullscreen.+ if (addAgentOpen) return;e.preventDefault();setFullscreen(null);}};window.addEventListener('keydown', onKey);return () => window.removeEventListener('keydown', onKey);- }, [setFullscreen]);+ }, [addAgentOpen, setFullscreen]);if (!agent || !agent.ptyId) {// Bail out — no real agent to show@@ -94,6 +100,7 @@ export function FullscreenTerminal() {agent={a}active={a.id === agent.id}onClick={() => { select(a.id); setFullscreen(a.id); }}+ onNoteChange={(note) => setAgentNote(a.id, note)}/>))}<button@@ -159,44 +166,151 @@ export function FullscreenTerminal() {);}-function Tab({ agent, active, onClick }: { agent: Agent; active: boolean; onClick: () => void }) {+function Tab({+ agent,+ active,+ onClick,+ onNoteChange+}: {+ agent: Agent;+ active: boolean;+ onClick: () => void;+ onNoteChange: (note: string) => void;+}) {+ const buttonRef = useRef<HTMLButtonElement>(null);+ const noteRef = useRef<HTMLDivElement>(null);+ const hideTimer = useRef<number | null>(null);+ const [notePosition, setNotePosition] = useState<{ left: number; top: number } | null>(null);++ useEffect(() => () => {+ if (hideTimer.current !== null) window.clearTimeout(hideTimer.current);+ }, []);++ const showNote = () => {+ if (hideTimer.current !== null) window.clearTimeout(hideTimer.current);+ const rect = buttonRef.current?.getBoundingClientRect();+ if (!rect) return;+ const width = 280;+ // Fullscreen tabs sit against the top edge, so the note always opens BELOW+ // its agent. Clamp horizontally so right-most tabs stay inside the viewport.+ setNotePosition({+ left: Math.max(8, Math.min(rect.left, window.innerWidth - width - 8)),+ top: rect.bottom + 6+ });+ };++ const scheduleHideNote = () => {+ if (hideTimer.current !== null) window.clearTimeout(hideTimer.current);+ hideTimer.current = window.setTimeout(() => {+ // Keep the editor open while the user is typing, even if their pointer+ // leaves the popover. Blur schedules the normal close.+ if (noteRef.current?.contains(document.activeElement)) return;+ setNotePosition(null);+ }, 120);+ };+return (- <button- onClick={onClick}- title={`${agent.name} · ${agent.project}`}- style={{- height: active ? 38 : 32,- padding: '0 10px',- marginBottom: active ? 0 : 4,- background: active ? 'var(--cth-cream-100)' : 'var(--cth-cream-300)',- border: 'none',- boxShadow: active- ? 'inset 0 0 0 2px var(--cth-ink-900), inset 0 -3px 0 var(--cth-cream-100)'- : 'inset 0 0 0 1px var(--cth-ink-700)',- display: 'inline-flex', alignItems: 'center', gap: 8,- cursor: 'pointer',- position: 'relative',- fontFamily: 'var(--cth-font-ui)', fontSize: 14,- color: 'var(--cth-ink-900)',- maxWidth: 240,- whiteSpace: 'nowrap'- }}- >- <div style={{- width: 20, height: 32,- background: `var(--cth-${agent.accent}-light)`,- boxShadow: 'inset 0 0 0 1px var(--cth-ink-900)',- display: 'flex', alignItems: 'flex-end', justifyContent: 'center',- overflow: 'hidden'- }}>- <SpritePortrait character={agent.character} scale={1} />- </div>- <span style={{- overflow: 'hidden', textOverflow: 'ellipsis',- fontFamily: 'var(--cth-font-display)', fontSize: 8, lineHeight: '12px'- }}>{agent.name.toUpperCase()}</span>- <PixelBadge status={agent.status} />- </button>+ <>+ <button+ ref={buttonRef}+ onClick={onClick}+ onMouseEnter={showNote}+ onMouseLeave={scheduleHideNote}+ aria-label={`${agent.name} · ${agent.project}`}+ style={{+ height: active ? 38 : 32,+ padding: '0 10px',+ marginBottom: active ? 0 : 4,+ background: active ? 'var(--cth-cream-100)' : 'var(--cth-cream-300)',+ border: 'none',+ boxShadow: active+ ? 'inset 0 0 0 2px var(--cth-ink-900), inset 0 -3px 0 var(--cth-cream-100)'+ : 'inset 0 0 0 1px var(--cth-ink-700)',+ display: 'inline-flex', alignItems: 'center', gap: 8,+ cursor: 'pointer',+ position: 'relative',+ fontFamily: 'var(--cth-font-ui)', fontSize: 14,+ color: 'var(--cth-ink-900)',+ maxWidth: 240,+ whiteSpace: 'nowrap'+ }}+ >+ <div style={{+ width: 20, height: 32,+ background: `var(--cth-${agent.accent}-light)`,+ boxShadow: 'inset 0 0 0 1px var(--cth-ink-900)',+ display: 'flex', alignItems: 'flex-end', justifyContent: 'center',+ overflow: 'hidden'+ }}>+ <SpritePortrait character={agent.character} scale={1} />+ </div>+ <span style={{+ overflow: 'hidden', textOverflow: 'ellipsis',+ fontFamily: 'var(--cth-font-display)', fontSize: 8, lineHeight: '12px'+ }}>{agent.name.toUpperCase()}</span>+ <PixelBadge status={agent.status} />+ </button>+ {notePosition && createPortal(+ <div+ ref={noteRef}+ onMouseEnter={showNote}+ onMouseLeave={scheduleHideNote}+ onClick={(e) => e.stopPropagation()}+ style={{+ position: 'fixed',+ left: notePosition.left,+ top: notePosition.top,+ width: 280,+ zIndex: 450,+ padding: 8,+ background: 'var(--cth-paper-100)',+ boxShadow: 'inset 0 0 0 2px var(--cth-ink-900), 4px 4px 0 rgba(26,19,32,0.25)',+ boxSizing: 'border-box'+ }}+ >+ <div style={{+ marginBottom: 5,+ fontFamily: 'var(--cth-font-display)',+ fontSize: 8,+ lineHeight: '12px',+ color: 'var(--cth-ink-700)'+ }}>+ {agent.name.toUpperCase()} · PRIVATE NOTE+ </div>+ <input+ value={agent.note ?? ''}+ onChange={(e) => onNoteChange(e.target.value)}+ onFocus={() => {+ if (hideTimer.current !== null) window.clearTimeout(hideTimer.current);+ }}+ onBlur={scheduleHideNote}+ onKeyDown={(e) => {+ if (e.key === 'Escape') {+ e.stopPropagation();+ setNotePosition(null);+ buttonRef.current?.focus();+ }+ }}+ placeholder="private note…"+ aria-label={`Note for ${agent.name}`}+ style={{+ width: '100%',+ height: 28,+ padding: '2px 7px',+ border: 'none',+ outline: 'none',+ boxSizing: 'border-box',+ background: 'var(--cth-cream-100)',+ boxShadow: 'inset 0 0 0 1px var(--cth-ink-700)',+ fontFamily: 'var(--cth-font-mono)',+ fontSize: 11,+ color: 'var(--cth-ink-900)'+ }}+ />+ </div>,+ document.body+ )}+ </>);}