Repository navigation
Stop notes inventing a colour, and mark system prompts by shape - #390
Merged
Merged
Conversation
SceneNode.color's own contract is "None means use the kind's own default colour, a rendering fallback that is entirely the frontend's job", and NoteNodeView already honours it (backgroundColor: data.color ?? undefined). The save path overrode that on every write with a hard-coded "#4a7c59", so a note nobody ever coloured came back from a save/reload permanently green - in the middle of an otherwise monochrome canvas, and in a colour that is not one of the picker's eight swatches (its Green is #3f8f5c), so it could not be deliberately chosen or re-chosen either. The column is TEXT NOT NULL, which is why a value was being invented at all; the empty string is the storable spelling of "no colour chosen" and normalises back to None on read. Rows already carrying the old default are normalised the same way on load rather than rewritten, so existing databases render neutral with no destructive migration. A note whose colour was genuinely chosen still round-trips as that hex. Separately, a system-prompt note took the colour picker's own "Purple" swatch as its border colour. That put a SEMANTIC marker (this note governs the branch) and a USER CHOICE (I coloured this note purple) in the same visual channel, indistinguishable the moment anyone picks Purple for a note body - and spent a hue in a palette whose whole design is monochrome. The meaning was already carried by shape: .note-node.system-prompt's dashed, heavier border, plus the header badge. That border now takes a theme token, and the inline colour override is gone. Co-Authored-By: Claude <noreply@anthropic.com>
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.
Problem
Every note rendered a saturated green in an otherwise monochrome canvas, and a system-prompt note rendered green with a purple border.
The green was invented by the save path.
SceneNode.color's own contract is "None means use the kind's own default colour, a rendering fallback that is entirely the frontend's job", andNoteNodeViewalready honours it (backgroundColor: data.color ?? undefined). Butchat_library.pywrotestr(note.get("color") or "#4a7c59")on every save, so:#4a7c59is not one ofGroupColorPicker's eight swatches (its Green is#3f8f5c), so that colour could never be deliberately chosen, nor re-chosen after changing it.The
notes.colorcolumn isTEXT NOT NULL, which is why a value was being invented at all.The purple was a semantic marker borrowing a user-choice swatch.
NOTE_SYSTEM_PROMPT_BORDER_COLORwas defined asGROUP_NAMED_COLORS[2].hex- the picker's own "Purple" - and applied as an inlineborderColor. That put a semantic marker (this note governs the branch) and a user's colour choice in the same visual channel, indistinguishable the moment anyone picks Purple for a note body, and spent a hue in a palette whose whole design is monochrome. The meaning was already carried by shape:.note-node.system-prompt's dashed, heavier border plus the header's own badge.Change
""- the storable spelling of "no colour chosen" under aNOT NULLcolumn - instead of a hex, and_legacy_default_to_nonemaps both""and the old forced default back toNoneon read.#4a7c59are normalised on load, not rewritten, so existing databases render neutral with no destructive migration. A colour the user genuinely chose still round-trips as that hex.NOTE_SYSTEM_PROMPT_BORDER_COLORis removed.Test plan
ruffclean.npm run checkgreen.test_session_format_adr009.py, all reloading through the notes table exactly asloadChatdoes: an uncoloured note staysNoneacross a full DB round trip; a chosen#3f8f5csurvives unchanged; and a legacy row carrying#4a7c59loads asNone.NoteNodeView.test.tsxasserts a system-prompt note carries no inlineborderColor, so the marker cannot drift back onto a palette hue.rgb(37, 37, 37)(the shared node surface) with a dashedrgb(148, 148, 148)border and no inline styles at all.