Skip to content

Commit 8723858

Browse files
fix(web): adapt changed files actions to pane width
Co-authored-by: Wout Stiens <[email protected]>
1 parent 9ad388e commit 8723858

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

‎apps/web/src/components/chat/ChangedFilesTree.test.tsx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ describe("ChangedFilesCard", () => {
2828
);
2929
expect(markup).toContain('class="flex shrink-0 items-center gap-1 whitespace-nowrap');
3030
expect(markup).toContain('class="ml-1 hidden min-w-0 flex-1 truncate');
31+
expect(markup).toContain("@[24rem]/changed-files:inline");
32+
expect(markup).not.toContain("sm:inline");
3133
expect(markup).toContain('class="flex shrink-0 items-center gap-1.5"');
3234
expect(markup).toContain("!size-[22px]");
3335
expect(markup).toContain("size-3");

‎apps/web/src/components/chat/ChangedFilesTree.tsx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export const ChangedFilesCard = memo(function ChangedFilesCard(props: {
5656

5757
return (
5858
<div
59-
className="mt-4 rounded-2xl border border-border/70 bg-secondary p-2 dark:border-transparent dark:bg-input/32"
59+
className="@container/changed-files mt-4 rounded-2xl border border-border/70 bg-secondary p-2 dark:border-transparent dark:bg-input/32"
6060
data-changed-files-state={
6161
expanded ? "expanded" : compactPreviewVisible ? "preview" : "collapsed"
6262
}
@@ -96,7 +96,7 @@ export const ChangedFilesCard = memo(function ChangedFilesCard(props: {
9696
/>
9797
)}
9898
</span>
99-
<span className="ml-1 hidden min-w-0 flex-1 truncate text-[11px] text-muted-foreground group-hover:text-foreground/80 sm:inline">
99+
<span className="ml-1 hidden min-w-0 flex-1 truncate text-[11px] text-muted-foreground group-hover:text-foreground/80 @[24rem]/changed-files:inline">
100100
{expanded ? "Hide files" : "Show files"}
101101
</span>
102102
</button>
@@ -142,7 +142,7 @@ export const ChangedFilesCard = memo(function ChangedFilesCard(props: {
142142
}
143143
>
144144
<FileDiffIcon className="size-3" />
145-
<span className="hidden sm:inline">Open diff</span>
145+
<span className="hidden @[24rem]/changed-files:inline">Open diff</span>
146146
</TooltipTrigger>
147147
<TooltipPopup side="top">Open the full diff</TooltipPopup>
148148
</Tooltip>

0 commit comments

Comments
 (0)