feat(tui): git view, project-scoped task stats, polished layout/theme
- Add a Git interactive view (hotkey [t]/[4]): branch + ahead/behind,
recent commits with detail strip, staged/unstaged/untracked files
panel, branches list, worktrees panel, and a [P] push modal with
pre-flight commit list and capture of stdout/stderr. ←→ cycles
status → branches → worktrees → commits → changes; ↑↓ navigates
rows in the focused list. 5s poll while mounted.
- Project-scoped task stats: BoardView pushes its selected project
path into the controller; refreshTUIStats now reads from a per-
project TaskStore via a shared getProjectStore helper. Project
switch triggers an immediate refresh via onBoardScopeChange.
- Unified MainHeader used by status and interactive modes — section
tabs ([1]–[5]) and interactive view tabs ([b]/[a]/[g]/[t]) always
visible; previously the interactive header replaced the main one.
- Logs panel keeps its size when expanding a single entry.
- 'f' cycles severity filter from any panel in status mode.
- BoardView: explicit cross-view shortcuts so g/a/t always switch
views regardless of input-handler ordering.
- BoardView column overlap fix: flexShrink={0} on structural rows.
- TaskCard always shows the title with wrap="wrap"; single short-id
pill, no duplicate id-as-title fallback.
- Stats panel reorg: StatRow helper, bold section headers, narrow-
width wrap for Heap and Memory trailing fragments.
- Lighter blue palette: cyanBright fg accents / cyan active bg /
logo gradient whiteBright → white → cyanBright → cyan → blue.
- System stats sampler: RSS, heap (V8 limit-aware color), external,
CPU%, load avg, system used/free. Heap thresholds scale off
--max-old-space-size automatically.
- Test fixture updated for the new InteractiveData.git block.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,99 @@
|
||||
import "./AuthTokenRecoveryDialog.css";
|
||||
import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import { clearAuthToken, setAuthToken } from "../auth";
|
||||
|
||||
export interface AuthTokenRecoveryDialogProps {
|
||||
open: boolean;
|
||||
}
|
||||
|
||||
export function AuthTokenRecoveryDialog({ open }: AuthTokenRecoveryDialogProps) {
|
||||
const [tokenInput, setTokenInput] = useState("");
|
||||
const tokenInputRef = useRef<HTMLInputElement>(null);
|
||||
|
||||
useEffect(() => {
|
||||
if (!open) return;
|
||||
tokenInputRef.current?.focus();
|
||||
}, [open]);
|
||||
|
||||
const handleSetToken = useCallback(() => {
|
||||
const token = tokenInput.trim();
|
||||
if (!token) return;
|
||||
|
||||
setAuthToken(token);
|
||||
window.location.reload();
|
||||
}, [tokenInput]);
|
||||
|
||||
const handleClearAndRetry = useCallback(() => {
|
||||
clearAuthToken();
|
||||
window.location.reload();
|
||||
}, []);
|
||||
|
||||
if (!open) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<div
|
||||
className="modal-overlay open auth-token-recovery-overlay"
|
||||
role="presentation"
|
||||
onKeyDownCapture={(event) => {
|
||||
if (event.key === "Escape") {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
}
|
||||
}}
|
||||
>
|
||||
<div
|
||||
className="modal auth-token-recovery-modal"
|
||||
role="dialog"
|
||||
aria-modal="true"
|
||||
aria-labelledby="auth-token-recovery-title"
|
||||
aria-describedby="auth-token-recovery-description"
|
||||
>
|
||||
<div className="modal-header auth-token-recovery-header">
|
||||
<h2 id="auth-token-recovery-title">Authentication token required</h2>
|
||||
</div>
|
||||
|
||||
<div className="auth-token-recovery-content">
|
||||
<p id="auth-token-recovery-description">
|
||||
This dashboard session can't authenticate with the daemon. Set a replacement token or clear the
|
||||
current token and retry.
|
||||
</p>
|
||||
|
||||
<div className="auth-token-recovery-field">
|
||||
<label htmlFor="auth-token-recovery-input">Replacement token</label>
|
||||
<input
|
||||
ref={tokenInputRef}
|
||||
id="auth-token-recovery-input"
|
||||
className="input"
|
||||
type="password"
|
||||
value={tokenInput}
|
||||
onChange={(event) => setTokenInput(event.target.value)}
|
||||
placeholder="Paste token"
|
||||
autoComplete="off"
|
||||
spellCheck={false}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="modal-actions auth-token-recovery-actions">
|
||||
<button
|
||||
type="button"
|
||||
className="btn"
|
||||
onClick={handleClearAndRetry}
|
||||
>
|
||||
Clear token and retry
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-primary"
|
||||
onClick={handleSetToken}
|
||||
disabled={tokenInput.trim().length === 0}
|
||||
>
|
||||
Set token and reload
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user