Repository navigation
feat(frontend): Machined Trust visual system — P0-P4 complete - #148
Conversation
…e codemod, fonts, brand mark - design-tokens.css rewritten on @theme: OKLCH brand(252)/neutral/semantic ramps, surface/page/ring themeable tokens, three type voices, ctl/card/auth radius discipline; both apps kept byte-identical - scripts/frontend/color-codemod.mjs migrates gray/zinc/slate/stone->neutral, indigo/blue/sky->brand, emerald->success, rose/red->error, amber->warning; palette-residue grep now 0 in both src trees - self-hosted @fontsource fonts (DM Sans, Archivo, JetBrains Mono, Noto Sans SC on user side); keyhole favicon + SVG AppLogo mark on both apps - page roots moved to bg-page/bg-surface; AdminLayout active-nav tick + ring token; AppLayout nav tick; AuthLayout rebuilt as vault-door shell (blade, blueprint grid, mono issuer line); admin LoginPage gains card h1 (mockup 06) - E2E selectors migrated off frozen palette classes (red/rose/sky -> semantic error/brand tokens) per plan P0 gate; GitHub-button test waits for hydration - Gates: admin 186 + user 109 e2e green, vitest green, both builds green
…ce, user kit adoption - admin 10-piece UI kit retuned to design tokens (3px brand focus ring, radius discipline ctl/card, eyebrow table headers, semantic badges); synced byte-identical to user frontend (11 components) - DData machine-data chip (11.5px mono hairline chip) landed on client_id / scopes / token prefixes / timestamps / device code / TOTP input frame / key metadata / backup codes across both ports - user account pages adopt the kit: AppCard/AppAlert/AppBadge/ AppEmptyState/AppModal (blocking backup-codes dialog keeps its must-confirm semantics via unwired close) — handwritten card and badge styles cleared - palette residue normalized (green/yellow/orange/purple outside the P0 codemod's 11 families): success/warning/info tokens, 800-step folded to 700; E2E selectors updated in lockstep (5 spec files + testid-based client-id-chip / backup-code assertions) - scripts/check-ui-sync.mjs: dual-copy drift gate (exit 1 on drift) - LoginPage/DeviceApprove focus + mono normalization (3px ring ring, tabular-nums code inputs) Verification: admin tsc+build+180 e2e passed (6 backend-dependent skipped); user build+109 e2e+24 vitest passed; ui-sync report: all 11 shared components byte-identical; keyboard Tab audit paints the 3px brand ring on every login-page stop.
…eipt, admin login - user auth pages (register/forgot/reset/verify) rebuilt inside the P0 AuthLayout vault door: per-page gradient shells removed, kit inputs/buttons, display-voice headings - register page gains the 4-segment password strength meter (error/warning/success progression); floor copy follows the real backend policy (auth.min_password_length = 8), not the mockup's 12 - MFA code inputs normalized to mockup 07 spec: mono tabular-nums, 0.42em tracking, centered, rounded-ctl, 3px brand focus ring (user login step + admin login step + SecurityPage setup) - ConsentPage rebuilt as the mockup 02 receipt — client identity block (glyph + name + truncated client_id chip), permission rows (tick + human description + scope chip), Deny quiet / Authorize primary, mono session footer. Script layer untouched: native form POST, user_id fallback chain (E7), PKCE/nonce/consent_csrf relay, missingUserId block all preserved; oauth.spec 10/10 green - admin login rebuilt per mockup 06: blueprint grid + machined top blade + brand row with admin chip + issuer verification line - GitHub callback page framed per mockup 26 conventions (script zero diff) - AppEmptyState adopted on admin Applications/Tokens/Logs lists with the asserted copy preserved verbatim Verification: admin tsc+build+180 e2e passed; user build+109 e2e+24 vitest passed; facade screenshots checked against mockups 01/02/06.
…iant input, user detail pills - dashboard metric numbers switched to the machine voice (mono, tabular-nums, -0.02em, weight 600) per mockup 03; stat/panel radii on the rounded-card step. Delta pills and trend sparklines omitted: the /stats contract carries no deltas and none were fabricated - table density unified at ~40px rows across Users/Applications/ Scopes/Roles (py-4 -> py-3, matching Tokens/Logs); all tables are hairline-divided with row hover, no zebra - DeviceApprove code input rebuilt to the mockup 15 giant spec: 24px mono, 0.18em tracking, uppercase, centered, left-padding compensation, RFC 8628 mono footnote - UserDetail header: three AppBadge status pills, mono DData ID line, AppAlert flashes, danger action buttons with focus rings - TokensPage row Revoke gains focus ring (confirm dialog and bulk danger already error-tokened) Verification: admin tsc+build+180 e2e passed; ui-sync in sync.
… stamp pulse
- stores/theme.ts (both ports, identical): localStorage('fulla-theme')
-> html[data-theme]; 'system' default follows prefers-color-scheme with
matchMedia hot-switch; explicit choice overrides the OS. Wired in
main.ts before first paint; toggle entries in the admin user menu and
the user avatar menu
- dark palette = ramp inversion (mockup .dark): neutral 50-900 flipped,
brand tints/accent re-stepped, semantic ramps get dark bgs/borders and
bright text steps; surfaces and the semantic var layer switch to
literals. Carrier is an SFC <style> block in App.vue with an
html[data-theme=dark] selector — three dead ends documented in the
block comment: (1) tailwind's vite plugin strips the block from
sibling @imports in dev, (2) layer-merges it away in builds,
(3) a bare [data-theme] selector loses the source-order tie to the
unlayered :root emission; the SFC seat + bumped specificity wins in
dev and build alike
- consent Authorize stamp: one-shot 400ms brand-ring pulse mounted on
the loading flip, active:scale press; prefers-reduced-motion kills
the animation
- verification: programmatic light-leak audit (elements with L>0.82 and
>400px^2) across 12 dark pages -> zero hits; theme persistence,
system-follow hot-switch, explicit-over-system, and the
reduced-motion kill switch all asserted; 16 dual-theme screenshots
(8 pages x 2) captured locally to deliverables/visual-mockups/
implemented/ with pixel-luminance verification (dark 10-17 vs light
245-248); full suites green: admin 180 e2e, user 109 e2e + 24 vitest
…and theme wiring The [data-theme=dark] block no longer lives in this file — the header now points to App.vue's SFC style (and why) plus stores/theme.ts.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
代码评审报告(Machined Trust P0–P4)评审方式:PR Review Toolkit 四维并行评审(代码质量 / 测试覆盖 / 注释与类型 / 静默失败)+ 逐项人工核验。83 文件,+3034/-1585,纯前端。 结论:建议修改后合并(Request Changes)工程质量整体很高,但存在 2 个 Critical 和一批暗色模式正确性问题,均与本 PR 的核心交付(dark theme + 自动化验收)直接冲突。 声明核验
Critical(合并前必须修复)C1. 注册 409 双用例断言恒真(测试回归) — C2. 暗色模式下 Modal 遮罩变白雾 — Important(应修复)I1. I2. brand-800/900 未在暗色块重映射 —
I3. design-tokens.css 遗留过期注释,与文件头自相矛盾 — I4. 四块新行为零测试覆盖
I5. I6. Suggestion(可选)
亮点
建议行动
|
… gaps
C1 registration 409 assertions were tautological: [class*=error-]
matched the AppInput required-star and strength meter forever.
Now asserts the mounted AppAlert (role=alert) with the real
backend codes (VALIDATION_USERNAME_TAKEN/EMAIL_TAKEN, per
AuthService.cc) and their catalog messages. Same fix applied to
the account.spec revoke-failure case.
C2 AppModal backdrop bg-neutral-900/50 became white fog in dark
(neutral ramp inversion); now uses the dedicated scrim token
--color-bg-overlay (dark value is a literal). Both copies synced.
I1 theme.mode is reactive now: osDark ref mirrors the OS preference
and the matchMedia change handler updates it, so the toggle
icon/label/aria-label and toggle() stay in sync on system hot-
switches.
I2 brand-800/900 remapped in the dark block (84%/90%) — badges on
brand-100 and hover:text-brand-800/900 links are readable in
dark again.
I3 stale dark-mode pointer comment in design-tokens.css corrected
to App.vue (was referencing the deleted dark-theme.css).
I4 test gaps: passwordStrength extracted to utils with a 0-4 scale
the 4-segment meter can actually top out (7 unit cases); new
theme.spec.ts covers OS-follow default, toggle entry flips
data-theme + persists across reload, and the consent stamp
reduced-motion kill switch — making the PR's earlier claim true
in-repo.
I5 check-ui-sync.mjs hardened (recursive walk; empty/missing dirs
are failures, not vacuous passes) and wired into _frontend.yml
as a gate step.
I6 theme init() wrapped in try/catch — theming can never block
app mount.
Also: LoginPage forgot-password hover collapse (hover:text-brand-700
-> 800), anti-FOUC inline theme resolver in both index.html heads,
password-floor provenance comment in passwordStrength.ts.
评审处置(efc1e225)全部 Critical/Important 已修复,Suggestion 择要处理。逐项: Critical
Important
Suggestion(已处理)
未处理(登记理由)
回归admin tsc+build+lint+180 e2e(连续 4 轮全绿;期间在并行构建负载下出现过 2 次单测偶发超时、重跑即绿,未定位到具体用例,Linux CI 会再验);user build+lint+112 e2e+31 vitest 全绿;ui-sync 门 in sync。 等 Linux CI 转绿后请再评。 |
|
CI 全绿(8/8):Build & Test linux 20m41s / macos / windows、Frontend Property Tests(含新接入的 ui-sync 门)4m43s、SDK Smoke、Dependency EOL、Secret Hygiene、Static Checks 全部通过。efc1e225 已包含全部评审处置,可再评。 |
…148 token system PR #148 (Machined Trust) remapped the palette to OKLCH semantic tokens; red-* is replaced by error-* (AppAlert's own error variant idiom). The new #149 callback page still used the legacy red-* classes -- swap to bg/text/border-error-* so it renders correctly under the remapped dark palette. (The Google/WeChat login buttons already match: #148 kept the GitHub button's neutral-* classes, and the neutral ramp is remapped in place.)
…148 token system PR #148 (Machined Trust) remapped the palette to OKLCH semantic tokens; red-* is replaced by error-* (AppAlert's own error variant idiom). The new #149 callback page still used the legacy red-* classes -- swap to bg/text/border-error-* so it renders correctly under the remapped dark palette. (The Google/WeChat login buttons already match: #148 kept the GitHub button's neutral-* classes, and the neutral ramp is remapped in place.)
…148 token system PR #148 (Machined Trust) remapped the palette to OKLCH semantic tokens; red-* is replaced by error-* (AppAlert's own error variant idiom). The new #149 callback page still used the legacy red-* classes -- swap to bg/text/border-error-* so it renders correctly under the remapped dark palette. (The Google/WeChat login buttons already match: #148 kept the GitHub button's neutral-* classes, and the neutral ramp is remapped in place.)
Summary
Implements the full "Machined Trust" visual plan (deliverables/frontend-visual-implementation-plan.md, five independently revertable commits):
scripts/check-ui-sync.mjsdual-copy drift gate (11 components byte-identical), plus the green/yellow/purple/orange residue the codemod map didn't coverAcceptance (all automated)
bg-whitein templates = 0; no googleapis/gstatic in dist; woff2 self-hostedgit diff master -- apps libs= 0)Notes for review
deliverables/visual-mockups/implemented/(local, gitignored)