Fix AbstractRow rowheaders/columnheaders no-op concat - #671
Merged
fpigeonjr merged 2 commits intoSep 1, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes AbstractRow header collections so they reflect discovered DOM cells.
Changes:
- Assigns concatenated header cells back to their collections.
- Adds Vitest coverage for row and column headers.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
abstract-row.ts |
Populates header collections. |
abstract-row.spec.ts |
Verifies header classification. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
fpigeonjr
added a commit
that referenced
this pull request
Sep 1, 2026
_findCells called _getCellsByRole twice per role — once to build the header collections via _setRowHeaders, and again to build the accumulator returned as cells. Each call constructs new AbstractCell instances, which also register duplicate keydown/click listeners on every header DOM node. Reuse the already-created cells value in the reducer so rowheaders/columnheaders are true subsets of cells and each node is initialized exactly once. Addresses Copilot review comment on PR #671.
_setRowHeaders discarded the result of Array.prototype.concat instead of assigning it, so the public rowheaders/columnheaders collections on AbstractRow were always empty regardless of the row's actual DOM content. Assign the concat result back to the properties, and add a spec asserting the header collections are populated correctly. Fixes #658
_findCells called _getCellsByRole twice per role — once to build the header collections via _setRowHeaders, and again to build the accumulator returned as cells. Each call constructs new AbstractCell instances, which also register duplicate keydown/click listeners on every header DOM node. Reuse the already-created cells value in the reducer so rowheaders/columnheaders are true subsets of cells and each node is initialized exactly once. Addresses Copilot review comment on PR #671.
fpigeonjr
force-pushed
the
gh-658-abstractrow-never-populates-rowheaders-columnheade
branch
from
September 1, 2026 18:30
f88df5d to
a4b75b2
Compare
fpigeonjr
marked this pull request as ready for review
September 1, 2026 18:37
beverly-n
approved these changes
Sep 1, 2026
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
AbstractRow._setRowHeaderscalledArray.prototype.concatonthis.rowheaders/this.columnheaderswithout assigning the result back.concatreturns a new array rather than mutating in place, so the return value was silently discarded and the publicrowheaders/columnheadersproperties onAbstractRowwere always empty — regardless of the row's actual DOM content. Only the flattenedcellscollection reflected reality.Fixed by assigning the concat result back:
Added a Vitest spec (
abstract-row.spec.ts) assertingrowheaders/columnheadersare populated with the correct cells (and only those cells) after construction.No Playwright/E2E coverage added: this is pure array-mutation logic with no CSS cascade, layout, or pointer hit-testing dependency, so per
AGENTS.md's Vitest/Playwright testing-boundary guidance it's fully and more cheaply verified in jsdom.Motivation and Context
Flagged by Copilot review on PR #654 (#654 (comment)). Left out of that PR since it was a spec-only PR and this is a pre-existing implementation bug.
Closes #658
Type of Change (Select One and Apply Label)
bugfixlabelenhancementlabelbreakinglabelmaintenancelabelHow to Test
npm ci && npm ci --prefix test-appcd test-app && npx vitest run --config vitest.config.mts -t "AbstractRow"— confirms the new spec passes and the header collections are populatednpm --prefix test-app test— confirms the full suite still passes (151 files / 1378 tests)Expected result:
AbstractRow.rowheaderscontains only cells withrole="rowheader", andAbstractRow.columnheaderscontains only cells withrole="columnheader", matching the row's actual DOM content.Screenshots (if appropriate)
N/A — internal logic fix, no UI changes.
Checklist
gh-<number>-<slug>)format:checkpasses (npm run format:check)lintpasses (npm run lint)buildpasses (cd test-app && npm run build)cd test-app && npm test)Note:
npm run coverage:checkcurrently fails onmasterat the tip commit (db5cc25b) with these exact percentages — confirmed viagh run viewon master's own CI run. This PR's change is coverage-neutral to slightly positive; the pre-existing floor miss is unrelated and out of scope here.