Repository navigation
tasks: confirm before discarding unmerged worktree work on delete (#160) - #161
Merged
Merged
Conversation
DELETE /api/tasks/:id already refuses with 409 UNMERGED_WORK unless forced, and the chat has asked again and resent with ?force=1 since #129. The Kanban card and the Schedule list did not: they surfaced the raw refusal in a toast and stopped, so a task whose worktree still held unmerged commits or uncommitted changes could not be deleted from either screen at all. Both now go through the same small request helper: the first refusal becomes the question, naming the branch and the worktree the delete would destroy; Cancel destroys nothing, a confirmed second attempt carries ?force=1, and a forced attempt that is still refused is reported instead of asking again in a loop. test/task-delete-unmerged.test.js runs the real helper from both pages in a vm, pins the wiring of both delete buttons, and checks the new string in all five languages. Local: the new suite 13/13, i18n-completeness 139/139, schedule-actions 15/15, kanban-schedule 42/42, kanban-run-badges 40/40, sidebar-ux 8/8, kanban-group-button 6/6 under Node 24.22.1.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes the first half of #160.
What was actually missing
DELETE /api/tasks/:idhas accepted?force=1/body.forcesince the chat delete gained it, and the chat itself (index.html, #129) already asks again and resends with force after a409 UNMERGED_WORK. The two task screens did not:kanban.htmlconfirmDeletesent an unforced DELETE throughapiFetch, which threw on 409, and the catch showed the raw JSON in a toast. The card stayed.schedule.htmldeleteTaskdid the same.So a task whose worktree still holds unmerged commits or uncommitted changes could not be removed from either screen; the only way out was manual git in the container.
Change
Both pages now use one small
_taskDeleteRequest(tk, send, ask)helper:409 UNMERGED_WORKit asks, naming the branch and the worktree the delete would destroy (newconfirm.unmergedstring in uk/en/ru/fr/he);?force=1;401goes to/login, any other failure shows the server's message.Verification (local, Node 24.22.1)
test/task-delete-unmerged.test.js(new) — 13/13: runs the real helper from both pages in a vm, pins that both delete buttons go through it (and that neither keeps a bareapiFetchDELETE), and that both dictionaries carry the new string five times.i18n-completeness139/139,schedule-actions15/15,kanban-schedule42/42,kanban-run-badges40/40,sidebar-ux8/8,kanban-group-button6/6.kanban-group-button).Not in this PR: a bulk purge of finished/cancelled/failed unmerged tasks (#2 in the issue) and an expiry setting that may discard unmerged worktrees (#4). Expiry deliberately keeps unmerged work — a setting to drop it is a policy decision, not a bug fix.