Skip to content

GridCore - EditorFactory & Adaptivity - fix eslint & ts errors - #35703

Merged
bit-byte0 merged 5 commits into
DevExpress:mainfrom
Tucchhaa:editor_factory_26_2
Oct 16, 2026
Merged

bit-byte0 merged 5 commits into
DevExpress:mainfrom
Tucchhaa:editor_factory_26_2

Conversation

@Tucchhaa

Copy link
Copy Markdown
Contributor

No description provided.

@Tucchhaa
Tucchhaa requested a balanced review from Copilot October 14, 2026 15:09
@Tucchhaa Tucchhaa self-assigned this Oct 14, 2026
@Tucchhaa Tucchhaa added the 26_2 label Oct 14, 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.

🟢 Approval recommended

The changes are focused, internally consistent, and preserve existing runtime behavior.

0 open findings

What changed in this PR

Improves GridCore editor factory type safety and resolves lint/TypeScript issues without changing intended behavior.

Changes:

  • Adds explicit types and modern null-safe syntax.
  • Documents focus-overlay initialization guarantees.
  • Cleans up focus and event-handler logic.
File Description
m_editor_factory.ts Strengthens editor factory typing and simplifies focus handling.
m_sticky_columns.ts Handles focus-overlay type checks in sticky-column extensions.

🧠 Review effort: Balanced


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

@Tucchhaa
Tucchhaa marked this pull request as ready for review October 15, 2026 03:01
@Tucchhaa
Tucchhaa requested a review from a team as a code owner October 15, 2026 03:01
Copilot AI balanced review requested due to automatic review settings October 15, 2026 03:01

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

Static review found no blocking issues in the changed code or relevant callers; project tests were not run.

0 open findings

🧠 Review effort: Balanced


function getColumnId(that, column) {
return that._columnsController.getColumnId(column);
function getColumnId(

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.

Confusing utility, it should be method of columnsController, but according to utility body it is already a method. Let's use method inline instead of this utility

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
export class AdaptiveColumnsViewController extends modules.ViewController {

cellOptions: AdaptiveDetailCellOptions,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
updateForm?: (hiddenColumns?: Column[]) => void,
): (options: unknown, container: DxElement) => void {

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 it possible to type options from usage?

private _isVisibleColumnsValid(visibleColumns) {
const getCommandColumnsCount = function () {
private _isVisibleColumnsValid(visibleColumns: Column[]): boolean {
const getCommandColumnsCount = (): number => {

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 use filter and length, it would be easier to read
also looks like visibleColumns do not change during function call, so we can just calculate value, not defined function and call it later

}

private _isPercentWidth(width) {
private _isPercentWidth(width: unknown): width is `${string}%` {

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 have similar utility in grid_view: isPercentWidth, lets extract it to views/utils and use there

items: this._getFormItemsByHiddenColumns(this._hiddenColumns),
formID: `dx-${new Guid()}`,
};
// @ts-expect-error

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.

add comment to directive, please

options: AdaptiveDetailCellOptions,
): void {
// eslint-disable-next-line @typescript-eslint/no-this-alias -- Form callbacks use their this
const that = this;

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 move alias before line 829
another option - extract bounded callbacks as variables and use them in callback

const $dataGridElement = this.component && this.component.$element();
private _updateFocusCore(): void {
const $dataGridElement = this.component?.$element();
// this selector is specific to IE

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 do not support IE, please, check, whether it is still actual

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.

Comment is not actual, but the code was never IE-only, so we can remove the comment, but keep the comment

this._$focusOverlay.addClass(DX_HIDDEN);
$focusOverlay.addClass(DX_HIDDEN);
} else if ($element.length) {
// align "right bottom" for Mozilla

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.

excessive comment, lets remove it

// eslint-disable-next-line no-undef
// NOTE: this condition is for the 'Row - Redundant validation messages should not be rendered
// in a detail grid when focused row is enabled (T950174)' testcafe test.
// The detail grid is created inside document_fragment_node but it is not shadow dom

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.

can we move this code to test mocks?

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.

I think it's better to keep it here: it's not test-only, a grid created from an HTML string with attributes ($('<div class="…">')) starts inside a document fragment, and without this branch it would listen on the fragment instead of document

Copilot AI balanced review requested due to automatic review settings October 15, 2026 13:47

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

Static review found the refactoring consistent with no blocking issues; builds and tests were not run.

0 open findings

🧠 Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 16, 2026 04:42

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

Static review found no blocking issues in the localized refactors and typing updates; builds and tests were not run.

0 open findings

🧠 Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 16, 2026 04:49

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

Static review found no blocking issues in these focused typing and refactoring changes; builds and tests were not run.

0 open findings

🧠 Review effort: Balanced

@bit-byte0
bit-byte0 requested a review from a team October 16, 2026 08:14
@bit-byte0
bit-byte0 added this pull request to the merge queue Oct 16, 2026
Merged via the queue into DevExpress:main with commit ab0536c Oct 16, 2026
148 checks passed
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.

4 participants