Skip to content

Conversation

@aleksei-semikozov
Copy link
Contributor

No description provided.

@aleksei-semikozov aleksei-semikozov self-assigned this Jan 14, 2026
@aleksei-semikozov aleksei-semikozov requested a review from a team as a code owner January 14, 2026 08:37
Copilot AI review requested due to automatic review settings January 14, 2026 08:37
@aleksei-semikozov aleksei-semikozov requested a review from a team as a code owner January 14, 2026 08:37
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 pull request adds a new API method overload to the Scheduler component's scrollTo method, allowing users to specify scroll alignment ('start' or 'center') when scrolling to a specific date.

Changes:

  • Adds new scrollTo method signature that accepts an options object with group, allDay, and align properties
  • Implements alignment logic in the workspace scroll calculations (defaults to 'center' for backward compatibility)
  • Adds comprehensive Jest tests for the workspace-level scrollTo functionality

Reviewed changes

Copilot reviewed 3 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/devextreme/ts/dx.all.d.ts Adds new scrollTo method overload with options object parameter for dx.all bundle
packages/devextreme/js/ui/scheduler.d.ts Adds new scrollTo method overload with JSDoc annotations and references new SchedulerScrollToAlign enum
packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts Implements align parameter in workspace scrollTo method to calculate scroll offsets based on alignment
packages/devextreme/js/__internal/scheduler/m_scheduler.ts Adds type guard to distinguish between positional and options-object parameters, forwards align to workspace
packages/devextreme/js/__internal/scheduler/tests/workspace.base.test.ts Adds comprehensive tests for workspace scrollTo with different alignment options

Copilot AI review requested due to automatic review settings January 15, 2026 12:14
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 6 out of 8 changed files in this pull request and generated 2 comments.

await waitAsync(0);

assert.equal(errors.log.callCount, 0, 'warning has been called once');
assert.equal(errors.log.callCount, 1, 'deprecation warning has been called once');
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

The existing QUnit tests have been updated to expect deprecation warnings for the old API, but there are no new tests in this file that verify the new options-based API works correctly with the align parameter. Consider adding tests that call scrollTo(date, { align: 'start' }) and scrollTo(date, { align: 'center', group: ..., allDay: ... }) to verify the new API functionality.

Copilot uses AI. Check for mistakes.
Comment on lines +2048 to +2049
return Boolean(options) && typeof options === 'object'
&& ('align' in options || 'allDay' in options || 'group' in options);
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

The type guard logic will incorrectly identify group values objects as the new options object if they happen to have an 'allDay' or 'group' property. Since group values can be arbitrary objects (e.g., { ownerId: 2 }), the type guard should only check for the presence of the 'align' property to definitively identify the new API usage. Update the condition to: return Boolean(options) && typeof options === 'object' && 'align' in options;

Suggested change
return Boolean(options) && typeof options === 'object'
&& ('align' in options || 'allDay' in options || 'group' in options);
return Boolean(options) && typeof options === 'object' && 'align' in options;

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