2026-02-28 20:42:40 +00:00
|
|
|
import { useShallow } from "zustand/react/shallow";
|
2026-02-27 04:29:51 +00:00
|
|
|
import { useAppState } from "../../store/appState";
|
2026-06-28 19:26:05 -07:00
|
|
|
import SttButton from "../terminal/SttButton";
|
|
|
|
|
import type { useSTT } from "../../hooks/useSTT";
|
2026-02-27 04:29:51 +00:00
|
|
|
|
2026-06-28 19:26:05 -07:00
|
|
|
interface Props {
|
|
|
|
|
stt: ReturnType<typeof useSTT>;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default function StatusBar({ stt }: Props) {
|
|
|
|
|
const {
|
|
|
|
|
projects, sessions, terminalHasSelection, activeSessionId, sttEnabled,
|
|
|
|
|
terminalAtBottom, scrollActiveToBottom,
|
|
|
|
|
} = useAppState(
|
|
|
|
|
useShallow(s => ({
|
|
|
|
|
projects: s.projects,
|
|
|
|
|
sessions: s.sessions,
|
|
|
|
|
terminalHasSelection: s.terminalHasSelection,
|
|
|
|
|
activeSessionId: s.activeSessionId,
|
|
|
|
|
sttEnabled: s.appSettings?.stt?.enabled,
|
|
|
|
|
terminalAtBottom: s.terminalAtBottom,
|
|
|
|
|
scrollActiveToBottom: s.scrollActiveToBottom,
|
|
|
|
|
}))
|
2026-02-28 20:42:40 +00:00
|
|
|
);
|
2026-02-27 04:29:51 +00:00
|
|
|
const running = projects.filter((p) => p.status === "running").length;
|
|
|
|
|
|
|
|
|
|
return (
|
2026-02-27 10:31:27 -08:00
|
|
|
<div className="flex items-center h-6 px-4 bg-[var(--bg-tertiary)] border border-[var(--border-color)] rounded-lg text-xs text-[var(--text-secondary)]">
|
2026-02-27 04:29:51 +00:00
|
|
|
<span>
|
|
|
|
|
{projects.length} project{projects.length !== 1 ? "s" : ""}
|
|
|
|
|
</span>
|
|
|
|
|
<span className="mx-2">|</span>
|
|
|
|
|
<span>
|
|
|
|
|
{running} running
|
|
|
|
|
</span>
|
|
|
|
|
<span className="mx-2">|</span>
|
|
|
|
|
<span>
|
|
|
|
|
{sessions.length} terminal{sessions.length !== 1 ? "s" : ""}
|
|
|
|
|
</span>
|
2026-03-12 13:14:08 -07:00
|
|
|
{terminalHasSelection && (
|
|
|
|
|
<>
|
|
|
|
|
<span className="mx-2">|</span>
|
2026-04-17 08:58:56 -07:00
|
|
|
<span className="text-[var(--accent)]">
|
|
|
|
|
Ctrl+Shift+C: copy trimmed · Ctrl+Shift+Alt+C: copy raw
|
|
|
|
|
</span>
|
2026-03-12 13:14:08 -07:00
|
|
|
</>
|
|
|
|
|
)}
|
2026-06-28 19:26:05 -07:00
|
|
|
{/* Right-aligned controls: Jump to Current + STT mic */}
|
|
|
|
|
<div className="ml-auto flex items-center gap-3 pl-2">
|
|
|
|
|
{activeSessionId && !terminalAtBottom && (
|
|
|
|
|
<button
|
|
|
|
|
onClick={() => scrollActiveToBottom()}
|
|
|
|
|
className="text-[var(--accent)] hover:text-[var(--accent-hover)] cursor-pointer"
|
|
|
|
|
title="Scroll the terminal to the latest output"
|
|
|
|
|
>
|
|
|
|
|
Jump to Current ↓
|
|
|
|
|
</button>
|
|
|
|
|
)}
|
|
|
|
|
{sttEnabled && activeSessionId && (
|
|
|
|
|
<SttButton
|
|
|
|
|
state={stt.state}
|
|
|
|
|
error={stt.error}
|
|
|
|
|
onToggle={stt.toggle}
|
|
|
|
|
onCancel={stt.cancelRecording}
|
|
|
|
|
/>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
2026-02-27 04:29:51 +00:00
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|