Skip to content

Commit 6abf868

Browse files
authored
feat: First session polish (#1658)
## Problem <!-- Who is this for and what problem does it solve? --> <!-- Closes #ISSUE_ID --> Closes #1638 Closes #1649 ## Changes 1. Add slide-in animation for new user messages via framer-motion 2. Remove DiffStatsIndicator component and all cloudDiffStats plumbing from editor/stores/views 3. Remove "Copy Task ID" and "Copy Path" from context menus 4. Fix skills detail panel close button not selecting null on deselect 5. Move setContext from render body into useEffect to avoid side effects during render 6. Minor spacing/padding fixes for environment cards, generating indicator and session footer 7. Rename "Auto-accept Permissions" labels to "Bypass Permissions" across settings, execution modes and permission options 1. Doing this because actual claude code auto mode is coming in the next adapter upgrade. https://code.claude.com/docs/en/permission-modes#eliminate-prompts-with-auto-mode <!-- What did you change and why? --> <!-- If there are frontend changes, include screenshots. --> ## How did you test this? Manually <!-- Describe what you tested -- manual steps, automated tests, or both. --> <!-- If you're an agent, only list tests you actually ran. -->
1 parent 94888c4 commit 6abf868

21 files changed

Lines changed: 174 additions & 320 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ AGENTS.md
3939
MEMORY.md
4040
.claude-config/
4141
.agent-trigger
42+
.posthog-code/
43+
.claude/worktrees/
4244

4345
# Testing
4446
playwright-results/

.posthog-code/environments/twig.toml

Lines changed: 0 additions & 7 deletions
This file was deleted.

apps/code/src/main/services/context-menu/schemas.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ const externalAppAction = z.discriminatedUnion("type", [
3737
const taskAction = z.discriminatedUnion("type", [
3838
z.object({ type: z.literal("rename") }),
3939
z.object({ type: z.literal("pin") }),
40-
z.object({ type: z.literal("copy-task-id") }),
4140
z.object({ type: z.literal("suspend") }),
4241
z.object({ type: z.literal("archive") }),
4342
z.object({ type: z.literal("archive-prior") }),

apps/code/src/main/services/context-menu/service.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ export class ContextMenuService {
118118
return this.showMenu<TaskAction>([
119119
this.item(isPinned ? "Unpin" : "Pin", { type: "pin" }),
120120
this.item("Rename", { type: "rename" }),
121-
this.item("Copy Task ID", { type: "copy-task-id" }),
122121
...(worktreePath
123122
? [
124123
this.separator(),
@@ -273,11 +272,6 @@ export class ContextMenuService {
273272
const lastUsedApp = apps.find((app) => app.id === lastUsedAppId) || apps[0];
274273
const openIn = (appId: string): T =>
275274
({ type: "external-app", action: { type: "open-in-app", appId } }) as T;
276-
const copyPath: T = {
277-
type: "external-app",
278-
action: { type: "copy-path" },
279-
} as T;
280-
281275
return [
282276
this.item(`Open in ${lastUsedApp.name}`, openIn(lastUsedApp.id)),
283277
{
@@ -293,7 +287,6 @@ export class ContextMenuService {
293287
action: openIn(app.id),
294288
})),
295289
},
296-
this.item("Copy Path", copyPath, { accelerator: "CmdOrCtrl+Shift+C" }),
297290
];
298291
}
299292

apps/code/src/renderer/features/command-center/components/CommandCenterPanel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ function EmptyCell({ cellIndex }: { cellIndex: number }) {
8787

8888
return (
8989
<Flex align="center" justify="center" height="100%">
90-
<Flex direction="column" align="center" gap="2">
90+
<Flex direction="column" align="center" gap="2" className="select-none">
9191
<TaskSelector
9292
cellIndex={cellIndex}
9393
open={selectorOpen}

apps/code/src/renderer/features/message-editor/components/DiffStatsIndicator.tsx

Lines changed: 0 additions & 84 deletions
This file was deleted.

apps/code/src/renderer/features/message-editor/components/MessageEditor.tsx

Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { useGitQueries } from "@features/git-interaction/hooks/useGitQueries";
55
import { getUserPromptsForTask } from "@features/sessions/stores/sessionStore";
66
import { useIsWorkspaceCloudRun } from "@features/workspace/hooks/useWorkspace";
77
import { useConnectivity } from "@hooks/useConnectivity";
8-
import { ArrowUp, Circle, Stop } from "@phosphor-icons/react";
8+
import { ArrowUp, Stop } from "@phosphor-icons/react";
99
import { Flex, IconButton, Text, Tooltip } from "@radix-ui/themes";
1010
import { EditorContent } from "@tiptap/react";
1111
import { hasOpenOverlay } from "@utils/overlay";
@@ -15,7 +15,6 @@ import { useDraftStore } from "../stores/draftStore";
1515
import { useTiptapEditor } from "../tiptap/useTiptapEditor";
1616
import type { EditorHandle } from "../types";
1717
import { AttachmentsBar } from "./AttachmentsBar";
18-
import { DiffStatsIndicator } from "./DiffStatsIndicator";
1918
import { EditorToolbar } from "./EditorToolbar";
2019
import { ModeIndicatorInput } from "./ModeIndicatorInput";
2120

@@ -26,11 +25,6 @@ interface ModeAndBranchRowProps {
2625
onModeChange?: () => void;
2726
repoPath?: string | null;
2827
cloudBranch?: string | null;
29-
cloudDiffStats?: {
30-
filesChanged: number;
31-
linesAdded: number;
32-
linesRemoved: number;
33-
} | null;
3428
disabled?: boolean;
3529
isBashMode?: boolean;
3630
isCloud?: boolean;
@@ -42,25 +36,16 @@ function ModeAndBranchRow({
4236
onModeChange,
4337
repoPath,
4438
cloudBranch,
45-
cloudDiffStats,
4639
disabled,
4740
isBashMode,
4841
isCloud,
4942
taskId,
5043
}: ModeAndBranchRowProps) {
51-
const { currentBranch: gitBranch, diffStats } = useGitQueries(
52-
repoPath ?? undefined,
53-
);
44+
const { currentBranch: gitBranch } = useGitQueries(repoPath ?? undefined);
5445
const currentBranch = cloudBranch ?? gitBranch;
5546

5647
const showModeIndicator = !!onModeChange;
5748
const showBranchSelector = !!currentBranch;
58-
const effectiveDiffStats = cloudDiffStats ?? diffStats;
59-
const showDiffStats =
60-
effectiveDiffStats &&
61-
(effectiveDiffStats.filesChanged > 0 ||
62-
effectiveDiffStats.linesAdded > 0 ||
63-
effectiveDiffStats.linesRemoved > 0);
6449

6550
if (!showModeIndicator && !showBranchSelector && !isBashMode) {
6651
return null;
@@ -103,20 +88,6 @@ function ModeAndBranchRow({
10388
wrap="nowrap"
10489
style={{ minWidth: 0, overflow: "hidden" }}
10590
>
106-
<DiffStatsIndicator
107-
repoPath={repoPath}
108-
overrideStats={cloudDiffStats}
109-
taskId={taskId}
110-
/>
111-
{showBranchSelector && showDiffStats && (
112-
<Flex
113-
align="center"
114-
justify="center"
115-
style={{ height: 16, marginRight: -8, flexShrink: 0 }}
116-
>
117-
<Circle size={4} weight="fill" color="var(--gray-9)" />
118-
</Flex>
119-
)}
12091
{showBranchSelector && (
12192
<Flex style={{ maxWidth: 200, minWidth: 0 }}>
12293
<BranchSelector
@@ -178,7 +149,6 @@ export const MessageEditor = forwardRef<EditorHandle, MessageEditorProps>(
178149
const isLoading = context?.isLoading ?? false;
179150
const repoPath = context?.repoPath;
180151
const cloudBranch = context?.cloudBranch;
181-
const cloudDiffStats = context?.cloudDiffStats;
182152
const isSubmitDisabled = disabled || !isOnline;
183153

184154
const getPromptHistory = useCallback(
@@ -361,7 +331,6 @@ export const MessageEditor = forwardRef<EditorHandle, MessageEditorProps>(
361331
onModeChange={onModeChange}
362332
repoPath={repoPath}
363333
cloudBranch={cloudBranch}
364-
cloudDiffStats={cloudDiffStats}
365334
disabled={disabled}
366335
isBashMode={isBashMode}
367336
isCloud={isCloud}

apps/code/src/renderer/features/message-editor/stores/draftStore.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,11 @@ import type { EditorContent } from "../utils/content";
77

88
type SessionId = string;
99

10-
export interface CloudDiffStats {
11-
filesChanged: number;
12-
linesAdded: number;
13-
linesRemoved: number;
14-
}
15-
1610
export interface EditorContext {
1711
sessionId: string;
1812
taskId: string | undefined;
1913
repoPath: string | null | undefined;
2014
cloudBranch?: string | null;
21-
cloudDiffStats?: CloudDiffStats | null;
2215
disabled: boolean;
2316
isLoading: boolean;
2417
}
@@ -87,7 +80,6 @@ export const useDraftStore = create<DraftStore>()(
8780
taskId: context.taskId ?? existing?.taskId,
8881
repoPath: context.repoPath ?? existing?.repoPath,
8982
cloudBranch: context.cloudBranch ?? existing?.cloudBranch,
90-
cloudDiffStats: context.cloudDiffStats ?? existing?.cloudDiffStats,
9183
disabled: context.disabled ?? existing?.disabled ?? false,
9284
isLoading: context.isLoading ?? existing?.isLoading ?? false,
9385
};
@@ -96,12 +88,6 @@ export const useDraftStore = create<DraftStore>()(
9688
existing?.taskId === newContext.taskId &&
9789
existing?.repoPath === newContext.repoPath &&
9890
existing?.cloudBranch === newContext.cloudBranch &&
99-
existing?.cloudDiffStats?.filesChanged ===
100-
newContext.cloudDiffStats?.filesChanged &&
101-
existing?.cloudDiffStats?.linesAdded ===
102-
newContext.cloudDiffStats?.linesAdded &&
103-
existing?.cloudDiffStats?.linesRemoved ===
104-
newContext.cloudDiffStats?.linesRemoved &&
10591
existing?.disabled === newContext.disabled &&
10692
existing?.isLoading === newContext.isLoading
10793
) {

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,15 @@ export function ConversationView({
7373
}
7474
const firstUserMessageId = firstUserMessageIdRef.current;
7575

76+
const [initialItemIds] = useState(
77+
() =>
78+
new Set(
79+
conversationItems
80+
.filter((i) => i.type === "user_message")
81+
.map((i) => i.id),
82+
),
83+
);
84+
7685
const pendingPermissions = usePendingPermissionsForTask(taskId ?? "");
7786
const pendingPermissionsCount = pendingPermissions.size;
7887
const queuedMessages = useQueuedMessagesForTask(taskId);
@@ -148,6 +157,7 @@ export function ConversationView({
148157
content={item.content}
149158
attachments={item.attachments}
150159
timestamp={item.timestamp}
160+
animate={!initialItemIds.has(item.id)}
151161
sourceUrl={
152162
slackThreadUrl && item.id === firstUserMessageId
153163
? slackThreadUrl
@@ -194,7 +204,7 @@ export function ConversationView({
194204
);
195205
}
196206
},
197-
[repoPath, taskId, slackThreadUrl, firstUserMessageId],
207+
[repoPath, taskId, slackThreadUrl, firstUserMessageId, initialItemIds],
198208
);
199209

200210
const getItemKey = useCallback((item: ConversationItem) => item.id, []);

apps/code/src/renderer/features/sessions/components/GeneratingIndicator.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,13 @@ export function GeneratingIndicator({
152152
<Flex
153153
align="center"
154154
gap="2"
155-
className="select-none text-accent-11"
155+
className="select-none"
156156
style={{ userSelect: "none", WebkitUserSelect: "none" }}
157157
>
158158
<Brain size={12} className="ph-pulse" />
159-
<Text size="1">{activity}...</Text>
159+
<Text size="1" className="text-accent-11">
160+
{activity}...
161+
</Text>
160162
<Text size="1" color="gray">
161163
(Esc to stop
162164
</Text>

0 commit comments

Comments
 (0)