fix: CpsTreeTableComponent issues#763
Open
fateeand wants to merge 4 commits into
Open
Conversation
fateeand
requested review from
TerranceKhumalo-absa,
korel-san and
lukasmatta
as code owners
July 23, 2026 13:53
Contributor
Coverage report for library
Test suite run success2433 tests passing in 76 suites. Report generated by 🧪jest coverage report action from 31b8894 |
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes cross-browser rendering issues in cps-tree-table by adjusting PrimeNG TreeTable base layout styles for Safari, deferring header width recalculation on node expand/collapse to eliminate Chromium column “jump”, and replacing a hardcoded selectable/row-menu column width with a root-font-size-derived value.
Changes:
- Updated TreeTable host CSS to ensure the loader mask sizes correctly in Safari while preserving flex-scroll behavior.
- Deferred expand/collapse header-width recalculation to run after the DOM reflects the new rows (before paint) to prevent Chromium column width corrections.
- Replaced hardcoded
55pxsizing for selectable/row-menu columns with arem-based constant derived from root font size.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| projects/cps-ui-kit/src/lib/components/cps-tree-table/cps-tree-table.component.ts | Updates auto-layout width measurement logic, replaces hardcoded widths with root-font-size-derived values, and defers recalculation on expand/collapse via microtask + change detection. |
| projects/cps-ui-kit/src/lib/components/cps-tree-table/cps-tree-table.component.scss | Ensures .p-treetable participates in layout in Safari (display: block) while keeping flex scroll layouts working (display: flex for flex-scrollable variant). |
Comments suppressed due to low confidence (1)
projects/cps-ui-kit/src/lib/components/cps-tree-table/cps-tree-table.component.ts:1036
- The
DocumentFragment/clonedTdwork here is effectively dead: styles are applied toclonedTd, but onlyclonedTd.innerHTMLis measured inhiddenDiv, so those styles (and the fragment append/remove) have no effect. This adds DOM churn and makes the sizing logic harder to follow.
const tdWidths: number[] = [];
const fragment = this.document.createDocumentFragment();
bodyRows.forEach((tr: HTMLElement) => {
const tds = tr?.querySelectorAll('td');
Contributor
Playwright test resultsDetails
|
fateeand
marked this pull request as draft
July 24, 2026 09:43
…sitioned-in-safari-columns-jump-on-row-expandcollapse-in-chromium
fateeand
marked this pull request as ready for review
July 24, 2026 12:59
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Summary
Fixes several cross-browser rendering and column-width bugs in
cps-tree-table, makes manually-resized columns coexist correctly with its auto-fit column layout.Changes
display: blockon the root element (unlike the sibling DataTable component), which made Safari collapse the loading mask's width instead of sizing it to the table. Added the missingdisplay: block, plus a compensating rule so tables usingscrollHeight="flex"still lay out as a flex column as intended.Before:

After:

Before:

After:

Resized columns now stay aligned with the header, and keep their width. Manually resizing a column (drag or keyboard) previously caused the header and body columns to drift out of alignment as soon as anything else triggered a layout recalculation (sorting, filtering, expanding a row, etc.), because header and body columns were being frozen inconsistently with each other. A resized column now keeps its exact width and the rest of the columns continue to auto-fit their content around it, with header and body always staying in sync.
Fixed a column-misalignment case when expanding multiple different rows in a row. Expanding a second, different row after an initial expand could leave earlier rows out of sync with the header. Column widths are now consistently kept in sync across any sequence of expand/collapse actions, not just the first one.
Chromium: columns no longer jump when sorting or filtering. Same root cause and fix as the expand/collapse jump above - the column-width recalculation triggered by sorting or filtering now also runs immediately after the update completes, before the next paint, instead of a moment later.
Fixed columns staying misaligned after clearing a global filter on virtual-scroll tables. When a filtered result set jumped from no matches back to many rows, the column-width recalculation could run before the virtual scroller finished repopulating rows, leaving the body permanently unstyled. It now automatically retries once the rows are actually available, instead of giving up after a single attempt.
Before:

After:

55(px) in several places; it's now derived from the root font size service (3.4375remequivalent), so it stays correct if the root font size changes.Release notes: