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(ui): reusable SegmentedPill control

enesac243ad03e22
diff --git a/src/renderer/components/SegmentedPill.tsx b/src/renderer/components/SegmentedPill.tsx
new file mode 100644
index 000000000..35addf1cc
--- /dev/null
+++ b/src/renderer/components/SegmentedPill.tsx
@@ -0,0 +1,30 @@
+export function SegmentedPill<T extends string>({
+ value,
+ options,
+ onChange,
+ ariaLabel
+}: {
+ value: T
+ options: { value: T; label: string }[]
+ onChange: (v: T) => void
+ ariaLabel?: string
+}): React.JSX.Element {
+ return (
+ <div className="seg-pill" role="radiogroup" aria-label={ariaLabel}>
+ {options.map((opt) => (
+ <button
+ key={opt.value}
+ type="button"
+ role="radio"
+ aria-checked={opt.value === value}
+ className={`seg-pill-opt${opt.value === value ? ' active' : ''}`}
+ onClick={() => {
+ if (opt.value !== value) onChange(opt.value)
+ }}
+ >
+ {opt.label}
+ </button>
+ ))}
+ </div>
+ )
+}
diff --git a/src/renderer/styles.css b/src/renderer/styles.css
index 50b1b06c3..b61b90956 100644
--- a/src/renderer/styles.css
+++ b/src/renderer/styles.css
@@ -3169,3 +3169,31 @@ body,
.ctx-popover__meta { margin-top: 8px; font-size: 12px; }
.ctx-popover__sub { margin-top: 4px; font-size: 11px; color: rgba(255, 255, 255, 0.5); }
.usage-account__email { font-size: 13px; }
+
+.seg-pill {
+ display: inline-flex;
+ padding: 2px;
+ gap: 2px;
+ border-radius: 8px;
+ background: rgba(255, 255, 255, 0.06);
+ border: 1px solid rgba(255, 255, 255, 0.08);
+}
+.seg-pill-opt {
+ appearance: none;
+ border: none;
+ background: transparent;
+ color: rgba(255, 255, 255, 0.55);
+ font: inherit;
+ font-size: 12px;
+ padding: 3px 12px;
+ border-radius: 6px;
+ cursor: pointer;
+ transition: background 0.12s ease, color 0.12s ease;
+}
+.seg-pill-opt:hover {
+ color: rgba(255, 255, 255, 0.85);
+}
+.seg-pill-opt.active {
+ background: var(--accent);
+ color: #fff;
+}