Skip to content

feat(code): add warning dialog for archiving running tasks#2530

Open
adboio wants to merge 1 commit into
mainfrom
06-08-feat_code_add_warning_dialog_for_archiving_running_tasks
Open

feat(code): add warning dialog for archiving running tasks#2530
adboio wants to merge 1 commit into
mainfrom
06-08-feat_code_add_warning_dialog_for_archiving_running_tasks

Conversation

@adboio
Copy link
Copy Markdown
Contributor

@adboio adboio commented Jun 8, 2026

Problem

tasks move around in the sidebar, i accidentally archived one that was running earlier, was frustrating

Changes

adds a warning dialog if you attempt to archive a task that is actively doing something

Screenshot 2026-06-08 at 11.23.48 AM.png

How did you test this?

manually

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

Copy link
Copy Markdown
Contributor Author

adboio commented Jun 8, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 8, 2026

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit ecbad7c.

@adboio adboio force-pushed the 06-08-feat_code_add_warning_dialog_for_archiving_running_tasks branch from e590e45 to ecbad7c Compare June 8, 2026 18:26
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Jun 8, 2026

Comments Outside Diff (1)

  1. apps/code/src/renderer/features/sidebar/components/SidebarMenu.tsx, line 342-371 (link)

    P2 handleArchivePrior silently stops running agents

    handleArchivePrior calls archiveTasksImperative directly without filtering through isTaskActivelyRunning, so any actively-running task older than the clicked task is stopped with no warning — which contradicts the guard added for single-task archival. Consider filtering out running tasks from priorTaskIds (or warning once if the batch contains any) to keep the behavior consistent.

    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: apps/code/src/renderer/features/sidebar/components/SidebarMenu.tsx
    Line: 342-371
    
    Comment:
    **`handleArchivePrior` silently stops running agents**
    
    `handleArchivePrior` calls `archiveTasksImperative` directly without filtering through `isTaskActivelyRunning`, so any actively-running task older than the clicked task is stopped with no warning — which contradicts the guard added for single-task archival. Consider filtering out running tasks from `priorTaskIds` (or warning once if the batch contains any) to keep the behavior consistent.
    
    How can I resolve this? If you propose a fix, please make it concise.
Prompt To Fix All With AI
Fix the following 3 code review issues. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 3
apps/code/src/renderer/features/sidebar/components/ArchiveRunningTaskDialog.tsx:18-23
When `AlertDialog.Action` closes the dialog it also triggers `onOpenChange(false)`, which calls `onCancel()` even after a confirmed archive. Both handlers currently just set `archiveConfirm` to `null`, so this is harmless today — but if `onCancel` ever gains distinct semantics (e.g., a "cancelled" toast), the action path will incorrectly trigger it. The cancel handler should only fire on true dismissals.

```suggestion
    <AlertDialog.Root open={open}>
```

### Issue 2 of 3
apps/code/src/renderer/features/sidebar/components/ArchiveRunningTaskDialog.tsx:37-41
If the `onOpenChange` approach is kept, the `Cancel` button should also explicitly call `onCancel` via its own `onClick` so the cancel path is explicit rather than relying solely on `onOpenChange`.

```suggestion
          <AlertDialog.Cancel>
            <Button variant="soft" color="gray" size="1" onClick={onCancel}>
              Cancel
            </Button>
          </AlertDialog.Cancel>
```

### Issue 3 of 3
apps/code/src/renderer/features/sidebar/components/SidebarMenu.tsx:342-371
**`handleArchivePrior` silently stops running agents**

`handleArchivePrior` calls `archiveTasksImperative` directly without filtering through `isTaskActivelyRunning`, so any actively-running task older than the clicked task is stopped with no warning — which contradicts the guard added for single-task archival. Consider filtering out running tasks from `priorTaskIds` (or warning once if the batch contains any) to keep the behavior consistent.

Reviews (1): Last reviewed commit: "feat(code): add warning dialog for archi..." | Re-trigger Greptile

Comment on lines +37 to +41
<AlertDialog.Cancel>
<Button variant="soft" color="gray" size="1">
Cancel
</Button>
</AlertDialog.Cancel>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 If the onOpenChange approach is kept, the Cancel button should also explicitly call onCancel via its own onClick so the cancel path is explicit rather than relying solely on onOpenChange.

Suggested change
<AlertDialog.Cancel>
<Button variant="soft" color="gray" size="1">
Cancel
</Button>
</AlertDialog.Cancel>
<AlertDialog.Cancel>
<Button variant="soft" color="gray" size="1" onClick={onCancel}>
Cancel
</Button>
</AlertDialog.Cancel>
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/code/src/renderer/features/sidebar/components/ArchiveRunningTaskDialog.tsx
Line: 37-41

Comment:
If the `onOpenChange` approach is kept, the `Cancel` button should also explicitly call `onCancel` via its own `onClick` so the cancel path is explicit rather than relying solely on `onOpenChange`.

```suggestion
          <AlertDialog.Cancel>
            <Button variant="soft" color="gray" size="1" onClick={onCancel}>
              Cancel
            </Button>
          </AlertDialog.Cancel>
```

How can I resolve this? If you propose a fix, please make it concise.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@adboio adboio marked this pull request as ready for review June 8, 2026 18:41
@adboio adboio requested a review from a team June 8, 2026 18:41
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Jun 8, 2026

Reviews (2): Last reviewed commit: "feat(code): add warning dialog for archi..." | Re-trigger Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant