diff --git a/docs/BUG_HISTORY.md b/docs/BUG_HISTORY.md index ec481d034..5abc89b72 100644 --- a/docs/BUG_HISTORY.md +++ b/docs/BUG_HISTORY.md @@ -29005,5 +29005,6 @@ - 修复:`email-otp-login.tsx` 改为方向 A 单栏,去掉「验证码登录 / 密码登录」页签和首屏的说明句,注册、忘记密码放进密码登录一步;所有登录逻辑(发码、校验、密码、注册、重设、两步验证、首个密码、同意记录后再跳转、管理后台)不变。新 `login-headline.tsx`:标题全文在服务端 HTML 里,打字机效果不改变尺寸,减少动态效果或脚本两秒没到时直接显示全文。新 `login-early-input.ts`:脚本到达前填的邮箱、勾的同意、按下的「用邮箱继续」都记下,脚本到后接着走;验证码格子和登录客户端改为按需加载、空闲时预热;登录页只引入自己需要的样式,标题字体表只含用到的字;协议链接不预取。负责人 2026-11-22 定:主按钮保持全站陶土色;首屏只留大标题;去掉同意勾选框,改为按钮下方一行「继续即表示同意《用户协议》和《隐私政策》」,同意记录照旧在登录成功后、进入首页前写一次(`enterApp` → `/api/account/consent`,管理后台不记录)。 - 下载量(生产构建,gzip):首屏 JS 270.7 KB → 173.6 KB(-36%),挡首次绘制的 CSS 95.6 KB → 65.4 KB(-32%)。 - 验证与防复发:`frontend/tests/login-direction-a-2139.test.tsx`(9 条:首屏无页签、标题在服务端 HTML、减少动态效果、脚本前输入保留与补发、各步可达、只引必要样式且不同步引入登录客户端、无负边距);7 个旧测试和 `tests/test_frontend_theme_contract.py` 按原值、新值、原因更新。本地生产构建 4 种尺寸 × 浅深色 × 6 种状态截图,拦住脚本的慢网实测:先填先按,脚本到后自动进入验证码一步。 +- 补充:总验收时手机深色截图标题末尾留着一条竖线(打字效果结束后光标闪三下仍保持可见,看起来像残留);改为闪三下后消失。 - 关联记录:BUG-2139 第一步、BUG-1662、BUG-1663、BUG-1664、BUG-1670、BUG-2138。 - 修复版本:`claude/login-a-2139`。 diff --git a/frontend/src/app/globals.css b/frontend/src/app/globals.css index 534c8013a..72163b20f 100644 --- a/frontend/src/app/globals.css +++ b/frontend/src/app/globals.css @@ -2660,7 +2660,9 @@ input:not([type="radio"]):not([type="checkbox"]):not([class^="ant-"]):not([class .auth-headline .is-pending { visibility: hidden; } .auth-headline .is-caret { position: relative; } .auth-headline .is-caret::after { position: absolute; top: .14em; right: -.12em; bottom: .1em; width: 2px; background: currentColor; content: ""; animation: auth-caret-blink 1s steps(1) infinite; } -.auth-headline .is-caret-done::after { animation-iteration-count: 3; } +/* BUG-2139 follow-up: after three blinks the caret goes away (it read as a leftover bar at the end of the headline). */ +.auth-headline .is-caret-done::after { animation: auth-caret-out 1s linear 3 forwards; } +@keyframes auth-caret-out { 0%, 49.9% { opacity: 1; } 50%, 100% { opacity: 0; } } @keyframes auth-caret-blink { 50% { opacity: 0; } } .auth-or { display: flex; align-items: center; gap: var(--space-3); color: var(--color-ink-tertiary); font-size: var(--type-caption); } .auth-or::before, .auth-or::after { flex: 1; height: 1px; background: var(--color-border); content: ""; } diff --git a/frontend/src/components/login-headline.tsx b/frontend/src/components/login-headline.tsx index 1c46ba0b3..6219d0f46 100644 --- a/frontend/src/components/login-headline.tsx +++ b/frontend/src/components/login-headline.tsx @@ -14,7 +14,7 @@ const TOTAL = LOGIN_HEADLINE.length; * wait server HTML and first client render: the whole headline, hidden by CSS for * up to 2 s while the page script loads (shown at once with reduced motion) * typing characters appear one by one; the hidden rest still holds the final layout - * done every character shown; the caret blinks three times and stays + * done every character shown; the caret blinks three times and then disappears * static the whole headline, no caret: reduced motion, a page that took longer than * the CSS wait to come alive, or a second visit within this page */ diff --git a/frontend/tests/login-direction-a-2139.test.tsx b/frontend/tests/login-direction-a-2139.test.tsx index 67b99e22d..fdf4f363e 100644 --- a/frontend/tests/login-direction-a-2139.test.tsx +++ b/frontend/tests/login-direction-a-2139.test.tsx @@ -61,7 +61,11 @@ test("the headline text is in the server HTML, waiting at its final size", () => assert.equal(css.match(/\[data-typing="wait"\]/g)?.length, 1); assert.match(css, /@keyframes auth-headline-show \{ to \{ visibility: visible; \} \}/); assert.match(css, /\.auth-headline \.is-pending \{ visibility: hidden; \}/); - assert.match(css, /\.auth-headline \.is-caret-done::after \{ animation-iteration-count: 3; \}/); + // 原值: the finished caret blinked three times and stayed visible + // 新值: it blinks three times and ends hidden (fill-mode forwards on a keyframe that ends at opacity 0) + // 原因: owner's final check 2026-11-22 read the lingering bar as a leftover at the end of the headline + assert.match(css, /\.auth-headline \.is-caret-done::after \{ animation: auth-caret-out 1s linear 3 forwards; \}/); + assert.match(css, /@keyframes auth-caret-out \{ 0%, 49\.9% \{ opacity: 1; \} 50%, 100% \{ opacity: 0; \} \}/); // Desktop breaks after the comma; phones wrap on their own. assert.match(css, /@media \(max-width: 640px\) \{\s*\.auth-headline-break \{ display: none; \}/); assert.deepEqual([...LOGIN_HEADLINE_LINES], ["在星图与当下之间,", "找到此刻的方向"]);