Skip to content

Fix 10292#10359

Open
prathamesh-patil-5090 wants to merge 26 commits intocvat-ai:developfrom
prathamesh-patil-5090:fix-10292
Open

Fix 10292#10359
prathamesh-patil-5090 wants to merge 26 commits intocvat-ai:developfrom
prathamesh-patil-5090:fix-10292

Conversation

@prathamesh-patil-5090
Copy link
Copy Markdown
Contributor

Abstract

Fixes #10292

When applying a filter, search, or sort on the Tasks page, the browser history entry was being replaced (history.replace) instead of pushed. This meant the Back button would navigate away from the Tasks page entirely instead of restoring the previous filter state.

Changes

  • tasks-page.tsx: Introduced a setQuery callback (mirroring the pattern from the Jobs page, Flattening job list on a task page #10217) that:
    • Calls history.push when filter, search, or sort changes — so
      each filter change creates a new history entry and Back restores it.
    • Calls history.replace when only page/pageSize changes — pagination
      does not pollute the history stack.
  • Added a useEffect on [updatedQuery, query, isMounted] to re-fetch tasks when the URL changes (e.g., via Back/Forward navigation), keeping data in sync with the URL.
  • All handlers (onApplyFilter, onApplySearch, onApplySorting, Pagination.onChange) now route through setQuery instead of dispatching directly.

Testing

  1. Go to the Tasks page.
  2. Apply a filter/search/sort — note the URL updates.
  3. Apply a second, different filter.
  4. Press the browser Back button — the previous filter state should be
    restored and the task list should update accordingly.
  5. Press Forward — the later filter state should be re-applied.
  6. Changing only the page number should not add a new history entry.

Related

prathamesh-patil-5090 and others added 25 commits November 23, 2025 15:36
Refactor not found components to use a common handleReturn function for navigation.
Remove console log for history length in TaskNotFoundComponent.
Added a new 'Return to Previous Page' button with smart fallback navigation.
Updated link for 'Return to Previous Page' button feature.
Updated the link for the 'Return to Previous Page' button in the changelog.
Updated the pull request link in the changelog.
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.

Pressing back button in browser should apply previous filter state

2 participants