Skip to content

feat: Add release update reminders and tests#62

Merged
bbsngg merged 2 commits intomainfrom
feat/release-update-reminder
Mar 27, 2026
Merged

feat: Add release update reminders and tests#62
bbsngg merged 2 commits intomainfrom
feat/release-update-reminder

Conversation

@bbsngg
Copy link
Copy Markdown
Contributor

@bbsngg bbsngg commented Mar 21, 2026

Summary

  • add release update reminder handling in the sidebar flow
  • keep the update modal wired with a dedicated later action and updated copy
  • add Playwright coverage for GitHub release update notifications

Testing

  • npm run build
  • npm run typecheck
  • npx playwright test test/release-update.spec.ts

@bbsngg bbsngg changed the title Add release update reminders and tests feat: Add release update reminders and tests Mar 21, 2026
@Zhang-Henry
Copy link
Copy Markdown
Collaborator

Code Review

Bug(建议修复后合并)

关闭方式不一致 — backdrop/X 不触发 snooze

VersionUpgradeModal.tsx 中有三种关闭弹窗的方式:

  1. 底部 "Remind Me Later" 按钮 → 调用 onLater(写 localStorage snooze)✅
  2. 遮罩层(backdrop)点击(约第68行)→ 调用 onClose(不写 snooze)❌
  3. 右上角 X 按钮(约第90行)→ 调用 onClose(不写 snooze)❌

用户点击 backdrop 或 X 关闭弹窗后,lastAutoPromptedVersion 阻止当前会话再次弹出,但下次刷新页面时 state 重置、localStorage 没有 snooze 记录,弹窗会立即再次出现。

建议:让 backdrop 和 X 按钮也调用 onLater,或如果"关闭 ≠ 稍后提醒"是有意设计,请在代码中注释说明。

小问题

  • 24小时 setTimeout 在 SPA 中基本不会触发(用户早就刷新了),mount 时的 snooze 检查已经足够处理过期情况。这个 timer 不会造成问题但属于多余逻辑。
  • 测试验证了 localStorage 写入,但没测 snooze 期间刷新不弹窗、snooze 过期后重新弹窗等场景
  • readVersionReminder 作为 useCallback([]) 可以简化为模块级函数

@bbsngg
Copy link
Copy Markdown
Contributor Author

bbsngg commented Mar 27, 2026

Addressed the review feedback in 0e2d094.

Updated:

  • made modal dismissal consistent so backdrop, close button, and the later action all snooze the reminder before update output is shown
  • simplified the sidebar reminder flow by removing the long-lived 24h timeout and moving reminder parsing to a module-level helper
  • added coverage for refresh behavior while snoozed and for expired reminders showing the modal again

Validation:

  • npm run typecheck
  • npx playwright test test/release-update.spec.ts (blocked locally: Playwright Chromium is not installed in this environment; runner requested npx playwright install)

@bbsngg bbsngg merged commit bf118c4 into main Mar 27, 2026
1 check passed
@bbsngg bbsngg deleted the feat/release-update-reminder branch March 27, 2026 14:36
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.

2 participants