From d581705eb0513d6c0fa1873c679c57f66116df77 Mon Sep 17 00:00:00 2001 From: nntrivi2001 Date: Wed, 12 Aug 2026 16:20:02 +0700 Subject: [PATCH] fix(workspace): restore View button functionality and clean up dead props Fix two issues identified in code review: 1. Critical: onViewFromHistory was a silent no-op. Now navigates to the SessionDetail page using the same route pattern as the external link in RunHistory, allowing users to view a finished run's transcript. 2. Important: Removed dead slashCommands={[]} prop from RunSetup invocation. Made slashCommands optional in RunSetupProps to maintain type safety while reflecting that the discovery logic was removed. All tests pass (396 client, 1152 server). --- client/src/components/run/RunSetup.tsx | 4 ++-- client/src/pages/Workspace.tsx | 19 +++++++++++-------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/client/src/components/run/RunSetup.tsx b/client/src/components/run/RunSetup.tsx index 3ae0890..8308057 100644 --- a/client/src/components/run/RunSetup.tsx +++ b/client/src/components/run/RunSetup.tsx @@ -112,7 +112,7 @@ interface RunSetupProps { * sessions. Undefined when no lane is selected (the picker then lists * everything, same as before lanes existed). */ laneCwd?: string; - slashCommands: SlashCommand[]; + slashCommands?: SlashCommand[]; runHistory: DashboardRunHistoryItem[]; onResumeFromHistory: (item: DashboardRunHistoryItem) => void; } @@ -172,7 +172,7 @@ export function RunSetup(props: RunSetupProps) { onSubmit={() => handleStart(props)} placeholder={t("fields.promptPlaceholderTerminal")} rows={5} - slashCommands={props.slashCommands} + slashCommands={props.slashCommands ?? []} fileCwd={props.resumeSession?.cwd || props.cwd} />
diff --git a/client/src/pages/Workspace.tsx b/client/src/pages/Workspace.tsx index 6dbc7e8..036e397 100644 --- a/client/src/pages/Workspace.tsx +++ b/client/src/pages/Workspace.tsx @@ -38,7 +38,7 @@ * ----------------------------------------------------------------------------- */ import { useCallback, useEffect, useRef, useState, useSyncExternalStore } from "react"; -import { useSearchParams } from "react-router-dom"; +import { useSearchParams, useNavigate } from "react-router-dom"; import { useTranslation } from "react-i18next"; import { Play, AlertCircle, X, Plus } from "lucide-react"; import { api } from "../lib/api"; @@ -307,12 +307,16 @@ export function Workspace() { [busy, refreshList, t, lanes] ); - // View a past run inline: not implemented in the new TerminalView architecture. - // The old RunConsole showed transcripts inline, but TerminalView only shows live - // runs. Use SessionDetail page instead. - const onViewFromHistory = useCallback(() => { - // No-op: feature moved to SessionDetail page - }, []); + // View a past run: navigate to the SessionDetail page which shows the transcript. + const navigate = useNavigate(); + const onViewFromHistory = useCallback( + (item: DashboardRunHistoryItem) => { + if (item.session_id) { + navigate(`/sessions/${encodeURIComponent(item.session_id)}`); + } + }, + [navigate] + ); const start = useCallback(async () => { if (!prompt.trim() || busy) return; @@ -802,7 +806,6 @@ export function Workspace() { laneCwd={currentLane?.cwd} resumeSession={resumeSession} onResumeSessionChange={setResumeSession} - slashCommands={[]} runHistory={runHistory} onResumeFromHistory={onResumeFromHistory} />