Bestehenden Kommentar auf einem Todo bearbeiten koennen #169
Labels
No labels
priority/could
priority/must
priority/should
priority/wont
status/blocked
status/claimed
status/done-migrated
type/bug
type/feature
type/infra
type/tech-debt
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
robert/todo#169
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Story: Bestehenden Kommentar auf einem Todo bearbeiten koennen
As a Autor eines Kommentars auf einem Todo,
I want to einen bereits abgeschickten Kommentar nachtraeglich korrigieren koennen,
so that ich nicht bei jedem Tippfehler den ganzen Kommentar loeschen und neu schreiben muss (und dabei Zeitstempel/Position im Thread verliere).
Background
Checkly/Features/Comments/hatCreateCommentCommandHandlerundDeleteCommentCommandHandler, aber keinen Update-Pfad - ein Tippfehler laesst sich aktuell nur per Loeschen+Neuanlegen korrigieren, was den Kommentar ans Ende der Liste verschiebt und den urspruenglichen Zeitstempel verliert.Acceptance criteria:
UpdateCommentCommandaendert den Text eines bestehenden Kommentars, nur durch dessen Autor (nicht durch andere Mitglieder oder den Listen-Owner).CreatedAt-Zeitstempel/seine Position im Thread; optional ein „(edited)"-Hinweis in der UI.Out of scope for this story:
Open questions: (escalate to human if unanswered)
Implemented and merged in commits
64400b0d(backend) and795bb0b5(frontend) on master.Scope: New
UpdateCommentCommandupdates a comment'sTextand sets a newEditedAttimestamp;CreatedAt/thread position stay untouched, per the AC. Deliberately author-only, no owner override - a newAuthorizeCommentUpdateAccessForCurrentUserQuerywas added rather than reusing the existing delete-access rule (which allows author OR list owner, for moderation) - editing someone else's words in place is a different kind of action than deleting them. Frontend adds a pencil-icon Edit button next to Delete (author-only visibility) with an inline input (Enter to save, Escape to cancel) and an "(edited)" hint next to the timestamp once a comment has been edited.Out of scope, as specified: version history of edits; Pantry product comments or Master Packing List item comments (separate entities/DTOs, no edit feature added there).
Tests: 3 new backend handler tests (text/EditedAt update, CreatedAt/thread-position untouched, not-found) + 5 new authorization tests (author allowed; owner explicitly NOT allowed - the key behavioral difference from delete; a third member rejected; not-logged-in; comment-already-gone defers to the command's own 404) - all confirmed to reach
DockerUnavailableExceptionin this sandbox, proving DI wiring is correct. 9 new/updated frontend tests acrossCommentItem.test.tsx/CommentList.test.tsx(edit button visibility, inline edit flow, save/cancel, no-op on unchanged text, the edited hint).Verification:
dotnet buildclean; full frontend suite green (126 files/1191 tests, +9 from this cycle);tsc -b/npm run buildclean. A dedicated security-review pass specifically confirmed the update-access handler has no owner-override branch at all (not merely disabled), that the command'sExecuteUpdateAsyncpredicate and the authorization query's lookup use the identical(TodoListId, TodoNr, CommentId)triple from the same request (no IDOR via mismatched checks), and that the frontend'scanEditis UI-only, mirroring the already-establishedcanDeletepattern - no findings.Closing as done.