Skip to content

Scheduler: refactor workspaces module (TS): part 1#33789

Closed
sjbur wants to merge 10 commits into
DevExpress:26_1from
sjbur:issue-4126_26_1
Closed

Scheduler: refactor workspaces module (TS): part 1#33789
sjbur wants to merge 10 commits into
DevExpress:26_1from
sjbur:issue-4126_26_1

Conversation

@sjbur
Copy link
Copy Markdown
Contributor

@sjbur sjbur commented Jun 2, 2026

No description provided.

@sjbur sjbur self-assigned this Jun 2, 2026
@sjbur sjbur added the 26_1 label Jun 2, 2026
@sjbur sjbur force-pushed the issue-4126_26_1 branch from 67bf5c6 to 7a14ff2 Compare June 3, 2026 10:11
@sjbur sjbur force-pushed the issue-4126_26_1 branch from 6e81176 to 6843e77 Compare June 3, 2026 10:41
@sjbur sjbur marked this pull request as ready for review June 3, 2026 11:25
@sjbur sjbur requested a review from a team as a code owner June 3, 2026 11:25
Copilot AI review requested due to automatic review settings June 3, 2026 11:25
Copy link
Copy Markdown
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

Refactors the Scheduler workspaces module to improve TypeScript type-safety and clarify workspace-specific option/config contracts as part of an incremental modernization of the internal Scheduler implementation.

Changes:

  • Introduces explicit exported types for workspace options, scrollable configs, and date-generation options, and applies stronger typing to key methods.
  • Tightens method signatures and return types across multiple workspaces (day/week/month/timeline/agenda) and the workspace indicator.
  • Updates Scheduler _optionChanged typing to use OptionChanged<...> and aligns several call sites with the new typed contracts.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts Adds exported option/config interfaces and strengthens typing for scrolling and option change handling.
packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_week.ts Adds explicit return/param types for week workspace overrides.
packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_month.ts Adds explicit return/param types and minor refactors for month workspace methods.
packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_indicator.ts Adds stronger typing for indicator logic, DOM wrappers, and option change handling.
packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_day.ts Adds explicit return types for day workspace overrides.
packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts Adds stronger typing for timeline workspace DOM/scrolling behavior and default options.
packages/devextreme/js/__internal/scheduler/workspaces/m_timeline_week.ts Adds explicit return types for timeline week overrides.
packages/devextreme/js/__internal/scheduler/workspaces/m_timeline_month.ts Adds types for templates/options and refines month timeline view start/date formatting logic.
packages/devextreme/js/__internal/scheduler/workspaces/m_timeline_day.ts Adds explicit return types for timeline day overrides.
packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts Improves typing for agenda rendering and option handling; refactors some loops/conditions.
packages/devextreme/js/__internal/scheduler/m_scheduler.ts Types _optionChanged with OptionChanged<...> and adjusts switch cases accordingly.

