PlotDirector/Docs/Investigations/TwoFactorOtpStyling-20261125.md

5.1 KiB

Two-factor code entry styling — 25 November 2026

The ordinary-browser /Account/TwoFactor view loaded Bootstrap input styling but not its component geometry: _PublicLayout marks plotline-theme.css media="not all", and public-auth-theme.js only enables that legacy stylesheet in installed windows. All existing .two-factor-inputs / .two-factor-digit rules lived there. Chromium confirmed the stylesheet loaded successfully but did not participate in the cascade. Bootstrap's display:block/width:100% then produced six stacked inputs. This is a loading/scope regression, not missing markup or an input-script failure.

The correction restores OTP geometry in the already-loaded public-site.css, inside its existing html[data-site-theme="public"] scope. Six equal shrinking square tracks, centred digits and spacing above/below the row work independently of the installed-window theme. Existing public colours, focus ring, page layout, buttons, recovery link, typography outside the digits and all form-control rules remain unchanged. Installed-window legacy styles remain responsible for that mode. No Razor, JavaScript, authentication/security or database structure was changed.

Actual compiled Razor/controller/layout rendering was exercised on an isolated loopback host. Its test-only IAuthService supplies a synthetic pending challenge; it cannot authenticate a user, perform TOTP operations or connect to a real DB. All hosted workers and outbound HTTP were disabled. This is rendered-page evidence, not a genuine account login or authenticator verification claim. The fixture was not installed into Development or Production.

Chromium checks at 1440, 390 and 320 pixels passed: one row, equal squares and gaps, centred text, inherited visible focus, no horizontal overflow and button separation. Inputs measured 56px, approximately 44.5px and 33.7px respectively. Before-and-after screenshots were visually inspected, including digits at the narrowest width. Advancement, numeric filtering, complete-code paste, backspace, Tab/Shift+Tab/arrows, existing accessibility/mobile attributes, automatic POST payload and antiforgery presence passed. Submission of empty Code exercised the real server-side required validation. Complete-code submissions were intercepted in the browser to avoid performing any authentication operation.

EnableTwoFactor uses a separate single Code input under ManageAccount, not these component classes or public layout. Its actual Razor view was also rendered with a display-only model; the verification input remains full-width. No setup or recovery-code logic was touched.

Reproduce browser checks with OTP_VISUAL_URL=http://127.0.0.1:5282 node PlotLine.Tests/Browser/two-factor-otp.cjs against the loopback Razor fixture retained privately at /home/nick/otp-style-20261125/host. The script refuses non-loopback hosts. Screenshots and measured geometry are in the visual evidence directory.

Viewport Before After
Desktop 1440px Before After
Mobile 390px Before After
Narrow 320px Before After

Deployed to Development only from clean commit eadda6f674ac456e8ae6014e2c5781088d408f8f, version 1.0.0. The signed code-only release is otp-eadda6f6-20261125; application/DLL, served stylesheet and local identity hashes were verified. Local/public HTTPS homepage and login returned 200. Existing configuration, uploads, keys and log paths were preserved. The new successful release row was recorded after health checks. All 321 existing migration history entries remain; zero migration scripts ran. A COPY_ONLY/CHECKSUM backup was VERIFYONLY-verified, and the previous application was retained in protected Atlas storage. Deployment took 31.28 seconds.

Final Chromium checks used the exact published application assembly and the CSS fetched from https://dev.plotdirector.com/; the after screenshots reflect that combination. Actual pending-login credentials were not used; the loopback-only render fixture is explicitly distinguished from genuine account/TOTP validation. The setup view was checked separately using its actual Razor view/display-only model. The loopback fixture has been stopped.

The first local deployment attempt stopped before application shutdown because an unprivileged filesystem inspection could not inspect Development's protected current directory. The check was repeated using the existing authorised sudo path; no permissions were loosened. Its verified backup and diagnostics were retained. A draft plan's stale omission-evidence reference was also corrected before package validation; no SQL/checksum or history entry changed. Neither preparation issue modified the running app. Production was not contacted or deployed by this task.

Sanitized Development deployment evidence.