Cleanup: shared queue badge states and a typed job class #107
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
needs-info
needs-triage
question
ready-for-agent
ready-for-human
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
crowmaki/ai-studio#107
Loading…
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?
Parent
#24
What to clean up
Two code-review findings left over from #52 (PR #106). Neither changes behaviour.
1. Badge labels are spelled out twice
takeBadge/TakeBadgeinsrc/lib/scenes/takes.tsandjobBadge/JobBadgeinsrc/lib/queue/summary.tseach define the same badges:If a label or tone changes in one place, the Take tiles and the Queue panel / Shot rows will drift apart. Give the shared states one helper, and have both badge functions call it. The badge type, with its tone union, should be shared too.
2. The job class is converted to text by hand
In
src-tauri/src/dto.rs,From<JobView> for JobDtoturnsJobClassinto"image" | "draft" | "final"with a hand-writtenmatch.JobClassalready derivesSerializewithrename_all = "snake_case", so the strings are written down twice. In TypeScript,JobDto.classis a plainstring.Make
JobDto.classa typed enum DTO (or reuseJobClassthrough specta), so the strings live in one place and the TypeScript type is the"image" | "draft" | "final"union. Regenerate the bindings withcargo test -p ai-studio --test smoke exports. Then checkwaitingGroupsinsrc/lib/queue/summary.ts, which mixes the class with its own"run_next"group key.Acceptance criteria
takeBadgeandjobBadge. Existing badge tests still pass unchanged.JobDto.classis typed inbindings.ts, and there is no hand-written class-to-stringmatchindto.rs.cargo test --workspace --all-features,bun test src scriptsandbun run checkpass.Blocked by