Skip to content

feat: redesign phase 6b — job cards, toasts, job cancel, narrower Inspector - #32

Merged
provos merged 2 commits into
mainfrom
feat/redesign-feedback
Sep 26, 2026
Merged

provos merged 2 commits into
mainfrom
feat/redesign-feedback

Conversation

@provos

@provos provos commented Sep 26, 2026

Copy link
Copy Markdown
Owner

The second half of phase 6 of the Claude Design handoff (docs/redesign/HANDOFF.md §9, §10, §11.3).

Backend

  • DELETE /api/v1/jobs/{id} returns 200 with the job, 404 for an unknown id, and 409 not_cancellable when the job can't be stopped. It cancels:
    • a queued job of any kind;
    • a running job that opted in. Today that's only inpainting generation: it raises at its next progress report, i.e. between diffusers steps.
    • A cancelled job still releases the project's busy slot and bumps its revision. The previous candidate set is left untouched, since the service only replaces it after full success.
    • The route no longer sends a final set_progress(1.0) after storing candidates, so a late cancel can't mark a finished generation "cancelled".
  • JobView gains the cancelled status, detail and cancellable (true only while a cancel would be accepted).
  • The depth job reports "Loading the depth model (the first run downloads its weights)" while the model loads.
  • Inpainting failures now include their cause in the message shown to the user.
  • ARCHITECTURE.md is updated.

Frontend

  • JobCard sits next to the control that started the job (depth, segmentation, split, inpainting, export, animation). It shows the label, %, the detail line and Cancel when the server says the job can stop. After a failure it shows an inline error card with Retry (generation), Open settings (inpainting-related jobs) and View log. The status bar mirrors Cancel.
  • ToastStack over the canvas: success and info toasts dismiss after 3 s; errors persist with the same actions. A cancel shows an info toast.
  • The Inspector narrows to the design's 328px, and the legacy CSS aliases are gone.

e2e

  • The driver clicks pixel centers. Two scenarios had pinned a one-pixel truncation that depended on the fitted scale; narrowing the Inspector shifted it. They now expect the pixels they request. The scenarios stay frontend-neutral.

Verified manually against the real models:

  • DINOv2 depth shows the loading detail.
  • An SDXL fill cancelled mid-run ended in 0.8 s with a "Cancelled" toast.
  • An unreachable Automatic1111 shows the error toast and card.

Tests: pytest 480, vitest 413, svelte-check clean, e2e 46/46 locally.

🤖 Generated with Claude Code

… narrower Inspector

Backend:
- DELETE /api/v1/jobs/{id} cancels a queued job, or a running job that
  opted in (inpainting generation, which stops between diffusers steps at
  its next progress report). Jobs gain a 'cancelled' status and
  'detail'/'cancellable' fields; a cancelled job still releases the
  project's busy slot and leaves the previous candidates untouched.
- The depth job reports 'Loading the depth model (the first run downloads
  its weights)' while the model loads.
- Inpainting failures name their cause.

Frontend:
- JobCard next to the control that started a job (label, %, detail,
  Cancel where supported) and an inline error card with Retry / Open
  settings / View log; the status bar mirrors Cancel.
- ToastStack over the canvas: success/info toasts dismiss after 3 s,
  errors persist with actions; a cancel shows an info toast.
- Inspector narrows to the design's 328px; legacy CSS aliases removed.
- e2e: clicks aim at pixel centers, so the scenarios expect the pixels
  they request instead of a layout-dependent truncation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 26, 2026 16:21

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The backend Job.request_cancel() currently accepts repeated cancels after a cancel is already requested, which conflicts with the intended cancellable semantics and can cause DELETE /jobs/{id} to incorrectly return 200 instead of 409.

Review effort: Lite
Findings: 1 Medium severity · 1 Low severity

Open (2)
What changed in this PR

Implements the “phase 6b” redesign handoff across backend, frontend, and e2e by adding cancellable background jobs (with detail lines), introducing job-linked UI feedback (JobCards + toast stack), and tightening layout (narrower Inspector + removal of legacy CSS aliases).

Changes:

  • Backend: adds DELETE /api/v1/jobs/{id} cancellation flow, a new cancelled job terminal status, and job detail/cancellable fields; depth generation reports a “loading model” detail while weights load.
  • Frontend: adds ToastStack/toastStore, JobCard UI, and cancel controls wired to DELETE /jobs/{id}; surfaces richer failure/cancel handling in workflow.ts.
  • Tests/docs: expands unit + HTTP tests for job state machine and cancellation, updates e2e click semantics to target pixel centers, and updates architecture docs/schema.