Comment on lines +739 to +740
const useKeyboardDisabled = !(component.option('useKeyboard') as unknown as boolean);
const useNativeEnabled = component.option('useNative') as unknown as boolean;
},
onOptionChanged: ({ fullName, value, component }) => {
const useKeyboardDisabled = component.option('useKeyboard') === false;
const useKeyboardDisabled = !(component.option('useKeyboard') as unknown as boolean);
Comment on lines +529 to 536
updateScrollPosition(date: Date): void {
const newDate = this.timeZoneCalculator.createDate(date, 'toGrid');

const bounds = this.getVisibleBounds();
const startDateHour = newDate.getHours();
const startDateMinutes = newDate.getMinutes();

if (this.needUpdateScrollPosition(startDateHour, startDateMinutes, bounds, newDate)) {
if (this.needUpdateScrollPosition(newDate, bounds)) {
this.scrollTo(newDate);
}
Comment thread packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts Outdated
Comment thread packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts Outdated
Comment thread packages/devextreme/js/__internal/scheduler/workspaces/m_timeline_month.ts Outdated
Comment thread packages/devextreme/js/__internal/scheduler/m_scheduler.ts
Comment thread packages/devextreme/js/__internal/scheduler/m_scheduler.ts
Comment thread packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_indicator.ts Outdated
Comment on lines +548 to 552
const bounds = this.getVisibleBounds();
const hours = date.getHours();
const minutes = date.getMinutes();
let isUpdateNeeded = false;

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Sergei Burkatskii <sergei.burkatskii@devexpress.com>
Copilot AI review requested due to automatic review settings June 3, 2026 11:33
Copy link
Copy Markdown
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 11 out of 11 changed files in this pull request and generated 5 comments.

Comment on lines 532 to 536
const bounds = this.getVisibleBounds();
const startDateHour = newDate.getHours();
const startDateMinutes = newDate.getMinutes();

if (this.needUpdateScrollPosition(startDateHour, startDateMinutes, bounds, newDate)) {
if (this.needUpdateScrollPosition(newDate, bounds)) {
this.scrollTo(newDate);
}
@@ -530,22 +565,26 @@ class SchedulerAgenda extends WorkSpace {
return isUpdateNeeded;
Comment on lines 73 to 76
protected override getFormat(): string {
const format = getGlobalFormatByDataType('time');
return typeof format === 'string' ? format : 'shorttime';
}
Comment on lines 42 to 45
// @ts-expect-error
protected override getFormat(): (date: Date) => string {
return formatWeekdayAndDay;
}
Comment on lines +543 to 546
// @ts-expect-error
case 'skippedDays':
break;
case 'indicatorTime':
Copilot AI review requested due to automatic review settings June 3, 2026 11:46
Copy link
Copy Markdown
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 11 out of 11 changed files in this pull request and generated 4 comments.

Comment on lines +70 to 73
protected override getFormat(): string | ((date: Date) => string) {
const format = getGlobalFormatByDataType('time');
return typeof format === 'string' ? format : 'shorttime';
}
Comment on lines +125 to +144
export interface WorkspaceDateTableScrollableConfig {
useKeyboard: boolean;
bounceEnabled: boolean;
updateManually: boolean;
onScroll: (event: ScrollEvent) => void;
onInitialized: (args: { component: Scrollable }) => void;
onOptionChanged: (args: { fullName: string; value: unknown; component: Scrollable }) => void;
direction?: 'both';
onEnd?: () => void;
}

export interface WorkspaceHeaderScrollableConfig {
useKeyboard: boolean;
showScrollbar: 'never';
direction: 'horizontal';
useNative: false;
updateManually: true;
bounceEnabled: false;
onScroll: (event: ScrollEvent) => void;
}
Comment on lines +529 to 536
updateScrollPosition(date: Date): void {
const newDate = this.timeZoneCalculator.createDate(date, 'toGrid');

const bounds = this.getVisibleBounds();
const startDateHour = newDate.getHours();
const startDateMinutes = newDate.getMinutes();

if (this.needUpdateScrollPosition(startDateHour, startDateMinutes, bounds, newDate)) {
if (this.needUpdateScrollPosition(newDate, bounds)) {
this.scrollTo(newDate);
}
Comment on lines +539 to +547
needUpdateScrollPosition(
date: Date,
appointmentGroupValues?: unknown,
inAllDayRow?: boolean,
): boolean {
if (appointmentGroupValues || inAllDayRow) {
noop();
}

Copilot AI review requested due to automatic review settings June 3, 2026 12:07
@sjbur sjbur marked this pull request as draft June 3, 2026 12:09
@sjbur sjbur closed this Jun 3, 2026
Copy link
Copy Markdown
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 11 out of 11 changed files in this pull request and generated 2 comments.

onScroll: (event: ScrollEvent) => void;
onInitialized: (args: { component: Scrollable }) => void;
onOptionChanged: (args: { fullName: string; value: unknown; component: Scrollable }) => void;
direction?: 'both';
Comment on lines +406 to +414
protected override renderIndicator(
height: number,
rtlOffset: number,
$container: dxElementWrapper,
groupCount: number,
): void {
if (height !== undefined) {
noop();
}
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