Conversation
- useProgress.ts 接上 Clerk:未登入沿用 AsyncStorage 訪客模式,登入後打 apps/web 既有的五支 API(migrate-local/answer/save-toggle/finish-level/finish-review), 伺服器回傳的權威 Progress 覆蓋本地樂觀更新 - 新增 context/ProgressContext.tsx(ProgressProvider)讓 Home/Profile 兩個 tab 共用同一份 progress state,避免各自呼叫 hook 造成搬遷邏輯重複觸發 - 修正搬遷時重讀 AsyncStorage 可能撞上尚未落盤的 race,改用記憶體內的 progressRef - iOS/Android 模擬器皆已實測:訪客進度登入後正確搬進資料庫且前後一致 - docs/roadmap.md、docs/rn-migration.md 同步更新目前進度與除錯記錄 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
|
Warning Review limit reached
Next review available in: 40 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 (2)
📝 WalkthroughWalkthroughThe mobile app now centralizes progress in a provider, hydrates visitor data from AsyncStorage, synchronizes signed-in progress with server APIs, and lets Home and Profile consume the same state. Migration and roadmap documentation were updated to record the completed flow and validation. ChangesMobile progress synchronization
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant App
participant ProgressProvider
participant AsyncStorage
participant Clerk
participant ProgressAPI
participant HomeProfileTabs
App->>ProgressProvider: mount around navigation tree
ProgressProvider->>AsyncStorage: hydrate local progress
Clerk->>ProgressProvider: expose signed-in state and token
ProgressProvider->>ProgressAPI: migrate or load authenticated progress
HomeProfileTabs->>ProgressProvider: read shared progress
HomeProfileTabs->>ProgressAPI: sync progress mutations
ProgressAPI-->>ProgressProvider: return server-authoritative progress
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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: 2
🤖 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/app/`(tabs)/profile.tsx:
- Around line 72-82: Update the signed-in profile view’s outer View in the
hydrated branch to use containerStyle instead of styles.container, matching the
other profile branches and preserving safe-area insets.
In `@apps/mobile/hooks/useProgress.ts`:
- Around line 121-136: Gate the signed-in server-sync branches in all four
progress mutation callbacks, including answerQuestion, on migratedRef.current
before calling getToken or posting. Keep local progress updates immediate, and
allow each POST to start only after the initial progress fetch and migrate-local
flow has completed.
🪄 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: 5c426396-cc30-43c4-864d-b786e988c6d7
📒 Files selected for processing (7)
apps/mobile/app/(tabs)/index.tsxapps/mobile/app/(tabs)/profile.tsxapps/mobile/app/_layout.tsxapps/mobile/context/ProgressContext.tsxapps/mobile/hooks/useProgress.tsdocs/rn-migration.mddocs/roadmap.md
- 已登入分支改用 containerStyle,避免內容被狀態列遮住 - 四個進度異動函式(answer/toggleSaved/finishLevel/finishReview)改為等 migrate-local 搬遷完成才打伺服器 API,避免搬遷回應蓋掉剛登入就作答的結果 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Summary by CodeRabbit
New Features
Documentation