Skip to content

feat: sync list filters with url params - #859

Draft
capfroggy wants to merge 1 commit into
o2sdev:mainfrom
capfroggy:codex/url-filter-sync
Draft

feat: sync list filters with url params#859
capfroggy wants to merge 1 commit into
o2sdev:mainfrom
capfroggy:codex/url-filter-sync

Conversation

@capfroggy

Copy link
Copy Markdown

What does this PR do?

  • My bugfix

Related Ticket(s)

Key Changes

  • Adds a framework-agnostic useUrlFilters hook in @o2s/ui for namespaced query param serialization/parsing.
  • Supports clean URLs, repeated params for multi-select filters, {ns}_page as a 1-based page value, and {ns}_view for non-default view modes.
  • Migrates ticket-list, order-list, invoice-list, product-list, and notification-list to use URL-backed filters.
  • Preserves unrelated query params and uses router.replace(..., { scroll: false }) to avoid browser history pollution.
  • Adds utility coverage for parsing, serialization, reset cleanup, repeated values, and optional filter keys.
  • Adds a changeset for the five public list block packages.

Side effects:

  • When a list block loads with matching namespaced URL params, it fetches the filtered data once on mount.
  • Query params are namespaced with the component id, falling back to the block name, so multiple blocks can coexist without colliding.

How to test

  1. Run npm ci.
  2. Run npm run lint.
  3. Run npm run test.
  4. Open pages with list blocks and apply filters/pagination/view mode changes.
  5. Confirm the URL updates with namespaced params and that refreshing or opening the URL restores the filtered view.
  6. Confirm unrelated query params remain intact when filters change.

Local checks I could run in this environment:

  • git diff --check
  • prettier@3.8.1 --check with the repo's main formatting options and --no-config because local workspace deps were unavailable
  • A tsx smoke test importing parseUrlFilters, parseUrlViewMode, and serializeUrlFilters directly

I could not run the full monorepo npm run lint / npm run test locally because this checkout environment does not have npm, node_modules, or the internal @o2s/* config packages installed.

Media (Loom or gif)

  • N/A

@opirebot

opirebot Bot commented Aug 7, 2026

Copy link
Copy Markdown

😅 Ups... the issue does not have any reward yet!

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 4654c919-045a-4242-92c4-2f620ee09956

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

[Feature] Bidirectional URL query params sync for list block filters

1 participant