File Description
parallax_maker/​workflow_services.py Reports/clears a depth-model “loading” detail around lazy load_model().
parallax_maker/​test_workflow_services.py Adds regression tests for depth loading detail behavior and compatibility with plain progress callables.
parallax_maker/​test_jobs.py New unit tests for Job/JobManager cancellation and terminal-state semantics.
parallax_maker/​test_inpainting_services.py Ensures cancellation propagates unwrapped and preserves prior candidate selection.
parallax_maker/​test_api_jobs.py Adds HTTP-level tests for detail/cancellable fields and DELETE /jobs/{id} behaviors.
parallax_maker/​test_api_inpainting.py Verifies inpainting generation jobs report cancellable when queued/running.
parallax_maker/​runtime.py Extends progress reporter with detail() hook to feed job detail lines.
parallax_maker/​inpainting_services.py Preserves OperationCancelled and includes underlying exception cause in failure message.
parallax_maker/​cancellation.py Introduces framework-neutral OperationCancelled exception shared across services/jobs.
parallax_maker/​api/​schemas.py Extends JobView + job status literal with cancelled, detail, cancellable.
parallax_maker/​api/​projects.py Implements DELETE /jobs/{id} route; ensures cancelled jobs return project and release busy slot.
parallax_maker/​api/​jobs.py Adds job cancellation state, detail line support, and cancelled terminal status handling in worker.
parallax_maker/​api/​inpainting.py Makes inpainting jobs cancellable and avoids late set_progress(1.0) that could flip to cancelled.
parallax_maker/​api/​errors.py Adds NotCancellable 409 API error for rejected cancels.
parallax_maker/​_api_test_helpers.py Treats cancelled as a terminal job status in polling helper.
frontend/​src/​lib/​workflow.ts Centralizes failure/cancel reporting into toasts + inline JobCard errors; uses job tracking vs raw progress.
frontend/​src/​lib/​workflow.test.ts Adds tests for toast/error/cancellation behavior and Retry action wiring.
frontend/​src/​lib/​state/​toasts.svelte.ts New toast store with auto-dismiss (success/info) and persistent errors with actions.
frontend/​src/​lib/​state/​toasts.svelte.test.ts Unit tests for toast timing, persistence, action execution, and max toast cap.
frontend/​src/​lib/​state/​jobs.svelte.ts Extends job store with job mirroring (track), cancellability, cancel action, and last error.
frontend/​src/​lib/​state/​jobs.svelte.test.ts Adds tests for job labeling, tracking fields, cancellability gating, and cancel behavior.
frontend/​src/​lib/​components/​shell/​AppShell.svelte Narrows Inspector via --inspector-w rather than hard-coded width.
frontend/​src/​lib/​components/​shell/​ActivityIndicator.svelte Uses shared job labels and adds Cancel/Cancelling UI driven by job store.
frontend/​src/​lib/​components/​shell/​ActivityIndicator.test.ts Tests Cancel button visibility/behavior when job is cancellable.
frontend/​src/​lib/​components/​segmentation/​SegmentPanel.svelte Adds JobCards for segmentation and slice generation feedback.
frontend/​src/​lib/​components/​inpainting/​InpaintPanel.svelte Replaces legacy progress bar with JobCard for generation/mutation jobs.
frontend/​src/​lib/​components/​ground/​SceneSideView.svelte Updates colors to non-legacy CSS variables.
frontend/​src/​lib/​components/​ground/​GroundPanel.svelte Fixes SceneSideView import to local ground component path.
frontend/​src/​lib/​components/​feedback/​ToastStack.svelte New toast UI component rendered over the canvas.
frontend/​src/​lib/​components/​feedback/​ToastStack.test.ts Tests toast rendering, dismiss, and action behavior.
frontend/​src/​lib/​components/​feedback/​JobCard.svelte New inline job card UI with progress/detail/cancel + persistent error card actions.
frontend/​src/​lib/​components/​feedback/​JobCard.test.ts Tests JobCard idle/running/detail/cancel/error-card rendering and actions.
frontend/​src/​lib/​components/​dialogs/​SettingsDialog.svelte Updates failure styling to use non-legacy danger color variables.
frontend/​src/​lib/​components/​dialogs/​ExportDialog.svelte Replaces export/animation progress bars with JobCards.
frontend/​src/​lib/​components/​depth/​ModeTab.svelte Replaces upload/depth progress bar with JobCard.
frontend/​src/​lib/​components/​canvas/​CanvasArea.svelte Mounts ToastStack over the canvas area.
frontend/​src/​lib/​api/​schema.json Updates generated schema for job detail/cancellable and cancelled status.
frontend/​src/​lib/​api/​generated.ts Updates generated TS types to include cancelled, detail, cancellable.
frontend/​src/​lib/​api/​client.ts Adds cancelJob() and JobCancelledError handling in polling.
frontend/​src/​lib/​api/​client.test.ts Tests polling cancellation and DELETE cancel request wiring.
frontend/​src/​app.css Removes legacy CSS variable aliases now that remaining components were updated.
e2e/​ux-parity.spec.ts Adjusts commentary/expectations around click rounding tolerance under fractional zoom.
e2e/​parallax-maker.spec.ts Updates expected pixels/depth/log output to match pixel-center click behavior.
e2e/​drivers/​svelte.ts Clicks pixel centers to avoid scale-dependent truncation into neighboring pixels.
docs/​svelte-migration/​ARCHITECTURE.md Documents DELETE /jobs/{id} behavior and job view fields/status updates.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread parallax_maker/api/jobs.py
Comment thread frontend/src/lib/api/client.ts Outdated
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@provos
provos merged commit 7b87218 into main Sep 26, 2026
1 check passed
@provos
provos deleted the feat/redesign-feedback branch September 26, 2026 16:36
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.

2 participants