Skip to content

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

Merged
sjbur merged 22 commits into
DevExpress:26_1from
sjbur:issue-4126_26_1
Jun 5, 2026
Merged

Scheduler: refactor workspaces module (TS): part 1#33824
sjbur merged 22 commits into
DevExpress:26_1from
sjbur:issue-4126_26_1

Conversation

@sjbur
Copy link
Copy Markdown
Contributor

@sjbur sjbur commented Jun 3, 2026

No description provided.

web-flow and others added 7 commits June 2, 2026 13:27
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Sergei Burkatskii <sergei.burkatskii@devexpress.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Sergei Burkatskii <sergei.burkatskii@devexpress.com>
@sjbur sjbur self-assigned this Jun 3, 2026
@sjbur sjbur added the 26_1 label Jun 3, 2026
@sjbur sjbur marked this pull request as ready for review June 3, 2026 14:12
@sjbur sjbur requested a review from a team as a code owner June 3, 2026 14:12
Copilot AI review requested due to automatic review settings June 3, 2026 14:12
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

This PR continues the Scheduler workspace TypeScript refactor by tightening typings across workspace implementations (base workspace, month/week/day, timeline variants, agenda) and aligning option/change handling with internal “safe” scheduler option types.

Changes:

  • Introduced and exported shared workspace typing primitives (scrollable config types, date generation options, option-changed option union) and applied stricter method signatures/return types.
  • Switched workspace option typing from dxSchedulerOptions to internal SafeSchedulerOptions, and updated _optionChanged signatures to use typed OptionChanged<...>.
  • Added skippedDays?: number[] to internal scheduler options and propagated related typing usage through render option generation.

Reviewed changes

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

Show a summary per file
File Description
packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts Adds exported workspace TS types, switches to SafeSchedulerOptions, tightens scrollable config and option-changed typing.
packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_week.ts Adds explicit return types for overrides and tightens startDate typing.
packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_month.ts Adds explicit method signatures, refines interval math typing, and exports month date-generation option typing usage.
packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_indicator.ts Tightens types around the current-time indicator and option-changed handling.
packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_day.ts Adds explicit return types for overrides and render method.
packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts Tightens typing for timeline workspace, scroll configs, and render option generation.
packages/devextreme/js/__internal/scheduler/workspaces/m_timeline_week.ts Adds explicit return types for overrides and registration typing suppression.
packages/devextreme/js/__internal/scheduler/workspaces/m_timeline_month.ts Tightens typing for header templates, start date calculation, and render option generation.
packages/devextreme/js/__internal/scheduler/workspaces/m_timeline_day.ts Adds explicit return types for overrides and registration typing suppression.
packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts Tightens Agenda workspace typing, improves some guards, and refactors several helpers to typed implementations.
packages/devextreme/js/__internal/scheduler/utils/options/types.ts Adds skippedDays?: number[] to SchedulerInternalOptions.
packages/devextreme/js/__internal/scheduler/m_scheduler.ts Types _optionChanged as OptionChanged<SafeSchedulerOptions>.

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/workspaces/m_agenda.ts Outdated
Copilot AI review requested due to automatic review settings June 4, 2026 10:36
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 12 out of 12 changed files in this pull request and generated 1 comment.

Comment thread packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts Outdated
Copilot AI review requested due to automatic review settings June 4, 2026 11:02
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 12 out of 12 changed files in this pull request and generated 4 comments.

Comments suppressed due to low confidence (1)

packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts:241

  • WorkspaceOptionsInternal.startDate is typed as Date, but Scheduler view startDate option is declared as Date | number | string | undefined (see js/ui/scheduler.d.ts:1161) and workspace default options set startDate: null. This narrowing can hide invalid runtime values and makes downstream code assume Date when it may be number|string|null.
export type WorkspaceOptionsInternal = Omit<SafeSchedulerOptions, 'groups'> & {
  groups: ResourceLoader[];
  getResourceManager: () => ResourceManager;
  startDate?: Date;
  currentDate: Date;
  intervalCount: number;

Comment thread packages/devextreme/js/__internal/scheduler/workspaces/agenda.ts Outdated
{
dateTableCellsMeta: [[{}]],
allDayPanelCellsMeta: [{}],
dateTableCellsMeta: [[{
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.

Agenda does not have any "cells", those values just mocked and does not affect anything, but for type safety reasons I changed the mocked values, because dateTableCellsMeta is array of Rect. So I just pass empty rects.

Comment thread packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts Outdated
Comment thread packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts Outdated
Comment thread packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_indicator.ts Outdated
Copilot AI review requested due to automatic review settings June 4, 2026 12:37
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 13 out of 13 changed files in this pull request and generated no new comments.

Tucchhaa
Tucchhaa previously approved these changes Jun 4, 2026
);

const cellTemplate: any = this.option('resourceCellTemplate');
const cellTemplate = this.option('resourceCellTemplate') as TemplateBase | undefined;
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 remove this as by moving the type to the options type?

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.

Moved resourceCellTemplate to workspace internal options

getAgendaVerticalStepHeight() {
return this.option('rowHeight');
getAgendaVerticalStepHeight(): number {
return this.option('rowHeight') as 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.

is it possible to remove as by moving rowHeight option to the options type?

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.

Moved rowHeight to workspace internal options

this.option('endDayHour') as any,
this.option('agendaDuration') as any,
this.option('endDayHour'),
this.option('agendaDuration') as 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.

is it possible to remove as by moving agendaDuration option to the options type?

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.

Moved agendaDuration to workspace internal options

type?: ViewType;
};

export type WorkspaceOptionChangedOptions = WorkspaceOptionsInternal & {
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.

Why do we need both WorkspaceOptionsInternal and WorkspaceOptionChangedOptions? Why not use a single type for workspace options?

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.

Yes, you're right. Removed WorkspaceOptionChangedOptions. Also moved all missing options from m_scheduler workspace config to workspace internal options.

Copilot AI review requested due to automatic review settings June 5, 2026 09:19
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 30 out of 30 changed files in this pull request and generated 2 comments.

Comment thread packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts Outdated
@sjbur sjbur merged commit 2098d97 into DevExpress:26_1 Jun 5, 2026
128 of 129 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.

5 participants