Repository navigation
Should be able to delete notes.. - #26
Merged
Merged
Conversation
…ld-be-able-to-delete-notes--f249f606
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.
Handover: Should be able to delete notes (G-28)
What you asked
You couldn't find a button to delete notes.
The hub could already delete notes. The only Delete button was at the bottom of a note after you opened it, so it was easy to miss. Sticky notes on the board and the notes list had no Delete button, and deleting never asked you to confirm.
What changed
Delete is now in three places (T-162, Tommy):
Every Delete asks first: "Delete N-12 'title'?" Nothing is removed until you say yes.
Who can delete is the same as before:
People who can't delete a note now see "Only the author or a workspace admin can delete this note." in its place. The screen and the hub now follow the same rule. Before, the open-note view could show Delete on notes the hub would refuse.
The hub is safe when a goal's plan or summary note is deleted (T-163, Trevor). The code already handled it: the next time the manager adds tasks or writes a summary, Canopy starts a new note. No production code changed here. Only tests were added.
Files changed (5 commits, plus a merge):
frontend/src/lib/stickies.ts: one rule for who can delete (canDeleteNote), with tests instickies.test.tsfrontend/src/components/board/Sticky.tsx: Delete on stickiesfrontend/src/components/board/panels/NotesPanel.tsx: Delete on list rows, the confirm step and the hinthub/internal/api/sticky_notes_test.go: tests for who can deletehub/internal/api/assign_tasks_test.go: a test that the manager can still add tasks after the plan note is deletedHow to check it
What isn't done, and the risks
st-del), but no style is written for it, so it isn't red. The confirm step stops accidental deletes, but you may want it to look different.What you need to decide