feat: initColumnInstanceData#6349
Conversation
📝 WalkthroughWalkthroughconstructColumn 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. ChangesPer-column feature initialization
Performance note formatting
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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
|
View your CI Pipeline Execution ↗ for commit 0373d24
☁️ Nx Cloud last updated this comment at |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/table-core/src/types/TableFeatures.ts (1)
412-426: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueClarify that
column.columnsis empty wheninitColumnInstanceDataruns.The doc lists
columnsamong the assigned fields, butconstructColumnsetscolumn.columns = []and the child columns are populated afterward bytable_getAllColumns/recurseColumns(seecoreColumnsFeature.utils.ts). A feature author reading this hook doc could reasonably expectcolumn.columnsto 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
📒 Files selected for processing (4)
packages/table-core/src/core/columns/constructColumn.tspackages/table-core/src/types/TableFeatures.tspackages/table-core/tests/unit/core/columns/constructColumn.test.tsperf.md
🎯 Changes
✅ Checklist
pnpm test:pr.Summary by CodeRabbit
Bug Fixes
Documentation
Tests