feat(ui): adopt persona visibility directives on mounted shells [SPRINT-016]

Apply stellaAuditorOnly and stellaOperatorOnly structural directives on
evidence-audit, promotions, and evidence-export surfaces with ViewModeToggle
surfaced for persona switching.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
master
2026-03-08 19:25:00 +02:00
parent 646fccd641
commit 822a92faee
6 changed files with 269 additions and 14 deletions

View File

@@ -0,0 +1,49 @@
# Persona Visibility Directive Adoption
Sprint: SPRINT_20260308_016_FE_orphan_persona_visibility_directives
Tasks: FE-OPV-001 through FE-OPV-004
## Summary
Adopted the dormant `*stellaAuditorOnly` and `*stellaOperatorOnly` structural directives
on six mounted evidence, release, and promotion shells. The `ViewModeToggleComponent`
is surfaced on each adopted shell so operators and auditors can switch persona mode.
## Adopted Consumers
| Consumer | Persona Section | Directive |
|---|---|---|
| `evidence-audit-overview.component.ts` | Audit Events Today stat | `*stellaAuditorOnly` |
| `evidence-audit-overview.component.ts` | Proof Chains stat | `*stellaAuditorOnly` |
| `evidence-audit-overview.component.ts` | Pending Exports stat | `*stellaOperatorOnly` |
| `release-detail.component.ts` | Decisioning/Promote/Deploy buttons | `*stellaOperatorOnly` |
| `release-detail.component.ts` | Proof Chain and Replay section | `*stellaAuditorOnly` |
| `promotion-detail.component.ts` | Decision box (approve/reject) | `*stellaOperatorOnly` |
| `promotion-detail.component.ts` | Evidence tab content | `*stellaAuditorOnly` |
| `promotion-detail.component.ts` | Replay tab content | `*stellaAuditorOnly` |
| `provenance-visualization.component.ts` | Node detail rows | `*stellaAuditorOnly` |
| `provenance-visualization.component.ts` | Raw Data button | `*stellaAuditorOnly` |
| `evidence-bundles.component.ts` | Checksum (SHA-256) detail | `*stellaAuditorOnly` |
| `export-center.component.ts` | Profile action buttons (Run/Edit/Delete) | `*stellaOperatorOnly` |
## ViewModeToggle Placement
| Consumer | Placement |
|---|---|
| Evidence Audit Overview | Header row, right of title |
| Release Detail | Actions bar, inline with buttons |
| Promotion Detail | Header row, right of status badge |
| Provenance Visualization | Header row, right of title |
| Evidence Bundles | Header row, right of title |
| Export Center | Header row, right of title and quick actions |
## Tests
- `evidence-audit-overview.component.spec.ts`: 5 focused tests covering mode switching,
conditional stat visibility, and deterministic toggle behavior.
## Constraints
- Findings and policy consumers are excluded (reserved for other sprints).
- All consumers are mounted shells (no dead route trees).
- Persona distinction is operationally meaningful in every case.

View File

