Skip to content

feat(task-comments): let authors delete their own recent comments - #593

Merged
artempartos merged 1 commit into
developfrom
artempartos/task-comment-delete-on
Oct 28, 2026
Merged

artempartos merged 1 commit into
developfrom
artempartos/task-comment-delete-on

Conversation

@artempartos

Copy link
Copy Markdown
Contributor

Why

User feedback: a person could Edit a task comment but found no way to delete it, and asked whether their permissions were wrong. They weren't — deletion didn't exist for anyone.

What

Delete follows the edit rules from #441 exactly:

  • only the comment's own author,
  • only human-authored comments (agent comments stay — later workflow steps read them),
  • only within TaskComment::EDIT_WINDOW (3 hours).

Company and project admins get no exception for now (a product decision, open to change later).

Backend

  • route DELETE /api/v1/projects/:project_id/tasks/:task_id/comments/:id
  • CommentsPolicy#destroy? = project_writable? (api + web), record-level check in the action via TaskComment#deletable_by? (same reason as update: the authorize-by-default path hands the policy a symbol, not the record) → 403 on a violation
  • TaskService.destroy_comment records a comment_deleted board activity (tag + body preview in metadata)
  • comment_deleted gets its own description in the board activity feed and in the recent-activity feed

Frontend

  • a Delete action next to Edit in the comment's action row, gated by the same canEditComment rule
  • a confirmation modal before the request; the comments and activity props reload afterwards
  • the Overview activity colour map gets a neutral colour for comment_deleted

Tests

  • model: deletable_by? follows the edit rules
  • service: destroy_comment removes the row and records the activity
  • request: owner 204; collaborator and company admin 403 on someone else's; viewer 403; agent comment 403; stale 403; stranger 404
  • resource: comment_deleted description
  • Vitest (BoardPage): Delete shows only on your own fresh comment, asks first, then sends the DELETE

Locally: the touched Ruby test files, rubocop on the changed files, tsc, eslint on the changed files, and the BoardPage + Overview Vitest suites are all green. The full suite runs on CI.

🤖 Generated with Claude Code

Users could edit a comment but had no way to remove one, which read as a
missing permission. Deletion follows the edit rules exactly — own comment,
human-authored, younger than TaskComment::EDIT_WINDOW — enforced in the
action like update, and company admins get no exception for now. Agent
comments stay undeletable because later workflow steps read them.

Each deletion records a comment_deleted board activity.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Artem Petrov <[email protected]>
@artempartos
artempartos force-pushed the artempartos/task-comment-delete-on branch from a41e18f to efc3f95 Compare October 28, 2026 02:18
@artempartos
artempartos merged commit bcd35a3 into develop Oct 28, 2026
16 checks passed
artempartos added a commit to Hitin/flow that referenced this pull request Oct 28, 2026
* origin/develop:
  docs(workflows): describe workflows as sessions made of steps (AixleHQ#595)
  feat(workflows): open archived workflows read-only in the builder (AixleHQ#594)
  feat(task-comments): let authors delete their own recent comments (AixleHQ#593)
  feat(mcp): log the JSON-RPC method and tool name of each MCP call (AixleHQ#592)
  fix(board): show a run waiting for a session slot as Queued on its card (AixleHQ#591)
  feat(brand): use the new Aixle Flow lockup and route fonts through tokens (AixleHQ#590)
  feat(overview): show tokens used and session time instead of token cost (AixleHQ#589)
  fix(agents): pre-acknowledge Claude Code's cost-threshold notice (AixleHQ#587)
  test(playwright): QA helpers batch 2 (appRequest, readInertiaPage, shot, probeRoutes, signOut) (AixleHQ#586)
  test(playwright): plain-JS QA helpers for browser_run_code on staging (AixleHQ#584)
  feat(runners): add the runners table and the Runner model (AixleHQ#583)
  refactor(feature-flags): plain cached reads, no usage tooling (AixleHQ#579)

# Conflicts:
#	CHANGELOG.md
artempartos added a commit to Hitin/flow that referenced this pull request Oct 28, 2026
* origin/develop:
  docs(workflows): describe workflows as sessions made of steps (AixleHQ#595)
  feat(workflows): open archived workflows read-only in the builder (AixleHQ#594)
  feat(task-comments): let authors delete their own recent comments (AixleHQ#593)
  feat(mcp): log the JSON-RPC method and tool name of each MCP call (AixleHQ#592)
  fix(board): show a run waiting for a session slot as Queued on its card (AixleHQ#591)
  feat(brand): use the new Aixle Flow lockup and route fonts through tokens (AixleHQ#590)
  feat(overview): show tokens used and session time instead of token cost (AixleHQ#589)
  fix(agents): pre-acknowledge Claude Code's cost-threshold notice (AixleHQ#587)
  test(playwright): QA helpers batch 2 (appRequest, readInertiaPage, shot, probeRoutes, signOut) (AixleHQ#586)
  test(playwright): plain-JS QA helpers for browser_run_code on staging (AixleHQ#584)
  feat(runners): add the runners table and the Runner model (AixleHQ#583)
  refactor(feature-flags): plain cached reads, no usage tooling (AixleHQ#579)

# Conflicts:
#	CHANGELOG.md
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