Skip to content

feat(autoseg): reapply palette colors to existing objects#83

Merged
dustenhubbard merged 1 commit into
mainfrom
feat/autoseg-reapply-colors
Jul 19, 2026
Merged

feat(autoseg): reapply palette colors to existing objects#83
dustenhubbard merged 1 commit into
mainfrom
feat/autoseg-reapply-colors

Conversation

@dustenhubbard

Copy link
Copy Markdown
Owner

Closes the retroactivity gap in the autoseg color features (#80/#82): series imported before those changes can now be brought onto the current palette.

  • 'Reapply autoseg colors...' in the object context menu (list + field submenu), acting on the SELECTION (composes with regex filter/groups); confirm dialog; locked objects blocked exactly like sibling attribute edits.
  • Label id recovered from the autoseg_<id> naming (import and recolor now share a hoisted prefix constant so they can't drift); renamed objects fall back to a crc32 name hash (deterministic across runs, unlike builtin hash).
  • Colors flow through the proven editTraceAttributes bulk path: ONE undo restores every prior color across all sections; render freshness covered by the fix(render): refresh trace render when a trace's attributes change #69 fix; per-object color map computed once, sections scoped via getObjectSections.
  • Deliberate deviation: zero-selection is a silent no-op (matches every sibling object action) rather than a notify.
  • Skipping manually-customized colors confirmed impossible (colors carry no provenance); mitigated by confirm + full undo.

15 new tests; suite 1234 passed, 5 pre-existing xfails.

🤖 Generated with Claude Code

Objects imported before the autoseg color features baked their colors in at
import time, so they never pick up the current colorblind-safe default (or a
custom) palette. Add "Reapply autoseg colors..." to the object-list / object
context menu to push the CURRENT palette + seed back onto selected objects.

- palette.py: AUTOSEG_TRACE_PREFIX (single source of truth for the
  "autoseg_<id>" import naming), label_id_from_name (recovers the label id from
  an unmodified import name), and palette_color_for_name (reproduces the exact
  import color for a parseable name; falls back to a stable, PYTHONHASHSEED-
  independent zlib.crc32 hash of the name otherwise). conversions.py now builds
  import names from the shared prefix so the two stay in sync.

- series.reapplyAutosegColors: resolves the palette/seed and per-object color
  once, then rewrites colors through the normal per-section editTraceAttributes
  path over only the sections the objects appear on -- one undoable operation,
  correct list/field refresh (reuses the #69 stale-render funnel), no per-object
  full-series scans.

- GUI action goes through the existing object_function wrapper, so locked
  objects are blocked exactly as any other bulk attribute edit, and a confirm
  dialog warns before existing colors are discarded (undo restores them).

Selection is the contract: it composes with the regex/group/invert filters, so
"select all autoseg_* then reapply" works without guessing a name pattern.

Tests: id-parse + hash-fallback determinism, custom palette/seed respected,
recolor matches a fresh import, distinct ids stay distinct, single undo
restores every prior color across sections, zero-selection no-op.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@dustenhubbard
dustenhubbard enabled auto-merge (squash) July 19, 2026 20:00
@dustenhubbard
dustenhubbard merged commit 0b1078a into main Jul 19, 2026
1 check passed
@dustenhubbard
dustenhubbard deleted the feat/autoseg-reapply-colors branch July 19, 2026 20:01
dustenhubbard added a commit that referenced this pull request Jul 23, 2026
Objects imported before the autoseg color features baked their colors in at
import time, so they never pick up the current colorblind-safe default (or a
custom) palette. Add "Reapply autoseg colors..." to the object-list / object
context menu to push the CURRENT palette + seed back onto selected objects.

- palette.py: AUTOSEG_TRACE_PREFIX (single source of truth for the
  "autoseg_<id>" import naming), label_id_from_name (recovers the label id from
  an unmodified import name), and palette_color_for_name (reproduces the exact
  import color for a parseable name; falls back to a stable, PYTHONHASHSEED-
  independent zlib.crc32 hash of the name otherwise). conversions.py now builds
  import names from the shared prefix so the two stay in sync.

- series.reapplyAutosegColors: resolves the palette/seed and per-object color
  once, then rewrites colors through the normal per-section editTraceAttributes
  path over only the sections the objects appear on -- one undoable operation,
  correct list/field refresh (reuses the #69 stale-render funnel), no per-object
  full-series scans.

- GUI action goes through the existing object_function wrapper, so locked
  objects are blocked exactly as any other bulk attribute edit, and a confirm
  dialog warns before existing colors are discarded (undo restores them).

Selection is the contract: it composes with the regex/group/invert filters, so
"select all autoseg_* then reapply" works without guessing a name pattern.

Tests: id-parse + hash-fallback determinism, custom palette/seed respected,
recolor matches a fresh import, distinct ids stay distinct, single undo
restores every prior color across sections, zero-selection no-op.
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.

1 participant