Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
26 changes: 13 additions & 13 deletions apps/web/src/components/chat/ChangedFilesTree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ export const ChangedFilesCard = memo(function ChangedFilesCard(props: {
const summaryStat = useMemo(() => summarizeTurnDiffStats(files), [files]);

return (
<div className="relative mt-4 rounded-2xl bg-card/40 shadow-xs/5 not-dark:bg-clip-padding after:pointer-events-none after:absolute after:inset-0 after:z-20 after:rounded-2xl after:border after:border-input">
<div className="sticky top-0 z-10 mb-3 flex items-center justify-between gap-2 rounded-t-2xl bg-card/72 p-3 backdrop-blur-md">
<p className="flex items-center gap-1 font-medium text-foreground text-xs leading-4">
<div className="mt-4 rounded-2xl border border-input bg-background p-2 pt-4 shadow-xs/5 not-dark:bg-clip-padding dark:bg-input/32">
<div className="mb-3 flex items-center justify-between gap-2 px-2">
<p className="flex self-start items-center gap-1 font-medium text-foreground text-xs leading-4">
<span>{files.length} changed files</span>
{hasNonZeroStat(summaryStat) && (
<DiffStatLabel
Expand All @@ -51,6 +51,7 @@ export const ChangedFilesCard = memo(function ChangedFilesCard(props: {
type="button"
size="xs"
variant="outline"
className="px-1.5"
data-scroll-anchor-ignore
onClick={onToggleAllDirectories}
>
Expand All @@ -60,22 +61,21 @@ export const ChangedFilesCard = memo(function ChangedFilesCard(props: {
type="button"
size="xs"
variant="outline"
className="px-1.5"
onClick={() => onOpenTurnDiff(turnId, files[0]?.path)}
>
View diff
</Button>
</div>
</div>
<div className="px-2 pb-2">
<ChangedFilesTree
key={`changed-files-tree:${turnId}`}
turnId={turnId}
files={files}
allDirectoriesExpanded={allDirectoriesExpanded}
resolvedTheme={resolvedTheme}
onOpenTurnDiff={onOpenTurnDiff}
/>
</div>
<ChangedFilesTree
key={`changed-files-tree:${turnId}`}
turnId={turnId}
files={files}
allDirectoriesExpanded={allDirectoriesExpanded}
resolvedTheme={resolvedTheme}
onOpenTurnDiff={onOpenTurnDiff}
/>
</div>
);
});
Expand Down
21 changes: 12 additions & 9 deletions apps/web/src/components/chat/MessagesTimeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1235,25 +1235,27 @@ function AssistantChangedFilesSectionInner({
);
const setExpanded = useUiStateStore((store) => store.setThreadChangedFilesExpanded);
const summaryStat = summarizeTurnDiffStats(checkpointFiles);
const changedFileCountLabel = String(checkpointFiles.length);

return (
<div className="mt-2 rounded-lg border border-border/80 bg-card/45 p-2.5">
<div className="sticky top-2 z-10 mb-1.5 flex items-center justify-between gap-2 bg-[color-mix(in_srgb,var(--card)_45%,var(--background))] before:absolute before:inset-x-0 before:-top-2 before:h-2 before:bg-[color-mix(in_srgb,var(--card)_45%,var(--background))] before:content-['']">
<p className="text-[10px] uppercase tracking-[0.12em] text-muted-foreground/65">
<span>Changed files ({changedFileCountLabel})</span>
<div className="mt-4 rounded-2xl border border-input bg-background p-2 pt-4 shadow-xs/5 not-dark:bg-clip-padding dark:bg-input/32">
<div className="mb-3 flex items-center justify-between gap-2 px-2">
<p className="flex self-start items-center gap-1 font-medium text-foreground text-xs leading-4">
<span>{checkpointFiles.length} changed files</span>
Comment thread
cursor[bot] marked this conversation as resolved.
Outdated
{hasNonZeroStat(summaryStat) && (
<>
<span className="mx-1">•</span>
<DiffStatLabel additions={summaryStat.additions} deletions={summaryStat.deletions} />
</>
<DiffStatLabel
additions={summaryStat.additions}
className="text-xs leading-4"
deletions={summaryStat.deletions}
layout="inline"
/>
)}
</p>
<div className="flex items-center gap-1.5">
<Button
type="button"
size="xs"
variant="outline"
className="px-1.5"
data-scroll-anchor-ignore
onClick={() => setExpanded(routeThreadKey, turnSummary.turnId, !allDirectoriesExpanded)}
>
Expand All @@ -1263,6 +1265,7 @@ function AssistantChangedFilesSectionInner({
type="button"
size="xs"
variant="outline"
className="px-1.5"
onClick={() => onOpenTurnDiff(turnSummary.turnId, checkpointFiles[0]?.path)}
>
View diff
Expand Down
Loading