Skip to content

Dev#16

Merged
Retsomm merged 5 commits into
mainfrom
dev
Jul 14, 2026
Merged

Dev#16
Retsomm merged 5 commits into
mainfrom
dev

Conversation

@Retsomm

@Retsomm Retsomm commented Jul 14, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • New Features

    • Added an option in Profile settings to clear locally stored progress data.
    • Clearing data now asks for confirmation before proceeding.
    • Account deletion also removes remaining local progress.
  • Improvements

    • Android release builds now support code minification and resource shrinking.
  • Documentation

    • Added functional programming guidelines covering immutability, abstraction, higher-order functions, and concurrency.

Retsomm and others added 3 commits July 14, 2026 10:19
刪除帳號時未清除本機 localStorage 進度,重新登入/註冊時被誤判為
訪客進度並搬遷回新帳號;同時在登出按鈕上方新增手動清除入口。

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
easy-learn Ready Ready Preview, Comment Jul 14, 2026 3:02am

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@Retsomm, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 21 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 7c06139e-cc68-4c97-9836-baa8312b4ccf

📥 Commits

Reviewing files that changed from the base of the PR and between 1b3290e and e8707f4.

📒 Files selected for processing (6)
  • README.md
  • apps/web/src/components/AccountHeader.tsx
  • apps/web/src/hooks/useProgress.ts
  • apps/web/src/index.css
  • apps/web/src/screens/Profile.tsx
  • functional-thinking.md.md
📝 Walkthrough

Walkthrough

Android release builds enable minification and resource shrinking. The web profile can clear local progress manually and after successful account deletion. A new functional-thinking guideline document defines principles for code organization, immutability, abstraction, higher-order functions, and concurrency.

Changes

Mobile build optimization

Layer / File(s) Summary
Configure Android release optimization
apps/mobile/app.json, apps/mobile/package.json
Registers expo-build-properties and enables Android release minification and resource shrinking.

Web local progress clearing

Layer / File(s) Summary
Expose progress reset through App
apps/web/src/hooks/useProgress.ts, apps/web/src/App.tsx
Adds resetLocalProgress, which clears persisted progress and resets in-memory state, then passes it to Profile.
Add Profile clearing actions
apps/web/src/screens/Profile.tsx
Adds a confirmed clear-data action and clears local progress after successful account deletion.

Functional-thinking guidelines

Layer / File(s) Summary
Document functional-thinking rules
functional-thinking.md.md
Defines ACD classification, immutability, stratified design, higher-order functions, and concurrency guidance.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Profile
  participant App
  participant useProgress
  participant localStorage
  Profile->>App: invoke onClearLocalData
  App->>useProgress: call resetLocalProgress
  useProgress->>localStorage: remove persisted progress
  useProgress->>useProgress: reset progress state
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is too vague to describe the changeset and does not identify the main update. Use a specific title summarizing the primary change, such as adding local progress clearing and mobile build property updates.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (2)
apps/web/src/screens/Profile.tsx (1)

20-26: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Add user feedback after clearing local data.

Since clearing local data won't change the UI for a logged-in user (as their screen displays cloud data), consider adding a brief success alert to provide clear feedback that the action was completed. This matches the alert usage in the error handling below.

✨ Proposed refactor
  const handleClearLocalData = () => {
    const confirmed = window.confirm(
      '確定要清除本機暫存的學習資料嗎?此操作無法復原,已同步到雲端的資料不受影響。',
    )
    if (!confirmed) return
    onClearLocalData()
+   alert('已清除本機暫存資料')
  }
