💄 修复日志页统计条窄屏文字重叠 - #2
Closed
RenjiYuusei wants to merge 1 commit into
Closed
Conversation
日志页「范围 / 统计条」在窄屏(移动端)下,统计文字会压到右侧「自动清理超过 N 天 的日志」上。原因是该条为单行 flex justify-between:左侧分组带 min-w-0 会被压缩, 但其中的计数 span 是 shrink-0,被压缩后内容溢出自身盒子并直接画到右侧分组上—— 是溢出,而不是换行或截断,所以两段文字叠在一起。 改为窄屏竖向堆叠(md 以上仍是原来的单行左右分布):两个分组各 w-full 独占一行, 长文本才能在行内截断;「自动清理」分组允许换行,避免超窄屏横向溢出。同时给 「当前 / 实时」两个徽标补 shrink-0 whitespace-nowrap,避免被挤成两行折字;统计 分隔符从全角「,」改为「 ·」,与顶栏一致,在非中文语言下更易读。 真实构建下用 Playwright 复现与验证(vi-VN,400px 宽):修复前两段文字 X 轴重叠 57.6px、Y 轴完全重叠;修复后 400/360/1280 宽在浅色与深色主题下均无重叠、无横向 溢出,桌面端布局不变。 Co-authored-by: RenjiYuusei <daoluc.yy@gmail.com>
Owner
Author
|
Đã chuyển commit này sang nhánh của #1 ( |
RenjiYuusei
deleted the
claude/fix-logger-stats-bar-overlap-3a9b0a21bb688020941d00a98cc7b572
branch
July 26, 2026 19:10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist / 检查清单
背景
用户在移动端(越南语界面)反馈:日志页「范围 / 统计条」里的
Tổng 0,Đã lọc 0(总计 / 已筛选)与右侧Tự động xóa nhật ký cũ hơn …(自动清理超过 N 天的日志)挤在一起、文字互相压字,完全看不清。已在真实构建(
dist/ext+ Playwright)中复现,且与语言无关——英文界面在 400px 宽下同样重叠:根因:该条是单行
flex items-center justify-between。左侧分组带min-w-0会被压缩,但其中的计数span是
shrink-0;分组被压到比内容更窄后,计数文字溢出自身盒子并直接画到右侧「自动清理」分组上——是溢出,不是换行或截断,所以两段文字重叠。
本次改动
src/pages/options/routes/Logger/index.tsx统计条:flex-col+md:flex-row md:items-center md:justify-between),桌面端(≥768px)保持原来的单行左右分布。
w-full md:w-auto,窄屏下各自独占整行,长时间范围文本才能在行内truncate而不是溢出压字。flex-wrap(md:flex-nowrap md:shrink-0),超窄屏(≤360px)时换行而不是横向溢出。shrink-0 whitespace-nowrap,不再被挤成「Hiện / tại」两行折字。,改为·,与顶栏同款写法,在非中文语言下更易读。建议审查重点
py-1.5+gap-1,min-h-[34px]保留)是否符合设计规范预期。shrink-0后,超窄屏由时间范围文本吸收压缩(truncate),已验证 360px 下无溢出。验证
新增单元用例「移动端范围/统计条竖向堆叠,统计与自动清理各自独占整行」按 TDD 先跑失败
(
getByTestId("logger-stats-bar")找不到元素),实现后转绿。真实扩展 + Playwright 一次性验证脚本(
e2e/scratch/,未提交)在 vi-VN 与默认英文下各测 400 / 360 / 1280 宽,另测深色主题,测量两分组包围盒:
即:修复前 X 轴重叠 57.6px,修复后所有测试宽度与两种主题下均
overlapping = false,且内容不超出视口宽度;桌面端仍为单行左右分布。
Screenshots / 截图
窄屏(400px,vi-VN)截图证据(本地
test-results/verify/logger-stats-bar/,按仓库规范不提交):Tổng 0,Đã lọc 0与Tự động xóa nhật ký cũ hơn叠印在同一行,「Hiện tại」徽标被挤成两行。2026-07-25 18:56:40 → 2026… Hiện tại · Tổng 8 · Đã lọc 8,第二行
Tự động xóa nhật ký cũ hơn [7] Ngày,两行清晰分离,徽标单行显示。