Skip to content

feat: initColumnInstanceData#6349

Merged
KevinVandy merged 2 commits into
betafrom
init-column-data
Jun 26, 2026
Merged

feat: initColumnInstanceData#6349
KevinVandy merged 2 commits into
betafrom
init-column-data

Conversation

@KevinVandy

@KevinVandy KevinVandy commented Jun 26, 2026

Copy link
Copy Markdown
Member

🎯 Changes

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested this code locally with pnpm test:pr.

Summary by CodeRabbit

  • Bug Fixes

    • Column setup now correctly applies feature-specific initialization to every column, including nested/grouped columns.
    • This improves consistency for column behavior and any feature-driven column metadata during table creation.
  • Documentation

    • Updated table feature documentation and inline guidance for clearer understanding of how table features and lifecycle hooks work.
  • Tests

    • Added coverage to verify column initialization works across grouped and child columns.

@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

constructColumn now invokes each feature's column-instance initializer during column creation. TableFeature comments were expanded to describe feature slots and lifecycle hooks, tests cover per-column annotation initialization, and one perf note table was reformatted.

Changes

Per-column feature initialization

Layer / File(s) Summary
Feature contract
packages/table-core/src/types/TableFeatures.ts
TableFeatures.ts imports Column and expands comments around helper types, prereq slots, Plugins, TableFeatures, and TableFeature hook docs without changing signatures.
Column construction hook
packages/table-core/src/core/columns/constructColumn.ts
constructColumn now calls each feature's initColumnInstanceData with the new column after core column properties are assigned.
Column initialization test
packages/table-core/tests/unit/core/columns/constructColumn.test.ts
The construct-column test adds a feature that annotates columns in initColumnInstanceData and checks the initialized data on grouped columns.

Performance note formatting

Layer / File(s) Summary
Scale-impact table
perf.md
The row-selection memoization note reformats its scale-impact Markdown table without changing the numbers.

Sequence Diagram(s)

sequenceDiagram
  participant constructColumn
  participant tableFeatures as table._features
  participant feature
  participant column
  constructColumn->>tableFeatures: Object.values(table._features)
  loop each feature
    constructColumn->>feature: initColumnInstanceData(column)
    feature->>column: define instance-specific data
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

Hoppity-hop, the columns found their tune,
each feature wakes a little under the moon.
The table docs now twinkle, neat and bright,
and perf notes march in tidy rows tonight. 🐰

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding initColumnInstanceData support for column instances.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch init-column-data

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nx-cloud

nx-cloud Bot commented Jun 26, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 0373d24

Command Status Duration Result
nx affected --targets=test:eslint,test:sherif,t... ✅ Succeeded 4m 7s View ↗
nx run-many --targets=build --exclude=examples/** ✅ Succeeded 1s View ↗

☁️ Nx Cloud last updated this comment at 2026-06-26 13:34:45 UTC

@pkg-pr-new

pkg-pr-new Bot commented Jun 26, 2026

Copy link
Copy Markdown
More templates

@tanstack/angular-table

npm i https://pkg.pr.new/TanStack/table/@tanstack/angular-table@6349

@tanstack/angular-table-devtools

npm i https://pkg.pr.new/TanStack/table/@tanstack/angular-table-devtools@6349

@tanstack/lit-table

npm i https://pkg.pr.new/TanStack/table/@tanstack/lit-table@6349

@tanstack/match-sorter-utils

npm i https://pkg.pr.new/TanStack/table/@tanstack/match-sorter-utils@6349

@tanstack/preact-table

npm i https://pkg.pr.new/TanStack/table/@tanstack/preact-table@6349

@tanstack/preact-table-devtools

npm i https://pkg.pr.new/TanStack/table/@tanstack/preact-table-devtools@6349

@tanstack/react-table

npm i https://pkg.pr.new/TanStack/table/@tanstack/react-table@6349

@tanstack/react-table-devtools

npm i https://pkg.pr.new/TanStack/table/@tanstack/react-table-devtools@6349

@tanstack/solid-table

npm i https://pkg.pr.new/TanStack/table/@tanstack/solid-table@6349

@tanstack/solid-table-devtools

npm i https://pkg.pr.new/TanStack/table/@tanstack/solid-table-devtools@6349

@tanstack/svelte-table

npm i https://pkg.pr.new/TanStack/table/@tanstack/svelte-table@6349

@tanstack/table-core

npm i https://pkg.pr.new/TanStack/table/@tanstack/table-core@6349

@tanstack/table-devtools

npm i https://pkg.pr.new/TanStack/table/@tanstack/table-devtools@6349

@tanstack/vue-table

npm i https://pkg.pr.new/TanStack/table/@tanstack/vue-table@6349

@tanstack/vue-table-devtools

npm i https://pkg.pr.new/TanStack/table/@tanstack/vue-table-devtools@6349

commit: 1bd20e6

@coderabbitai coderabbitai Bot 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.

🧹 Nitpick comments (1)
packages/table-core/src/types/TableFeatures.ts (1)

412-426: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Clarify that column.columns is empty when initColumnInstanceData runs.

The doc lists columns among the assigned fields, but constructColumn sets column.columns = [] and the child columns are populated afterward by table_getAllColumns/recurseColumns (see coreColumnsFeature.utils.ts). A feature author reading this hook doc could reasonably expect column.columns to contain children, which it won't. Consider noting that child columns are not yet attached at this point.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/table-core/src/types/TableFeatures.ts` around lines 412 - 426,
Update the `initColumnInstanceData` doc in `TableFeatures` to clarify that
`column.columns` is initialized as an empty array when this hook runs and child
columns are attached later by
`constructColumn`/`table_getAllColumns`/`recurseColumns`. Adjust the wording so
feature authors do not assume `column.columns` already contains children at this
point, while keeping the guidance about per-column mutable data and shared
methods via `assignColumnPrototype`.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@packages/table-core/src/types/TableFeatures.ts`:
- Around line 412-426: Update the `initColumnInstanceData` doc in
`TableFeatures` to clarify that `column.columns` is initialized as an empty
array when this hook runs and child columns are attached later by
`constructColumn`/`table_getAllColumns`/`recurseColumns`. Adjust the wording so
feature authors do not assume `column.columns` already contains children at this
point, while keeping the guidance about per-column mutable data and shared
methods via `assignColumnPrototype`.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 971ffecb-50ca-4a5b-a639-a385a89bb581

📥 Commits

Reviewing files that changed from the base of the PR and between 2ee9de4 and 1bd20e6.

📒 Files selected for processing (4)
  • packages/table-core/src/core/columns/constructColumn.ts
  • packages/table-core/src/types/TableFeatures.ts
  • packages/table-core/tests/unit/core/columns/constructColumn.test.ts
  • perf.md

@KevinVandy KevinVandy merged commit 0a89a97 into beta Jun 26, 2026
8 checks passed
@KevinVandy KevinVandy deleted the init-column-data branch June 26, 2026 13:40
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