fix: preserve boolean search tags in routes#107
Conversation
WalkthroughThe changes introduce dedicated serialization and deserialization helpers for route tags in the routing system. The API is updated to use Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
✨ Simplify code
📝 Coding Plan
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.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
test/assets/router-helper.test.ts (1)
1-48:⚠️ Potential issue | 🟡 MinorTests correctly verify encoding/decoding, but consider integration verification for the full route flow.
The unit tests appropriately verify:
- Encoding of special characters (
&→%26,:→%3A)- Multiple tags as array format
- Round-trip encoding via
parseRouteTagsHowever, these tests operate on the raw route object without verifying the full flow through Vue Router. While integration tests exist elsewhere in the test suite (e.g.,
test/pages/posts.test.ts), they don't specifically test tag encoding through the router'snavigateTo(). Consider adding a focused integration test to confirm the encoding behavior works correctly end-to-end when used withnavigateTo({ ...postsRoute })in actual page navigation.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@test/assets/router-helper.test.ts` around lines 1 - 48, Add an integration test that verifies generatePostsRoute and parseRouteTags behavior when routed through Vue Router by calling navigateTo with the generated route; specifically, create a test that builds a posts route via generatePostsRoute (using tags with characters like '&' and ':'), calls navigateTo({ ...route }) or the app's router push equivalent, then inspects the actual browser/router URL or the router.currentRoute location and uses parseRouteTags on the resolved query to assert tags were encoded/decoded correctly. Locate usage around generatePostsRoute and parseRouteTags in tests and invoke navigateTo (or router.push) so the assertion covers end-to-end routing rather than only the raw route object.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@test/assets/router-helper.test.ts`:
- Around line 1-48: Add an integration test that verifies generatePostsRoute and
parseRouteTags behavior when routed through Vue Router by calling navigateTo
with the generated route; specifically, create a test that builds a posts route
via generatePostsRoute (using tags with characters like '&' and ':'), calls
navigateTo({ ...route }) or the app's router push equivalent, then inspects the
actual browser/router URL or the router.currentRoute location and uses
parseRouteTags on the resolved query to assert tags were encoded/decoded
correctly. Locate usage around generatePostsRoute and parseRouteTags in tests
and invoke navigateTo (or router.push) so the assertion covers end-to-end
routing rather than only the raw route object.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: f2df44d9-efc9-48bf-bccd-cf51b0ef7e90
📒 Files selected for processing (4)
assets/js/RouterHelper.tspages/posts/[domain].vuepages/premium/saved-posts/[domain].vuetest/assets/router-helper.test.ts
Summary
tagsquery string to repeatedtagsquery paramsValidation
pnpm exec vitest run "test/assets/router-helper.test.ts"Context
Summary by CodeRabbit