Worker Portal Design Reference
For plugin authors and worker-portal maintainers: this page distils the
worker-portal design handoff (design/canopy-web/) — the architectural
decisions the design depends on and the ADRs that ratified them, the
composition TOML the runtime loads as built, and the contract plugin authors
work against. Section numbers follow the handoff; its §3 (the design system)
is its own page, so the numbering here runs 2.x → 4.x.
The design artifacts
The package is a set of self-contained HTML design canvases (open in a browser
to pan, zoom and focus per artboard) backed by JSX component sources: the
dashboard kit and three jurisdiction compositions (as shipped, the panel sets
in the georgia pack’s composition/{worker,supervisor,analyst}_dashboard.toml),
case-detail composability across three shell strategies, the IDP-aware sign-in,
Jurisdiction Studio, dashboard customization, the ⌘K palette, the audit log,
the marketplace and the first-impression states. The PNG renders are indexed
in design/canopy-web/renders/README.adoc. The package applies the design
system; it does not redefine it.
Architectural decisions made during design
Each decision is summarized for context; the authoritative rationale lives in the ratifying ADR, which is xref’d rather than duplicated.
2.1 Composability is the core thesis
A jurisdiction never forks canopy to make the portal theirs — it edits TOML in the jurisdiction’s configuration layer. Composability holds at three layers: dashboard (which panels, in which rows, at what spans), case detail (which sections, in what order, under which shell strategy — scroll / card_grid / tabs), and identity (which IDPs, in what order, with what label and colour). Every plugin declares its slug, programs, spans, permissions and i18n catalogs in its manifest (§4.5); the runtime renders whatever the jurisdiction’s TOML references, and plugins not opted in stay invisible.
Ratified by ADR-021:
compile-time-linked Askama plugins registered through the #[canopy_plugin]
attribute (crates/canopy-plugin-macros) and listed in the explicit
PLUGINS slice (services/canopy-web/src/plugins.rs, #855), behind a
PluginSource trait so a v2 WASM source is additive
(crates/canopy-composition/src/source.rs).
2.2 Storage is hybrid-layered
Composition is resolved from layered overrides; the top layer wins.
| Layer | Storage | Edited via | Audience |
|---|---|---|---|
User personal layout |
DB (small JSONB delta) |
"Customize my dashboard" view |
Each worker |
Role overrides |
DB |
Studio (live mode) |
Jurisdiction admin |
Jurisdiction live overrides |
DB |
Studio (live mode) |
Jurisdiction admin |
Jurisdiction baseline |
TOML on disk, in git |
Studio promote → PR |
Maintainer via PR |
System defaults |
Bundled with binary |
canopy core PRs |
canopy team |
Ratified by ADR-022:
one composition_documents table keyed by (jurisdiction_id, layer, scope_key,
surface) holds the three DB layers, override bodies replay over the TOML
baseline in jurisdiction_live → role → user order, and the live lifecycle is
create → edit → promote → archive. The user layer is
ADR-024's
user_delta_v1 delta (hidden_slugs / span_overrides / slug_order,
dashboard surfaces only); reset deletes the row. The handoff’s required
panels (required = true, a lock badge) did not ship — RawComposition has
no such flag (crates/canopy-composition/src/types.rs) and
templates/dashboard/customize.html lists "Hide required panels" as locked.
2.3 Sign-in at one upstream
The handoff’s IDP-aware sign-in (email-first discovery, a chip list of
configured IDPs, a local-accounts toggle) is not built: canopy-web signs every
worker in at the deployment’s one upstream identity provider through
canopy-identity (ADR-049;
ADR-050 names Kanidm the default).
GET /login renders the jurisdiction’s system-use notice (NIST AC-8,
jurisdiction.toml's required [sign_in] system_use_notice) and a
Continue link; GET /login/start starts the flow and navigates to the
upstream (services/canopy-web/src/auth/). The upstream is deployment
configuration, canopy-identity’s upstream profile, not ruleset data. The earlier
chip list over idp.toml (the IdP loader + sign-in plan)
went with the move to canopy-identity (ADR-049), which left idp.toml the role catalog alone (§4.4).
2.4 Audit is JWS-signed and exportable
Every system action emits a signed event. Two scopes share one primitive: the
system audit (admin-facing, jurisdiction-wide, filterable, exportable) and
case history (the same data filtered to one household, exportable as "Cite
for hearing"). The handoff sketched an AuditEvent with an ed25519
signature field; as built the type is
crates/canopy-contracts-security/src/events.rs — event_type,
source_service, action, resource_type / resource_id, user_id /
user_role, household_id, programs, metadata, and the
event_hash / previous_hash chain fields.
2.5 Empty / loading / error states are first-class
Every panel renders all four states (data plus three):
-
Empty is editorial and confident ("Nothing in your queue."), never chirpy. Sometimes a tiny CTA (
Open Studio →). -
Loading uses pulsing skeletons (the shipped
pulsekeyframe, 1.6s ease-in-out — the handoff called itcy-pulse) shaped to the eventual content, so the data swap does not reflow the panel. -
Error names the failing service, shows the last-known sync timestamp when useful, and offers Retry + "Status page". It never blames the worker.
empty_state, skeleton / skeleton_row and
error_block / panel_error in templates/_primitives/orchard.html.
2.6 The ⌘K palette is one keystroke from anywhere
Cross-entity search by default. Prefixes narrow scope:
| Prefix | Scope |
|---|---|
|
Households, people, notices, appeals, activity |
|
Command mode (run actions: "Re-run IEVS sync for current case", "Reset my layout", "Open Studio") |
|
People only |
|
Cases only |
RBAC filters at query time — a worker sees the commands they can run, a supervisor their team, an admin everything. The palette is treated as a panel: same overline + gold rule + ID-mono language as everything else.
2.7 The accent gold has strict scope
Orchard Gold (#ecbf44) is brand and decoration only — never functional
warning UI, status pills or body text. The rule, its allowed uses and the
separate DHS Logo Gold live on Orchard Design System
under Color tokens.
Composition TOML as built (handoff §4)
The handoff sketched dashboards.toml, case-detail.toml and an idp.toml
with [options] / [email_routing] tables. None of those schemas exist; the
runtime loads the files below from the jurisdiction’s configuration layer, and their keys
match the RawComposition Rust fields byte-for-byte
(crates/canopy-composition/src/types.rs: shell, shell_per_role, items,
sections). Georgia’s copies are the excerpts.
4.1 theme.toml
Branding, layout and the light/dark palettes. The handoff’s reference file is
design/canopy-web/canopy-handoff/georgia-theme.toml; the live one is
the georgia pack’s theme.toml, loaded by services/canopy-web/src/theme.rs,
with the token contract on the design system page.
4.2 composition/{worker,supervisor,analyst}_dashboard.toml
# composition/worker_dashboard.toml (the georgia pack)
shell = "grid"
[[items]]
item = "worker-dashboard-at-a-glance-panel"
row = 0
span = 12
[[items]]
item = "worker-dashboard-my-queue-panel"
row = 1
span = 6
item is a plugin slug from the registry, not a panel type; row orders
rows and span is validated against the exporting plugin’s allowed_spans
(types.rs). Items whose manifest permissions.required_roles excludes the
request’s role are dropped at render time
(crates/canopy-composition/src/role_filter.rs). Which dashboard a role gets
is surface_for_role in canopy-web (canopy-web pages + actions).
4.3 composition/case_detail.toml
# composition/case_detail.toml (the georgia pack)
[[sections]]
item = "case-detail-household-section"
row = 0
span = 12
[[sections]]
item = "case-detail-notices-section"
row = 3
span = 6
[shell_per_role.eligibility_worker]
strategy = "tabs"
[shell_per_role.supervisor]
strategy = "scroll"
[shell_per_role.analyst]
strategy = "card_grid"
The [[sections]] arrays must precede the [shell_per_role.<role>] tables in
the file — TOML attributes a later root-level array to the last opened table
(the file’s header comment). types.rs defines an error for a role with no
[shell_per_role.<role>] entry, so every role in idp.toml needs one. Section
slugs (case-detail-*-section) are the registry’s; program gating is the
section plugin’s manifest programs, not a programs = […] key in this file.
4.4 idp.toml
# idp.toml (the georgia pack; header comments omitted)
[roles.eligibility_worker]
display_name = "Eligibility Worker"
description = "Front-line caseworker"
[roles.supervisor]
display_name = "Supervisor"
description = "Reviews caseworker decisions; can override"
[roles.jurisdiction_admin]
display_name = "Jurisdiction Admin"
description = "Manages live composition overrides for this jurisdiction"
[roles.analyst]
display_name = "Analyst"
description = "Read-only case + reporting auditor (formerly QC)"
[roles.studio_admin]
display_name = "Studio Admin"
description = "Manages jurisdiction provisioning + plugin authoring via Canopy Studio"
[roles.*] is the composition role catalog (ADR-022): the composition API
validates a role slug against it (IdpDocument,
services/canopy-web/src/api/composition.rs). It holds no identity or
sign-in table: the upstream identity provider is deployment configuration
(ADR-050). composition/sign_in.toml is an empty stub (shell = "",
items = []): the sign-in page renders the system-use notice from
jurisdiction.toml, not a composition.
4.5 Plugin manifest (Plugin.toml)
[plugin]
slug = "child_support"
name = "Child Support Enforcement"
version = "0.2.1"
author = "Georgia DHS · OCSE Integration Team"
license = "AGPL-3.0-or-later"
canopy_min = "1.4.0"
[plugin.exports]
panels = ["child_support"]
case_sections = ["child_support"]
[panel.child_support]
display_name = "Child support"
icon = "scales"
description = "OCSE enforcement actions, arrears balances, payment status."
programs = ["tanf", "medicaid"]
default_span = 6
allowed_spans = [4, 6, 8, 12]
[data]
# Implemented schema (ADR-021, #1218): `source` is a canopy service slug, `auth` ∈
# {none, service_class, user_jwt}, TTL/timeout are integer seconds/ms, `endpoints`
# is a flat allow-list (empty is legal). The TTL is the author's default —
# composition layers override it per item; 0 disables caching.
source = "canopy-exchange"
auth = "service_class"
cache_ttl_seconds = 300
timeout_ms = 2000
endpoints = [
"/v1/child-support/balances/{household_id}",
"/v1/child-support/actions?household_id={household_id}&limit=10",
]
[permissions]
required_roles = ["eligibility_worker", "case_manager", "supervisor"]
audit = "ocse_read"
[i18n]
default = "en-US"
catalogs = ["en-US", "es-US"]
Validation rules: the slug is unique in the catalog, the version is semver, the
programs are known program slugs, allowed_spans ⊆ {1..12}, and every required
role exists.
Hard rules for plugin authors
-
Use
--orchard-*CSS variables. Never hardcode hex. -
No new fonts. Inherit Montserrat + JetBrains Mono.
-
Wrap content in
PanelFramewith an overline label. Don’t add chrome at the panel-frame level. -
Declare programs + permissions in the manifest. The runtime enforces; don’t gate inside the plugin.
-
Implement all four states (data, empty, loading, error). PR review will reject plugins that don’t.
-
Ship en-US + at least one Spanish catalog. Required for publish to the marketplace.
-
No images. Use the leaf glyph or text-only treatments. Plugins should add < 100KB.
-
All write actions are CSRF-protected + audited. Use the canopy CSRF + audit helpers; don’t roll your own.
The CSRF + audit requirement in rule 8, and the manifest-declared permission enforcement in rule 4, follow the CLI/API/UI parity discipline in ADR-007 — every plugin action is a first-class, auditable API operation rather than UI-only behavior.
Handoff questions settled by ADRs
The handoff closed with five open questions. Two are settled:
one table or table-per-layer → one composition_documents table per
ADR-022, with the
user delta per ADR-024
(§2.2); audit retention → ADR-022 fixes uniform 1-year retention for
override-layer events (per-layer rejected for v1); the wider case-action vs.
config/auth split is a policy decision no ADR has taken. The other three —
git-host access for the promote-PR flow, a cross-jurisdiction directory for
federated workers, marketplace install counts — have no ratifying ADR and are
not tracked on this page.