Skip to content

Commit 75f8ad3

Browse files
committed
feat(code): remove cloud status bar, add pr view button
1 parent 2dd5059 commit 75f8ad3

4 files changed

Lines changed: 38 additions & 61 deletions

File tree

apps/code/src/renderer/components/HeaderRow.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { CloudGitInteractionHeader } from "@features/git-interaction/components/CloudGitInteractionHeader";
12
import { GitInteractionHeader } from "@features/git-interaction/components/GitInteractionHeader";
23
import { RightSidebarTrigger } from "@features/right-sidebar/components/RightSidebarTrigger";
34
import { useRightSidebarStore } from "@features/right-sidebar/stores/rightSidebarStore";
@@ -124,9 +125,12 @@ export function HeaderRow() {
124125
}}
125126
>
126127
<RightSidebarTrigger />
127-
{!isCloudTask && rightSidebarOpen && (
128-
<GitInteractionHeader taskId={view.data.id} />
129-
)}
128+
{rightSidebarOpen &&
129+
(isCloudTask ? (
130+
<CloudGitInteractionHeader taskId={view.data.id} />
131+
) : (
132+
<GitInteractionHeader taskId={view.data.id} />
133+
))}
130134
{rightSidebarOpen && (
131135
<Box
132136
onMouseDown={handleRightSidebarMouseDown}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { useSessionForTask } from "@features/sessions/hooks/useSession";
2+
import { Eye } from "@phosphor-icons/react";
3+
import { Button, Flex, Text } from "@radix-ui/themes";
4+
5+
interface CloudGitInteractionHeaderProps {
6+
taskId: string;
7+
}
8+
9+
export function CloudGitInteractionHeader({
10+
taskId,
11+
}: CloudGitInteractionHeaderProps) {
12+
const session = useSessionForTask(taskId);
13+
const prUrl = (session?.cloudOutput?.pr_url as string) ?? null;
14+
15+
if (!prUrl) return null;
16+
17+
return (
18+
<div className="no-drag">
19+
<Button size="1" variant="solid" asChild>
20+
<a href={prUrl} target="_blank" rel="noopener noreferrer">
21+
<Flex align="center" gap="2">
22+
<Eye size={12} weight="bold" />
23+
<Text size="1">View PR</Text>
24+
</Flex>
25+
</a>
26+
</Button>
27+
</div>
28+
);
29+
}

apps/code/src/renderer/features/inbox/components/ReportTaskLogs.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,6 @@ export function ReportTaskLogs({
222222
taskId={task.id}
223223
task={task}
224224
hideInput={reportStatus !== "ready"}
225-
hideCloudStatus
226225
/>
227226
</div>
228227
</div>

apps/code/src/renderer/features/task-detail/components/TaskLogsPanel.tsx

Lines changed: 2 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import {
2020
useCreateWorkspace,
2121
useWorkspaceLoaded,
2222
} from "@features/workspace/hooks/useWorkspace";
23-
import { Box, Button, Flex, Spinner, Text } from "@radix-ui/themes";
23+
import { Box, Flex } from "@radix-ui/themes";
2424
import type { Task } from "@shared/types";
2525
import { getTaskRepository } from "@utils/repository";
2626
import { useCallback, useEffect, useMemo } from "react";
@@ -30,16 +30,9 @@ interface TaskLogsPanelProps {
3030
task: Task;
3131
/** Hide the message input — log-only view. */
3232
hideInput?: boolean;
33-
/** Hide the cloud status footer bar. */
34-
hideCloudStatus?: boolean;
3533
}
3634

37-
export function TaskLogsPanel({
38-
taskId,
39-
task,
40-
hideInput,
41-
hideCloudStatus,
42-
}: TaskLogsPanelProps) {
35+
export function TaskLogsPanel({ taskId, task, hideInput }: TaskLogsPanelProps) {
4336
const isWorkspaceLoaded = useWorkspaceLoaded();
4437
const { isPending: isCreatingWorkspace } = useCreateWorkspace();
4538
const repoKey = getTaskRepository(task);
@@ -60,8 +53,6 @@ export function TaskLogsPanel({
6053
session,
6154
repoPath,
6255
isCloud,
63-
isCloudRunNotTerminal,
64-
cloudStatus,
6556
isRunning,
6657
hasError,
6758
events,
@@ -90,9 +81,7 @@ export function TaskLogsPanel({
9081
handleBashCommand,
9182
} = useSessionCallbacks({ taskId, task, session, repoPath });
9283

93-
const cloudStage = session?.cloudStage ?? null;
9484
const cloudOutput = session?.cloudOutput ?? null;
95-
const cloudErrorMessage = session?.cloudErrorMessage ?? null;
9685
const prUrl =
9786
isCloud && cloudOutput?.pr_url ? (cloudOutput.pr_url as string) : null;
9887
const slackThreadUrl =
@@ -175,50 +164,6 @@ export function TaskLogsPanel({
175164
/>
176165
</ErrorBoundary>
177166
</Box>
178-
{isCloud && !hideCloudStatus && (
179-
<Flex
180-
align="center"
181-
justify="center"
182-
gap="2"
183-
py="2"
184-
className="border-gray-4 border-t"
185-
>
186-
{prUrl ? (
187-
<>
188-
<Text size="2" color="gray">
189-
Task completed
190-
</Text>
191-
<Button size="2" variant="soft" asChild>
192-
<a href={prUrl} target="_blank" rel="noopener noreferrer">
193-
View Pull Request
194-
</a>
195-
</Button>
196-
</>
197-
) : isCloudRunNotTerminal ? (
198-
<>
199-
<Spinner size="2" />
200-
<Text size="2" color="gray">
201-
Running in cloud
202-
{cloudStage ? ` \u2014 ${cloudStage}` : ""}
203-
...
204-
</Text>
205-
</>
206-
) : cloudStatus === "failed" ? (
207-
<Text size="2" color="red">
208-
Task failed
209-
{cloudErrorMessage ? `: ${cloudErrorMessage}` : ""}
210-
</Text>
211-
) : cloudStatus === "cancelled" ? (
212-
<Text size="2" color="red">
213-
Task cancelled
214-
</Text>
215-
) : cloudStatus ? (
216-
<Text size="2" color="gray">
217-
Cloud task completed
218-
</Text>
219-
) : null}
220-
</Flex>
221-
)}
222167
</Flex>
223168
</BackgroundWrapper>
224169
);

0 commit comments

Comments
 (0)