Conversation
RN 重構過程中淺色主題太刺眼,先把 useColorScheme 鎖死回傳 dark(不看裝置系統設定), Colors.dark 改用柔和的 #121212/#e6e6e6 取代刺眼的純黑/純白。 Icon.tsx 原本用 react-native 原生 Text 顯示非 emoji 符號(✕←→›↺),預設黑字在深色背景 幾乎全隱形,改成從 Themed 匯入 Text 讓它跟著主題文字色走。 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
對照 apps/web 的 Notes/QuestionBook/Stats 畫面與 QuestionReview 元件,複用 packages/core 既有的 getWrongQuestions/getWrongEntries/getSavedQuestions 等函式。 Notes tab 比照 Home tab 用 view 狀態機切換 notes/wrongbook/savedbook/review/ savedpractice,review 與 savedpractice 直接複用既有的 Quiz 元件。Stats tab 是 單一唯讀畫面,熱力圖改用 RN ScrollView horizontal。刪除不再使用的 ComingSoon.tsx。 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
packages/core 的 applyAnswer 是 web/mobile 共用邏輯,直接改成正確就刪除錯題紀錄。 apps/web 登入時的伺服器端寫入(api/progress/answer/route.ts)是另外手刻同一套規則的 Prisma 交易,沒有共用 applyAnswer,這次一起同步改掉。GRADUATE_BOX 常數與 UI 上的 「熟練度 X/3」顯示已跟著移除(移出時機改成單次答對後,這個數字永遠停在 1,留著只會 誤導);WrongEntryMeta.box 型別欄位與 Prisma 資料庫欄位刻意保留不動,避免多一次 schema migration,一律寫 1、不再遞增。 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
把 apps/web/src/lib/stages.ts 的吉祥物成長階段資料搬進 packages/core(web/mobile 共用, Phase 1 漏搬的部分)。新增 apps/mobile 的 Mascot/GrowthHistory/AccountHeader 三個元件, AccountHeader 對照 web 版的頭像裁切換算公式整段照搬,互動層換成 react-native-gesture-handler 的 PanGestureHandler(拖曳)+ @react-native-community/slider (縮放)+ expo-image-picker(選照片,URI 轉 Blob 交給 Clerk setProfileImage)。 app/_layout.tsx 加上 GestureHandlerRootView,app.json 補上 expo-image-picker 的 plugin 設定。profile.tsx 補齊帳號設定(登出/刪除帳號)與成長史展開/收合。 這是全計畫風險最高、完全沒有真機驗證過的一個 phase,需要重新原生建置才能測。 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
回應真機測試後的三項設計回饋:AccountHeader 移除 USER.XXXXXXXX 顯示;profile.tsx 把成長史(吉祥物/XP/展開清單)拆成跟「個人資料」各自獨立的卡片,不再擠在同一張卡片裡; Icon.tsx 從 emoji 換成 lucide-react-native(跟 apps/web Icons.tsx 同源的線型圖示), 用逐一深層匯入(lucide-react-native/icons/xxx)避免 barrel import 讓 Metro 把全部 3000+ 個圖示一起打包進 bundle。 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
修復 AccountHeader.tsx 選照片上傳丟出的 RN Blob 例外:fetch(uri).blob() 沒辦法從 ArrayBuffer 建立 RN 認得的 Blob,改用 XMLHttpRequest 讀取本機圖片 URI。同時處理三項 真機測試發現的樣式問題:縮放拉桿在深色主題下配色補齊(原本吃套件預設淺色)、頭像編輯框的 dashed border 改成純色實線(RN 對圓形疊虛線框是已知平台限制)、改名輸入框補上文字顏色 (TextInput 沒有走 Themed 自動套色,預設黑字在深色底看不見)。 另外三項介面回饋:拿掉縮放拉桿旁的放大鏡圖示;成長史從卡片內展開改成 Modal 彈窗顯示; 移除輸入框顏色問題後的最終確認。 使用者已在 iOS/Android 模擬器完整測試通過(含用 adb push 測試圖片驗證 Android 上傳路徑)。 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
Next review available in: 30 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (10)
📝 WalkthroughWalkthroughThe PR replaces mobile placeholders with notes, review, statistics, and profile experiences; adds shared XP stages; changes wrong-question removal to immediate deletion after correct answers; updates web integrations; and introduces dark-mode, gesture, avatar, and icon support. ChangesMobile learning and progress experience
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant NotesScreen
participant QuestionBook
participant Quiz
User->>NotesScreen: Open Notes tab
NotesScreen->>QuestionBook: Open wrong or saved questions
QuestionBook->>Quiz: Start sampled review
Quiz-->>NotesScreen: Finish or exit review
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
packages/core/src/progressCalc.ts (1)
43-54: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winUpdate the review-mode copy in
apps/mobile/screens/Quiz.tsx.
The banner still says答對升熟練度,答錯重來,練到最高熟練度才畢業, butapplyAnswernow removes a wrong question on the first correct answer. The review text should match the new immediate-removal rule.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/core/src/progressCalc.ts` around lines 43 - 54, Update the review-mode banner text in Quiz so it reflects that answering correctly once removes the question from the wrong-question list, rather than requiring maximum proficiency; leave the answer-processing logic in applyAnswer unchanged.apps/web/src/screens/Quiz.tsx (1)
100-104: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winUpdate stale review-mode text to match the new immediate-removal behavior.
The review banner (line 143) says "答對升熟練度,答錯重來,練到最高熟練度才畢業" (correct answers increase mastery, practice until highest mastery to graduate), but the new behavior removes a wrong entry on a single correct answer — there is no mastery progression or graduation threshold. The result hint (line 102) similarly implies ongoing mastery progression with "繼續練會更熟練". These texts are now misleading to users.
📝 Suggested text updates
<div className="review-banner"> <Icon name="rotate-ccw" size={15} /> - 錯題重練模式:答對升熟練度,答錯重來,練到最高熟練度才畢業 + 錯題重練模式:答對一次就從錯題本畢業,答錯重來 </div><p className="result-hint"> {isReview && questions.some((q) => progress.wrongIds[q.id]) - ? '還沒畢業的錯題會留著,繼續練會更熟練!' + ? '還沒答對的錯題會留著,再練一次就能畢業!' : '你的星球又長大了一點,明天也要回來澆灌它喔!'} </p>Also applies to: 140-145
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/web/src/screens/Quiz.tsx` around lines 100 - 104, Update the review-mode copy in the result hint and review banner near the result rendering to describe immediate removal of a wrong entry after one correct answer, rather than mastery progression, continued practice, or graduation thresholds. Preserve the existing non-review text and conditional behavior.
🧹 Nitpick comments (1)
apps/mobile/app/(tabs)/profile.tsx (1)
108-117: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winDuplicate XP-progress formula also lives in Mascot.tsx.
xpProgresshere recomputes the exact same(xp - stage.min) / (nextStage.min - stage.min)percentage already implemented inapps/mobile/components/Mascot.tsx(progressToNext). Since this PR just movedSTAGES/getStage/getNextStageintopackages/corespecifically to share this logic, consider adding agetStageProgress(xp)helper there and using it from both places, so any future change to the progress calc doesn't need to be kept in sync manually.♻️ Proposed consolidation
// packages/core/src/stages.ts +export const getStageProgress = (xp: number) => { + const stage = getStage(xp) + const next = getNextStage(xp) + return next ? Math.min(100, Math.round(((xp - stage.min) / (next.min - stage.min)) * 100)) : 100 +}// apps/mobile/app/(tabs)/profile.tsx - const xpProgress = nextStage - ? Math.min(100, Math.round(((progress.xp - stage.min) / (nextStage.min - stage.min)) * 100)) - : 100; + const xpProgress = getStageProgress(progress.xp);🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/mobile/app/`(tabs)/profile.tsx around lines 108 - 117, Consolidate the duplicated XP percentage calculation by adding a shared getStageProgress(xp) helper alongside getStage and getNextStage in packages/core. Update the profile component’s xpProgress calculation and Mascot.tsx’s progressToNext logic to use this helper, preserving the existing clamping and completed-stage behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/mobile/components/AccountHeader.tsx`:
- Around line 175-193: Update saveName and the confirm button using saveName so
an all-whitespace name cannot be submitted silently: disable the confirm action
when nameValue.trim() is empty, while preserving the existing validation guard
and saving behavior for non-empty names.
---
Outside diff comments:
In `@apps/web/src/screens/Quiz.tsx`:
- Around line 100-104: Update the review-mode copy in the result hint and review
banner near the result rendering to describe immediate removal of a wrong entry
after one correct answer, rather than mastery progression, continued practice,
or graduation thresholds. Preserve the existing non-review text and conditional
behavior.
In `@packages/core/src/progressCalc.ts`:
- Around line 43-54: Update the review-mode banner text in Quiz so it reflects
that answering correctly once removes the question from the wrong-question list,
rather than requiring maximum proficiency; leave the answer-processing logic in
applyAnswer unchanged.
---
Nitpick comments:
In `@apps/mobile/app/`(tabs)/profile.tsx:
- Around line 108-117: Consolidate the duplicated XP percentage calculation by
adding a shared getStageProgress(xp) helper alongside getStage and getNextStage
in packages/core. Update the profile component’s xpProgress calculation and
Mascot.tsx’s progressToNext logic to use this helper, preserving the existing
clamping and completed-stage behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: c824a6de-f312-4c20-a5aa-c46d48f40953
⛔ Files ignored due to path filters (1)
yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (29)
apps/mobile/app.jsonapps/mobile/app/(tabs)/notes.tsxapps/mobile/app/(tabs)/profile.tsxapps/mobile/app/(tabs)/stats.tsxapps/mobile/app/_layout.tsxapps/mobile/components/AccountHeader.tsxapps/mobile/components/ComingSoon.tsxapps/mobile/components/GrowthHistory.tsxapps/mobile/components/Icon.tsxapps/mobile/components/Mascot.tsxapps/mobile/components/useColorScheme.tsapps/mobile/components/useColorScheme.web.tsapps/mobile/constants/Colors.tsapps/mobile/package.jsonapps/mobile/screens/Notes.tsxapps/mobile/screens/QuestionBook.tsxapps/mobile/screens/QuestionReview.tsxapps/mobile/screens/Stats.tsxapps/web/src/app/api/progress/answer/route.tsapps/web/src/components/GrowthHistory.tsxapps/web/src/components/Mascot.tsxapps/web/src/components/QuestionReview.tsxapps/web/src/hooks/useProgress.tsapps/web/src/screens/Profile.tsxapps/web/src/screens/Quiz.tsxdocs/rn-migration.mdpackages/core/src/index.tspackages/core/src/progressCalc.tspackages/core/src/stages.ts
💤 Files with no reviewable changes (1)
- apps/mobile/components/ComingSoon.tsx
- Quiz 錯題重練模式的 banner/結算提示文字改為描述「答對一次即從錯題本移除」, 修正舊版 Leitner 盒制熟練度用語與實際邏輯(applyAnswer)不符的問題 - AccountHeader 姓名確認按鈕在輸入全空白時停用,避免靜默失敗 - 新增 packages/core 的 getStageProgress(),收斂 profile.tsx/web 與 mobile Mascot.tsx 三處重複的 XP 進度百分比算式 - 修正 mobile 學習數據頁熱力圖月份標籤欄寬(16px)與格子欄寬(11px)不一致 導致視覺對不齊、看起來像沒有算到最新日期的問題,補上分科成效細分頁的提示文字
Summary by CodeRabbit