From a98323d2f4981f84eab890d2f654b25357dad215 Mon Sep 17 00:00:00 2001 From: Ahmed Darrazi Date: Fri, 20 Feb 2026 00:23:44 +0100 Subject: [PATCH] fix: enterprise UX overhaul for baseline governance MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix display_name → name column on Tenant model (3 files) - Rename 'Soll vs Ist' to 'Baseline Compare' (English consistency) - Redesign landing page: stats overview grid, critical drift banner, severity breakdown section, proper empty states with icons - Upgrade dashboard widget: severity badges, inline critical alert, last compared timestamp, compliance status indicator - Move Findings + DriftLanding from 'Drift' to 'Governance' nav group --- .specify/memory/constitution.md | 49 +++- .specify/templates/plan-template.md | 3 +- .specify/templates/spec-template.md | 6 +- .specify/templates/tasks-template.md | 8 + app/Filament/Pages/BaselineCompareLanding.php | 17 +- app/Filament/Pages/DriftLanding.php | 2 +- .../Pages/ViewBaselineProfile.php | 6 +- ...selineTenantAssignmentsRelationManager.php | 8 +- app/Filament/Resources/FindingResource.php | 2 +- .../Widgets/Dashboard/BaselineCompareNow.php | 46 ++-- .../pages/baseline-compare-landing.blade.php | 255 ++++++++++++------ .../dashboard/baseline-compare-now.blade.php | 85 ++++-- 12 files changed, 336 insertions(+), 151 deletions(-) diff --git a/.specify/memory/constitution.md b/.specify/memory/constitution.md index e17ec6f..3b66104 100644 --- a/.specify/memory/constitution.md +++ b/.specify/memory/constitution.md @@ -1,22 +1,19 @@ # TenantPilot Constitution @@ -179,7 +176,7 @@ ### Filament UI — Action Surface Contract (NON-NEGOTIABLE) - Accepted forms: clickable rows via `recordUrl()` (preferred), a dedicated row “View” action, or a primary linked column. - Rule: Do NOT render a lone “View” row action button. If View is the only row action, prefer clickable rows. - View/Detail MUST define Header Actions (Edit + “More” group when applicable). -- View/Detail SHOULD be sectioned (e.g., Infolist Sections / Cards); avoid long ungrouped field lists. +- View/Detail MUST be sectioned (e.g., Infolist Sections / Cards); avoid long ungrouped field lists. - Create/Edit MUST provide consistent Save/Cancel UX. Grouping & safety @@ -199,6 +196,38 @@ ### Filament UI — Action Surface Contract (NON-NEGOTIABLE) - A change is not “Done” unless the Action Surface Contract is met OR an explicit exemption exists with documented reason. - CI MUST run an automated Action Surface Contract check (test suite and/or command) that fails when required surfaces are missing. +### Filament UI — Layout & Information Architecture Standards (UX-001) + +Goal: Demo-level, enterprise-grade admin UX. These rules are NON-NEGOTIABLE for new or modified Filament screens. + +Page layout +- Create/Edit MUST default to a Main/Aside layout using a 3-column grid with `Main=columnSpan(2)` and `Aside=columnSpan(1)`. +- All fields MUST be inside Sections/Cards. No “naked” inputs at the root schema level. +- Main contains domain definition/content. Aside contains status/meta (status, version label, owner, scope selectors, timestamps). +- Related data (assignments, relations, evidence, runs, findings, etc.) MUST render as separate Sections below the main/aside grid (or as tabs/sub-navigation), never mixed as unstructured long lists. + +View pages +- View/Detail MUST be a read-only experience using Infolists (or equivalent), not disabled edit forms. +- Status-like values MUST render as badges/chips using the centralized badge semantics (BADGE-001). +- Long text MUST render as readable prose (not textarea styling). + +Empty states +- Empty lists/tables MUST show: a specific title, one-sentence explanation, and exactly ONE primary CTA in the empty state. +- When non-empty, the primary CTA MUST move to the table header (top-right) and MUST NOT be duplicated in the empty state. + +Actions & flows +- Pages SHOULD expose at most 1 primary header action and 1 secondary action; all other actions MUST be grouped (ActionGroup / BulkActionGroup). +- Multi-step or high-risk flows MUST use a Wizard (e.g., capture/compare/restore with preview + confirmation). +- Destructive actions MUST remain non-primary and require confirmation (RBAC-UX-005). + +Table work-surface defaults +- Tables SHOULD provide search (when the dataset can grow), a meaningful default sort, and filters for core dimensions (status/severity/type/tenant/time-range). +- Tables MUST render key statuses as badges/chips (BADGE-001) and avoid ad-hoc status mappings. + +Enforcement +- New resources/pages SHOULD use shared layout builders (e.g., `MainAsideForm`, `MainAsideInfolist`, `StandardTableDefaults`) to keep screens consistent. +- A change is not “Done” unless UX-001 is satisfied OR an explicit exemption exists with a documented rationale in the spec/PR. + Spec Scope Fields (SCOPE-002) - Every feature spec MUST declare: @@ -245,4 +274,4 @@ ### Versioning Policy (SemVer) - **MINOR**: new principle/section or materially expanded guidance. - **MAJOR**: removing/redefining principles in a backward-incompatible way. -**Version**: 1.8.2 | **Ratified**: 2026-01-03 | **Last Amended**: 2026-02-14 +**Version**: 1.9.0 | **Ratified**: 2026-01-03 | **Last Amended**: 2026-02-19 diff --git a/.specify/templates/plan-template.md b/.specify/templates/plan-template.md index a0dd948..17afc7a 100644 --- a/.specify/templates/plan-template.md +++ b/.specify/templates/plan-template.md @@ -44,8 +44,7 @@ ## Constitution Check - Automation: queued/scheduled ops use locks + idempotency; handle 429/503 with backoff+jitter - Data minimization: Inventory stores metadata + whitelisted meta; logs contain no secrets/tokens - Badge semantics (BADGE-001): status-like badges use `BadgeCatalog` / `BadgeRenderer`; no ad-hoc mappings; new values include tests -- Filament UI Action Surface Contract: for any new/modified Filament Resource/RelationManager/Page, define Header/Row/Bulk/Empty-State actions, ensure every List/Table has a record inspection affordance (prefer `recordUrl()` clickable rows; do not render a lone View row action), keep max 2 visible row actions with the rest in “More”, group bulk actions, require confirmations for destructive actions (typed confirmation for large/bulk where applicable), write audit logs for mutations, enforce RBAC via central helpers (non-member 404, member missing capability 403), and ensure CI blocks merges if the contract is violated or not explicitly exempted - +- Filament UI Action Surface Contract: for any new/modified Filament Resource/RelationManager/Page, define Header/Row/Bulk/Empty-State actions, ensure every List/Table has a record inspection affordance (prefer `recordUrl()` clickable rows; do not render a lone View row action), keep max 2 visible row actions with the rest in “More”, group bulk actions, require confirmations for destructive actions (typed confirmation for large/bulk where applicable), write audit logs for mutations, enforce RBAC via central helpers (non-member 404, member missing capability 403), and ensure CI blocks merges if the contract is violated or not explicitly exempted- Filament UI UX-001 (Layout & IA): Create/Edit uses Main/Aside (3-col grid, Main=columnSpan(2), Aside=columnSpan(1)); all fields inside Sections/Cards (no naked inputs); View uses Infolists (not disabled edit forms); status badges use BADGE-001; empty states have specific title + explanation + 1 CTA; max 1 primary + 1 secondary header action; tables provide search/sort/filters for core dimensions; shared layout builders preferred for consistency ## Project Structure ### Documentation (this feature) diff --git a/.specify/templates/spec-template.md b/.specify/templates/spec-template.md index 2fe1fe8..ce057d6 100644 --- a/.specify/templates/spec-template.md +++ b/.specify/templates/spec-template.md @@ -115,7 +115,11 @@ ## Requirements *(mandatory)* **Constitution alignment (Filament Action Surfaces):** If this feature adds or modifies any Filament Resource / RelationManager / Page, the spec MUST include a “UI Action Matrix” (see below) and explicitly state whether the Action Surface Contract is satisfied. If the contract is not satisfied, the spec MUST include an explicit exemption with rationale. - +**Constitution alignment (UX-001 — Layout & Information Architecture):** If this feature adds or modifies any Filament screen, +the spec MUST describe compliance with UX-001: Create/Edit uses Main/Aside layout (3-col grid), all fields inside Sections/Cards +(no naked inputs), View pages use Infolists (not disabled edit forms), status badges use BADGE-001, empty states have a specific +title + explanation + exactly 1 CTA, and tables provide search/sort/filters for core dimensions. +If UX-001 is not fully satisfied, the spec MUST include an explicit exemption with documented rationale.