Skip to content

Commit 56d7984

Browse files
authored
fix: Rerender changes panel upon task refocus (#380)
1 parent ddfdade commit 56d7984

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

apps/array/src/renderer/features/right-sidebar/components/RightSidebarContent.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,11 @@ export function RightSidebarContent({
7070
</Flex>
7171
<Box flexGrow="1" overflow="hidden">
7272
{activeTab === "changes" && (
73-
<ChangesPanel taskId={taskId} task={task} />
73+
<ChangesPanel key={taskId} taskId={taskId} task={task} />
74+
)}
75+
{activeTab === "files" && (
76+
<FileTreePanel key={taskId} taskId={taskId} task={task} />
7477
)}
75-
{activeTab === "files" && <FileTreePanel taskId={taskId} task={task} />}
7678
</Box>
7779
</Flex>
7880
);

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,7 @@ export function ChangesPanel({ taskId, task }: ChangesPanelProps) {
363363
}),
364364
enabled: !!repoPath,
365365
refetchOnMount: "always",
366+
refetchOnWindowFocus: true,
366367
});
367368

368369
const getActiveIndex = useCallback((): number => {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export function ChangesTabBadge({ taskId, task }: ChangesTabBadgeProps) {
2626
}),
2727
enabled: !!repoPath,
2828
refetchOnMount: "always",
29+
refetchOnWindowFocus: true,
2930
});
3031

3132
if (!diffStats || diffStats.filesChanged === 0) {

0 commit comments

Comments
 (0)