Repository navigation
feat: notes are visible under every tool, editable in a panel, and undoable - #77
Merged
Merged
Conversation
…doable The Note tool placed a marker and little else. Notes were drawn from `PointTool::overlays`, so they existed only while that tool was held; the text a note carried was set once to "Note 3" and never shown anywhere; and none of it went through the history. - Markers are the shell's now, not the tool's, drawn from the shared `schist_tools_doc::note_overlays` beside the carve-out that already keeps pen paths visible across a tool switch. View ▸ Notes hides them deliberately, and ⌘H with the rest of the extras. - A Notes panel in the side column: author, ‹ n / m › navigation, delete, and a click-to-edit multi-line body. New notes arrive empty and selected rather than holding a placeholder nothing could reach. - `EditOp::NotesSet` and `EditBuilder::change_notes`. Place, move, edit, delete and Clear Notes are all history entries; a drag is one entry for the gesture and a click that only selects is none. This is the path `Document::mark_dirty`'s comment already anticipated, so that comment is updated rather than left describing the old state. - Options bar parity: an Author field defaulting to `$USER` and persisted as a preference, a colour swatch through the existing picker, and Clear All. Colour is per-note, so several reviewers stay apart on one document. Markers are sized in screen pixels, so a note stays clickable at any zoom; overlapping ones are hit topmost-first. Two fixes fall out of moving notes off the pixel path: note edits no longer report canvas damage, which was invalidating every composited tile each time a marker was nudged, and the note tool no longer trips `tool_has_overlay`, which was running the 8fps marching-ants ticker for markers that do not march. Counts share `PointTool` and stay outside the history, and notes still do not round-trip to PSD. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
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.
The Note tool placed a marker and little else. A note left on a document vanished the moment anyone picked up a brush, the text it carried was set once to
"Note 3"and shown nowhere, and none of it reached the history — so ⌘Z stepped straight past a misplaced note to whatever was edited before it.PointTool::overlays, which the canvas only calls for the active tool, so notes were on screen exactly while the Note tool was held — indistinguishable from having been deleted. They now come from the shell, through a sharedschist_tools_doc::note_overlays, beside the carve-out atworkspace.rsthat already keeps a pen path visible across a tool switch. View ▸ Notes hides them deliberately (Photoshop's Show ▸ Notes), and ⌘H with the rest of the extras.‹ n / m ›navigation, a trash button, and a click-to-edit multi-line body.Note.textandNote.authorhad no reader anywhere in the app before this; the only note-related menu item was Clear Notes. New notes arrive empty and selected rather than holding a placeholder nothing could edit.EditOp::NotesSetandEditBuilder::change_notes.tools-docwas the one tool plugin that never touched the history. Place, move, edit, delete and Clear Notes are entries now; a drag is one entry for the whole gesture, and a click that only selects a note to read it is none at all. This is the pathDocument::mark_dirty's comment already anticipated — "when they get their ownEditOpthe call here becomes redundant rather than wrong" — so that comment is updated rather than left describing the old state.$USERand persisted as a preference (a reviewer types their name once, not once per note), a colour swatch through the existing picker viaColorTarget::Note, and Clear All. Colour is per-note, so several reviewers stay apart on one document. Markers are sized in screen pixels, so a note stays findable at 5% and clickable at 1600%; overlapping ones are hit topmost-first.Two fixes fall out of moving notes off the pixel path. Note edits no longer report canvas damage — a note is an overlay, and damage invalidates cached composited tiles, so every marker nudge was recompositing the whole document. And the note tool no longer trips
tool_has_overlay, which drives the 8fps marching-ants ticker; static markers have nothing to march.Selection is an index into
Document::notes, which undo, delete, Clear Notes and switching to a document with fewer of them all leave dangling —Workspace::active_noteis the single place that resolves it, so the panel and the canvas outline cannot disagree.Six new tests in
plugins/tools-doc/tests/doc_tools.rscover undo/redo of place, move and delete; one entry per drag and none per bare click; author, colour and empty text on a new note; selection following a delete; topmost hit order; and marker generation.Verified in the app (headless X, fixture PNG): placing two notes, typing into one, switching to the brush with both markers still drawn and the panel still showing the text, two ⌘Z stepping back through Edit Note and Place Note, and View ▸ Notes hiding the markers.
Out of scope, both called out in the code: counts share
PointTooland stay outside the history, and notes still do not round-trip to PSD. Photoshop keeps annotations in an image resource, and I would be guessing at that format; today's behaviour is unchanged, so annotations in an opened PSD survive a re-save as preserved opaque resources but are not shown, and notes made here are not written.🤖 Generated with Claude Code