feat: right-click menus everywhere, workspace/session cost, long-term DB safety

Right-click menus: one portal shell (components/ContextMenu.tsx) for every
item with actions - sidebar/Recents/archived session rows (SessionMenu),
console tabs, pane headers, the Changes panel's files/tree/commits, the
workspace home, sessions outside a workspace (SessionRowMenu: Sessions
table, Dashboard, Activity, Workflow runs), prompt images, every Settings
list and every Claude Code/Codex config list (FileItemMenu). Buttons stay;
a delete keeps its button's confirm; the shell stops portal clicks from
reaching the card that opened it.

Status bar: Workspace $ and Session $ on the Workspace page, from
?lane= on GET /api/pricing/cost and the focused/replayed session's cost.

Database, no data dropped: synchronous=NORMAL, journal_size_limit 64 MB,
hourly PASSIVE checkpoint + PRAGMA optimize, idx_events_session_created
(replacing the redundant idx_events_session), watchdog reads
sessions.transcript_path, transcript parsed before the hook's write
transaction, GET /api/sessions/:id?events=0 for the web page (reloads only
on its own session, debounced), streamed export, transactional clear-data
and chunked cleanup, subagent import reads tool_use_ids once, runtime logs
rotated past 5 MB.
This commit is contained in:
2026-10-05 09:37:48 +07:00
parent 65fe680d38
commit ad6e80192d
80 changed files with 2914 additions and 489 deletions
@@ -1,6 +1,7 @@
/**
* @file WorkflowRunsPanel.tsx
* @description Surfaces dynamic Workflow-tool runs (issue #167) - fleets of
* @description Surfaces dynamic Workflow-tool runs (issue #167; a run's
* right-click opens its session's `SessionRowMenu`) - fleets of
* inner sub-agents spawned by the Claude Code "Workflow" tool, ingested from
* on-disk run journals. Works in two modes: controlled (pass `runs`, e.g. from
* SessionDetail) or self-fetching (pass a `statusFilter`, e.g. the Workflows
@@ -80,6 +81,8 @@ import { Link } from "react-router-dom";
import { useTranslation } from "react-i18next";
import { Workflow, ChevronRight, ChevronDown, Layers, ExternalLink, Loader2 } from "lucide-react";
import { api } from "../../lib/api";
import { useContextMenu } from "../ContextMenu";
import { SessionRowMenu } from "../SessionRowMenu";
import { eventBus } from "../../lib/eventBus";
import type {
WorkflowRun,
@@ -227,6 +230,7 @@ export function WorkflowRunsPanel({
hideSessionLink,
}: Props) {
const { t } = useTranslation("workflows");
const runCtx = useContextMenu<string>();
const controlled = controlledRuns != null;
const [fetchedRuns, setFetchedRuns] = useState<WorkflowRun[]>([]);
@@ -337,6 +341,14 @@ export function WorkflowRunsPanel({
return (
<div className="space-y-2">
{runCtx.menu && (
<SessionRowMenu
session={{ id: runCtx.menu.item }}
x={runCtx.menu.x}
y={runCtx.menu.y}
onClose={runCtx.close}
/>
)}
{runs.map((run) => {
const isOpen = expanded.has(run.run_id);
const running = run.status === "running" || run.status === "working";
@@ -354,6 +366,7 @@ export function WorkflowRunsPanel({
>
<button
onClick={() => toggle(run.run_id)}
onContextMenu={(e) => runCtx.open(e, run.session_id)}
className="w-full flex items-center gap-3 px-3 py-2.5 text-left hover:bg-surface-2/30 transition-colors"
aria-expanded={isOpen}
>