Editor uses hardcoded THREAD_COLORS (10 colors) instead of the thread library — custom colors added in Settings don't appear in Editor's thread picker #140
Labels
No labels
blocked:commit-ready-failed
blocked:gate-fetch
blocked:gate-lint
blocked:gate-plan
blocked:gate-research
blocked:needs-attention
blocked:needs-decision
blocked:needs-human
blocked:no-changes
blocked:verify-failed
bug
deferred
feature-request
in-progress
needs-decompose
needs-triage
quickfix
security/medium
triage-approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Mark/Kimi_Agent_Brother_10_Digitizing_App#140
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Finding
The Editor uses its own hardcoded
THREAD_COLORSconst (src/components/editor/constants.ts:3-7) with 10 colors. The thread library (post-#120, post-#126 work-in-progress) is the actual source of truth for thread colors in the Workspace, the Right Panel, the Bottom Thread Bar, and the Export Dialog.The Editor's thread picker uses neither the thread library nor the service catalog. A user who adds a custom color in Settings will see it everywhere except the Editor. The Editor's
EditorThreadBar.tsx(closed #94 was a fix for its disconnected rendering) reads from the hardcodedTHREAD_COLORSarray, not fromuseThreadLibrary().Where
src/components/editor/constants.ts:3-7(10 colors)src/components/editor/EditorThreadBar.tsxsrc/pages/Editor.tsx:111(const paletteColor = library[threadIndex % library.length] ?? library[0];—libraryhere is the thread library parameter, but the fallback usesTHREAD_COLORSand the index is bounded toTHREAD_COLORS.length)The Editor's thread picker shows 10 colors from the hardcoded const, ignoring both the user's custom library AND the service's 61-color catalog.
Suggested fix shape
useThreadLibrary()call at the Editor page level (src/pages/Editor.tsx) and passcolorstoEditorThreadBarandEditorRightPanelas a prop (matching the pattern that the Workspace uses post-round-5).THREAD_COLORSimport with the prop. TheTHREAD_COLORSconst stays for demo data (theDEMO_PATHSarray uses it) but production thread references use the library.currentThreadIndex(bumped by the user picking a color) needs to be reindexed against the live library length, not the hardcoded 10.Severity
Medium. The Editor is the place a user spends the most time refining their design. Showing 10 hardcoded colors when they have 30 in their library is a real UX gap.
Discovered by
Gap analysis (2026-10-02) of editor / library integration.
Related
Fixed in commit
09239cbon main (pushed).The Editor's thread picker, current-thread swatch, and freshly-created path color now read from the live
useThreadLibrary()palette instead of the hardcoded 10-colorTHREAD_COLORSconst:loadInitialPaths(library)maps snapshot hexes against the live library (withDEFAULT_THREAD_LIBRARYfallback) instead of indexing the hardcoded array.pathsToStitchObjects/pathsToThreadStopsclamp the per-paththreadIndexagainst the live library length.currentThreadColorpreview andhandleFinishPath'sthreadColorwrite both read fromthreadLibrary[clamped index], so the Editor's preview swatch and the new path's stored hex always match the user's library.useEffectre-clampscurrentThreadIndexwhenever the library length changes (Settings add/remove), so removing a color never leaves the preview pointing past the end of the palette.DEMO_PATHSstill usesTHREAD_COLORSfor its demo seed.Tests: typecheck clean, lint clean (no new warnings),
Editor.test.tsx/EditorCanvas.test.tsx/EditorRightPanel.test.tsxall green (24/24).