Skip to content

GridCore - ColumnsController - Add types to the controller state - #35449

Merged
bit-byte0 merged 5 commits into
DevExpress:mainfrom
bit-byte0:refactor/columnscontroller-lint-cleanup-main
Oct 2, 2026
Merged

bit-byte0 merged 5 commits into
DevExpress:mainfrom
bit-byte0:refactor/columnscontroller-lint-cleanup-main

Conversation

@bit-byte0

Copy link
Copy Markdown
Contributor

What

Clean up remaining lint issues in ColumnsController without changing DataGrid or TreeList behavior

How

Simplify local variables, callbacks, and two nested methods while preserving existing falsy-value handling. Keep necessary type and nesting exceptions narrowly scoped

@bit-byte0
bit-byte0 requested a review from a team as a code owner October 2, 2026 00:14
Copilot AI balanced review requested due to automatic review settings October 2, 2026 00:14
@bit-byte0 bit-byte0 added the 26_2 label Oct 2, 2026
@bit-byte0 bit-byte0 self-assigned this Oct 2, 2026

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.

Copilot review overview

🔵 Needs a closer look

Changes span several stateful grid algorithms, so behavior parity warrants final human review.

Review effort: Balanced
Findings: None

What changed in this PR

Cleans up lint issues and strengthens typing in the shared ColumnsController while aiming to preserve DataGrid and TreeList behavior.

Changes:

  • Simplifies variables, callbacks, and control flow with narrowly scoped lint exceptions.
  • Adds regression tests for column generation, visibility, selectors, and filter callback behavior.
File Description
packages/​devextreme/​js/​__internal/​grids/​grid_core/​columns_controller/​m_columns_controller.ts Refactors controller logic and improves typing.
packages/​devextreme/​js/​__internal/​grids/​grid_core/​columns_controller/​__tests__/​columns_controller.integration.test.ts Adds behavior-preservation regression tests.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

if (!columns[i].dataType || (checkSerializers && columns[i].deserializeValue && columns[i].serializationFormat === undefined)) {
return false;
for (const column of columns) {
if (column.dataField || column.calculateCellValue !== column.defaultCalculateCellValue) {

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: we can combine both conditions into one, just for readability create variable that will describe what this conditions are about

also for other conditions that are not fit in a single line it would be more readable to introduce variables with proper names

columns = columns || that._columns;

each(columns, (_, column) => {
each(sourceColumns, (_, column) => {

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.

lets replace it with forEach to preserve types

also, please, check other places where each is used, we can also check extend, but it requires care

const that = this;
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- module option (never-typed)
const customizeColumns: any = that.option('customizeColumns');
const customizeColumns: any = this.option('customizeColumns');

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.

Suggested change
const customizeColumns: any = this.option('customizeColumns');
const { customizeColumns } = this.option() as ColumnsControllerOptions;

Copilot AI balanced review requested due to automatic review settings October 2, 2026 11:28

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.

Copilot review overview

🔵 Needs a closer look

The broad shared-controller refactor needs runtime validation, and a callback regression remains unresolved.

Review effort: Balanced
Findings: 1 High severity

Open (1)

Copilot AI balanced review requested due to automatic review settings October 2, 2026 11:59

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.

Copilot review overview

🔵 Needs a closer look

The broad, stateful shared-controller refactor still needs DataGrid and TreeList runtime verification.

Review effort: Balanced
Findings: None

Resolved since last review (1)

Copilot AI balanced review requested due to automatic review settings October 2, 2026 12:37

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.

Copilot review overview

🟢 Approval recommended

Static review found no blocking issues; automated tests were not run.

Review effort: Balanced
Findings: None

@bit-byte0
bit-byte0 added this pull request to the merge queue Oct 2, 2026
Merged via the queue into DevExpress:main with commit 704e0ef Oct 2, 2026
149 checks passed
@bit-byte0
bit-byte0 deleted the refactor/columnscontroller-lint-cleanup-main branch October 2, 2026 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants