Share badge states and type the job class (#107) #132

Merged
crowmaki merged 2 commits from issue-107-badge-jobclass-cleanup into main 2026-10-09 22:58:26 +00:00
Owner

Closes #107

Behaviour doesn't change.

Shared badge states

  • New src/lib/queue/badge.ts has one Badge type, which replaces TakeBadge and JobBadge, and renderBadge, which builds Queued, Held, Finishing, Rendering N% / Rendering… and Failed.
  • takeBadge and jobBadge both call renderBadge. Badges that only one side has stay where they are: Not ready, Interrupted, Ready, and the post-step failure.
  • progressPercent is the one place the Rendering percent is worked out, for both takeBadge and jobPercent.

Typed job class

  • JobDto.class is now JobClassDto ("image" | "draft" | "final" in bindings.ts). From<JobClass> maps enum to enum, so the strings exist only in serde's rename_all.
  • WaitingGroup.key in waitingGroups is now "run_next" | JobClassDto.

Checks

  • cargo test --workspace --all-features: pass
  • bun test src scripts: pass (285)
  • bun run check: 0 errors
Closes #107 Behaviour doesn't change. ## Shared badge states - New `src/lib/queue/badge.ts` has one `Badge` type, which replaces `TakeBadge` and `JobBadge`, and `renderBadge`, which builds Queued, Held, Finishing, Rendering N% / Rendering… and Failed. - `takeBadge` and `jobBadge` both call `renderBadge`. Badges that only one side has stay where they are: Not ready, Interrupted, Ready, and the post-step failure. - `progressPercent` is the one place the Rendering percent is worked out, for both `takeBadge` and `jobPercent`. ## Typed job class - `JobDto.class` is now `JobClassDto` (`"image" | "draft" | "final"` in `bindings.ts`). `From<JobClass>` maps enum to enum, so the strings exist only in serde's `rename_all`. - `WaitingGroup.key` in `waitingGroups` is now `"run_next" | JobClassDto`. ## Checks - `cargo test --workspace --all-features`: pass - `bun test src scripts`: pass (285) - `bun run check`: 0 errors
takeBadge and jobBadge build Queued, Held, Finishing, Rendering and
Failed through one renderBadge helper, with one Badge type. JobDto.class
is a JobClassDto enum, so bindings type it as "image" | "draft" | "final"
and waitingGroups keys are typed.
takeBadge and jobPercent share one progressPercent.
crowmaki deleted branch issue-107-badge-jobclass-cleanup 2026-10-09 22:58:26 +00:00
Sign in to join this conversation.
No description provided.