Hive
feat(specs): allow authors to delete comments
GitHub issue · Closed
What changed
Spec comment authors can now delete their own comments from the spec page.
The dashboard now renders a Noora confirmation modal for each deletable comment, with a warning message and destructive Delete action. The LiveView handles cancel and delete events, closes the modal after deletion, refreshes the spec, and keeps the existing author-only authorization behavior. The route stylesheet also treats the modal trigger like the existing comment action buttons so the icon row stays visually consistent.
Why
Authors could edit their own spec comments, and deletion already existed in the underlying spec domain, but the spec page did not expose a dashboard path for removing a comment. That made routine cleanup depend on a non-dashboard path.
Root cause
The comments action row only rendered edit and permalink controls. There was no delete trigger, no confirmation step, and no LiveView event wired to the existing deletion capability.
Approach
I followed the destructive modal pattern used in Tuist settings screens: a Noora modal, warning treatment, clear Cancel and Delete actions, and an explicit close event. The trigger remains icon-only so it fits beside edit and permalink without changing the comment layout.
Impact
Signed-in comment authors can remove their own comments from the spec discussion after confirming the action. Other users still do not see edit or delete controls, and direct delete attempts from another user are rejected.
Validation
mix format lib/hive_web/live/spec_live/show.ex lib/hive_web/components/spec_components.ex test/hive_web/live/spec_live/show_test.exsmix test test/hive_web/live/spec_live/show_test.exsmix compile --warnings-as-errors
No GitHub comments yet.