# BTDB Manager UI Consistency Implementation Plan > **For Codex:** REQUIRED SUB-SKILL: Use `executeplan` to implement this plan task-by-task. **Goal:** Align BTDB Manager with the Theme-first suite refinements while preserving precise audited edits and making forms, overlays and recovery accessible. **Architecture:** Keep the InteractiveServer host and existing Manager.Core repositories/transactions, role gates, read-only lot context, preview/import planner and PDF reports. Adopt the validated shared package and recipes; keep BTDB-specific edit/row/diff state local. Reuse the documented ScadaBridge dialog pilot contract for a second consumer before considering generic RCL extraction. **Tech Stack:** .NET 10 Blazor InteractiveServer without prerendering, Bootstrap 5, Theme RCL, xUnit 2.9.3, bUnit 2.7.2 after GB (`BunitContext` / `Render`), existing repository fakes and WebApplicationFactory boot tests. Keep the GB-validated test stack unchanged during UI implementation. --- ## Required testing prerequisite Complete [bUnit standardization](BUnit.md) and close **GB before any task in this chapter**, including local fixes and candidate UI pilots. All bUnit snippets below use the post-GB `BunitContext` / `Render` / `AddAuthorization` API; their inherited helpers must be migrated in GB. Preserve framework HtmlRenderer methods and xUnit runner APIs where used. Non-bUnit runtimes retain their existing harnesses, but their UI work also waits for the family gate. Old package pins are discovery baselines, not targets for this chapter. ## Scope, baseline and shared dependencies - Active repo `/Users/dohertj2/Desktop/BTDB`, plan baseline `5b89798`. Theme is **0.4.1** in `src/ZB.MOM.WW.BTDB.Manager/ZB.MOM.WW.BTDB.Manager.csproj:27`; this repo intentionally does not use central package management. Do not add Directory.Packages.props. - Inputs: `/Users/dohertj2/Desktop/scadaproj/impeccable/BTDB.md` BT-01–11 and shared design contract. Existing teal **#1b7f8e** remains product identity inside the common Plex/neutral-paper/rail system. The mockup is a layout/behavior illustration; example records are not new backend requirements. - **G1 prerequisite for visual adoption:** validated immutable Theme artifact with symbolic `THEME_VERSION` replaced only by its assigned real version. Semantic text tokens: `--ok-ink:#236f34`, `--warn-ink:#855000`, `--bad-ink:#b42121`, `--idle-ink:#535d66`, `--ink-faint:#626970`; `--info-ink` is semantic blue independent of product teal. Additive TechField `For/HintId/ErrorId` and shell `AccentDeep/AccentTint/AccentBorder/AccentFocus` retain compatibility. TechButton BusyText is optional, aria-busy identifies pending work, and caller owns outcome announcements. G1 also documents focus/reduced-motion/table/filter/dialog recipes. - Local correctness repairs may start after GB closes and the contract is agreed; package-dependent visual merge waits for G1. BT-01 native-event modal wiring follows the ScadaBridge pilot, preserving capture/restore behavior but avoiding delayed `window.event`; after both consumers pass, parent G2 can assess generic extraction. Do not introduce a new global modal framework now. - Preserve existing machine/group/BatchEdit policies, existing batch editing only, datetime2(7) precision, UTC edit/query semantics, report-time Machine.TimeZone conversion, reason/audit attribution, concurrency handling and transaction rollback. No database migration, secret, production fixture, service restart or deploy is required by this planning request. ## Exact path notation, baseline and execution rules All commands use cwd `/Users/dohertj2/Desktop/BTDB`. File-inventory prefixes expand exactly: ```text U = src/ZB.MOM.WW.BTDB.Manager C = src/ZB.MOM.WW.BTDB.Manager.Core T = tests/ZB.MOM.WW.BTDB.Manager.Tests ``` Set task-specific shell variables when executing: ```sh BT_UI=src/ZB.MOM.WW.BTDB.Manager BT_TEST=tests/ZB.MOM.WW.BTDB.Manager.Tests/ZB.MOM.WW.BTDB.Manager.Tests.csproj git status --short dotnet test "$BT_TEST" -c Release ``` Expected baseline pass, or record an independent existing failure before starting. `build.sh` already runs restore/build/test on BTDB.slnx; preserve it. Perform the prescribed test-pin/API/parser changes in GB first. After GB, parser/package failure is a regression to investigate, not an expected UI red state or a reason for another incidental upgrade. For each behavioral change: write the specified regression in existing fixtures, run its exact filter and confirm the expected assertion fails, implement the minimum fix, rerun filter, run related tests, commit only named changes. bUnit cannot prove focus movement/contrast/overflow; browser checks supply that evidence. CSS-only work uses screenshot/computed-style verification, without tests duplicating CSS declarations. New files below are marked create. Plan writing itself performs none of these implementation steps. ## Task BT-00: Capture and adopt the validated shared package **Files:** Modify `U/ZB.MOM.WW.BTDB.Manager.csproj`, inspect `U/Components/App.razor`, `U/Components/Layout/MainLayout.razor`, `U/wwwroot/css/site.css`; create `docs/ui-consistency/BTDB-verification.md` and implementation screenshot directory `docs/ui-consistency/screenshots/`. 1. Record previous pin, actual G1 package version/digest, current repo changes and baseline test result. Capture login, overview, machines, machine form, find batch, batch edit, config import and audit/PDF-view context at desktop/tablet/phone before the bump. 2. Replace the direct Theme version with the real `THEME_VERSION` supplied by G1. Keep existing Bootstrap/Theme/site/scoped CSS load order and no-prerender setting; preserve lazy Monaco and asset cache busting. 3. Run `dotnet restore "$BT_TEST"` and `dotnet test "$BT_TEST" -c Release`; expected existing behavior passes. Browser capture 1440×900, 768×1024, 390×844, 200% zoom, mobile nav closed/open; content and footer remain visible. A package bump alone must not silently rewrite all component styles. 4. Do not start a host automatically while writing the plan. During implementation choose an existing disposable dev fixture; local documented port is 9877 and requires a test ConnectionStrings__BT environment value. Record actual URL/auth state without committing credentials. A server cannot be assumed healthy merely because `dotnet build` passes. 5. Commit explicit package/verification files, `git commit -m "chore(ui): adopt validated BTDB theme package"`. Preserve the prior artifact/pin for rollback. ## Task BT-01: Restore full modal keyboard behavior in two local adapters **Maps:** BT-01. **Depends:** documented G1 overlay recipe and ScadaBridge pilot behavior, not a hypothetical generic modal API. **Files:** Modify `U/Components/Shared/DialogHost.razor`, `EditableRows.razor`, `U/Components/App.razor`, `U/wwwroot/css/site.css`; create `U/wwwroot/js/dialog.js`, `tools/ui_consistency_browser.py`; extend `T/Shared/DialogServiceTests.cs`, `EditableRowsTests.cs`. 1. Extend existing dialog/row fixtures with close/focus-lifecycle assertions and preserve typed result/Cancel rollback tests. Add `Editor_CancelRestoresSnapshotAndRemovedFocusTargetIsSafe`: edit an existing cloned row, Cancel, assert original data/state restored; remove trigger before close and assert component cleanup does not throw. Run `dotnet test "$BT_TEST" --filter 'FullyQualifiedName~DialogServiceTests|FullyQualifiedName~EditableRowsTests'`. 2. Unit markup tests should assert named modal, proper disabled state and clean close behavior; do not mistake loose JSInterop no-ops for a real focus-trap test. Existing rollback tests may already pass; retain them as regression protection rather than forcing a fake red result. 3. Write real-browser red case using `playwright.sync_api` in the new script, with explicit `--base-url`, `--storage-state`, `--output-dir`, `--case overlays`. Record that Tab from final button currently reaches blocked background. Script must only open/cancel fixture dialogs and may not submit a production save/import. 4. Reuse the proven DOM behavior contract in BTDB namespace: capture opener before initial focus; add an actual element-bound keydown listener; synchronous event.preventDefault at Tab boundaries; exclude hidden/inert/disabled controls; handle zero-focusable dialog; body lock/background inert; Escape cancel; remove listeners on close/dispose; restore connected trigger or stable page context. Track state per overlay; do not copy ScadaBridge's old window.event dependency. Preserve Enter/default form behavior and stop Escape closing two nested overlays. 5. Reference `/js/dialog.js?v=@AssetVersion` from App before Blazor, retaining existing versioning. Wire both local adapters to the same lifecycle. Preserve Clone rollback and cancellation of a newly added row; never implement Done as immediate database save. 6. Run focused unit tests then `python3 tools/ui_consistency_browser.py --base-url "$BT_REVIEW_URL" --storage-state "$BT_REVIEW_STATE" --output-dir docs/ui-consistency/screenshots --case overlays`. Expected red pre-change / green after: first/last Tab and Shift+Tab contained, Escape returns to initiating row, hidden tabs skipped, short-dialog footer reachable. 7. Commit explicit named files, `git commit -m "fix(ui): preserve keyboard context in BTDB dialogs"`. Record successful second pilot for the parent G2 extraction decision; do not extract a shared generic component in this task. ## Task BT-02: Connect field labels, validation and editor names **Maps:** BT-02. **Depends:** BT-00 for TechField adoption; direct id/for repairs may precede it. **Files:** Modify `U/Components/Pages/Machines/MachineForm.razor`, `MachinesList.razor`, `U/Components/Pages/MachineGroups/MachineGroupForm.razor`, `U/Components/Pages/Batches/BatchEdit.razor`, `U/Components/Shared/DialogHost.razor`, `JsonEditor.razor`, `U/wwwroot/js/json-editor.js`; extend `T/Pages/Machines/MachineFormTests.cs`, `MachinesListTests.cs`, `T/Pages/MachineGroups/MachineGroupFormTests.cs`, `T/Pages/Batches/BatchEditPageTests.cs`, `T/Shared/JsonEditorTests.cs`. 1. In existing MachineFormTests reuse RegisterFakeRepository/BuildSampleMachine/AuthorizeAsAdministrator. Add `CodeInput_IsNamedByVisibleLabel` with render setup already used by the class: ```csharp var cut = Render(p => p.Add(c => c.Id, SampleMachineId)); var label = cut.FindAll("label").Single(e => e.TextContent.Trim() == "Code"); var id = label.GetAttribute("for"); Assert.False(string.IsNullOrWhiteSpace(id)); Assert.Equal("Z001", cut.Find("#" + id).GetAttribute("value")); ``` Add corresponding field-error association after invalid submission, populated search/group filter naming and repeated work-order row-editor uniqueness. For JsonEditor test forwarded ariaLabel options, not Monaco internals. 2. Run `dotnet test "$BT_TEST" --filter 'FullyQualifiedName~MachineFormTests|FullyQualifiedName~MachinesListTests|FullyQualifiedName~MachineGroupFormTests|FullyQualifiedName~BatchEditPageTests|FullyQualifiedName~JsonEditorTests'`; expected red: missing id/for or editor field-name relationship. 3. Give visible labels stable ids/for. Use G1 TechField additively where appropriate; caller still connects input id/error/hint/invalid attributes. Add optional local JsonEditor Label/HintId/ErrorId contract; pass meaningful ariaLabel to Monaco and fallback textarea; keep document-specific names for every editor. 4. Keep required/validation business rules; align hints and errors without replacing timestamp parsing or row models. Cover group form, import filters, prompt, batch/work-order/cycle/transfer editors; do not attach duplicate ids in hidden panes. 5. Rerun focused tests and screen-reader forms-mode checks; check invalid controls announce both field and corrective hint. Commit explicit files, `git commit -m "fix(ui): name BTDB fields and validation context"`. ## Task BT-03: Guard dirty navigation without changing save transactions **Maps:** BT-03. **Files:** Create `U/Components/Shared/UnsavedChangesGuard.razor`, `T/Shared/UnsavedChangesGuardTests.cs`; modify `U/Components/Pages/Machines/MachineForm.razor`, `U/Components/Pages/MachineGroups/MachineGroupForm.razor`, `.razor.cs`, `U/Components/Pages/Batches/BatchEdit.razor`; extend existing MachineFormTests, MachineGroupFormTests, BatchEditPageTests; extend browser script. 1. Test the guard through NavigationManager and real/stub existing IDialogService: clean navigation proceeds without prompt; dirty + Stay prevents location change; dirty + Discard proceeds once; a second navigation prompts again. Add page integration tests for row-only dirty changes, failed save retaining guard and successful save bypassing guard exactly once. 2. Run `dotnet test "$BT_TEST" --filter 'FullyQualifiedName~UnsavedChangesGuardTests|FullyQualifiedName~MachineFormTests|FullyQualifiedName~MachineGroupFormTests|FullyQualifiedName~BatchEditPageTests'`; initial red: guard missing or dirty navigation proceeds. Use bUnit test navigation history/registered handlers, not a test that simply counts component tags. 3. Minimal local component uses the existing dialog service and built-in NavigationLock (add the routing namespace import): ```razor @using Microsoft.AspNetCore.Components.Routing @inject IDialogService Dialog @code { [Parameter] public bool IsDirty { get; set; } private async Task BeforeNavigate(LocationChangingContext context) { if (!IsDirty) return; var discard = await Dialog.ConfirmAsync("Discard unsaved changes?", "Leave this page and discard the pending edits?"); if (!discard) context.PreventNavigation(); } } ``` On Stay prevent navigation; on accepted discard allow that navigation. Serialize overlapping navigation attempts so rapid clicks cannot open two confirmations; if disposal occurs while awaiting, do not act on a stale navigation context. Never auto-save on leave. Native browser unload confirmation has browser-owned text and cannot await an async server dialog. 4. Wire current dirty calculations including child rows and edit reason. Set successful-save/explicit-discard state before final navigation; do not disable the guard merely while a failing save is pending. Reload-conflict button must explicitly warn that it discards pending values. Reuse one confirmation path to avoid double prompts on Cancel. 5. Browser check rail, Back, refresh, close tab, external navigation, form Cancel, conflict Reload, row-editor Cancel, failed save and successful save using disposable data. No draft-persistence claim is added. Check disconnected circuit message still says unsaved changes are not kept. 6. Rerun tests then browser `--case dirty-navigation` added to the script. Commit explicit files, `git commit -m "fix(ui): guard unsaved BTDB edits on navigation"`. ## Task BT-04: Migrate semantic ink and preserve teal identity **Maps:** BT-04. **Depends:** BT-00/G1. **Files:** Modify `U/wwwroot/css/site.css`, `U/Components/Layout/MainLayout.razor`, `U/Components/Pages/ConfigImport/ConfigImport.razor.css`, `U/Components/Pages/Machines/MachineForm.razor.css`; update verification notes. 1. Record before computed color pairs for JSON caption, inactive tab, import hint, row-added/edited/removed chip and toast dismissal. No unit tests duplicating CSS values. 2. Change textual row/change/status usages to semantic ink tokens; reserve saturated status colors for dots/decoration. Keep informational status blue via --info-ink even when product Accent is teal. Keep inactive/removed text readable and labelled; strike-through/color alone is insufficient to explain row removal. 3. Pass audited teal deep/tint/border/focus values through the G1 additive shell parameters after visual comparison; retain existing Accent. In particular existing --accent-deep must not silently stay blue while primary buttons/nav are teal. Put shared values in Theme-approved product configuration, not a new uncoordinated palette per page. 4. Measure normal text ≥4.5:1 and relevant nontext/focus ≥3:1 on actual surfaces. Verify no color-only meaning, copied values/selected text readable, and reduced-motion keeps focus/feedback visible. BTDB currently has no dark-mode feature; do not invent one in this chapter. 5. Run `dotnet test "$BT_TEST" -c Release` to protect semantic behavior; screenshot desktop/tablet/phone once, fix once and confirm. Commit named files/notes, `git commit -m "style(ui): adopt semantic inks and coherent BTDB accent"`. ## Task BT-05: Finish machine-form tab behavior **Maps:** BT-05. **Files:** Modify `U/Components/Pages/Machines/MachineForm.razor`, `.razor.css`; extend `T/Pages/Machines/MachineFormTests.cs` and browser script tabs case. 1. Add `Tabs_ReferenceLabelledPanels_AndPreserveDraft`: each tab references an existing panel id, active tab tabindex 0, others -1; panel aria-labelledby points back. Edit OtherData, switch to Memberships and back, assert draft persists. Add Right/Left/Home/End keyboard selection tests with existing machine fixture. 2. Run `dotnet test "$BT_TEST" --filter FullyQualifiedName~MachineFormTests`; expected red: absent relationships and key behavior. Existing all-panes-rendered test stays valid; do not change hidden panel persistence. 3. Assign ids/controls/labelledby and implement roving focus following shared tab recipe. Keep inactive panels hidden and their values rendered. Focus must reach active tab only once in normal tab order; handle arrow key defaults synchronously if native event prevention is needed. 4. Browser Tab → active tab; arrows change/focus; Home/End move boundaries; Tab enters visible panel. No hidden editor focus target may be included in modal trap. At phone width wrap/scroll tab labels without clipping active indicator. 5. Rerun filter then browser `--case tabs`. Commit three explicit files, `git commit -m "fix(ui): complete BTDB machine form tab navigation"`. ## Task BT-06: Adapt forms and row dialogs for phone/touch **Maps:** BT-06. **Files:** Modify `U/wwwroot/css/site.css`, `U/Components/Pages/Machines/MachineForm.razor.css`, `U/Components/Pages/ConfigImport/ConfigImport.razor.css`; update verification notes. 1. Capture existing three/two-column identity form and 80vw row dialog at 390px and 200% zoom with long timezone, machine code, validation and multiple checkboxes. Use screenshot evidence; no mirrored CSS unit tests. 2. At narrow widths reduce .form-grid/.cols-3 to one column, reset span-2 semantics, allow .check-row wrap. Give row dialog near-full phone width, bounded dvh-compatible height/body scrolling and visible actions. Preserve compact desktop density and the permanent no-entrance-animation fix for panels hosting EditableRows. 3. Increase coarse-pointer hit regions to practical ≥44px without making every desktop data row oversized. Keep table overflow local; avoid blocking a nested scroll at short landscape heights. 4. Run `dotnet test "$BT_TEST" --filter 'FullyQualifiedName~EditableRowsTests|FullyQualifiedName~MachineFormTests|FullyQualifiedName~ConfigImportPageTests'`; expected behavioral pass. Browser verify phone/tablet/landscape/zoom and keyboard focus visibility with form errors. 5. Commit named CSS/notes, `git commit -m "style(ui): adapt BTDB forms and row editors for touch"`. ## Task BT-07: Recover from failed Monaco initialization **Maps:** BT-07. **Files:** Modify `U/Components/Shared/JsonEditor.razor`, `U/wwwroot/js/json-editor.js`; extend `T/Shared/JsonEditorTests.cs`. 1. Add `InitializeFailure_ShowsNamedFallbackWithoutLosingValue`: configure strict JSInterop createEditor to throw JSException, render with a valid original string, assert visible initialization error and labelled textarea/fallback preserves value. Edit fallback, assert ValueChanged and existing parse validation. Retry success must preserve edited text and remove stale fallback/error; disposal must not leave an orphan editor. 2. Run `dotnet test "$BT_TEST" --filter FullyQualifiedName~JsonEditorTests`; expected red: failure only logged and empty host remains. Test async result/wait path with existing strict interop style; do not globally loosen calls to hide errors. 3. Add explicit loading/ready/failed initialization state and retry path; failed state renders a labelled bound plain-text editor using the same validation/value pipeline and ReadOnly setting. Keep original/updated bound text on every state transition. Record JS failures for diagnosis without exposing stack detail in UI. 4. Monaco create options receive field ariaLabel from BT-02; optional format action becomes available only when ready. Keep lazy assets and worker paths; retry must not initialize duplicate editor instances. Existing echo-suppression/value restore tests remain. 5. Rerun filter; browser block script/worker request, retry, invalid/valid JSON and disconnected circuit with no value loss. Commit three files, `git commit -m "fix(ui): recover BTDB JSON editor initialization"`. ## Task BT-08: Reconcile shared page anatomy and version compatibility **Maps:** BT-08. **Depends:** BT-00, BT-04. **Files:** Modify `U/wwwroot/css/site.css`, `U/Components/Layout/MainLayout.razor`, `U/Components/Pages/Overview/Overview.razor`, `U/Components/Pages/Machines/MachinesList.razor`, `MachineForm.razor`, `U/Components/Pages/MachineGroups/MachineGroupsList.razor`, `MachineGroupForm.razor`, `U/Components/Pages/Batches/FindBatch.razor`, `BatchEdits.razor`, `BatchEdit.razor`, `U/Components/Pages/ConfigImport/ConfigImport.razor`, `U/Components/Pages/Audit/AuditIndex.razor`, `MachineAudit.razor`, `MachineGroupAudit.razor`, `BatchEditAudit.razor`; update verification notes and existing relevant semantic tests only if headings change. 1. Build ownership table for shared .page-head/.panel/.data-table/.btn vs legitimate BTDB .diff/.editable-rows/.form-grid. Verify actual package rules; keep local overrides where no shared replacement exists. 2. Move compact h1/action/meta anatomy to G1 pattern across every family, including AuditIndex which currently lacks a page h1. Add one semantic test `AuditIndex_HasSinglePageHeading` to `T/Pages/Audit/AuditIndexTests.cs`; red before heading, green after. Do not snapshot every margin or class. 3. Remove/reconcile duplicate .page-head and spread page action CSS only after computed layout matches shared family. Keep custom row/editor/diff components local; keep import steps numbered because sequence is meaningful. Avoid nested panel containers for errors while preserving role=alert. 4. Run `dotnet test "$BT_TEST" --filter 'FullyQualifiedName~AuditIndexTests|FullyQualifiedName~MachineFormTests|FullyQualifiedName~BatchEditPageTests|FullyQualifiedName~ConfigImportPageTests'`; compare header/table/action sizing and mobile closed-nav behavior to same-suite fixtures. 5. Commit explicit modified paths, `git commit -m "refactor(ui): align BTDB page anatomy with shared theme"`. Do not introduce a numeric release or change other dependencies. ## Task BT-09: State UTC before date entry and retain precision **Maps:** BT-09. **Files:** Modify `U/Components/Pages/Batches/FindBatch.razor`, `BatchEdits.razor`, optionally `U/Components/Shared/DateTimeRangeFilter.razor` for additive zone hint only; extend `T/Pages/Batches/FindBatchTests.cs`, `BatchEditsTests.cs`, `T/Shared/DateTimeRangeFilterTests.cs`. 1. Add `BeforeSearch_CustomWindowIsExplicitlyUtc`: render FindBatch using existing repository fixture before _searched, assert field/zone guidance already says UTC. Submit exact UTC boundaries and assert repository receives those unchanged; inverted range emits no search and preserves values. Add cross-host-zone data cases through existing fake callback rather than modifying system clock. 2. Run `TZ=America/Indianapolis dotnet test "$BT_TEST" --filter 'FullyQualifiedName~FindBatchTests|FullyQualifiedName~DateTimeRangeFilterTests|FullyQualifiedName~BatchEditsTests'`; expected red on missing initial guidance; timestamp-preservation tests may already pass and protect current behavior. Repeat after fix under `TZ=UTC` and `TZ=Asia/Tokyo`. 3. Label range “Start time window (UTC)” and/or suffix field labels before input; repeat UTC on applied filter/export results. Keep DateTimeRangeFilter input-only, stored edit timestamps UTC and full datetime2(7) batch-editor precision. Do not apply Machine.TimeZone at edit/query time; it belongs to reporting. 4. Browser choose the same UTC boundaries from UTC/Indianapolis/Tokyo contexts and around DST dates; same known batch result. UTC edits have no ambiguous local-time conversion. No generic browser-local policy is introduced. 5. Commit exact component/test files, `git commit -m "fix(ui): state UTC before BTDB time-window entry"`. ## Task BT-10: Remove misleading sort cues and verify table scale **Maps:** BT-10. **Files:** Modify `U/Components/Pages/Machines/MachinesList.razor`, `U/Components/Shared/DataTable.razor`; extend `T/Shared/DataTableTests.cs`; inspect `U/Components/Pages/Batches/BatchEdits.razor`, `U/Components/Pages/Audit/AuditIndex.razor`, `C/Services/DbRepository.cs` without changing SQL in this UI task. 1. Add `NamedOverflowRegionRetainsTableHeaders`: render a table with a meaningful label, assert labelled region/table relationship and accessible headers/count. Initial red: component has no label API. Use optional TableLabel parameter with meaningful safe default and named callsites; do not assert scroll behavior in AngleSharp. 2. Run `dotnet test "$BT_TEST" --filter FullyQualifiedName~DataTableTests`; expected missing parameter/assertion red, then pass after wrapper API/markup change. 3. Remove Code .sortable appearance because no sorting behavior exists; do not add new sorting merely to justify a class. Preserve current query order. Add labelled/focusable overflow region only where needed, avoid duplicate nested scroll areas; keep blank action header accessible as Actions. 4. Measure batch-edit and audit-index load/query/browser render on a representative large disposable history, record item count, payload size, query time and input responsiveness in verification notes. Current whole-history client filtering is known; do not claim a measured bottleneck before capture. If unacceptable, create a separately scoped repository/server-pagination follow-up with measured budget and parity tests; leave this UI consistency change bounded. 5. Browser long values at 390px/200% zoom, local horizontal scroll and accessible action names. Rerun DataTableTests/BatchEditsTests; commit exact files, `git commit -m "fix(ui): clarify BTDB table controls and overflow"`. ## Task BT-11: Promote the review workflow and complete suite acceptance **Maps:** BT-11. **Depends:** preceding tasks. **Files:** Modify `U/Components/Pages/Overview/Overview.razor`, `.razor.css`, `U/Components/Pages/Batches/BatchEdit.razor`, `U/wwwroot/css/site.css`; extend `T/Pages/Overview/OverviewTests.cs`, `T/Pages/Batches/BatchEditPageTests.cs` as needed for changed visible behavior; update verification notes/browser cases. 1. Add role regression `Overview_FindBatchShortcutOnlyForBatchEdit`: reuse existing authorization fixtures, render Viewer then BatchEdit policy, verify shortcut visibility and retained read-only audit destinations. Run `dotnet test "$BT_TEST" --filter FullyQualifiedName~OverviewTests`; red before new shortcut, green with policy gate. 2. Compress six equal counts into shared facts strip, promote recent edits and a policy-gated Find a batch action; keep all count meanings and existing access info available in a disclosure. Do not invent a real-time monitor or new batch-creation CTA. 3. Keep batch machine/id/UTC context visible beside reason/change summary and pending state. Use “Review changes” before existing audited Save confirmation; avoid extra confirmation for harmless field edits. Retain original values, row change counts and lot context; no fabricated production diff from mockup. 4. Run `dotnet test "$BT_TEST" -c Release` and existing Manager.Core tests with `dotnet test tests/ZB.MOM.WW.BTDB.Manager.Core.Tests/ZB.MOM.WW.BTDB.Manager.Core.Tests.csproj -c Release`. Expected pass. Integration tests requiring BTDB_TEST_CONNECTION remain separately identified, not silently counted as run; use a disposable test DB if later execution requires DB checks. 5. Run new browser cases on the supplied fixture, capture all route families once in desktop/tablet/phone/zoom, inspect focus/contrast/overflow/states in the same batch, fix once then confirm. Verify PDF-related existing tests still pass; do not rewrite PDF layout solely to match web chrome. 6. Commit explicit page/test/verification files, `git commit -m "refactor(ui): prioritize BTDB change review and recent edits"`. ## Coverage, rollout and rollback | Report finding | Task | Acceptance evidence | |---|---|---| | BT-01 modal behavior | BT-01 | native browser Tab/Shift+Tab/Escape/focus return + row rollback | | BT-02 field names | BT-02 | visible label/error relationships, named editor and populated filters | | BT-03 dirty navigation | BT-03 | Stay/Discard, Back/refresh/Cancel/save/conflict paths | | BT-04 readable tokens | BT-04 | computed contrast pairs, semantic blue separate from teal | | BT-05 tab semantics | BT-05 | linked panels, roving focus and drafts survive switching | | BT-06 phone forms | BT-06 | single-column/coarse-pointer/short-viewport browser captures | | BT-07 JSON recovery | BT-07 | JS init failure/fallback/retry/value preservation | | BT-08 shared anatomy/version | BT-00/08 | recorded real package, one title system, mobile closed-nav | | BT-09 UTC entry | BT-09 | guidance before first query, exact UTC boundaries and precision | | BT-10 sort/overflow/scale | BT-10 | honest controls, keyboard local scrolling, measured history size | | BT-11 task hierarchy | BT-11 | role-appropriate shortcut and unchanged audited review flow | **State/role matrix:** Viewer / MachineConfig / BatchEdit / Administrator; no configured vs filtered-zero; loading vs unavailable; open/closed batch; added/edited/removed/restored child; invalid precision/JSON/range; optimistic-concurrency conflict; save rollback; missing username; empty/stale import preview; import failure; no audit entity/history; script/worker failure; lost circuit. Test both direct links and nav presentation; server authorization remains authoritative. **G2 candidate gate:** full relevant test pass, route-family screenshot review, complete browser modal and dirty-navigation evidence, package version/digest recorded, no duplicate theme/token ownership. Report two-pilot overlay findings to the shared Theme owner before any generic extraction. No new DB schema; test migration is completed in GB before these UI tasks. **Later authorized rollout:** Theme artifact availability → isolated dev fixture → one BTDB consumer environment under its existing release procedure, then other environments with observed checks. This is ordering guidance, not deployment authorization or a command to write real batches. Use existing build.sh unchanged; record artifact/version and old application artifact before rollout. Protect active dirty sessions before restart. **Rollback:** revert consumer UI commits and Theme pin to the recorded 0.4.1 baseline together if a compatibility problem occurs, restore previous app artifact through normal release process, preserve underlying data/audit/schema. Do not delete pending production records, history, user browser preferences or machine time zones. Keep guard/circuit copy honest about unpersisted drafts. Reproduce the defect on fixture and document remaining gate; source-only unknowns are verification items, not a reason to leave the plan incomplete.