🤖 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/Profile.tsx` around lines 20 - 26, Update
handleClearLocalData so that, after onClearLocalData completes for a confirmed
action, it shows a brief success alert to the user; keep the existing
confirmation flow and do not alert when the action is cancelled.
functional-thinking.md.md (1)

49-49: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Avoid requiring map/filter/reduce instead of loops.

This blanket rule can produce less-readable code for early exits, complex control flow, or effectful operations, and may encourage misusing reduce for sequencing side effects. Reword it to prefer the clearest abstraction, while allowing loops when they better express the behavior.

🤖 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 `@functional-thinking.md.md` at line 49, Revise the “告別手寫迴圈” guideline to
prefer the clearest, most readable collection-processing abstraction rather than
requiring map(), filter(), or reduce(). Explicitly allow loops for early exits,
complex control flow, or effectful operations, and avoid implying that reduce()
should sequence side effects.
🤖 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/web/src/hooks/useProgress.ts`:
- Around line 186-192: Update resetLocalProgress to always remove STORAGE_KEY,
but only call setProgress(defaultProgress) when the current user is a guest.
Preserve the existing signOut flow for account deletion so signed-in users’
active cloud progress is not cleared from in-memory state.

In `@functional-thinking.md.md`:
- Around line 33-35: Update the 防禦性複製 (Defensive copying) section to replace the
blanket deep-copy rule with explicit DTO/schema validation and normalization for
untrusted boundary data. State that only owned portions requiring isolation
should be copied, avoiding unconditional structuredClone() for potentially
non-cloneable values such as functions.
- Line 61: Update the “使用協調原語” guidance to define what Cut means before
presenting it as a coordination primitive, and revise the Queue description to
state its actual contract, including single-consumer or explicit synchronization
requirements. Avoid implying Queue guarantees ordering or completion beyond that
contract.

---

Nitpick comments:
In `@apps/web/src/screens/Profile.tsx`:
- Around line 20-26: Update handleClearLocalData so that, after onClearLocalData
completes for a confirmed action, it shows a brief success alert to the user;
keep the existing confirmation flow and do not alert when the action is
cancelled.

In `@functional-thinking.md.md`:
- Line 49: Revise the “告別手寫迴圈” guideline to prefer the clearest, most readable
collection-processing abstraction rather than requiring map(), filter(), or
reduce(). Explicitly allow loops for early exits, complex control flow, or
effectful operations, and avoid implying that reduce() should sequence side
effects.
🪄 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: 38373bc8-c8d3-4cc3-afc3-7a094b0de4b3

📥 Commits

Reviewing files that changed from the base of the PR and between ff9030e and 1b3290e.

⛔ Files ignored due to path filters (7)
  • apps/mobile/assets/store/feature-graphic-1024x500.png is excluded by !**/*.png
  • apps/mobile/assets/store/screenshot-1.png is excluded by !**/*.png
  • apps/mobile/assets/store/screenshot-2.png is excluded by !**/*.png
  • apps/mobile/assets/store/screenshot-3.png is excluded by !**/*.png
  • apps/mobile/assets/store/screenshot-4.png is excluded by !**/*.png
  • apps/mobile/assets/store/screenshot-5.png is excluded by !**/*.png
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (6)
  • apps/mobile/app.json
  • apps/mobile/package.json
  • apps/web/src/App.tsx
  • apps/web/src/hooks/useProgress.ts
  • apps/web/src/screens/Profile.tsx
  • functional-thinking.md.md

Comment thread apps/web/src/hooks/useProgress.ts Outdated
Comment thread functional-thinking.md.md Outdated
Comment thread functional-thinking.md.md Outdated
- resetLocalProgress 只在訪客身分才清空記憶體 progress,避免清本機快取時誤將已登入使用者的雲端進度歸零
- 修正登出瞬間的競態:訪客模式寫回 effect 會把切換前的舊 progress 復活寫回 localStorage,蓋掉剛清空的內容,導致刪除帳號後重新登入又被 migrate-local 搬回舊資料
- 登入頁新增「清除本機資料」按鈕,作為額外保險
- 個人資料頁移除使用者 ID 顯示;成長史清單改為彈窗顯示,不再是下方展開
- 修正 functional-thinking 技能筆記三處措辭(防禦性複製、集合處理、協調原語)
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@Retsomm
Retsomm merged commit de30882 into main Jul 14, 2026
3 checks passed
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