Skip to content

fix(ui): add the global reset layer and align form/button geometry with the prototype - #159

Merged
argszero merged 1 commit into
mainfrom
fix/global-reset-layer
Sep 11, 2026
Merged

argszero merged 1 commit into
mainfrom
fix/global-reset-layer

Conversation

@argszero

Copy link
Copy Markdown
Owner

Summary

Adds the global reset layer that docs/prototype/aitokenpool-console.html
(lines 53–72) defines but which was dropped wholesale during the site-wide UI
migration, and fixes the form/button geometry that depended on it.

Because the reset was missing, every form control without a class fell back
to the browser's native rendering. Measured with a headless per-element
computed-style probe at 1912×836, the most visible cases were:

element before after = prototype
#login-email h 19px, radius 0, border 2px inset rgb(118,118,118), bg browser default h 43.59px, padding 10px 12px, radius 8px, 1px solid var(--border)
.auth-tabs button (未选中) border 2px outset rgb(0,0,0) (native 3D button) border 0px none
#guest-browse-btn h 34 h 40 (matches .btn)
#login-form .btn-primary h 34, padding 8px 16px, min-height auto h 40, padding 0 16px, min-height 40px

A census over all 9 views counted 108 browser-default-styled controls before
this change and 0 after
(excluding checkbox/radio, which the prototype also
leaves to accent-color).

This PR addresses host rant 2026-09-11T22:01:43"UI 重设计遗漏:全站缺「全局 reset 层」,导致 26 个裸表单控件裸露浏览器默认样式(登录页/共享管理/设置最明显)".

Related Issue

No issue — driven by the host rant 2026-09-11T22:01:43+08:00 (project aitokenpool), per CONTRIBUTING.md §开发流程 ("EMRG 自动实现 → 本地测试全绿 → 提交 PR(引用 rant 时间戳)").

Changes

