Repository navigation
fix(automation): Address colors by palette slot - #161
Conversation
annotate://color/<slot> and the Set Color action take a palette slot from 1 to 9 instead of a color name, so an editable palette can change what a slot holds without breaking saved links and shortcuts.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Decoding let %2F pass for a separator, so color/4%2F ran as color/4/.
Live verificationHead: 1c3639b
Not tested: the number pad and non-US keyboard layouts. |
Prep for #155. The
annotate://colorlink and the Shortcuts Set Color action now address a color by its palette slot, so an editable palette can change what a slot holds without breaking saved links and shortcuts. Neither has shipped yet, so there is no compatibility to keep.Summary
annotate://color/<slot>takes1to9. Anything else (red,0,10,01,+1) is rejected as an unknown value, like any other bad link. Percent-encoded links (color/%34,color/4%2F) are rejected too, for every command: no link needs encoding, and a decoded%2Fpassed for a separator, socolor/4%2Fran ascolor/4/.shortcut.color4instead ofshortcut.colorGreen). They aren't in v1.8.0, so nothing is migrated. Color keys set in a development build go back to unassigned.Testing
swift test: 1317 tests, 4 skipped, 0 failures. SwiftLint: 0 violations.PaletteColor.allCases.countfails the build), so a test fails if the palette stops having 9 colors.Live verification: passed on b6324d3. How: links opened in the
verify-annotatedebug copy, one pen stroke after each.color/1,color/4, andcolor/7drew red, green, and magenta; aftercolor/greenandcolor/10the stroke stayed magenta. Not rerun for the follow-up commits, which change nothing drawn on screen. Evidence for that commit: recording and end-state screenshot attached below.Summary by CodeRabbit
Changes
Documentation
annotate-color-slots.mp4