Conversation
- TikTok iOS UA 為 musical_ly_<版本>,底線破壞 \b 邊界導致漏判,改為 musical_ly[\d._]* - 漏判使 TikTok iOS 使用者看不到「改用外部瀏覽器開啟」安裝指引 - prefers-reduced-motion 一併停用安裝步驟使用的 animate-pulse-soft - 補 TikTok iOS UA 偵測單元測試 測試:pnpm --filter @app/ratewise exec vitest run pwaInstallGuide 與 PwaInstallGuide 共 13 項通過
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
|
✅ SEO 審計通過!所有 2026 標準驗證項目都符合要求。
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fb65e74609
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| --- | ||
| '@app/ratewise': patch | ||
| --- |
| ['facebook', /\b(FBAN|FBAV|FBIOS|FB_IAB|FB4A)\b/i], | ||
| ['line', /\bLine\//i], | ||
| ['tiktok', /\b(TikTok|BytedanceWebview|musical_ly)\b/i], | ||
| ['tiktok', /\b(TikTok|BytedanceWebview|musical_ly[\d._]*)/i], |
There was a problem hiding this comment.
這裡為了支援 musical_ly_37.0.0 移除了整個 alternation 的結尾邊界,因此 UA 只要含有 TikToker 或 BytedanceWebviewX 這類以現有 token 開頭的字串,也會被判成 TikTok 內建瀏覽器。因為 getPwaInstallEnvironment 在 inAppBrowser !== null 時即使平台是 desktop/unknown 也會顯示外部瀏覽器指引,這些 UA 會看到錯誤的 PWA 提示;建議只放寬 musical_ly 的版本後綴,其他 token 仍保留完整邊界。
Useful? React with 👍 / 👎.
- musical_ly[\d._]* 會誤判 musical_lyric,改為要求 _<版本> 才命中 - 補 trill_<版本> TikTok iOS 形式;TikTok/BytedanceWebview 維持邊界 - 測試改 table-driven,含 musical_lyric/Safari 反例 測試:pwaInstallGuide 與 PwaInstallGuide 18 項通過、tsc 通過
|
✅ SEO 審計通過!所有 2026 標準驗證項目都符合要求。
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7f09dfe730
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ['facebook', /\b(FBAN|FBAV|FBIOS|FB_IAB|FB4A)\b/i], | ||
| ['line', /\bLine\//i], | ||
| ['tiktok', /\b(TikTok|BytedanceWebview|musical_ly)\b/i], | ||
| ['tiktok', /\b(TikTok|BytedanceWebview|musical_ly_[\d.]+|trill_[\d.]+)/i], |
There was a problem hiding this comment.
這個改動把舊有可命中的 musical_ly 單獨 token 改成只接受 musical_ly_ + 版本數字;若 TikTok UA 仍是舊規則原本支援的 ... musical_ly JsSdk/...,detectInAppBrowser 會回傳 null,PwaInstallGuide.getGuideCopy 便走 iOS/Android 一般安裝文案而不是外部瀏覽器文案(apps/ratewise/src/components/PwaInstallGuide.tsx:42),導致內建瀏覽器使用者仍看不到正確外開指引。建議在支援版本後綴時保留 bare musical_ly 分支。
Useful? React with 👍 / 👎.
摘要
Hotfix:TikTok iOS 內建瀏覽器未被辨識,導致該環境使用者看不到「改用外部瀏覽器開啟」安裝指引;並補齊 prefers-reduced-motion 對安裝步驟脈動動畫的停用。
由並行 Cursor code-review 子代理(composer-2.5-fast,獨立 worktree)在審查 #430 動畫指引功能時發現並修復。
根因
apps/ratewise/src/utils/pwaInstallGuide.ts的 TikTok UA 規則/\b(...|musical_ly)\b/i:TikTok iOS 的 UA 為musical_ly_37.0.0,musical_ly後接底線_(屬 word char),末端\b永遠不成立 → 漏判 →inAppBrowser為 null → 不顯示外開指引與右上角動畫。變更
/\b(TikTok|BytedanceWebview|musical_ly[\d._]*)/i,吃掉版本後綴。index.css:prefers-reduced-motion區塊加入.animate-pulse-soft(安裝步驟 1 使用),完成減動覆蓋。Test plan
vitest run pwaInstallGuide.test.ts PwaInstallGuide.test.tsx→ 13/13 通過🤖 Generated with Claude Code