ui/css/style.css

  • add the reset layer exactly as the prototype specifies:
    img, svg { display:block; max-width:100% }, a { color:inherit; text-decoration:none },
    button { font:inherit; cursor:pointer; border:0; background:none; color:inherit },
    input, select, textarea { font:inherit }, p { text-wrap:pretty },
    h1,h2,h3 { text-wrap:balance }.
    These are element selectors, so their specificity stays below the existing
    .btn / .input class rules and already-styled components are unaffected
    (verified, see Tests).
    The prototype's :focus-visible line is not duplicated — the impl already
    has an equivalent rule; the comment on site records that decision.
  • add .num { font-family: var(--mono); font-variant-numeric: tabular-nums }.
    Only .table .num existed, so .num outside a table (#wallet-forever,
    #tx-count) had lost its mono/tabular alignment — that is why the gap was
    never noticed.
  • add .row { display:flex; align-items:center; gap:10px; flex-wrap:wrap }.
    The markup already used class="row" in 6 button rows (共享上架 / 充值 /
    申请加额) and the class had no rule at all — buttons sat edge to edge and
    did not wrap.
  • add .divider (the prototype's own class name) as a shared rule with the
    historical .login-divider alias, and lift .avatar out of the
    .user-chip .avatar descendant selector.
  • align .btn (min-height:40px; padding:0 16px; font-size:13.5px; inline-flex; gap:7px), .btn-sm (32px / 0 11px) and .input
    (padding:10px 12px; font-size:13.5px) with the prototype.
  • write the auth-tab border/background out explicitly: those two buttons
    deliberately carry no .btn class (they are tabs, not buttons), so they were
    the ones rendering the native 3D border.

ui/index.html

  • add class="input" to the 12 login / register / verify / forgot inputs
    (consistent with the other 47 already-classed inputs across the site, and the
    approach the rant itself recommends).
  • rename the login divider login-dividerdivider (both are supported; the
    prototype name is used going forward).
  • bump the cache-bust ?v=20260911-3?v=20260911-4 (5 refs).

Note on scope: the rant's per-view inventory (e.g. "8 裸控件 in view-sharing")
does not match the actual markup — those inputs already had class="input" at
HEAD. The accurate count is 27 classless controls, of which 12 are text-ish
and all 12 are on the login/register/verify/forgot family
; that is the set
fixed here. The one cosmetic drift the rant also flagged (.avatar display
grid in the prototype vs flex in the impl) is left as is deliberately, to
avoid changing the sidebar user card's layout in a reset-layer PR.

  • 功能/修复说明
  • 涉及配置/数据结构的改动已同步示例文件 — not applicable: UI-only change, no config or data-structure change (backend contract untouched)

Tests

  • cargo test 全部通过 — 148 passed; 0 failed
  • cargo fmt --check 通过
  • cargo clippy --all-targets — no warnings
  • 新增/更新了单元测试(如适用)— not applicable for CSS; instead the change
    is verified by measurable probes:
node --check ui/js/{app,api,data,i18n}.js          # all 4 OK
i18n parity: ZH 762 keys == EN 762 keys, 0 unresolved    # js/i18n.js untouched
cache-bust ?v=20260911-4 in ui/index.html                # 5/5 refs consistent

computed-style probes (headless Chrome, 1912×836, 9 views, dark+light):
  browser-default-styled controls      before 108  ->  after 0
  classless TEXT-ish controls          before  27  ->  after 0
    (remaining 15 classless controls are checkbox/radio, each covered by an
     ancestor-scoped rule: .chip input(8) / .check-line input(5) /
     .checkbox-line input(1) / .checkbox input(1))
  `.row` button rows measured 18, spacing/top misaligned 0
  native 3D (inset/outset) borders remaining 0
  A/B vs HEAD, identity-keyed over 310 elements x 10 computed fields:
    visible svg/img resized: 0       (the reset's display:block is inert here)
    geometry changes: 39, all of them the intended prototype-parity fixes
    (nav-item 37->39.59 from font:inherit, auth tab 34->36.8, .btn-ghost 27->40,
     .num column widths, .input row heights)
    border-radius changes: 0, font-family changes: only Arial->system stack

Checklist

  • 分支命名符合约定(feat/ /fix/ /docs/ ...)— fix/global-reset-layer
  • Commit message 使用 Conventional Commits 格式 — fix(ui): add the global reset layer and align form/button geometry with the prototype
  • 单一职责,改动最小化 — one root cause (missing reset layer) + the geometry that depended on it; no opportunistic refactor
  • PR 目标分支 main

…th the prototype

The whole global reset layer from docs/prototype/aitokenpool-console.html
(lines 53-72) was dropped during the site-wide UI migration, so every form
control without a class fell back to the browser's native rendering:
`#login-email` measured 19px high, radius 0, `2px inset rgb(118,118,118)`
border, and the classless auth tab rendered a `2px outset` 3D border.
Headless computed-style probes over all 9 views found 108 such controls
before this change and 0 after.

Changes:
- add the missing reset layer (img/svg, a, button, input|select|textarea,
  p/h1-h3 text-wrap) exactly as the prototype specifies. Element selectors
  keep specificity below the existing .btn/.input class rules.
- add the missing `.num` rule (mono + tabular-nums) — only `.table .num`
  existed, so `.num` outside a table lost its alignment.
- add the missing `.row` rule (flex, gap 10px, wrap) — the markup already
  used `class="row"` in 6 button rows and it had no styling at all.
- add `.divider` as an alias of the historical `.login-divider`, and lift
  `.avatar` out of the `.user-chip` descendant selector.
- align `.btn` (min-height 40px, padding 0 16px, font-size 13.5px, inline
  flex), `.btn-sm` (32px / 0 11px) and `.input` (padding 10px 12px,
  font-size 13.5px) with the prototype, and write the auth-tab
  border/background out explicitly.
- give `class="input"` to the 12 login/register/verify/forgot inputs and
  rename the login divider to `.divider`; bump the cache-bust to
  20260911-4.

Verified: cargo test 148/148, cargo fmt --check, cargo clippy, node --check
on all four ui/js bundles, i18n ZH/EN key sets exactly equal (762/762).
Computed-style A/B against HEAD shows the reset resized no SVG icon and
introduced no geometry change other than the intended prototype parity
fixes.
@argszero
argszero merged commit f46882c into main Sep 11, 2026
1 check passed
@argszero argszero mentioned this pull request Sep 11, 2026
14 tasks
argszero added a commit that referenced this pull request Sep 11, 2026
Release the global reset layer fix (PR #159, rant 2026-09-11T22:01:43).

- Cargo.toml + Cargo.lock: 0.7.21 -> 0.7.22
- ui/index.html: cache-bust 20260911-4 -> 20260911-5 (5 refs)
- CHANGELOG.md: v0.7.22 entry

Gates: cargo test 148/148, cargo fmt --check, cargo clippy,
node --check x4, i18n ZH 762 == EN 762.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant