Skip to content

fix(ag-grid-table): restore pager focus and update TreeTable tests for antd 6.7.0 - #46669

Merged
hainenber merged 2 commits into
apache:masterfrom
seunggabi:fix/tree-table-pager-focus-antd
Nov 28, 2026
Merged

hainenber merged 2 commits into
apache:masterfrom
seunggabi:fix/tree-table-pager-focus-antd

Conversation

@seunggabi

Copy link
Copy Markdown
Contributor

SUMMARY

sharded-frontend-tests (2), (3) and (8) currently fail on master, and on PRs that include the latest master and run the frontend tests: 8 tests under plugins/plugin-chart-ag-grid-table/src/TreeTable/.

Two PRs crossed:

In @rc-component/pagination 1.7.0 the focusable control is no longer the <li> but the link or button inside it.

This is also a real bug, not only outdated tests. TreeTablePager restores focus to the current page when the control in use goes away or turns disabled (for example "Next" on the last page). It did that with focus() on .ant-pagination-item-active, which is the <li>. That element is no longer focusable, so focus was not restored. The selector now targets the focusable control inside the item.

Test updates, following the new pager:

  • Controls are looked up by role and accessible name (Page 2, Next Page, …) instead of the title of the <li>.
  • Tab-order expectations now report the inner button.
  • A disabled "Previous" has tabindex="-1" instead of no tabindex.
  • Behavior change to confirm: Space on a page number now changes the page, the same as Enter, because the pager items are exposed as buttons. The old test asserted that Space does nothing ("platform pager: Enter only"). It was passing only because focus() on the <li> no longer did anything. I updated it to assert that Space changes the page once, and updated the component comment. If Enter-only is still wanted for this pager, I can change the component instead.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A (keyboard focus behavior, covered by tests)

TESTING INSTRUCTIONS

cd superset-frontend && npm run test -- plugins/plugin-chart-ag-grid-table/src/TreeTable

Local results:

  • master: the CI failures reproduce (for example 5 of 14 in TreeTablePager.test.tsx).
  • With only the test updates: 1 failure, the focus-restore test ("when the control used goes away ... the new current page takes focus").
  • With the component fix: 26 suites and 488 tests pass.

I verified this in Jest only, not in a browser.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

…r antd 6.7.0

antd 6.7.0 (apache#46269) pulls @rc-component/pagination 1.7.0, which moves keyboard focus from the pager list item to the link or button inside it. TreeTablePager (apache#46490) still called focus() on the list item, so focus was no longer restored to the current page when the control in use turned disabled. Target the focusable control instead, and update the tests for the new accessible names, tab stops and Space activation.
@codeant-ai-for-open-source

Copy link
Copy Markdown
Contributor

CodeAnt  CodeAnt PR Risk

🟢  Low Risk

  • The PR appears safe to merge; no actionable issues were identified in the review.

Assessed commit: f72d33abb962

@codecov

codecov Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.42%. Comparing base (9969fe9) to head (a559735).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #46669      +/-   ##
==========================================
+ Coverage   86.23%   86.42%   +0.19%     
==========================================
  Files        3146     3183      +37     
  Lines      220018   222606    +2588     
  Branches    52110    52996     +886     
==========================================
+ Hits       189725   192385    +2660     
+ Misses      26823    26751      -72     
  Partials     3470     3470              
Flag Coverage Δ
javascript 83.41% <100.00%> (+0.51%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

@seunggabi
seunggabi requested a review from hainenber November 28, 2026 08:35

@hainenber hainenber left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM for now. Merge to unblock mainline's CI but just in case the fix here breaks author's vision, you might need to follow up with him at @DamianPendrak

@hainenber
hainenber merged commit 1f02203 into apache:master Nov 28, 2026
76 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants