Worker portal redesign — composability runtime + design-system extraction

Status: In progress — Stages 1–5 shipped; Stage 6 residual #500 (live-mode composer) and #501 (Plugin Studio); Stage 7 residual #504 (first-impression states)
Tracking issue: #460
Epic: &51
Contracts: ADR-021, ADR-022, ADR-024

NOTE

This file is the canonical source of truth for the redesign; the May 2026 design-exploration handoff artifacts are non-normative. Stage 2 closed on 2026-05-20 at two of three ADRs — ADR-021 and ADR-022 ratified — while the third ("ADR-023: promote-PR mechanism") was reframed as the canopy-wide config-backend question and deferred to #507. Composition v1 therefore ships on the filesystem rulesets/{juris}/ pattern and the Studio promote affordance is descoped from v1 (#488 and #492 closed-deferred); it lands as a follow-up once #507 ratifies a write-capable backend.

Status

Step

Description

Status

1

Design system extraction (1 MR). Extract 8 Askama macro primitives — panel_frame, overline, gold_rule, big_number, hero_strip, leaf_glyph, status_pill, money_cell — into a single services/canopy-web/templates/_primitives/orchard.html file. Reuses existing .skeleton + @keyframes pulse + .u-empty-state; adds one new .u-error-block utility. Stage 1.5 (#505) upgrades the four panel-state surfaces to first-class Askama-macro primitives. All primitives consume the --orchard-* token surface shipped via !295. Outcome: every existing canopy-web template can be rewritten to use these primitives without routing or business-logic changes. Low risk, high leverage. Independent of composability work. Stage-1 implementation plan: worker-portal-redesign-stage1-design-system.adoc.

Done (2026-05-21) — !349

1.5

Panel-state primitives upgrade (1 MR, follow-up to Stage 1, non-blocking). Upgrade the four CSS-only panel-state utility classes from Stage 1 to first-class Askama-macro primitives with proper props: empty_state (title + body + optional CTA), skeleton (discrete-enum height + width; emits the existing .skeleton class), skeleton_row (composed for table-shaped panels; columns enum 2-6), error_block (title + body + last-known timestamp + retry/status buttons). Macros wrap the existing classes (.u-empty-state, .skeleton, .u-error-block) — no class renames or deletions, continuing Stage 1 Decision 4. 19 of 20 in-tree .u-empty-state consumers migrated. Validating surface is cases/search.html + cases/_results.html + new cases/_results_error.html — handler returns the error fragment on Err(_) from canopy-persons; server-side branching with HTTP 200 (no htmx-response-targets extension dependency). 4 Playwright tests in tests/e2e/specs/panel-states.spec.ts + 18 new primitives_test wrappers. Stage 1.5 implementation plan.

Done (2026-05-21)

2

ADR ratification (2 MRs shipped; 3rd deferred). ADR-021 (composability runtime + plugin model — ratified 2026-05-20). ADR-022 (storage layering — ratified 2026-05-20). Originally ADR-023 (promote-PR mechanism) — deferred 2026-05-20 in favor of #507 (unified config backend ADR across canopy).

Done (2026-05-20) — ADR-021 + ADR-022 ratified; ADR-023 deferred to #507

3

Composability runtime + storage layering (2 MRs; 1 deferred). MR1 lands the forward-only migration creating composition_documents + composition_documents_archive per ADR-022 + the composition loader runtime (5-layer merge: system defaults → baseline TOML via RFC 7396 → DB layers via RFC 6902 in jurisdiction_live → role → user order) + PluginSource trait + CompileTimePluginSource + #[canopy_plugin] proc-macro + Plugin.toml schema + roles-only idp.toml schema + Georgia jurisdiction fixtures (shell-only since real plugin handlers land Stage 5). MR2 adds the live-override HTTP APIs (11 endpoints: GET/PUT/PATCH on live/role/user-me + DELETE live + POST live/archive) with atomic audit emission via publisher.publish_tx (Decision 9 — outbox row commits with the composition row), RFC 7232/6585-clean precondition handling, surgical cache invalidation, JSON-only OpenAPI spec (no Swagger UI in v1 due to strict CSP), and a JSON-aware session extractor pair that shares the HTML BFF’s refresh-token + fail-closed semantics. The promote-live-to-baseline endpoint (#492) was deferred to #507 when ADR-023 was reframed as a canopy-wide config-backend ADR. Stage-3 MR1 implementation plan: worker-portal-redesign-stage3-composition-runtime.adoc. Stage-3 MR2 implementation plan: worker-portal-redesign-stage3-mr2-live-override-apis.adoc.

Done (2026-05-22) — MR1 + MR2 merged

4

Identity rework (2 MRs). Generic IDP loader from rulesets/{juris}/idp.toml (email-discovery routing + OIDC SSO initiation + local-accounts toggle; SAML was never built — canopy is OIDC-only, with SAML brokered upstream, per ADR-048). IDP-aware sign-in template carrying multiple IDP chips with chip_color + chip_icon per IDP entry; zero-IDP graceful state points jurisdiction admins at Studio → Identity.

Done (2026-05-22) — !353 + !354

5

Core surfaces (4-5 MRs, one per surface). Worker dashboard (12-panel kit composition-driven). Supervisor dashboard. Analyst dashboard. Case detail with 3 shell strategies (scroll / card-grid / tabs) and 13 section types. Customize-my-dashboard (worker-level deltas). MR1 (495) lands the worker dashboard via the Stage 3 composition runtime: 12 panel plugins registered through [canopy_plugin] + linkme; each panel is its own #[derive(Template)] struct rendered to a String in Rust and embedded in worker.html via {{ panel.html|safe }}; Georgia baseline declares all 12 with row/span per ADR-021 breakpoints. 6 panels wire existing endpoints; 6 ship state = "empty" placeholders pending FU-1..FU-6 (#519-#524). MR2 (#496) adds supervisor + analyst dashboard surfaces via surface_for_role dispatch, 8 new panel plugins (5 supervisor + 5 of them with real upstream wiring: team-queue via /v1/applications?status=submitted, sanctions rollup via new /v1/tanf/sanctions/rollup, overpayment summary via new /v1/reporting/overpayments/summary, pending hearings client-filters /v1/appeals/queue), renames WorkerRole::QualityControl → ::Analyst, plumbs worker_role_slug through 11 templates, extracts shared _panel_grid.html macro, adds /team-queue full-page route. 9 of 14 FUs landed in-MR; 5 stay deferred with scope-corrected comments. MR3 (#498, ADR-024) ships Customize My Dashboard. MR4 (#497) ships case-detail composition over three MRs: MR4a wired the composition pipeline with a compat shim; MR4b shipped the scroll shell + 20 section plugins (13 design SECTION_REGISTRY + 7 issue-only stubs tracked at #562); MR4c shipped the card-grid shell + 27-action shell-aware redirect (target_section + safe_focus_section allowlist) and moved Georgia analyst to card_grid. MR-1 plan: worker-portal-redesign-stage5-worker-dashboard.adoc. MR-2 plan: worker-portal-redesign-stage5-supervisor-analyst-dashboards.adoc. MR-3 (#498) plan: worker-portal-redesign-stage5-customize-my-dashboard.adoc. MR-4 (#497) plan archived at plans/archive/worker-portal-redesign-stage5-case-detail.adoc.

Done (2026-05-25) — !355, !356, !357, !359, !363, !364, !365

6

Maintainer surfaces (3 MRs). Jurisdiction Studio: onboarding wizard. Studio: live-mode composer (promote modal descoped from v1 pending #507). Studio: plugin developer view (Plugin Studio).

In progress — #499 shipped 2026-05-25; #500 and #501 open

7

Polish (2-3 MRs). ⌘K command palette. Audit log (system + case scopes sharing one primitive). First-impression states (splash, maintenance, expired, 404).

In progress — #502 and #503 shipped; #504 open

Child issues

Stage Issue Title Weight

1

#485

Design system extraction (Askama partials + CSS utility classes)

3

1.5

#505

Upgrade panel-state utility classes to 4 Askama-macro primitives

3

2

#486

ADR-021 — composability runtime + plugin model (ratified)

2

2

#487

ADR-022 — composition override storage layering (ratified)

2

2

~#488~

~~ADR — promote-PR mechanism~~ deferred to #507

—

3

#489

DB migrations for composition override layers

3

3

#490

Composition loader (TOML parse + role filter + override merge)

5

3

#491

Live override APIs (read/write/archive endpoints)

3

3

~#492~

~~Promote-live-to-baseline (git-host PR generation)~~ deferred to #507

—

4

#493

Generic IDP loader from idp.toml

3

4

#494

IDP-aware sign-in template

2

5

#495

Worker dashboard (12-panel kit, composition-driven)

5

5

#496

Supervisor + analyst dashboards (role overrides)

3

5

#497

Case detail (3 shell strategies + 13 section types)

8

5

#498

Customize my dashboard (per-worker deltas)

3

6

#499

Studio onboarding wizard

3

6

#500

Studio live-mode composer (promote modal descoped pending #507)

3

6

#501

Plugin Studio (developer view)

5

7

#502

⌘K command palette

3

7

#503

Audit log unified surface (system + case scopes)

3

7

#504

First-impression states (splash / maintenance / expired / 404)

2

Context

The worker portal becomes composition-driven: jurisdictions edit TOML in rulesets/{jurisdiction}/ rather than fork canopy. The same three layers (dashboard, case-detail, identity) follow the same composition + override pattern, with a five-layer storage model (user delta → role override → jurisdiction live override → TOML baseline → system defaults).

Scope

In scope (across Stages 1-7)

  • Design system extraction into reusable Askama partials + CSS utility classes (Stage 1) + four-state primitive upgrade (Stage 1.5)

  • Composability runtime: TOML composition loader, 5-layer merge (RFC 7396 baseline + RFC 6902 DB layers per ADR-022), plugin manifest validation per ADR-021

  • Storage layering: forward-only migration for composition_documents + composition_documents_archive; live override APIs (read/write/archive)

  • Generic IDP loader + IDP-aware sign-in

  • Worker / supervisor / analyst dashboards (composition-driven)

  • Case detail (3 shell strategies + 13 section types)

  • Customize-my-dashboard (per-worker deltas)

  • Jurisdiction Studio (onboarding wizard + live-mode composer + Plugin Studio)

  • ⌘K command palette

  • Audit log unified surface (system + case scopes)

  • First-impression states (splash, maintenance, expired, 404)

Out of scope

  • Plugin Marketplace federation — defer to v2 (in-process Askama partials in v1 per ADR-021 require canopy-core PRs to install plugins; federation arrives when WasmPluginSource is added)

  • Studio promote modal / promote-live-to-baseline endpoint — descoped from v1 pending #507 (unified canopy config-backend ADR). Admins promote live overrides to baseline via their jurisdiction’s existing workflow (PR / Salt / manual edit) external to canopy until #507 lands.

  • Applicant portal (ADR-008, Dioxus) — separate project

  • Mobile / tablet — not in scope for v1

  • Print views — ADR-010 Typst territory, separate surface

  • Worker-journey microspec — needs design iteration before build; file separate design-spec issues per journey (intake / IEVS resolution / sign-and-authorize / notice compose)

  • Determination sign-and-authorize ceremony — needs design before build; tracked as separate spec issue

  • Notice compose/preview UX — needs design before build; tracked as separate spec issue

  • Income tab interaction depth (IEVS resolution, add/edit/remove income, employer lookup) — section shape is designed; interaction depth is not yet designed

Design

The contracts live in the ADRs and are not restated here: the plugin model, PluginSource, the #[canopy_plugin] macro, compile-time manifest validation and the cache posture in ADR-021; the five-layer storage model, the composition_documents table and the RFC 6902 / RFC 7396 merge semantics in ADR-022; the per-worker delta schema in ADR-024. The rules a contributor needs are in Coding Conventions (worker-portal & composition patterns); per-stage design detail is in the archived stage plans linked from the Status table. The one decision recorded only here follows.

Case-detail shell strategy (locked 2026-05-19)

Shells are jurisdiction-selectable per role, not progressive enhancements at viewport breakpoints. Same jurisdiction can run different shells per role; any given user in any given context sees exactly one shell. No responsive shell-switching in v1.

Rationale (per design):

  • Desktop-first product — workers don’t review cases on phones

  • Runtime cost of two shells live: double templates, double htmx swap targets, ambiguous focus management when the viewport crosses a breakpoint mid-action

  • Escape hatch already exists: a jurisdiction that needs viewport flexibility picks tabs (the most viewport-tolerant shell)

TOML shape per role in rulesets/{jurisdiction}/composition/case-detail.toml:

[shell.eligibility_worker]
strategy = "scroll"

[shell.intake_screener]
strategy = "card_grid"

Erratum (2026-09-17): as built the file is rulesets/<jurisdiction>/composition/case_detail.toml and the table is [shell_per_role.<role>] (RawComposition.shell_per_role; rulesets/georgia/composition/case_detail.toml).

Section list and shell strategy are independent knobs. A jurisdiction on tabs can still reorder sections, mark some required = true, or exclude program-specific ones via the same TOML’s sections = […​] list. Section partials know nothing about which shell hosts them — section content shape is identical across shells; only the chrome changes per strategy.

Georgia migration default: existing 6-tab implementation becomes strategy = "tabs" with current section slugs in sections = […​]. scroll and card_grid ship as opt-in; Studio admin switches when ready. No auto-migration.

Verification

  • cargo xtask validate clean (fmt + clippy + nextest + check-docs)

  • cargo xtask docs plan-lint clean (this plan’s Status column stays canonical)

  • Pre-push validate + Playwright E2E

  • cargo xtask coverage at or above the current DEFAULT_THRESHOLD floor (xtask/src/cmd/coverage.rs; unit-lane scoped since #1382)

  • Stages 6 and 7: per-surface acceptance is defined in the surface’s own MR

Errata

  • Erratum (2026-09-16): Step 5’s MR4c merged as !365 on 2026-05-25 (the case-detail stage plan is archived); Step 6’s #499 shipped 2026-05-25 (services/canopy-web/src/studio/wizard.rs) while #500 and #501 have no code yet; Step 7’s #502 (/command-palette/search) and #503 (/audit-log, its CSV export and the citation PDF, in services/canopy-web/src/api/mod.rs) shipped and only #504 remains — the Status cells are corrected to as-built.

  • Erratum (2026-09-16): the ADR-023 number was later claimed by the OIDC ADR and ADR-024 by this epic’s Stage 5 MR3; coding-conventions.adoc gained the composition-runtime conventions after Stage 3. The Steps, Files Touched, branch-hygiene, CHANGELOG-format, Q1–Q8, Risk and open-decisions sections were removed on 2026-09-16 as duplicates of the archived stage plans, the ADRs and the synced rules.

  • Erratum (2026-10-25, as-built): cargo xtask validate no longer runs check-docs, which retired with the template sync (#2990); the rest of the § Verification line stands.

Edit this page · default