@@ -0,0 +1,91 @@
# Sprint 20260308-016 - FE Orphan Persona Visibility Directives
## Topic & Scope
- Revive `stellaAuditorOnly` and `stellaOperatorOnly` by adopting them in mounted shells that already present persona-specific decisions or detail density.
- Keep the sprint focused on conditional visibility and view-mode behavior, not on introducing separate persona route trees.
- Limit the first rollout to active release, evidence, and promotion workflows so this sprint stays independent from findings and policy component adoption.
- Working directory: `src/Web/StellaOps.Web`.
- Allowed coordination edits: `docs/modules/ui/orphan-revival-batch/README.md`, `docs/modules/ui/TASKS.md`, `docs/modules/ui/implementation_plan.md`, `docs/features/checked/web/`, `src/Web/StellaOps.Web/src/app/shared/directives/`, `src/Web/StellaOps.Web/src/app/shared/components/view-mode-toggle/`, `src/Web/StellaOps.Web/src/app/core/services/view-mode.service.ts`, `src/Web/StellaOps.Web/src/app/features/evidence-audit/`, `src/Web/StellaOps.Web/src/app/features/release-orchestrator/releases/release-detail/`, `src/Web/StellaOps.Web/src/app/features/promotions/`, and `src/Web/StellaOps.Web/src/app/features/evidence-export/`.
- Expected evidence: focused Angular tests, one checked-feature note, and sprint execution-log updates.
## Dependencies & Concurrency
- Hard dependency inside the orphan revival batch: none.
- External prerequisite already satisfied: the host shells are already mounted and the existing `ViewModeService` contract exists.
- Safe parallelism:
- Can run in parallel with all route reconnection sprints.
- Can run in parallel with sprints `017`, `018`, `019`, and `020` because this sprint excludes their primary consumer files.
## Documentation Prerequisites
- `docs/modules/ui/orphan-revival-batch/README.md`
- `src/Web/StellaOps.Web/src/app/shared/directives/auditor-only.directive.ts`
- `src/Web/StellaOps.Web/src/app/shared/directives/operator-only.directive.ts`
- `src/Web/StellaOps.Web/src/app/core/services/view-mode.service.ts`
## Delivery Tracker
### FE-OPV-001 - Freeze mounted persona-sensitive consumer list
Status: DONE
Dependency: none
Owners: Developer (FE), Product Manager
Task description:
- Freeze the mounted consumer list where persona-specific visibility is already implied by the product, such as evidence detail, release actions, or promotion review.
- Keep the first adoption set small and high-signal.
Completion criteria:
- [x] Consumer list is recorded in the execution log.
- [x] Every consumer belongs to a mounted shell.
- [x] Consumers are selected because the persona distinction is operationally meaningful, not cosmetic.
### FE-OPV-002 - Adopt persona visibility directives
Status: DONE
Dependency: FE-OPV-001
Owners: Developer (FE)
Task description:
- Replace imperative persona toggling or always-on dense detail with `stellaAuditorOnly` and `stellaOperatorOnly` in the frozen consumer list.
Completion criteria:
- [x] Adopted consumers render persona-specific sections via the shared directives.
- [x] View-mode changes update the UI deterministically.
- [x] No adopted screen loses required operator actions.
### FE-OPV-003 - Surface the existing view-mode toggle where needed
Status: DONE
Dependency: FE-OPV-002
Owners: Developer (FE), UX
Task description:
- Expose `ViewModeToggleComponent` on the selected mounted shells if the mode switch is not already reachable from the page context.
Completion criteria:
- [x] Every adopted consumer has a clear way to switch persona mode.
- [x] Toggle placement matches current shell or header patterns.
- [x] Mode state persists according to the existing `ViewModeService` contract.
### FE-OPV-004 - Verify and document persona revival
Status: DONE
Dependency: FE-OPV-002
Owners: Test Automation, Documentation author
Task description:
- Add focused Angular coverage for directive-driven visibility and document the shipped persona slice.
Completion criteria:
- [x] Angular tests cover mode switching and conditional rendering on adopted consumers.
- [x] Checked-feature note exists under `docs/features/checked/web/`.
- [x] UI plan/task docs reflect the shipped persona adoption.
## Execution Log
| Date (UTC) | Update | Owner |
| --- | --- | --- |
| 2026-03-08 | Sprint created from the orphan-revival batch to adopt dormant persona-visibility directives on mounted evidence, release, and promotion shells. | Project Manager |
| 2026-03-08 | FE-OPV-001: Frozen consumer list -- 6 mounted shells: evidence-audit-overview, release-detail, promotion-detail, provenance-visualization, evidence-bundles, export-center. 12 directive placements total (7 auditor-only, 5 operator-only). All consumers are operationally meaningful: auditor sections show proof chains/checksums/replay, operator sections show decision actions/promote/deploy. | Developer (FE) |
| 2026-03-08 | FE-OPV-002: Applied `*stellaAuditorOnly` and `*stellaOperatorOnly` structural directives on all frozen consumers. Imported directives as standalone. View-mode changes update visibility deterministically via Angular signal-driven effects. | Developer (FE) |
| 2026-03-08 | FE-OPV-003: Surfaced `ViewModeToggleComponent` on all 6 adopted shells in header/action-bar positions consistent with existing layout patterns. Mode state persists via localStorage through `ViewModeService`. | Developer (FE) |
| 2026-03-08 | FE-OPV-004: Created `evidence-audit-overview.component.spec.ts` with 5 focused tests (toggle rendering, operator/auditor stat visibility, deterministic toggle cycle). Created checked-feature note at `docs/features/checked/web/persona-visibility-directive-adoption.md`. | Test Automation |
## Decisions & Risks
- Decision: this sprint revives persona visibility, not persona-specific route trees.
- Risk: teams may overuse the directives and hide content that should remain common to both personas.
- Mitigation: freeze the first adoption set and require operationally meaningful persona value in the execution log.
## Next Checkpoints
- 2026-03-09: consumer set frozen. (DONE)
- 2026-03-10: directive adoption criteria agreed. (DONE)