Skip to content

[T-087b] New campaign wizard (4 steps, defaults pre-filled, YAML preview, strategy params from /meta) #170

Closed

Description

@CodewithJha

Task T-087b · Milestone M8 — Dashboard · Size M · Priority P0 · Epic #8

Implements FR-DSH-001 · FR-SCN-007

Branch feat/t-087b-new-campaign-wizard-4-steps — one task = one branch = one PR (doc 32 §6)

Summary

Implement features/campaigns/wizard/ per doc 13 §3.2: Space (pin sliders, live dimension count), Robot & backend (disabled when no worker online, with explanation), Strategy (plain-language cards, budget/batch/seed, advanced params form generated from /meta JSON Schemas), Review (YAML preview equal to CLI config, estimated duration, Start now).

Context / motivation

US-002: start a campaign in ≤ 5 min with all defaults (SC-6).

Scope

In scope

  • Form state with schema validation (zod generated from JSON Schema or ajv).
  • Server errors mapped to fields via problem+json errors[].pointer.

Implementation guidance

  • Folder features/campaigns/wizard/ with WizardPage.tsx, steps/{SpaceStep,RobotStep,StrategyStep,ReviewStep}.tsx, wizardState.ts (reducer + derived values), toYaml.ts (deterministic YAML equal to the roboprobe campaign create -f input; yaml package with sorted keys).
  • Step 1: useSpaces() + version select; parameter table with range sliders (Radix Slider) to pin values (FR-SCN-007); live dimension count = enabled − pinned.
  • Step 2: useSutProfiles(); backend radio cards disabled with an explanation when useWorkers() shows none online for that backend; repeats input.
  • Step 3: strategy cards from /meta (description text from the API); budget, batch size (default = online workers for the chosen backend), seed (random default, editable); the Advanced accordion renders a form from the strategy's JSON Schema (params_schema) validated with Ajv (draft 2020-12).
  • Step 4: YAML preview with copy button; estimated duration = budget × typical_episode_s(backend) / workers, with typical time taken from /meta backend capabilities (not hard-coded); "Start now" checkbox → POST /campaigns with start: true and an Idempotency-Key (uuid per wizard session).
  • Server-side 422 errors are mapped to steps/fields using errors[].pointer; navigation jumps to the first step with an error.
  • Standards: respect the layering contracts (doc 16 §2) and conventions in doc 34; no hard-coded tunables — thresholds/defaults come from typed settings (doc 27); no magic numbers (ruff PLR2004); public APIs typed (mypy strict) and documented.

Acceptance criteria

  • Create flow works against MSW; server validation errors appear on the right fields.
  • YAML preview round-trips with roboprobe campaign create -f.
  • All defaults pre-filled: Next×3 + Create works with zero edits (SC-6).
  • Double-clicking Create does not create two campaigns (idempotency).
  • YAML preview snapshot equals the CLI fixture.
  • Tests listed below added and green in CI; coverage of new code meets the gate in doc 18 §3.
  • Docs, config reference and CHANGELOG Unreleased updated where behaviour, keys or interfaces changed.
  • Definition of Done (doc 32 §3) satisfied.

Tests required

  • features/campaigns/wizard/*.test.tsx; Playwright flow in T-118.

Dependencies

Blocked by: #165 (T-085d), #166 (T-086a), #120 (T-060)

Blocks: #187 (T-118)

Parallelization notes

Files / paths owned by this task — avoid editing other paths; shared files (pyproject.toml entry points, cli/main.py, api/routers/__init__.py, router.tsx, docker/compose.yaml, ci.yml) are append-only:

  • web/src/features/campaigns/wizard/**

Independent feature folder.

Definition of Done

Per doc 32 §3 and AGENTS.md §5: lint, format, mypy strict and import-linter green; tests added and passing; docs updated; PR template completed with Closes #<this issue>; Conventional Commit messages referencing T-087b (doc 16 §6); commits authored only by the repository owner identity (AGENTS.md §4); CI green; reviewer checklist (doc 32 §5.1) satisfied.

References

Design docs: doc 13 §3.2 · doc 12 §3.1 · doc 03 §UC-02

Requirements: FR-DSH-001 · FR-SCN-007 (traceability: doc 28)

External:

Activity

  1. added this to the M8 — Dashboard milestone on Nov 19, 2026
  2. CodewithJha commented on Nov 22, 2026

    @CodewithJha
    OwnerAuthor

    Shipped on main (merged PR).

  3. added a commit that references this issue on Nov 22, 2026
    893b74a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:dashboardReact web dashboardmilestone:M8M8 — Dashboardpriority:P0Critical path / blocks otherssize:M1-3 daystaskChild task of a milestone epictype:featureNew functionality

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions