Skip to content

Commit 2c538f0

Browse files
committed
fix: show actual working directory, not derived fallback
The Working directory field was confusing because it showed: - derivedPath (workspace + repo name) even when NOT actually set - This made it look like a directory was selected when it wasn't Now it shows: - The ACTUAL repoPath from taskState (what's really stored) - Empty with placeholder "Not set - click Run to select" if nothing is set - Clear button only shows when directory is actually set This makes it crystal clear: - What directory will ACTUALLY be used - Whether you need to select one or not Much clearer UX!
1 parent 3b66de0 commit 2c538f0

2 files changed

Lines changed: 5 additions & 14 deletions

File tree

src/renderer/features/task-detail/components/TaskDetailPanel.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,6 @@ export function TaskDetailPanel({ taskId, task }: TaskDetailPanelProps) {
9090
? { status: execution.state.progress.status }
9191
: undefined
9292
}
93-
derivedPath={taskData.derivedPath}
94-
defaultWorkspace={taskData.defaultWorkspace}
9593
/>
9694
</Flex>
9795

src/renderer/features/task-detail/components/TaskMetadata.tsx

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,14 @@ import type React from "react";
1919
interface TaskMetadataProps {
2020
task: Task;
2121
progress?: { status: string };
22-
derivedPath: string | null;
23-
defaultWorkspace: string | null;
2422
}
2523

2624
export const TaskMetadata: React.FC<TaskMetadataProps> = ({
2725
task,
2826
progress,
29-
derivedPath,
30-
defaultWorkspace,
3127
}) => {
32-
const { setRepoPath, revalidateRepo } = useTaskExecutionStore();
28+
const { setRepoPath, revalidateRepo, getTaskState } = useTaskExecutionStore();
29+
const taskState = getTaskState(task.id);
3330

3431
const handleWorkingDirectoryChange = async (newPath: string) => {
3532
setRepoPath(task.id, newPath);
@@ -91,17 +88,13 @@ export const TaskMetadata: React.FC<TaskMetadataProps> = ({
9188
<Flex gap="2" align="center" width="100%">
9289
<Box style={{ flex: 1, minWidth: 0 }}>
9390
<FolderPicker
94-
value={derivedPath || ""}
91+
value={taskState.repoPath || ""}
9592
onChange={handleWorkingDirectoryChange}
96-
placeholder={
97-
!defaultWorkspace
98-
? "No workspace configured"
99-
: "Select working directory..."
100-
}
93+
placeholder="Not set - click Run to select"
10194
size="2"
10295
/>
10396
</Box>
104-
{derivedPath && (
97+
{taskState.repoPath && (
10598
<Tooltip content="Clear directory selection">
10699
<IconButton
107100
size="2"

0 commit comments

Comments
 (0)