Skip to content

feat(ui): redesign login page as two-column layout + rework sidebar (rant 2026-09-11, PR2) - #153

Merged
argszero merged 1 commit into
mainfrom
feat/ui-login-sidebar
Sep 11, 2026
Merged

feat(ui): redesign login page as two-column layout + rework sidebar (rant 2026-09-11, PR2)#153
argszero merged 1 commit into
mainfrom
feat/ui-login-sidebar

Conversation

@argszero

Copy link
Copy Markdown
Owner

Summary

PR2 of the front-end adaptation to the new high-fidelity prototype — login page redesign (single centered card → two-column split) + sidebar rework, per the rollout order suggested by the host's rant.

Rant addressed (verbatim quote of the relevant sections):

【六、建议实施顺序(分批 PR,避免一次巨型改动不可控)】

  • PR2:登录页重设计(左右分栏 + 品牌叙事 + 端点卡片)+ 侧边栏重构(brand/nav-group/foot/user-chip)
  1. 登录页(布局大改:单卡片 → 左右分栏
  • 左侧品牌叙事区(.login-brand):logo tile「AT」+ eyewear + 大标题「不要让 token plan 白白浪费。」+ 副文案 + 4 条卖点(多协议网关互转 / 三档透明计费 / 共享分成 90/10 / 企业点数管控)+ 网关端点卡片区(三种 API 类型各一 chip + code:POST /v1/chat/completionsPOST /v1/responsesPOST /anthropic/v1/messages,下方「任意端点 · 全部厂商模型 / SSE / 非流式」+ 厂商列表 DeepSeek·智谱 GLM·Claude·GPT·Gemini·Qwen·Kimi)+ 底部 meta(单 Rust 二进制 + SQLite · Docker 一键启动 · 中英双语前端)
  • 右侧表单区(.login-panel):标题「进入平台」+ 登录/注册 tab 切换(data-auth)+ 邮箱/密码/记住我 + 「进入平台」+ 分隔线「或」+ 「先逛逛模型市场」+ 底部提示
  • 主题切换按钮在右上角(.login-theme,毛玻璃)
  • 保留功能:注册表单、验证码页、找回密码表单(原型只画了登录/注册 tab,这 4 个既有流程一个都不能丢,按新视觉重排即可)
  • ⚠️ 原型登录页脚注「产品原型 · 演示数据 · 任意邮箱密码可登录」属于原型描述,线上不得照抄
  1. 侧边栏
  • 品牌区 .sb-brand(logo tile + AITokenPool + 角色副标题 #mode-label)
  • 导航 #nav(保留现有 data-view + 角色过滤;新增 .nav-group「角色专属」分组标题,管理/运营归入)
  • 「模型市场」项带 badge(模型数量)
  • 底部 .sb-foot:用户 chip(头像 + 昵称 + 点数余额)+ 主题切换 icon-btn + 退出登录全宽按钮
  • ⚠️ 原型底部的「切换角色视图(演示)」.role-switch 与「演示数据 · PROTOTYPE」.demo-badge 是原型演示专用,线上不得实现(线上靠真实 role 控制)

Rant timestamp: 2026-09-11T16:23:43.625143+08:00 (project aitokenpool).

Changes

Login page — two-column layout

Left brand panel (.login-brand): logo tile + wordmark, eyebrow line, serif headline, sub-copy, four selling-point chips, and the gateway endpoint card listing three API types with their real routes plus the vendor strip and footer meta.

The three declared endpoints are accurate against the backend, not copied blindly: src/gateway.rs registers /v1/chat/completions, /v1/responses (P3-A) and /anthropic/v1/messages, so the three-row card is honest. (This matters because the rant explicitly warns about the settings page: 「需与后端实际支持的路由对齐后再定…没有则按实际能力呈现,勿虚标」.)

Right form panel (.login-panel): title, subtitle, and a login / register tab switcher. The tabs drive the existing showAuthForm() function, so the register / verify-code / forgot-password flows are all preserved with zero behavioural change — the rant's hard requirement that 「这 4 个既有流程一个都不能丢」 is met. Login-only extras (divider / guest entry / footer / tip) live in #auth-login-extras and hide when another form is showing.

Theme toggle moved to the top-right as .login-theme (frosted glass), sharing one toggleTheme() helper with the sidebar button.

Prototype demo content intentionally omitted: no "any email/password works" footnote, no PROTOTYPE badge, no role switcher.

Sidebar

Restructured to the prototype shell — .sb-brandnav.sb-foot (user chip + theme toggle + full-width logout). The theme toggle moves from the sidebar header into the footer, matching the prototype. Marketplace gains a model-count badge sourced from the same data as the list (Live.models when signed in, guest catalogue otherwise). Nav items, user chip and avatar were restyled to the prototype (34px avatar, --accent-soft background, --fg-soft hover). The existing role-based filtering and shortcut-key hints are untouched.

Compatibility & preserved behaviour

  • 12 new i18n keys added to both zh and en (login.title, login.tab.login/register, login.brand.*, login.gw.*, login.panel.sub); key parity verified at 701/701 with no missing entries in either language
  • Guest mode preserved via a new setGuestSidebar() helper that hides only the account controls and keeps the theme toggle reachable (it used to live in the header)
  • Responsive: brand panel collapses below 900px, endpoint cards stack below 560px (prototype rules)
  • Dead rules from the old implementation removed (.logo, .sidebar-bottom, .sidebar-top)

Verification

  • cargo test — 148/148 passed
  • cargo fmt --check / cargo clippy --all-targets -- -D warnings — clean
  • node --check on all ui/js/*.js — OK
  • CSS integrity: 0 undefined var() references, balanced braces/parens
  • HTML tag balance check — clean
  • i18n: 701 zh / 701 en keys, 0 missing in either direction; every data-i18n* key in index.html resolves
  • Rendered headless in Chrome and visually inspected in dark and light themes, across the login tab and the register tab, plus the signed-out app shell — the register-tab render caught a real defect (login-only extras rendering above the register fields), which is fixed in this PR
  • A 25-assertion DOM-contract check covers the acceptance items: two-column structure, all four auth forms preserved, sidebar shell, no prototype demo elements, preserved features

Remaining rant work

PR3 shared component layer · PR4 dashboard/market/sharing · PR5 wallet/transactions · PR6 settings/admin/ops.

Second step of the front-end adaptation to the new prototype (rant
2026-09-11T16:23:43, PR2 of the suggested rollout order: login page +
sidebar).

Login page (single centered card -> two-column split):
- Left: brand narrative panel (.login-brand) with logo tile, eyebrow,
  serif headline "don't let your token plan go to waste", sub-copy, four
  selling-point chips, the gateway endpoint card (.gw) listing all three
  API types (OpenAI Chat / OpenAI Responses / Anthropic Messages) with
  their real routes, the vendor list, and the footer meta line
- Right: form panel (.login-panel) with a login / register tab switcher
  (.auth-tabs) that reuses the EXISTING register flow via showAuthForm --
  no new behaviour, the register, verify-code and forgot-password forms
  are all preserved and still reachable
- Login-only extras (divider, guest entry, footer, tip) are grouped in
  #auth-login-extras and hidden when another auth form is shown, so the
  register fields no longer render below the guest button
- Theme toggle added top-right (.login-theme, frosted glass), sharing one
  toggleTheme() helper with the sidebar button
- Prototype-only demo content deliberately NOT implemented: no
  "any email/password works" footnote, no PROTOTYPE badge, no role switcher

Sidebar:
- Restructured to the prototype shell: .sb-brand (logo tile + title +
  role subtitle), nav, then .sb-foot (user chip + theme toggle + full-width
  logout) -- the theme toggle moves from the header into the footer
- .nav-group is now the prototype's monospace uppercase group label
- Marketplace nav item shows a model-count badge (.nav-count) sourced from
  the same data as the list (Live.models when signed in, guest catalogue
  otherwise)
- nav item / user chip / avatar restyled to the prototype (34px avatar,
  accent-soft background, --fg-soft hover)

Compatibility:
- 12 new i18n keys added to both zh and en (login.title, login.tab.*,
  login.brand.*, login.gw.*, login.panel.sub); key parity verified 701/701
- Guest mode still works: setGuestSidebar() hides only the account
  controls, keeping the theme toggle reachable
- Responsive: the brand panel collapses below 900px (prototype rule) and
  the endpoint cards stack below 560px
- Dead rules from the old implementation removed (.logo,
  .sidebar-bottom, .sidebar-top)

Gates: cargo test 148/148, cargo fmt --check, cargo clippy -D warnings,
node --check on all ui/js files, CSS var integrity (0 undefined refs) and
HTML tag balance. Rendered headless in both themes to confirm the layout.
@argszero
argszero merged commit e33bf2e into main Sep 11, 2026
1 check passed
@argszero
argszero deleted the feat/ui-login-sidebar branch September 11, 2026 09:00
argszero added a commit that referenced this pull request Sep 11, 2026
发布 v0.7.21(rant 2026-09-11T21:03:06)。

- Cargo.toml / Cargo.lock: 0.7.20 → 0.7.21
- ui/index.html: cache-bust ?v=20260911-2 → ?v=20260911-3(5 处资源引用)
- CHANGELOG.md: 新增 v0.7.21 条目,概括 6 片全站 UI 重设计
  (#152 OKLCH 设计 token 层 / #153 登录页左右分栏 + 侧边栏 / #154 共享组件层 /
  #155 仪表盘·市场·共享 / #156 钱包·交易 / #157 设置·管理·运营)

本次为纯前端改动,后端契约未变;部署结构不变(数据库仍留 NAS,不启用 WAL)。

Gates: cargo test 148 passed / cargo fmt --check clean / cargo clippy clean /
node --check x4 / i18n ZH-EN 762=762 exact parity.

Co-authored-by: argszero <argszero@argszerodeMac-mini.local>
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