Skip to content

fix(ratewise): 修復 360px 底部留白死類與 v2 小高度視口鍵盤遮擋(#662、QA-J J-1) - #675

Merged
s123104 merged 1 commit into
experiment/ratewise-product-2026h2from
fix/662-small-viewport-layout
Jul 7, 2026
Merged

fix(ratewise): 修復 360px 底部留白死類與 v2 小高度視口鍵盤遮擋(#662、QA-J J-1)#675
s123104 merged 1 commit into
experiment/ratewise-product-2026h2from
fix/662-small-viewport-layout

Conversation

@s123104

@s123104 s123104 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary

修復兩處小螢幕佈局缺陷(同區域、單一 PR):

  1. [bug] max-[360px] 任意變體死類:repo Tailwind object screens 下不產 CSS,≤360px 底部 padding 失效 #662 max-[360px] 死類:repo Tailwind screens 為 object 格式(含 raw 高度斷點),max-[...] 任意變體不會產出 CSS——layout.tsmax-[360px]:pb-[calc(84px+...)] 是死類,≤360px 裝置底部留白停留 56px;且 design-tokens.test.ts 以字串斷言反向固化死類。
  2. QA-J J-1(Medium):v2 等值雙列於 360×740/360×800 小高度視口,鍵盤底列被固定底導覽遮 66px/6px。

Closes #662

修法

#662:slim 斷點進 SSOT(比照 #660 narrow/xnarrow 模式)

  • breakpointTokens.screens 新增 slim: { raw: '(max-width: 360px)' }tailwind.config.ts 同步註冊
  • navigationTokens.mainScroll.paddingBottomClass 改用 slim:pb-[calc(84px+env(safe-area-inset-bottom,0px))] 生效類名
  • 測試不再斷言 token 字串,改以 postcss + tailwindcss 編譯層驗證:類名必須實際產出 @media (max-width:360px) 下的 84px padding-bottom 規則(同 object screens 條件,死類回歸即紅燈)

J-1:v2 壓縮梯次補齊(749px 恆定根因)

根因:v2 佈局(雙列卡、sparkline、4×4 keypad)全部只有 short:(≤700px)一級壓縮;701–805px 高度帶(360×740、360×800 落此區間)無任何梯次生效,佈局採未壓縮的固定高度(鍵高 54px、sparkline 72px、gap-3……),keypad 底緣的文件位置恆為 749px——視口再矮也不縮,735px 以下必被 fixed bottom nav(含 56px main 留白)遮住。非百分比高度問題,是固定高度+梯次覆蓋缺口

補齊兩級(short: 以下既有梯次零變動):

梯次 斷點 收斂內容
snug(新,≤805px) 輕度 容器 gap 12→8、sparkline 72→56、keypad pt 12→8、quick chips 36→32
compact(既有斷點,v2 新增消費) 加深 列內距 py-3→py-1.5、鍵高 54→48

ConverterV2Skeleton 同步梯次避免載入期跳動。snug 於 config 宣告在 compact 之前,維持「更小視口後蓋」的 cascade 順序。

實測(dev 環境量測)

視口 修正前 keypad 底緣 vs nav 頂緣 修正後 零捲動 keypad 預算
360×740 741 > 683(遮 58px) 657 ≤ 683 ✅ 36.8% ✅
360×800 749 > 743(遮 6px) 705 ≤ 743 ✅ 37.0% ✅
390×844(守門) 304px 不變 36.0% ✅
375×667(守門) 234px 不變(short) 35.1% ✅
430×932(守門) 304px 不變 32.6% ✅
  • ≤360px main computed padding-bottom 實測 84px(dist CSS 亦確認產出 @media (max-width:360px) 規則)
  • 前後截圖(360×740):screenshots/j1-before-360x740.png(+鍵整排被 nav 蓋住)→ screenshots/j1-after-360x740.png(4×4 全鍵可見;QA 暫存不入版控,AGT-QA-01)

測試

  • pnpm --filter @app/ratewise exec vitest run:190 檔 9222 passed 全綠
  • converter-v2.spec.ts e2e:28 passed(desktop+mobile),零捲動矩陣擴充 360×740/360×800 並新增 ≤360px 寬 84px 留白守門
  • pre-commit(lint-staged/typecheck/format/SSOT/002 記分)與 pre-push(typecheck/test/build:ratewise)全過

附註

  • changeset:patch(small-viewport-layout-fix
  • 002:+1(reward-rw-662-slim-deadclass-j1-snug-tier),累計 +188

Made with Cursor

- breakpointTokens 新增 slim(≤360px)raw 斷點,main 底部留白改用 slim: 生效類名取代 max-[360px] 死類
- design-tokens 測試改為 postcss+tailwindcss 編譯層斷言,驗證實際產出 max-width:360px 的 84px 規則
- v2 補齊 snug(≤805px)/compact(≤760px)壓縮梯次,360×740/360×800 鍵盤底列不再被固定底導覽遮蓋
- ConverterV2Skeleton 同步梯次;e2e 零捲動矩陣擴 360×740/360×800 並守門 84px 留白

測試:typecheck、vitest 9222 passed、converter-v2 e2e 28 passed、dist CSS 產出驗證

Co-authored-by: Cursor <cursoragent@cursor.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

⚠️ Deprecation Warning: The deny-licenses option is deprecated for possible removal in the next major release. For more information, see issue 997.

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

✅ SEO 審計通過!所有 2026 標準驗證項目都符合要求。

  • ✅ Sitemap 2026 標準
  • ✅ Breadcrumb Schema
  • ✅ JSON-LD 結構化數據
  • ✅ 內部連結結構

@s123104
s123104 merged commit 9d2538e into experiment/ratewise-product-2026h2 Jul 7, 2026
11 checks passed
@s123104
s123104 deleted the fix/662-small-viewport-layout branch July 7, 2026 14:09
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