Skip to content

Conversation

@Alyar666
Copy link
Contributor

No description provided.

@Alyar666 Alyar666 self-assigned this Jan 20, 2026
@Alyar666 Alyar666 requested a review from a team as a code owner January 20, 2026 13:45
Copilot AI review requested due to automatic review settings January 20, 2026 13:45
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a bug in DataGrid column reordering when using fixed columns with virtual column rendering mode (T1316881). The fix removes incorrect column index offset adjustments that were causing reordering to malfunction.

Changes:

  • Removed column index offset logic from drag-and-drop column reordering operations
  • Updated keyboard navigation to handle column index offset corrections after scrolling
  • Refactored column visibility index calculations to handle virtual rendering mode properly

Reviewed changes

Copilot reviewed 9 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
m_headers_keyboard_navigation.ts Added method to correct focused column index after scroll and simplified cell retrieval
m_column_keyboard_navigation_core.ts Removed column index offset adjustments from visibility index calculations
m_columns_resizing_reordering.ts Removed addColumnIndexOffset method and its usage from drag-and-drop operations
types.ts Added type definitions for column index and drop location names
m_columns_controller_utils.ts Refactored getColumnIndexByVisibleIndex to properly handle virtual rendering mode with column offsets
const.ts Added constants for virtual command column and headers location
visual.ts Added visual regression tests for column reordering scenarios
functional.ts Added functional tests for column reordering with fixed columns and virtual rendering
columnReordering.ts Moved existing tests to separate functional.ts and visual.ts files

Copilot AI review requested due to automatic review settings January 21, 2026 20:13
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 12 changed files in this pull request and generated 2 comments.

visibleIndex = isObject(visibleIndex) ? visibleIndex.columnIndex : visibleIndex;
column = columns[visibleIndex];
if (column?.type === GROUP_COMMAND_COLUMN_NAME) {
return that._columns.filter((col) => column.type === col.type)[0] || column;
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

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

The filter condition compares column.type with col.type, but should compare the constant GROUP_COMMAND_COLUMN_NAME with col.type directly. The current logic will always match the first column with the same type, which might not be the intended behavior.

Suggested change
return that._columns.filter((col) => column.type === col.type)[0] || column;
return that._columns.filter((col) => col.type === GROUP_COMMAND_COLUMN_NAME)[0] || column;

Copilot uses AI. Check for mistakes.
Comment on lines +470 to +471

return column?.index ?? -1;
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

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

The use of optional chaining with nullish coalescing could mask issues where column is unexpectedly undefined. Consider using isDefined(column?.index) check consistent with the codebase pattern, or add explicit validation.

Suggested change
return column?.index ?? -1;
const columnIndex = column?.index;
return isDefined(columnIndex) ? columnIndex : -1;

Copilot uses AI. Check for mistakes.
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.

1 participant