Skip to content

feat: add dataReloadBtnLoading input to table and tree table - #897

Merged
fateeand merged 1 commit into
masterfrom
895-table-tree-table-add-datareloadbtnloading-input-so-the-reload-button-keeps-focus-while-data-loads
Oct 29, 2026
Merged

fateeand merged 1 commit into
masterfrom
895-table-tree-table-add-datareloadbtnloading-input-so-the-reload-button-keeps-focus-while-data-loads

Conversation

@fateeand

Copy link
Copy Markdown
Collaborator

Summary

Added a dataReloadBtnLoading input to CpsTableComponent and CpsTreeTableComponent, and passed it to the toolbar reload button as [loading]. While it is true, the native button stays enabled, so it keeps keyboard focus and its focus ring. It ignores clicks and Enter, has aria-busy="true" and shows the loading spinner. Until now apps could only set dataReloadBtnDisabled, which disabled the button, so focus fell back to <body> until the data arrived.

Closes #895


Release notes:

  • added dataReloadBtnLoading input to table and tree table so the reload button keeps keyboard focus while data reloads

Copilot AI 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.

🟢 Approval recommended

No unresolved review issues were identified, and the loading behavior is covered by unit and end-to-end tests.

No open issues 🎉

What changed in this PR

Adds a dataReloadBtnLoading input to table and tree-table components, keeping reload buttons focusable during asynchronous data reloads while preventing duplicate actions.

Changes:

  • Added and documented the loading input for both table components.
  • Propagated loading state to reload buttons and guarded reload events while loading.
  • Updated composition examples, API metadata, unit tests, and Playwright coverage.
File Description
projects/​cps-ui-kit/​src/​lib/​components/​cps-tree-table/​cps-tree-table.component.ts Adds the loading input and reload guard for tree tables.
projects/​cps-ui-kit/​src/​lib/​components/​cps-tree-table/​cps-tree-table.component.spec.ts Tests tree-table loading, focus, and reload behavior.
projects/​cps-ui-kit/​src/​lib/​components/​cps-tree-table/​cps-tree-table.component.html Passes loading state to the tree-table reload button.
projects/​cps-ui-kit/​src/​lib/​components/​cps-table/​cps-table.component.ts Adds the loading input and reload guard for tables.
projects/​cps-ui-kit/​src/​lib/​components/​cps-table/​cps-table.component.spec.ts Tests table loading, focus, and reload behavior.
projects/​cps-ui-kit/​src/​lib/​components/​cps-table/​cps-table.component.html Passes loading state to the table reload button.
projects/​composition/​src/​app/​pages/​tree-table-page/​tree-table-page.examples.ts Updates the tree-table code example with loading-state usage.
projects/​composition/​src/​app/​pages/​tree-table-page/​tree-table-page.component.ts Simulates asynchronous tree-table reload completion.
projects/​composition/​src/​app/​pages/​tree-table-page/​tree-table-page.component.html Binds loading state in the tree-table example.
projects/​composition/​src/​app/​pages/​table-page/​table-page.examples.ts Updates the table code example with loading-state usage.
projects/​composition/​src/​app/​pages/​table-page/​table-page.component.ts Simulates asynchronous table reload completion.
projects/​composition/​src/​app/​pages/​table-page/​table-page.component.html Binds loading state in the table example.
projects/​composition/​src/​app/​api-data/​cps-tree-table.json Documents the new tree-table input.
projects/​composition/​src/​app/​api-data/​cps-table.json Documents the new table input.
playwright/​cps-ui-kit/​components/​cps-tree-table.spec.ts Verifies tree-table reload focus and loading behavior end to end.
playwright/​cps-ui-kit/​components/​cps-table.spec.ts Verifies table reload focus and loading behavior end to end.

Review effort: Lite

@github-actions

Copy link
Copy Markdown
Contributor

Coverage report for library

St.❔
Category Percentage Covered / Total
🟢 Statements 98.84% 7579/7668
🟢 Branches 93.88% 3909/4164
🟢 Functions 97.48% 1393/1429
🟢 Lines 99.34% 7032/7079

Test suite run success

3248 tests passing in 76 suites.

Report generated by 🧪jest coverage report action from cb346c6

@github-actions

Copy link
Copy Markdown
Contributor

Playwright test results

passed  978 passed

Details

stats  978 tests across 35 suites
duration  24 minutes, 43 seconds
commit  cb346c6
info  For details, download the Playwright report

@fateeand
fateeand merged commit dcdd259 into master Oct 29, 2026
11 checks passed
@fateeand
fateeand deleted the 895-table-tree-table-add-datareloadbtnloading-input-so-the-reload-button-keeps-focus-while-data-loads branch October 29, 2026 08:16
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.

Table, Tree table: add dataReloadBtnLoading input so the reload button keeps focus while data loads

3 participants