TenantAtlas/specs/142-rbac-role-definition-diff-ux-upgrade/quickstart.md
ahmido 3f6f80f7af feat: refine onboarding draft flow and RBAC diff UX (#171)
## Summary
- add the RBAC role definition diff UX upgrade as the first concrete consumer of the shared diff presentation foundation
- refine managed tenant onboarding draft routing, CTA labeling, and cancellation redirect behavior
- tighten related Filament and diff rendering regression coverage

## Testing
- updated focused Pest coverage for onboarding draft routing and lifecycle behavior
- updated focused Pest coverage for shared diff partials and RBAC finding rendering

## Notes
- Livewire v4.0+ compliance is preserved within the existing Filament v5 surfaces
- provider registration remains unchanged in bootstrap/providers.php
- no new Filament assets were added; existing deployment practice still relies on php artisan filament:assets when assets change

Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de>
Reviewed-on: #171
2026-03-14 20:09:54 +00:00

2.4 KiB

Quickstart: RBAC Role Definition Diff UX Upgrade

Goal

Upgrade the existing RBAC role definition diff region on the finding detail page so it becomes the first concrete consumer of the shared diff presentation foundation from Spec 141.

Implementation Steps

  1. Add a small RBAC-specific builder that reads Finding.evidence_jsonb.rbac_role_definition and produces DiffPresentation using the shared DiffPresenter.
  2. Move RBAC-specific field-label mapping, field-order rules, and list-field designation into that builder rather than the Blade view.
  3. Refactor resources/views/filament/infolists/entries/rbac-role-definition-diff.blade.php so it renders:
    • the shared summary badge partial
    • the shared row partial for each row
    • the existing RBAC explanatory copy about assignments exclusion and restore support
  4. Keep unchanged rows visible but visually quieter by relying on the shared unchanged-row partial.
  5. Render Allowed Actions and any other approved simple list fields through the shared inline list partial.
  6. Do not add a local “show only changes” toggle unless the implementation remains clearly low-risk and unnecessary complexity does not appear.

Verification Targets

Update and run the smallest focused set first:

vendor/bin/sail artisan test --compact tests/Feature/Filament/FindingViewRbacEvidenceTest.php
vendor/bin/sail artisan test --compact tests/Unit/Support/Diff/DiffPresenterTest.php
vendor/bin/sail artisan test --compact tests/Feature/Support/Diff/SharedDiffRowPartialTest.php
vendor/bin/sail artisan test --compact tests/Feature/Support/Diff/SharedInlineListDiffPartialTest.php

Then format:

vendor/bin/sail bin pint --dirty --format agent

Acceptance Checklist

  • Changed rows are visually stronger than unchanged rows.
  • Summary badges match the rendered row states.
  • Allowed Actions shows added and removed actions as inline list chips.
  • Baseline-only and current-only rows render as removed and added, not generic changed rows.
  • No-change and sparse payloads render safely.
  • No unrelated diff consumer is migrated.

Notes

  • Livewire compliance remains on v4 because the feature stays within the existing Filament v5 surface.
  • Provider registration remains unchanged in bootstrap/providers.php; this feature introduces no new provider or panel.
  • The Findings resource already has a View page, so there is no global-search eligibility issue introduced by this work.