Skip to content

Conversation

@samarth93
Copy link

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:

  1. Navigate to a ticket from an "Active View" (with ?view= query parameter)
  2. Switch between tabs (Activity, Comments, History, etc.)

The view query parameter was being removed from the URL, causing the view context to be lost.

Solution

Updated router.replace() calls in useActiveTabManager.ts to preserve route.query alongside route.path in three locations:

  • changeTabTo() function (line 15)
  • setActiveTab() function (line 47)
  • Hash watch handler (line 58)

Changes

File: desk/src/composables/useActiveTabManager.ts

Before:

router.replace({ path: route.path });

After:

router.replace({ path: route.path, query: route.query });

Applied to all three router.replace() calls in the file.

Testing

Tested the following flow:

  1. Navigate to tickets list with a view (?view=VIEW-HD+Ticket-001)
  2. Click on a ticket (URL becomes /tickets/1?view=VIEW-HD+Ticket-001)
  3. Switch between different tabs (Activity, Comments, etc.)
  4. Navigate back to the list

Result: View parameter is now preserved throughout the navigation flow ✅

Test Results:

  • ✅ View parameter maintained when switching tabs
  • ✅ View parameter maintained when navigating back to list
  • ✅ Proper navigation context preserved across tab operations

Fixes frappe#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.

Changes:
- Updated router.replace() calls in useActiveTabManager.ts to preserve
  route.query alongside route.path
- Ensures view context is maintained during tab navigation
- Applies to changeTabTo(), setActiveTab(), and hash watch handler

This fix ensures that when users navigate to a ticket from an Active View
and switch between tabs, the view parameter remains in the URL for proper
navigation context.
@RitvikSardana
Copy link
Member

@pratikb64 please check and confirm

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.

Active View is removed from the query params when the page is reloade

2 participants