Skip to content

fix: keep filter chips in sync with the URL on back and forward - #3699

Merged
AlexAndBear merged 7 commits into
mainfrom
fix/search-chips-stale
Oct 13, 2026
Merged

AlexAndBear merged 7 commits into
mainfrom
fix/search-chips-stale

Conversation

@AlexAndBear

@AlexAndBear AlexAndBear commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

Description

  • ItemFilter: watches its route query and re-syncs its selection on every change, e.g. Back/Forward or a tag link, and emits selectionChange only when the selection really changed. This keeps the chips in sync in all views that use it: search, Favorites, Shared with me, Shared with others and admin Users.
  • ItemFilterToggle: follows its query param on every route change instead of only on mount, so "Title only" turns off after Back.
  • ItemFilterInline: follows its query param on every route change, so the "Hidden Shares" filter on Shared with me switches back after Back.
  • Deprecation: ItemFilter still exposes setSelectedItemsBasedOnQuery, now marked @deprecated because the filter follows the route query by itself.
  • Search list: drops its manual chip re-sync workaround, which the ItemFilter route sync now covers.
  • Admin Users: resets the page with router.replace instead of push when a filter changes, so Forward keeps working after going Back.

Related Issue

How Has This Been Tested?

  • test environment: unit tests (Vitest), browser tests (Playwright) against a local OpenCloud
  • test case 1: ItemFilter clears its selection and emits selectionChange when its query param is removed from the route
  • test case 2: ItemFilterToggle resets its active state when its query param is removed from the route
  • test case 3: the search list clears the tag filter chip when q_tags is removed from the route (real router and real ItemFilter)
  • test case 4: admin Users resets the page with router.replace and not router.push when the groups filter changes
  • test case 5: ItemFilterInline resets to the first option and emits toggleFilter when its query param is removed from the route
  • test case 6: ItemFilter still exposes the deprecated setSelectedItemsBasedOnQuery
  • test case 7: Back and Forward with filters in search, Favorites, Shared with me (including the hidden shares filter), Shared with others and admin Users keep the chips in sync with the URL

Types of changes

  • Bugfix
  • Enhancement (a change that doesn't break existing code or deployments)
  • Breaking change (a modification that affects current functionality)
  • Technical debt (addressing code that needs refactoring or improvements)
  • Tests (adding or improving tests)
  • Documentation (updates or additions to documentation)
  • Maintenance (like dependency updates or tooling adjustments)

@AlexAndBear AlexAndBear changed the title fix: keep search filter chips in sync with the URL on back and forward fix: keep filter chips in sync with the URL on back and forward Oct 12, 2026

@JammingBen JammingBen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes some of the filters, but not all: The "hidden"-filter on the Shared with me page and the user search filter in the admin-settings don't follow back.

Comment thread packages/web-pkg/src/components/ItemFilter.vue
@AlexAndBear

Copy link
Copy Markdown
Member Author

Hidden filter fixed in 33fdcd1; the admin user search is fixed in #3753.

@AlexAndBear
AlexAndBear merged commit a6d8ffb into main Oct 13, 2026
27 checks passed
@AlexAndBear
AlexAndBear deleted the fix/search-chips-stale branch October 13, 2026 16:56
@openclouders openclouders mentioned this pull request Oct 13, 2026
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

2 participants