Skip to content

fix(auth): prevent long quota note text from overflowing account names - #10087

Merged
farion1231 merged 1 commit into
farion1231:mainfrom
jimpablo:fix/auth-center-quota-note-overflow
Nov 29, 2026
Merged

farion1231 merged 1 commit into
farion1231:mainfrom
jimpablo:fix/auth-center-quota-note-overflow

Conversation

@jimpablo

@jimpablo jimpablo commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Human Note / 本人说明

在实机验证 #10073 的时候把界面切到德文 + 宽松密度,看到授权中心里像「切到这个号后才能查额度」(Wechsle zu diesem Konto, um sein Kontingent abzufragen)以及手动模式下的「点刷新查询额度」这种较长的提示文案会直接往左边溢出去,盖在账号邮箱上面,而且截断后悬停也看不到完整句子。查了一下 AccountQuotaColumn 的 note 分支,发现 span 在 flex-col + self-end 下带了右外边距 me-[calc(var(--auth-quota-reset)+var(--auth-quota-gap))],但 max-w-full 没把这段右外边距减掉,导致超长文案向左撑出了列宽。这个小 PR 只把 max-w 改成减去右外边距并补上 title 悬停提示,同时在 AccountQuotaColumn 对应的单测里补上回归用例,不改其他状态、文案和后端。

Summary / 概述

Fix leftward overflow and missing hover tooltip for long localized note strings in Auth Center's AccountQuotaColumn (src/components/settings/auth/AccountQuota.tsx):

  • Cause: In state.kind === "note", the <span> sits inside .auth-quota-col.auth-quota-col-static (flex-col) with self-end and me-[calc(var(--auth-quota-reset)+var(--auth-quota-gap))], while constraining width with max-w-full (from fix(auth): give account details room in the auth center rows #9369). Because max-w-full resolves to 100% of the column width without subtracting the trailing margin, long translations across 6 of 8 locales (en, de, ja, ko, tr, ru for authCenter.agy.quotaNotCurrent and/or quota.manualIdle) overflow leftward by up to var(--auth-quota-reset) + var(--auth-quota-gap) (62px default / 68px comfortable) over the account login/email and have no title tooltip when truncated.
  • Changes:
    • Change max-w-full to max-w-[calc(100%-var(--auth-quota-reset)-var(--auth-quota-gap))] so the note stays within the static column width while keeping right-edge alignment with the value slot unchanged for shorter text.
    • Add title={state.text} on the note <span> (consistent with state.kind === "failed"'s reason line) so truncated notes can be read on hover.
    • Audited adjacent static states (failed, loading) across all 8 locales and both densities: neither uses self-end or me-[...], neither overflows/wraps, and failed's reason line already uses truncate + title={state.reason}.
  • Verification:
    • Verified rendered bounding-box geometry with the compiled Tailwind stylesheet in both headless Chromium (Blink) and macOS WKWebView (WebKit) across default/comfortable densities, normal/wide (>=800px)/narrow (<=560px) container widths, RTL, and all 8 locales (0 overflows after fix; exact right-edge alignment with sibling rows value cells preserved).
    • Added a unit test under describe("AccountQuotaColumn") in tests/components/AuthCenterGroups.test.tsx covering both explicit state={{ kind: "note", text: ... }} and idle (quota.manualIdle) note rendering (.auth-quota-col-static, bounded max-w, me-[...], truncate, self-end, no max-w-full, and title).

Related Issue / 关联 Issue

Refs #10073

(同步修复 #9369 引入的 AccountQuotaColumn note 分支 max-w-full 未扣除右外边距的问题。)

Screenshots / 截图

Before / 修改前 After / 修改后
德文等 6 种语言在标准/宽松密度下 note 长译文向左溢出最多 var(--auth-quota-reset) + var(--auth-quota-gap)(62px / 68px),盖住左侧账号邮箱,且无悬停全文提示 note 宽度被限制在 100% - var(--auth-quota-reset) - var(--auth-quota-gap) 内,在列内正常省略截断、不遮挡账号名,短文案右对齐位置不变,悬停 title 可查看完整提示

Checklist / 检查清单

  • pnpm typecheck passes / 通过 TypeScript 类型检查
  • pnpm format:check passes / 通过代码格式检查(同时通过 pnpm knip、pnpm build:renderer、pnpm test:unit 348/348 files, 4626/4626 tests)
  • cargo clippy passes (if Rust code changed) / 通过 Clippy 检查(如修改了 Rust 代码)(N/A — 本 PR 仅修改前端组件与前端单元测试,未改动 Rust 代码)
  • Updated i18n files if user-facing text changed / 如修改了用户可见文本,已更新国际化文件(N/A — 无用户可见文案改动)

@farion1231 farion1231 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM,感谢您的贡献!

@farion1231

farion1231 commented Nov 29, 2026 •

Copy link
Copy Markdown
Owner

感谢修复!长译文下额度提示压住账号名的原因找得很准,宽度扣掉右侧留白正好对上,还顺手补了悬停提示和回归测试。已合并,会随下个版本发布。

@farion1231
farion1231 merged commit cc325d9 into farion1231:main Nov 29, 2026
8 checks passed
@jimpablo
jimpablo deleted the fix/auth-center-quota-note-overflow branch December 2, 2026 14:23
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.

2 participants