Skip to content

fix(colours): letter-family group boxes lost their palette colours (uppercase distinctly coloured again) - #63

Merged
willwade merged 2 commits into
mainfrom
fix/restore-v5-group-colours
Aug 26, 2026
Merged

fix(colours): letter-family group boxes lost their palette colours (uppercase distinctly coloured again)#63
willwade merged 2 commits into
mainfrom
fix/restore-v5-group-colours

Conversation

@willwade

@willwade willwade commented Aug 26, 2026

Copy link
Copy Markdown

Summary

Fixes #62 — the v5-parity report: "In v5, [capitals] were placed in a separate, uniquely colored node, which made them much easier to spot and target quickly." The separate group node survived; its colour did not.

Investigation traced it with a frame-command colour probe (scan dasher_frame output for filled-rect RGB per palette), which found two compounding causes:

1. Load-order clobber (hits every default-palette user)

DasherInterfaceBase parsed new-format color.*.xml before legacy colour.*.xml — and Data/colours/colour.xml is a legacy palette also named "Default". ParseLegacy overwrote KnownPalettes["Default"], destroying the new-format Default that defines uppercase groupColor="#ffff00". Probe, pre-fix: on Default no group box rendered with any palette fill at all; on European/Asian the yellow uppercase box rendered fine.

2. Legacy parser never set letter-family group colours

ParseLegacy mapped every letter-family colorInfoName to one shared GroupColorInfo with no groupColor, and its key list missed the bare "uppercase" / "limitedPunctuation" names the alphabet files actually use — so legacy palettes rendered all letter families identically.

Fix

  • Legacy files parse first; the maintained new format wins name collisions.
  • ParseLegacy restores group colours per v6's palette design: lowercase 0 / uppercase 111 (yellow) / punctuation 112 (green) / numbers 113 (red) — legacy indices that exactly match the new-format files' groupColor values (verified against the parsed palettes; v5's own file had pink there, but v6's maintained palettes deliberately chose yellow/green/red, so the fix makes both formats consistent).

Result (probe-verified)

palette uppercase group box
Default none → #FFFF00
European/Asian (Original) (legacy) none → #FFFF00
European/Asian (new) #FFFF00 (unchanged)

Capitals now sit in a distinctly coloured group box on every palette — the v5 behaviour restored under v6's colour design.

Test

uppercase_group_box_has_distinct_colour (test_draw_commands.cpp): renders frames and asserts the uppercase group's fill colour on both the Default palette (post-clobber) and a legacy palette — verified failing pre-fix, passing post-fix. Local matrix suite green (capi 10, extended 17, draw 9, parameters 13, settings 7, color-math 14).

Fixes #62

Greptile Summary

The PR restores distinct letter-family group-box colors across modern and legacy palettes and ensures maintained modern palettes win name collisions.

  • Loads legacy colour.*.xml files before modern color.*.xml files.
  • Assigns legacy group colors for lowercase, uppercase, punctuation, and number families.
  • Adds regression coverage for uppercase group coloring in both default and legacy palettes.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
src/DasherCore/ColorIO.cpp Adds distinct legacy group-box colors and aliases for the letter-family names used by alphabet definitions.
src/DasherCore/DasherInterfaceBase.cpp Reorders palette discovery so maintained modern definitions override colliding legacy palette names.
tests/test_draw_commands.cpp Adds command-stream regression coverage tying the expected uppercase color to the geometry containing the capital “A” label.

Reviews (2): Last reviewed commit: "test: tie uppercase-box assertion to geo..." | Re-trigger Greptile

Users on the default palette saw no group colours at all - capitals
were not visually distinct from lowercase (v5 report: 'they were in a
separate, uniquely colored node'). Two causes:

1. Load-order clobber: new-format color.*.xml files parsed BEFORE
   legacy colour.*.xml, and Data/colours/colour.xml is a legacy palette
   also named 'Default' - ParseLegacy overwrote the new Default and
   dropped its group colours (uppercase #ffff00 etc). Legacy files now
   parse first so the maintained format wins name collisions.

2. ParseLegacy never set any letter-family groupColor and missed the
   bare 'uppercase'/'limitedPunctuation' colorInfoName keys the
   alphabets actually use, so even legacy palettes rendered all letter
   families identically. Restore the v6 palette design consistently:
   lowercase 0 / uppercase 111 (yellow) / punctuation 112 (green) /
   numbers 113 (red) - legacy indices that match the new-format files'
   groupColor values exactly.

Regression test renders a frame and asserts the uppercase group box
fill: Default palette and a legacy palette both must show #FFFF00
(verified failing pre-fix via a frame-command colour probe).

Fixes #62

Signed-off-by: will wade <willwade@gmail.com>
Comment thread tests/test_draw_commands.cpp
The 'A' label (unique to the uppercase group at rest) must sit inside
the yellow filled rect, so an unrelated yellow element can no longer
satisfy the assertion (caught in review of #63). Re-verified
fail-then-pass against the pre-fix sources.

Signed-off-by: will wade <willwade@gmail.com>
@willwade
willwade merged commit 911cb77 into main Aug 26, 2026
15 checks passed
@willwade
willwade deleted the fix/restore-v5-group-colours branch August 26, 2026 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Uppercase group lost its distinct v5 colour (pink group box) - palette parser drops group colours and misses colorInfoName keys

1 participant