Skip to content

UI: Sync FilterBar pills with URL values#67082

Open
suyua9 wants to merge 1 commit into
apache:mainfrom
suyua9:fix/filterbar-sync-initial-values
Open

UI: Sync FilterBar pills with URL values#67082
suyua9 wants to merge 1 commit into
apache:mainfrom
suyua9:fix/filterbar-sync-initial-values

Conversation

@suyua9
Copy link
Copy Markdown
Contributor

@suyua9 suyua9 commented May 18, 2026

Fix FilterBar reconciliation so existing pills update their visible value when external URL state rewrites initialValues.

The existing effect already added new pills and removed cleared values. This also replaces the value for an already-rendered pill, which avoids stale UI when URL-driven table filters change externally.

Tests:

  • ./node_modules/.bin/eslint --quiet src/components/FilterBar/FilterBar.tsx src/components/FilterBar/FilterBar.test.tsx
  • ./node_modules/.bin/vitest run src/components/FilterBar/FilterBar.test.tsx

No newsfragment added; this is a small UI bug fix.


Was generative AI tooling used to co-author this PR?
  • Yes — OpenAI Codex

Generated-by: OpenAI Codex following the guidelines

@boring-cyborg boring-cyborg Bot added the area:UI Related to UI/UX. For Frontend Developers. label May 18, 2026
@suyua9 suyua9 force-pushed the fix/filterbar-sync-initial-values branch from a4ca2d4 to ab083c4 Compare May 18, 2026 03:21
@choo121600
Copy link
Copy Markdown
Member

For UI-related contributions, attaching before/after screenshots to the PR description would help reviewers a lot.

Could you update the description with screenshots when you have a chance?

@potiuk potiuk added the ready for maintainer review Set after triaging when all criteria pass. label May 18, 2026
@pierrejeambrun pierrejeambrun added backport-to-v3-2-test Mark PR with this label to backport to v3-2-test branch and removed ready for maintainer review Set after triaging when all criteria pass. labels May 21, 2026
Copy link
Copy Markdown
Member

@pierrejeambrun pierrejeambrun left a comment

Choose a reason for hiding this comment

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

Thanks for the fix! Direction looks good and the test covers the new behavior. One small nit below, nothing blocking.

For UI-related contributions, attaching before/after screenshots to the PR description would help reviewers a lot.

Could you update the description with screenshots when you have a chance?

That. Or give more context / reproduction step about what this is actually fixing. I tried manually editing the state filter in the URL and refresh the page, but that's already working on main, so I'm not sure what this is solving yet.

};

const queryPillText = (value: string) =>
screen.queryAllByText((_, element) => element?.textContent === `State: ${value}`).at(-1);
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.

Nit: the getAllByText(...).at(-1) selector is a little fragile since it depends on the order of text matches in the rendered DOM. Could we add a data-testid on the pill in FilterPill.tsx (something like data-testid={\filter-pill-${filter.config.key}}) and use screen.getByTestId in the test? Makes the test more readable too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:UI Related to UI/UX. For Frontend Developers. backport-to-v3-2-test Mark PR with this label to backport to v3-2-test branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants