Skip to content

Grids: Type grid_core m_utils - #35537

Open
Alyar666 wants to merge 6 commits into
DevExpress:mainfrom
Alyar666:grids_type_grid_core_m_utils_26_2
Open

Alyar666 wants to merge 6 commits into
DevExpress:mainfrom
Alyar666:grids_type_grid_core_m_utils_26_2

Conversation

@Alyar666

@Alyar666 Alyar666 commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@Alyar666 Alyar666 self-assigned this Oct 7, 2026
Copilot AI balanced review requested due to automatic review settings October 7, 2026 11:26
@Alyar666
Alyar666 requested a review from a team as a code owner October 7, 2026 11:26

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

🟡 Changes recommended

Stringifying display-map keys breaks cached text retrieval for symbol-valued cells.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Adds TypeScript coverage to grid-core utilities and removes an obsolete cast.

Changes:

  • Types formatting, grouping, load-panel, widget, and lookup utilities.
  • Adds shared supporting interfaces.
  • Simplifies getCellText.
File Description
grid_core/​views/​utils.ts Removes redundant string cast.
grid_core/​types.ts Adds utility-related types.
grid_core/​m_utils.ts Types and refactors grid utilities.

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

Comment thread packages/devextreme/js/__internal/grids/grid_core/m_utils.ts
@Alyar666
Alyar666 marked this pull request as draft October 7, 2026 23:18
Comment thread packages/devextreme/js/__internal/grids/grid_core/m_utils.ts Outdated
Comment thread packages/devextreme/js/__internal/grids/grid_core/m_utils.ts Outdated
Comment thread packages/devextreme/js/__internal/grids/grid_core/m_utils.ts Outdated
@Alyar666 Alyar666 changed the title Grids: Type part 1 of grid_core m_utils Grids: Type grid_core m_utils Oct 8, 2026
@Alyar666
Alyar666 marked this pull request as ready for review October 8, 2026 13:26
Copilot AI balanced review requested due to automatic review settings October 8, 2026 13:26

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.

🟢 Approval recommended

The typing refactor preserves existing behavior and includes focused regression tests.

0 open findings

1 resolved since last review

🧠 Review effort: Balanced


Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.

@Alyar666
Alyar666 requested a review from anna-shakhova October 8, 2026 13:52
Comment thread packages/devextreme/js/__internal/grids/grid_core/m_utils.ts Outdated
const normalizeSortingInfo = function (sort) {
sort = sort || [];
const result = normalizeSortingInfoUtility(sort);
const normalizeSortingInfo = (sort: unknown): SortingInfo[] => {

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.

We can type sort from usage, using StoreLoadOptions or its sort/group parameters types directly. Also type other utils that use same argument

Suggested change
const normalizeSortingInfo = (sort: unknown): SortingInfo[] => {
const normalizeSortingInfo = (sort: StoreLoadOptions['sort'] | StoreLoadOptions['group]): SortingInfo[] => {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are errors with these types:

  • The isExpanded and groupInterval properties are missing.
  • equalSortParameters passes arguments of type unknown to normalizeSortingInfo. The argument types will need to be properly defined throughout the call chain.

Comment thread packages/devextreme/js/__internal/grids/grid_core/m_utils.ts Outdated
getIndexByKey(key: RowKey, items: unknown, keyName?: string | string[] | null): number {
let index = -1;

if (key !== undefined && Array.isArray(items)) {

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.

is there possibility items is not an array?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can be unknown[] | null | undefined.

Comment thread packages/devextreme/js/__internal/grids/grid_core/m_utils.ts Outdated
Comment thread packages/devextreme/js/__internal/grids/grid_core/m_utils.ts Outdated
Comment thread packages/devextreme/js/__internal/grids/grid_core/types.ts Outdated
Copilot AI balanced review requested due to automatic review settings October 9, 2026 11:32
@Alyar666
Alyar666 force-pushed the grids_type_grid_core_m_utils_26_2 branch from b208e55 to d9ac423 Compare October 9, 2026 11:32

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.

🟢 Approval recommended

The typing refactor preserves behavior and includes focused regression coverage.

0 open findings

🧠 Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 9, 2026 15:02

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.

🔵 Needs a closer look

The broad refactor affects central grid utilities and multiple rendering, lookup, and filtering paths.

0 open findings

🧠 Review effort: Balanced

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants