Skip to content

Add support for deleting issues and projects in tk-vsc#217

Merged
neongreen merged 4 commits intomainfrom
copilot/implement-delete-issues-and-projects
Nov 1, 2025
Merged

Add support for deleting issues and projects in tk-vsc#217
neongreen merged 4 commits intomainfrom
copilot/implement-delete-issues-and-projects

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Nov 1, 2025

  • Add project.delete event type to tk internal types
  • Add ProjectDeletePayload to tk internal types
  • Implement "tk project rm" command in tk
  • Rename "tk delete" to "tk rm" with aliases (delete, del, remove)
  • Add delete task command to tk-vsc
  • Add delete project command to tk-vsc
  • Remove all success toasts from tk-vsc (only warnings/failures)
  • Add status filter buttons to tk-vsc
  • Document success toast rule in AGENTS.md
  • Run tests and verify all changes work
  • Fix project deletion to properly delete all tasks
  • Refactor based on code review feedback

All features implemented, tested, and refactored based on code review suggestions.

Original prompt
  1. in tk-vsc, support deleting issues (already implemented in tk)
  2. in tk, implement "tk project rm" -- let's say if a project is removed, all issues inside are also considered removed (but don't expand it into a myriad issue deletion events, the single project deletion event should be enough)
  3. rename tk delete to tk rm, add "tk delete" "tk del" "tk remove" as aliases
  4. in tk-vsc, also let me delete projects
  5. remove all success toasts from tk-vsc, only warnings and failures should have notifs, success should NEVER have notifs. write this in agents.md also
  6. Add buttons to filter which statuses are shown (one per status). by default all are shown

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits November 1, 2025 21:59
… filters

- Add project.delete event type and ProjectDeletePayload
- Implement "tk project rm" command to delete projects
- Rename "tk delete" to "tk rm" with aliases (delete, del, remove)
- Add deleteTask and deleteProject commands to tk-vsc
- Remove all success toasts from tk-vsc (only warnings/errors)
- Add status filter buttons (next, wip, done, none) to tk-vsc
- Document no-success-toast rule in tk-vscode/AGENTS.md

Co-authored-by: neongreen <1523306+neongreen@users.noreply.github.com>
- Add taskProjects map to reducer to track task-project associations
- Update applyTaskCreated to store project associations
- Implement applyProjectDelete to delete all tasks in a project
- Update applyTaskDelete to clean up project associations
- Update ProjectProjectDeleteEvent to delete tasks from database tables

Now when a project is deleted, all tasks in that project are properly
removed from both the database and the reducer's in-memory state.

Co-authored-by: neongreen <1523306+neongreen@users.noreply.github.com>
Co-authored-by: neongreen <1523306+neongreen@users.noreply.github.com>
@neongreen
Copy link
Copy Markdown
Owner

@copilot continue

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Nov 1, 2025

@copilot continue

All features have been implemented and tested successfully:

  1. ✅ Task and project deletion in tk-vsc with confirmation dialogs
  2. ✅ "tk project rm" command implemented
  3. ✅ "tk delete" renamed to "tk rm" with aliases (delete, del, remove)
  4. ✅ Success notifications removed from tk-vsc (only errors/warnings shown)
  5. ✅ Status filter buttons added to tk-vsc UI
  6. ✅ Project deletion correctly removes all tasks from both database (with transactions) and reducer
  7. ✅ Code refactored based on review feedback (transactions, removed duplication)

All tests pass and the implementation has been verified with manual testing.

@mergify
Copy link
Copy Markdown

mergify Bot commented Nov 1, 2025

🧪 CI Insights

Here's what we observed from your CI run for d3e2bf3.

🟢 All jobs passed!

But CI Insights is watching 👀

@neongreen neongreen marked this pull request as ready for review November 1, 2025 23:12
@neongreen neongreen changed the title [WIP] Add support for deleting issues and projects in tk-vsc Add support for deleting issues and projects in tk-vsc Nov 1, 2025
@neongreen neongreen merged commit 21273d6 into main Nov 1, 2025
6 checks passed
@neongreen neongreen deleted the copilot/implement-delete-issues-and-projects branch November 1, 2025 23:15
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

func (r *Reducer) applyTaskRelocate(e types.Event) error {
var payload types.TaskRelocatePayload
if err := json.Unmarshal(e.Payload, &payload); err != nil {
return fmt.Errorf("failed to unmarshal task.relocate payload: %w", err)
}
// types.Task relocations are managed by DB projections
// The task itself doesn't change in the in-memory reducer
return nil

P1 Badge Track task project changes during relocation

The reducer now maintains taskProjects and relies on it when handling project.delete to remove all tasks in the deleted project. However applyTaskRelocate still ignores relocation events and never updates that map. Any task that was created in project A and later moved to project B will remain mapped to A, so deleting project B will leave those tasks in memory (and they will still be shown by tk ls), while deleting project A will remove tasks that no longer belong to it. The project delete event therefore cannot reliably remove the correct tasks until the relocation handler updates taskProjects for the new project.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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.

2 participants