Skip to content

Conversation

@sjbur
Copy link
Contributor

@sjbur sjbur commented Dec 30, 2025

No description provided.

@sjbur sjbur self-assigned this Dec 30, 2025
@sjbur sjbur added the 26_1 label Dec 30, 2025
@sjbur sjbur marked this pull request as ready for review December 31, 2025 07:49
@sjbur sjbur requested a review from a team as a code owner December 31, 2025 07:49
Copilot AI review requested due to automatic review settings December 31, 2025 07:49
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 where the Scheduler's scrollTo method did not properly account for the viewOffset option, which shifts the displayed time range. The fix ensures that when an offset is applied, hours are not incorrectly clamped to the startDayHour/endDayHour range, and the valid scroll date range is extended appropriately.

Key changes:

  • Modified _getScrollCoordinates to skip hour clamping when viewOffset is non-zero, allowing natural hour values to be used with the offset
  • Enhanced _isValidScrollDate to extend the valid date range by the viewOffset on both ends
  • Consolidated test files by merging workspace.base.test.ts and workspace.recalculation.test.ts into a single organized workspace.test.ts with a new test case for the offset scrolling behavior

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts Fixed _getScrollCoordinates to conditionally apply hour clamping only when viewOffset === 0, and updated _isValidScrollDate to extend the valid date range by the offset value
packages/devextreme/js/__internal/scheduler/__tests__/workspace.test.ts New consolidated test file containing all workspace tests including base functionality, async template recalculation, and a new test for scrollTo with offset (T1310544)
packages/devextreme/js/__internal/scheduler/__tests__/workspace.base.test.ts Deleted - tests moved to workspace.test.ts
packages/devextreme/js/__internal/scheduler/__tests__/workspace.recalculation.test.ts Deleted - tests moved to workspace.test.ts

Copy link
Contributor

@aleksei-semikozov aleksei-semikozov left a comment

Choose a reason for hiding this comment

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

I see two remote test files.
How I see them:
workspace.base.test.ts - unit test.
workspace.recalculation.test.ts - integration test where we create the scheduler

I don't think this test should be in one file
I would rename workspace.recalculation.test.ts -> workspace.test.ts and write your test case in this file

@sjbur sjbur requested review from a team and aleksei-semikozov January 5, 2026 07:44
@sjbur
Copy link
Contributor Author

sjbur commented Jan 5, 2026

@aleksei-semikozov applied changes you asked

Comment on lines 1875 to 1876
const extendedMin = new Date(min.getTime() - viewOffset);
const extendedMax = new Date(max.getTime() + viewOffset);
Copy link
Contributor

@Tucchhaa Tucchhaa Jan 7, 2026

Choose a reason for hiding this comment

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

Question: shouldn't min and max dates be offseted in the same direction?

Comment on lines 1417 to 1423
if (hours < startDayHour) {
hours = startDayHour;
}

if (hours >= endDayHour) {
hours = endDayHour - 1;
if (hours >= endDayHour) {
hours = endDayHour - 1;
}
Copy link
Contributor

@Tucchhaa Tucchhaa Jan 7, 2026

Choose a reason for hiding this comment

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

I notice that we validate scrollTo date here before calculating scrollTo coordinates.

I suspect that this normalization may be redundant now, since we will throw a warning if scrollTo date is out of range. But I am not fully sure.

Can you investigate it please?

Copy link
Contributor

@Tucchhaa Tucchhaa Jan 7, 2026

Choose a reason for hiding this comment

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

I got it. We need this normalization for views larger than day, e.g. timelineWeek, timelineMonth, etc.

However we should not just ignore this normalization if viewOffset is set. We need to adjust this normalization to include viewOffset into it.

For example this case (I have changed currentView and viewOffset). The scheduler is scrolled to 5 PM, however it should scroll to the last cell of the day (7 PM).

Please adjust the normalization and write a test for it.

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

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

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

@DevExpress DevExpress deleted a comment from Copilot AI Jan 9, 2026
Copilot AI review requested due to automatic review settings January 9, 2026 08:01
@DevExpress DevExpress deleted a comment from Copilot AI Jan 9, 2026
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 3 out of 3 changed files in this pull request and generated 6 comments.

Copilot AI review requested due to automatic review settings January 9, 2026 08:31
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 3 out of 3 changed files in this pull request and generated 1 comment.

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