Assign paletteIndex to each stitch object based on catalog position #81
Labels
No labels
blocked:children
blocked:depends-101
blocked:depends-103
blocked:depends-104
blocked:needs-attention
blocked:needs-decision
blocked:no-changes
blocked:preflight
bug
chore
feature-request
in-progress
lint-cleanup
needs-decompose
performance
quality
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/easystitch#81
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?
Context
The SAAS service contract (
Mark/easystitch-service/docs/api.md) requires every stitch object to carry apaletteIndex: int:The pipeline currently tracks
stitch_intentswith raw colors but never assigns a palette index. ThreadCraft #10 (palette picker UI) needs this index to drive the catalog-name lookup.Goal
After thread matching (which assigns each color to a catalog entry), assign each stitch object's
paletteIndexto the index of the matched catalog entry.Implementation
ThreadMatcher.match_color_with_alternatives()resolves each unique color to a catalog entry, build adict[input_color_hex -> palette_index].threadColorin that dict and setpaletteIndexaccordingly.paletteIndexisnull— the service already models this aspaletteIndex: int | None.Acceptance
paletteIndex(ornullfor unmatched colors).threadColoracross multiple stitch objects produces the samepaletteIndex.tests/test_main.pycovers index assignment.Blocks
Mark/easystitch-service#1— response shape requirespaletteIndex.Mark/Kimi_Agent_Brother_10_Digitizing_App#10— palette picker UI depends on this.Notes
BrotherPR10ThreadLibrary(#4) being available, since the index is into the PR-10 catalog (or whatever catalog is loaded).BrotherPR10ThreadLibrary().entries[i]. Index 0 is the first catalog entry, not the most-used color.