Skip to content

Commit 5ebea01

Browse files
authored
feat: Show static "waiting" state when permission is pending (#658)
1 parent 651ff6a commit 5ebea01

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

apps/twig/src/main/services/folders/service.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ vi.mock("electron", () => ({
4343
dialog: mockDialog,
4444
}));
4545

46-
vi.mock("@posthog/agent", () => ({
46+
vi.mock("@posthog/agent/worktree-manager", () => ({
4747
WorktreeManager: class MockWorktreeManager {
4848
deleteWorktree = mockWorktreeManager.deleteWorktree;
4949
cleanupOrphanedWorktrees = mockWorktreeManager.cleanupOrphanedWorktrees;

apps/twig/src/renderer/features/sessions/components/ConversationView.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ export function ConversationView({
165165
}
166166
lastStopReason={lastTurn?.stopReason}
167167
queuedCount={queuedMessages.length}
168+
hasPendingPermission={pendingPermissionsCount > 0}
168169
/>
169170
</div>
170171
{showScrollButton && (

apps/twig/src/renderer/features/sessions/components/SessionFooter.tsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { Pause } from "@phosphor-icons/react";
12
import { Box, Flex, Text } from "@radix-ui/themes";
23

34
import { formatDuration, GeneratingIndicator } from "./GeneratingIndicator";
@@ -8,6 +9,7 @@ interface SessionFooterProps {
89
lastGenerationDuration: number | null;
910
lastStopReason?: string;
1011
queuedCount?: number;
12+
hasPendingPermission?: boolean;
1113
}
1214

1315
export function SessionFooter({
@@ -16,8 +18,26 @@ export function SessionFooter({
1618
lastGenerationDuration,
1719
lastStopReason,
1820
queuedCount = 0,
21+
hasPendingPermission = false,
1922
}: SessionFooterProps) {
2023
if (isPromptPending) {
24+
// Show static "waiting" state when permission is pending
25+
if (hasPendingPermission) {
26+
return (
27+
<Box className="pt-3 pb-1">
28+
<Flex
29+
align="center"
30+
gap="2"
31+
className="select-none text-gray-10"
32+
style={{ userSelect: "none", WebkitUserSelect: "none" }}
33+
>
34+
<Pause size={14} weight="fill" />
35+
<Text size="1">Awaiting permission...</Text>
36+
</Flex>
37+
</Box>
38+
);
39+
}
40+
2141
return (
2242
<Box className="pt-3 pb-1">
2343
<Flex align="center" gap="2">

0 commit comments

Comments
 (0)