fix: preserve query parameters when switching tabs (#2790) #2798
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Fixes #2790 - Active View is removed from the query params when the page is reloaded
When navigating to a ticket from an Active View and switching between tabs, the query parameters (including view parameter) were being removed from the URL. This caused the view context to be lost, breaking the navigation flow.
Problem
When users:
?view=query parameter)The view query parameter was being removed from the URL, causing the view context to be lost.
Solution
Updated
router.replace()calls inuseActiveTabManager.tsto preserveroute.queryalongsideroute.pathin three locations:changeTabTo()function (line 15)setActiveTab()function (line 47)Changes
File:
desk/src/composables/useActiveTabManager.tsBefore:
After:
Applied to all three
router.replace()calls in the file.Testing
Tested the following flow:
?view=VIEW-HD+Ticket-001)/tickets/1?view=VIEW-HD+Ticket-001)Result: View parameter is now preserved throughout the navigation flow ✅
Test Results: