Skip to content

Commit 5b08659

Browse files
committed
feat: task detail UI cleanup
1 parent 82b027c commit 5b08659

File tree

7 files changed

+390
-332
lines changed

7 files changed

+390
-332
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@
5959
"yaml": "^2.8.1"
6060
},
6161
"dependencies": {
62-
"@posthog/agent": "^1.3.1",
62+
"@phosphor-icons/react": "^2.1.10",
63+
"@posthog/agent": "^1.4.0",
6364
"@radix-ui/react-icons": "^1.3.2",
6465
"@radix-ui/themes": "^3.2.1",
6566
"@tanstack/react-query": "^5.90.2",

pnpm-lock.yaml

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/renderer/components/Combobox.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ interface ComboboxProps {
1616
searchPlaceholder?: string;
1717
emptyMessage?: string;
1818
size?: "1" | "2" | "3";
19-
variant?: "classic" | "surface" | "soft" | "ghost";
19+
variant?: "classic" | "surface" | "soft" | "ghost" | "outline";
2020
renderItem?: (item: ComboboxItem) => ReactNode;
21+
icon?: ReactNode;
2122
side?: "top" | "bottom" | "left" | "right";
2223
align?: "start" | "center" | "end";
2324
}
@@ -32,6 +33,7 @@ export function Combobox({
3233
size = "2",
3334
variant = "surface",
3435
renderItem,
36+
icon,
3537
side = "bottom",
3638
align = "start",
3739
}: ComboboxProps) {
@@ -54,7 +56,10 @@ export function Combobox({
5456
<Popover.Trigger>
5557
<Button variant={variant} size={size} color="gray">
5658
<Flex justify="between" align="center" gap="2" width="100%">
57-
<Text size={size}>{displayValue}</Text>
59+
<Flex align="center" gap="2">
60+
{icon}
61+
<Text size={size}>{displayValue}</Text>
62+
</Flex>
5863
<ChevronDownIcon />
5964
</Flex>
6065
</Button>

src/renderer/components/LogView.tsx

Lines changed: 37 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
import { TrashIcon } from "@radix-ui/react-icons";
2-
import { Box, Code, Flex, Heading, IconButton, Text } from "@radix-ui/themes";
2+
import {
3+
Box,
4+
Code,
5+
ContextMenu,
6+
Flex,
7+
Heading,
8+
IconButton,
9+
Text,
10+
} from "@radix-ui/themes";
311
import { useEffect, useRef } from "react";
412
import { formatTime, type LogEntry } from "../types/log";
513
import { DiffView } from "./log/DiffView";
@@ -38,40 +46,23 @@ export function LogView({ logs, isRunning, onClearLogs }: LogViewProps) {
3846
);
3947
}
4048

41-
return (
42-
<Flex direction="column" height="100%">
43-
<Box p="4" className="border-gray-6 border-b">
44-
<Flex align="center" justify="between">
45-
<Heading size="3">Activity Log</Heading>
46-
<Flex align="center" gap="2">
47-
{isRunning && (
48-
<Flex align="center" gap="2">
49-
<Box
50-
width="8px"
51-
height="8px"
52-
className="animate-pulse rounded-full bg-green-9"
53-
/>
54-
<Text size="2" color="gray">
55-
Running
56-
</Text>
57-
</Flex>
58-
)}
59-
{logs.length > 0 && onClearLogs && (
60-
<IconButton
61-
size="1"
62-
variant="ghost"
63-
color="gray"
64-
onClick={onClearLogs}
65-
title="Clear logs"
66-
>
67-
<TrashIcon />
68-
</IconButton>
69-
)}
70-
</Flex>
71-
</Flex>
72-
</Box>
49+
const handleCopyLogs = () => {
50+
const logsText = logs
51+
.map((log) => {
52+
if (typeof log === "string") return log;
53+
if (log.type === "output") return log.content;
54+
if (log.type === "error") return `Error: ${log.content}`;
55+
return "";
56+
})
57+
.join("\n");
58+
navigator.clipboard.writeText(logsText);
59+
};
7360

74-
<Box ref={scrollRef} flexGrow="1" overflowY="auto" p="4">
61+
return (
62+
<ContextMenu.Root>
63+
<ContextMenu.Trigger>
64+
<Flex direction="column" height="100%">
65+
<Box ref={scrollRef} flexGrow="1" overflowY="auto" p="4">
7566
{logs.map((log, index) => {
7667
const key =
7768
typeof log === "string"
@@ -222,7 +213,17 @@ export function LogView({ logs, isRunning, onClearLogs }: LogViewProps) {
222213
);
223214
}
224215
})}
225-
</Box>
226-
</Flex>
216+
</Box>
217+
</Flex>
218+
</ContextMenu.Trigger>
219+
<ContextMenu.Content>
220+
<ContextMenu.Item onClick={handleCopyLogs}>Copy</ContextMenu.Item>
221+
{onClearLogs && (
222+
<ContextMenu.Item onClick={onClearLogs} color="red">
223+
Clear
224+
</ContextMenu.Item>
225+
)}
226+
</ContextMenu.Content>
227+
</ContextMenu.Root>
227228
);
228229
}

0 commit comments

Comments
 (0)