Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ AGENTS.md
MEMORY.md
.claude-config/
.agent-trigger
.posthog-code/
.claude/worktrees/

# Testing
playwright-results/
Expand Down
7 changes: 0 additions & 7 deletions .posthog-code/environments/twig.toml

This file was deleted.

1 change: 0 additions & 1 deletion apps/code/src/main/services/context-menu/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ const externalAppAction = z.discriminatedUnion("type", [
const taskAction = z.discriminatedUnion("type", [
z.object({ type: z.literal("rename") }),
z.object({ type: z.literal("pin") }),
z.object({ type: z.literal("copy-task-id") }),
z.object({ type: z.literal("suspend") }),
z.object({ type: z.literal("archive") }),
z.object({ type: z.literal("archive-prior") }),
Expand Down
7 changes: 0 additions & 7 deletions apps/code/src/main/services/context-menu/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ export class ContextMenuService {
return this.showMenu<TaskAction>([
this.item(isPinned ? "Unpin" : "Pin", { type: "pin" }),
this.item("Rename", { type: "rename" }),
this.item("Copy Task ID", { type: "copy-task-id" }),
...(worktreePath
? [
this.separator(),
Expand Down Expand Up @@ -273,11 +272,6 @@ export class ContextMenuService {
const lastUsedApp = apps.find((app) => app.id === lastUsedAppId) || apps[0];
const openIn = (appId: string): T =>
({ type: "external-app", action: { type: "open-in-app", appId } }) as T;
const copyPath: T = {
type: "external-app",
action: { type: "copy-path" },
} as T;

return [
this.item(`Open in ${lastUsedApp.name}`, openIn(lastUsedApp.id)),
{
Expand All @@ -293,7 +287,6 @@ export class ContextMenuService {
action: openIn(app.id),
})),
},
this.item("Copy Path", copyPath, { accelerator: "CmdOrCtrl+Shift+C" }),
];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ function EmptyCell({ cellIndex }: { cellIndex: number }) {

return (
<Flex align="center" justify="center" height="100%">
<Flex direction="column" align="center" gap="2">
<Flex direction="column" align="center" gap="2" className="select-none">
<TaskSelector
cellIndex={cellIndex}
open={selectorOpen}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useGitQueries } from "@features/git-interaction/hooks/useGitQueries";
import { getUserPromptsForTask } from "@features/sessions/stores/sessionStore";
import { useIsWorkspaceCloudRun } from "@features/workspace/hooks/useWorkspace";
import { useConnectivity } from "@hooks/useConnectivity";
import { ArrowUp, Circle, Stop } from "@phosphor-icons/react";
import { ArrowUp, Stop } from "@phosphor-icons/react";
import { Flex, IconButton, Text, Tooltip } from "@radix-ui/themes";
import { EditorContent } from "@tiptap/react";
import { hasOpenOverlay } from "@utils/overlay";
Expand All @@ -15,7 +15,6 @@ import { useDraftStore } from "../stores/draftStore";
import { useTiptapEditor } from "../tiptap/useTiptapEditor";
import type { EditorHandle } from "../types";
import { AttachmentsBar } from "./AttachmentsBar";
import { DiffStatsIndicator } from "./DiffStatsIndicator";
import { EditorToolbar } from "./EditorToolbar";
import { ModeIndicatorInput } from "./ModeIndicatorInput";

Expand All @@ -26,11 +25,6 @@ interface ModeAndBranchRowProps {
onModeChange?: () => void;
repoPath?: string | null;
cloudBranch?: string | null;
cloudDiffStats?: {
filesChanged: number;
linesAdded: number;
linesRemoved: number;
} | null;
disabled?: boolean;
isBashMode?: boolean;
isCloud?: boolean;
Expand All @@ -42,25 +36,16 @@ function ModeAndBranchRow({
onModeChange,
repoPath,
cloudBranch,
cloudDiffStats,
disabled,
isBashMode,
isCloud,
taskId,
}: ModeAndBranchRowProps) {
const { currentBranch: gitBranch, diffStats } = useGitQueries(
repoPath ?? undefined,
);
const { currentBranch: gitBranch } = useGitQueries(repoPath ?? undefined);
const currentBranch = cloudBranch ?? gitBranch;

const showModeIndicator = !!onModeChange;
const showBranchSelector = !!currentBranch;
const effectiveDiffStats = cloudDiffStats ?? diffStats;
const showDiffStats =
effectiveDiffStats &&
(effectiveDiffStats.filesChanged > 0 ||
effectiveDiffStats.linesAdded > 0 ||
effectiveDiffStats.linesRemoved > 0);

if (!showModeIndicator && !showBranchSelector && !isBashMode) {
return null;
Expand Down Expand Up @@ -103,20 +88,6 @@ function ModeAndBranchRow({
wrap="nowrap"
style={{ minWidth: 0, overflow: "hidden" }}
>
<DiffStatsIndicator
repoPath={repoPath}
overrideStats={cloudDiffStats}
taskId={taskId}
/>
{showBranchSelector && showDiffStats && (
<Flex
align="center"
justify="center"
style={{ height: 16, marginRight: -8, flexShrink: 0 }}
>
<Circle size={4} weight="fill" color="var(--gray-9)" />
</Flex>
)}
{showBranchSelector && (
<Flex style={{ maxWidth: 200, minWidth: 0 }}>
<BranchSelector
Expand Down Expand Up @@ -178,7 +149,6 @@ export const MessageEditor = forwardRef<EditorHandle, MessageEditorProps>(
const isLoading = context?.isLoading ?? false;
const repoPath = context?.repoPath;
const cloudBranch = context?.cloudBranch;
const cloudDiffStats = context?.cloudDiffStats;
const isSubmitDisabled = disabled || !isOnline;

const getPromptHistory = useCallback(
Expand Down Expand Up @@ -361,7 +331,6 @@ export const MessageEditor = forwardRef<EditorHandle, MessageEditorProps>(
onModeChange={onModeChange}
repoPath={repoPath}
cloudBranch={cloudBranch}
cloudDiffStats={cloudDiffStats}
disabled={disabled}
isBashMode={isBashMode}
isCloud={isCloud}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,11 @@ import type { EditorContent } from "../utils/content";

type SessionId = string;

export interface CloudDiffStats {
filesChanged: number;
linesAdded: number;
linesRemoved: number;
}

export interface EditorContext {
sessionId: string;
taskId: string | undefined;
repoPath: string | null | undefined;
cloudBranch?: string | null;
cloudDiffStats?: CloudDiffStats | null;
disabled: boolean;
isLoading: boolean;
}
Expand Down Expand Up @@ -87,7 +80,6 @@ export const useDraftStore = create<DraftStore>()(
taskId: context.taskId ?? existing?.taskId,
repoPath: context.repoPath ?? existing?.repoPath,
cloudBranch: context.cloudBranch ?? existing?.cloudBranch,
cloudDiffStats: context.cloudDiffStats ?? existing?.cloudDiffStats,
disabled: context.disabled ?? existing?.disabled ?? false,
isLoading: context.isLoading ?? existing?.isLoading ?? false,
};
Expand All @@ -96,12 +88,6 @@ export const useDraftStore = create<DraftStore>()(
existing?.taskId === newContext.taskId &&
existing?.repoPath === newContext.repoPath &&
existing?.cloudBranch === newContext.cloudBranch &&
existing?.cloudDiffStats?.filesChanged ===
newContext.cloudDiffStats?.filesChanged &&
existing?.cloudDiffStats?.linesAdded ===
newContext.cloudDiffStats?.linesAdded &&
existing?.cloudDiffStats?.linesRemoved ===
newContext.cloudDiffStats?.linesRemoved &&
existing?.disabled === newContext.disabled &&
existing?.isLoading === newContext.isLoading
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,15 @@ export function ConversationView({
}
const firstUserMessageId = firstUserMessageIdRef.current;

const [initialItemIds] = useState(
() =>
new Set(
conversationItems
.filter((i) => i.type === "user_message")
.map((i) => i.id),
),
);

const pendingPermissions = usePendingPermissionsForTask(taskId ?? "");
const pendingPermissionsCount = pendingPermissions.size;
const queuedMessages = useQueuedMessagesForTask(taskId);
Expand Down Expand Up @@ -148,6 +157,7 @@ export function ConversationView({
content={item.content}
attachments={item.attachments}
timestamp={item.timestamp}
animate={!initialItemIds.has(item.id)}
sourceUrl={
slackThreadUrl && item.id === firstUserMessageId
? slackThreadUrl
Expand Down Expand Up @@ -194,7 +204,7 @@ export function ConversationView({
);
}
},
[repoPath, taskId, slackThreadUrl, firstUserMessageId],
[repoPath, taskId, slackThreadUrl, firstUserMessageId, initialItemIds],
);

const getItemKey = useCallback((item: ConversationItem) => item.id, []);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,13 @@ export function GeneratingIndicator({
<Flex
align="center"
gap="2"
className="select-none text-accent-11"
className="select-none"
style={{ userSelect: "none", WebkitUserSelect: "none" }}
>
<Brain size={12} className="ph-pulse" />
<Text size="1">{activity}...</Text>
<Text size="1" className="text-accent-11">
{activity}...
</Text>
<Text size="1" color="gray">
(Esc to stop
</Text>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { ContextUsage } from "@features/sessions/hooks/useContextUsage";
import { Pause } from "@phosphor-icons/react";
import { Brain, Pause } from "@phosphor-icons/react";
import { Box, Flex, Text } from "@radix-ui/themes";

import { ContextUsageIndicator } from "./ContextUsageIndicator";
Expand Down Expand Up @@ -71,36 +71,28 @@ export function SessionFooter({
const wasCancelled =
lastStopReason === "cancelled" || lastStopReason === "refusal";

if (
const showDuration =
lastGenerationDuration !== null &&
lastGenerationDuration > 0 &&
!wasCancelled
) {
return (
<Box className="pb-1">
<Flex align="center" justify="between" gap="2">
<Text
size="1"
color="gray"
style={{ fontVariantNumeric: "tabular-nums" }}
>
Generated in {formatDuration(lastGenerationDuration)}
</Text>
<ContextUsageIndicator usage={usage ?? null} />
</Flex>
</Box>
);
}
!wasCancelled;

if (usage) {
return (
<Box className="pb-1">
<Flex justify="end">
<ContextUsageIndicator usage={usage} />
</Flex>
</Box>
);
}

return null;
return (
<Box className="pb-1">
<Flex align="center" justify="between" gap="2">
{showDuration && (
<Flex align="center" gap="2" className="select-none text-gray-10">
<Brain size={12} />
<Text
size="1"
color="gray"
style={{ fontVariantNumeric: "tabular-nums" }}
>
Generated in {formatDuration(lastGenerationDuration)}
</Text>
</Flex>
)}
<ContextUsageIndicator usage={usage ?? null} />
</Flex>
</Box>
);
}
Loading
Loading