[_]: fix/reset the anchor Id when navigating through folders#68
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds a new exported constant ChangesMailbox Reset and Polling Constant
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed: one or more packages not found in the registry. 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.
Warning
CodeRabbit couldn't request changes on this pull request because it doesn't have sufficient GitHub permissions.
Please grant CodeRabbit Pull requests: Read and write permission and re-run the review.
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 `@src/features/mail/MailView.tsx`:
- Around line 55-58: The folder-change reset in MailView is happening too late,
after useListFolderPaginated(folder) has already derived query args with stale
anchorId/unreadFilter. Move this logic out of the MailView useEffect and into
the list-fetching hook path, such as useListFolderPaginated or its query-arg/key
derivation, so changing folder clears or rekeys the query before
useGetListFolderQuery runs. Keep MailView dumb and rendering only, and ensure
the reset behavior is driven by the hook’s state/inputs rather than an
imperative post-render effect.
In `@src/hooks/mail/useListFolderPaginated.ts`:
- Around line 43-58: The new reset behavior in useListFolderPaginated needs
co-located test coverage, and the missing useListFolderPaginated.test.ts should
verify that resetListFolder clears both anchorId and unreadFilter. Add a focused
hook test around useListFolderPaginated that exercises the resetListFolder
callback and asserts the state is fully reset, matching the existing hook’s
reset logic and protecting the folder-navigation flow regression.
🪄 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: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: f801286e-00b4-4e10-8e36-e2c1ed2523bb
📒 Files selected for processing (3)
src/constants.tssrc/features/mail/MailView.tsxsrc/hooks/mail/useListFolderPaginated.ts
Deploying mail-web with
|
| Latest commit: |
3577f9d
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://c81af2f6.mail-web-ea0.pages.dev |
| Branch Preview URL: | https://fix-folder-navigation.mail-web-ea0.pages.dev |
|



Reseting the anchor Id when navigating through folders. It was causing problems because fetching folders with the wrong anchor ID was throwing a 500 error.