# UI review and searchable audit history

Date: 2026-10-19
Environment: primary ERP development installation.

## Findings and fixes
- Header controls overflowed the available width around 985px: responsive spacing and visibility corrected.
- Roles page rendered every permission form at once, burying assignment controls: existing roles and custom-role creation now use expandable panels with counts and indicators.
- Role creation fields had no accessible names: explicit labels added.
- Employee status/action layout wrapped awkwardly: account controls now stack consistently.
- Empty employee table colspan corrected.
- Added read-only /audit-history, linked from Access / Activity Log.

## Audit history behavior
- Requires company-wide audit.view or company-wide access.manage (owner/system admin retain existing authorized access).
- Always filters by the active company.
- Search, exact action filter and inclusive UTC date range.
- 25-row pagination with filters preserved.
- Expandable safely escaped details; secrets redacted again before display.
- No new permissions assigned, no edit/delete/export endpoints.
- Application access restrictions do not provide database-level tamper resistance.

## Validation
- Browser: user-authorized existing login session in the in-app browser, controlled through computer-use browser APIs.
- Reviewed Employees, Roles & Permissions, Warehouses and Audit History.
- Tested tabs, expanding a role, search submission, filtered results and event details.
- Desktop/default viewport approximately 985px wide; mobile override 390x844, reset afterward.
- Confirmed document width stayed within the 390px viewport; tables retain local horizontal scrolling.
- Relevant browser error/warning log was empty; no blank page or framework overlay observed.
- 33 automated tests / 164 assertions pass, including cross-company history isolation, date/search filters, secret redaction, permission denial and missing delete endpoint.
- PHP syntax and git diff whitespace checks pass.
- Role/employee/warehouse write workflows were not submitted from the real browser session; tested with disposable SQLite records.
- No new migration or real-user permission change in this patch.

## Backup
/home/snyt/backups/snyt-erp/2026-10-19-p0/before-ui-audit-review.tar.gz

## Remaining release/P1 items
Database-level audit immutability and retention, restore drill, API auth and approval thresholds remain pending.
No claim that financial/export/stock workflows are implemented.
