Skip to content

Node-based terminal manager for AI coding agents — tmux-backed terminals and parallel agent sessions as draggable nodes on an infinite pan/zoom canvas. macOS, Linux, and a browser Server Edition.

feat(search): IconSearch + FindBar presentational component and styles

enes31cc9fda3841
diff --git a/src/renderer/components/FindBar.tsx b/src/renderer/components/FindBar.tsx
new file mode 100644
index 000000000..b9c1094f4
--- /dev/null
+++ b/src/renderer/components/FindBar.tsx
@@ -0,0 +1,78 @@
+import { useEffect, useRef } from 'react'
+
+/** Identical shape to SearchSnippet in useTerminalSearch.ts (imported by the consumer). */
+export interface FindBarSnippet {
+ source: 'terminal' | 'claude'
+ role?: 'user' | 'assistant' | 'tool'
+ text: string
+}
+
+interface Props {
+ query: string
+ onQueryChange: (q: string) => void
+ matchIndex: number // 1-based; 0 when no matches
+ matchCount: number
+ current: FindBarSnippet | null
+ onNext: () => void
+ onPrev: () => void
+ onClose: () => void
+}
+
+export function FindBar({
+ query,
+ onQueryChange,
+ matchIndex,
+ matchCount,
+ current,
+ onNext,
+ onPrev,
+ onClose
+}: Props): JSX.Element {
+ const inputRef = useRef<HTMLInputElement>(null)
+ useEffect(() => {
+ inputRef.current?.focus()
+ }, [])
+
+ return (
+ <div className="term-node__find nodrag nowheel" onMouseDown={(e) => e.stopPropagation()}>
+ <div className="term-node__find-row">
+ <input
+ ref={inputRef}
+ className="term-node__find-input"
+ placeholder="Find…"
+ value={query}
+ spellCheck={false}
+ onChange={(e) => onQueryChange(e.target.value)}
+ onKeyDown={(e) => {
+ if (e.key === 'Enter') {
+ e.preventDefault()
+ if (e.shiftKey) onPrev()
+ else onNext()
+ } else if (e.key === 'Escape') {
+ e.preventDefault()
+ onClose()
+ }
+ }}
+ />
+ <span className="term-node__find-count">{matchCount ? `${matchIndex} / ${matchCount}` : '0 / 0'}</span>
+ <button className="term-node__find-btn" title="Previous (Shift+Enter)" onClick={onPrev} disabled={!matchCount}>
+ ↑
+ </button>
+ <button className="term-node__find-btn" title="Next (Enter)" onClick={onNext} disabled={!matchCount}>
+ ↓
+ </button>
+ <button className="term-node__find-btn" title="Close (Esc)" onClick={onClose}>
+ ✕
+ </button>
+ </div>
+ {current && (
+ <div className="term-node__find-snippet">
+ <span className={`term-node__find-tag term-node__find-tag--${current.source}`}>
+ {current.source === 'claude' ? current.role ?? 'claude' : 'terminal'}
+ </span>
+ <span className="term-node__find-snippet-text">{current.text.trim() || '(empty line)'}</span>
+ </div>
+ )}
+ </div>
+ )
+}
diff --git a/src/renderer/components/icons.tsx b/src/renderer/components/icons.tsx
index cb50c7de5..6dab77c94 100644
--- a/src/renderer/components/icons.tsx
+++ b/src/renderer/components/icons.tsx
@@ -151,3 +151,10 @@ export const IconSave = () => (
<path d="M17 21v-8H7v8M7 3v5h8" />
</svg>
)
+
+export const IconSearch = () => (
+ <svg {...S}>
+ <circle cx="11" cy="11" r="7" />
+ <path d="M21 21l-4.35-4.35" />
+ </svg>
+)
diff --git a/src/renderer/styles.css b/src/renderer/styles.css
index 50b1b06c3..9a3641faf 100644
--- a/src/renderer/styles.css
+++ b/src/renderer/styles.css
@@ -634,6 +634,116 @@ body,
cursor: default;
}
+.term-node__search {
+ background: transparent;
+ border: none;
+ color: var(--muted);
+ cursor: pointer;
+ line-height: 1;
+ padding: 2px 5px;
+ border-radius: 4px;
+ flex-shrink: 0;
+ display: inline-flex;
+ align-items: center;
+}
+
+.term-node__search:hover {
+ background: rgba(10, 132, 255, 0.18);
+ color: #6cb0ff;
+}
+
+.term-node__find {
+ display: flex;
+ flex-direction: column;
+ gap: 4px;
+ padding: 6px 8px;
+ background: #2a2a2a;
+ border-bottom: 1px solid rgba(255, 255, 255, 0.08);
+}
+
+.term-node__find-row {
+ display: flex;
+ align-items: center;
+ gap: 6px;
+}
+
+.term-node__find-input {
+ flex: 1;
+ min-width: 0;
+ background: #1e1e1e;
+ border: 1px solid rgba(255, 255, 255, 0.12);
+ border-radius: 4px;
+ color: #e6e6e6;
+ font-size: 12px;
+ padding: 3px 6px;
+ outline: none;
+}
+
+.term-node__find-input:focus {
+ border-color: var(--accent);
+}
+
+.term-node__find-count {
+ color: var(--muted);
+ font-size: 11px;
+ font-variant-numeric: tabular-nums;
+ flex-shrink: 0;
+}
+
+.term-node__find-btn {
+ background: transparent;
+ border: none;
+ color: var(--muted);
+ cursor: pointer;
+ font-size: 12px;
+ line-height: 1;
+ padding: 2px 5px;
+ border-radius: 4px;
+ flex-shrink: 0;
+}
+
+.term-node__find-btn:hover:not(:disabled) {
+ background: rgba(10, 132, 255, 0.18);
+ color: #6cb0ff;
+}
+
+.term-node__find-btn:disabled {
+ opacity: 0.4;
+ cursor: default;
+}
+
+.term-node__find-snippet {
+ display: flex;
+ align-items: baseline;
+ gap: 6px;
+ font-size: 11px;
+ color: #cfcfcf;
+ overflow: hidden;
+}
+
+.term-node__find-snippet-text {
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ font-family: var(--mono, monospace);
+}
+
+.term-node__find-tag {
+ flex-shrink: 0;
+ text-transform: uppercase;
+ font-size: 9px;
+ letter-spacing: 0.4px;
+ padding: 1px 5px;
+ border-radius: 3px;
+ background: rgba(255, 255, 255, 0.1);
+ color: var(--muted);
+}
+
+.term-node__find-tag--claude {
+ background: rgba(10, 132, 255, 0.22);
+ color: #6cb0ff;
+}
+
.term-node__close {
background: transparent;
border: none;