Skip to content

Commit fa877f0

Browse files
committed
Adjust changeset file toolbar to be visible on hover
1 parent b1299d9 commit fa877f0

File tree

2 files changed

+30
-13
lines changed

2 files changed

+30
-13
lines changed

apps/array/src/renderer/features/task-detail/components/ChangesPanel.tsx

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,12 @@ function ChangedFileItem({
186186
>
187187
{file.originalPath ? `${file.originalPath}${file.path}` : file.path}
188188
</Text>
189+
189190
{hasLineStats && (
190191
<Flex
191192
align="center"
192193
gap="1"
194+
className="group-hover:hidden"
193195
style={{ flexShrink: 0, fontSize: "10px", fontFamily: "monospace" }}
194196
>
195197
{(file.linesAdded ?? 0) > 0 && (
@@ -200,25 +202,40 @@ function ChangedFileItem({
200202
)}
201203
</Flex>
202204
)}
205+
206+
<Flex
207+
align="center"
208+
gap="1"
209+
className="hidden group-hover:flex"
210+
style={{ flexShrink: 0 }}
211+
>
212+
<Tooltip content="Discard changes">
213+
<IconButton
214+
size="1"
215+
variant="ghost"
216+
color="gray"
217+
onClick={handleDiscard}
218+
style={{
219+
flexShrink: 0,
220+
width: "18px",
221+
height: "18px",
222+
padding: 0,
223+
marginLeft: "2px",
224+
marginRight: "2px",
225+
}}
226+
>
227+
<ArrowCounterClockwiseIcon size={12} />
228+
</IconButton>
229+
</Tooltip>
230+
</Flex>
231+
203232
<Badge
204233
size="1"
205234
color={indicator.color}
206235
style={{ flexShrink: 0, fontSize: "10px", padding: "0 4px" }}
207236
>
208237
{indicator.label}
209238
</Badge>
210-
<Tooltip content="Discard changes">
211-
<IconButton
212-
size="1"
213-
variant="ghost"
214-
color="gray"
215-
onClick={handleDiscard}
216-
className={isActive ? "" : "opacity-0 group-hover:opacity-100"}
217-
style={{ flexShrink: 0, width: "20px", height: "20px" }}
218-
>
219-
<ArrowCounterClockwiseIcon size={12} />
220-
</IconButton>
221-
</Tooltip>
222239
</Flex>
223240
);
224241
}

apps/array/src/renderer/features/task-detail/components/ChangesTabBadge.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export function ChangesTabBadge({ taskId, task }: ChangesTabBadgeProps) {
3131
const filesLabel = diffStats.filesChanged === 1 ? "file" : "files";
3232

3333
return (
34-
<Flex gap="2">
34+
<Flex gap="2" mr="2">
3535
{diffStats.linesAdded > 0 && (
3636
<Text size="1">
3737
<Text size="1" color="green">

0 commit comments

Comments
 (0)