Skip to content

chore: Migrate PropertyFilter tokens to internal Token#4754

Draft
ernst-dev wants to merge 1 commit into
mainfrom
dev-v3-ernstka-property-filter-token-migration
Draft

chore: Migrate PropertyFilter tokens to internal Token#4754
ernst-dev wants to merge 1 commit into
mainfrom
dev-v3-ernstka-property-filter-token-migration

Conversation

@ernst-dev

Copy link
Copy Markdown
Member

Description

Replace PropertyFilter's inline token implementation with the shared internal Token component (src/token/internal.tsx), following the same pattern established in b24a0ee (file-token migration).

What changed:

  • src/property-filter/filtering-token/index.tsx: The local TokenGroup component's token-box rendering (the inner <div class="token"> + content div + action button) is now delegated to InternalToken with role="presentation" (the outer div[role="group"] still provides the accessibility grouping). __customContent carries the popover-trigger content and the dismiss/edit button; __tokenBoxClassName applies the filtering-token's own border/background/radius classes on top of the token-box mixin; disableInnerPadding removes the token-box default padding so the content div's own padding takes effect.
  • src/property-filter/filtering-token/styles.scss: Removed the border-inline-start divider from .dismiss-button, .inner-dismiss-button, and .edit-button. This is the one intentional visual change: the divider between the token label and the dismiss/edit button is gone.

What is NOT changed:

  • Public API surface of PropertyFilter (no prop changes, no interface changes)
  • Accessibility attributes: role="group", aria-label, aria-disabled on the outer group wrapper are all preserved exactly
  • The internal Token component (src/token/internal.tsx) — not touched
  • Grouped-token / and-or operation rendering and dismiss behavior
  • Test-util selectors (filtering-token-dismiss-button, filtering-token-inner-dismiss-button, etc.) — preserved by keeping TokenDismissButton with its original class names

Related links, issue #, if available: n/a

How has this been tested?

Unit tests: All 345 existing PropertyFilter tests pass (17 test suites including filtering-token.test.tsx with 14 tests). No tests weakened. No snapshot tests affected (no snapshot tests in this suite).

Visual parity: Captured before/after screenshots of property-filter/property-filter-tokens-permutations dev page (single token, token with operation, grouped tokens, long labels, disabled states). Pixel-by-pixel diff: zero differences (PIL ImageChops.difference bounding box = None). The only intentional visual change — divider removal — is confirmed by code inspection of the removed border-inline-start line in styles.scss.

Evidence screenshots:

  • /home/ernstka/workplace/chat-bubble-reference/pf-tokens-before-permutations.png
  • /home/ernstka/workplace/chat-bubble-reference/pf-tokens-after-permutations.png

Build: gulp build succeeds. TypeScript compilation clean (tsc --noEmit no errors). ESLint clean on changed files.

Review checklist

The following items are to be evaluated by the author(s) and the reviewer(s).

Correctness

  • Changes include appropriate documentation updates. — No public-facing documentation changes needed; this is an internal refactor.
  • Changes are backward-compatible if not indicated, see CONTRIBUTING.md. — ✅ No public API changes. The one intentional visual change (divider removal) is by design.
  • Changes do not include unsupported browser features, see CONTRIBUTING.md. — ✅ No new browser features used.
  • Changes were manually tested for accessibility, see accessibility guidelines. — ✅ role="group", aria-label, aria-disabled on group wrappers preserved exactly. role="presentation" on the inner InternalToken prevents a redundant nested group from being exposed to assistive tech.

Security

Testing

  • Changes are covered with new/existing unit tests? — ✅ All 14 filtering-token unit tests pass. All 345 PropertyFilter tests pass.
  • Changes are covered with new/existing integration tests? — Existing integration tests cover PropertyFilter token behavior.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.60%. Comparing base (bcde582) to head (ee831c8).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4754      +/-   ##
==========================================
- Coverage   97.60%   97.60%   -0.01%     
==========================================
  Files         951      951              
  Lines       30744    30739       -5     
  Branches    11281    11276       -5     
==========================================
- Hits        30007    30002       -5     
  Misses        690      690              
  Partials       47       47              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

1 participant