Skip to content

Scheduler: refactor view model output and sorted Index#30732

Merged
Ambrozy merged 8 commits intoDevExpress:25_2from
Ambrozy:25_2_view_model_output
Aug 14, 2025
Merged

Scheduler: refactor view model output and sorted Index#30732
Ambrozy merged 8 commits intoDevExpress:25_2from
Ambrozy:25_2_view_model_output

Conversation

@Ambrozy
Copy link
Copy Markdown
Contributor

@Ambrozy Ambrozy commented Aug 13, 2025

No description provided.

@Ambrozy Ambrozy self-assigned this Aug 13, 2025
@Ambrozy Ambrozy requested a review from a team as a code owner August 13, 2025 07:32
@Ambrozy Ambrozy added the 25_2 label Aug 13, 2025
wdevfx
wdevfx previously approved these changes Aug 14, 2025
import { setupSchedulerTestEnvironment } from './__mock__/m_mock_scheduler';

describe('Appointments', () => {
it('All-day appointment should not be resizable if current view is "day"', async () => {
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.

Can you clarify? appointment should not be resizable but in assertion block appointment.classList.contains('dx-resizable') should be resizeble.
Same in test name - Appointment should **not** re-rendered on window resize when width and height have percent value (T1139566) but in the assertion block we are not checking whether it was re-rendered or not. Why was the test renamed this way

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.

The condition is correct !appointment.classList.contains('dx-resizable'). if appointment resizable it has dx-resizable class. Otherwise no class.

According to Appointment should **not** re-rendered on window resize when width and height have percent value (T1139566). Because new change detection mechanism is better track changes, this cases not trigger rerender anymore. In the ticket user complained to often rerender. S it's become better.


const compare = (a: Obj, b: Obj): boolean => a.id === b.id && a.name === b.name;

const getOperations = <T>(items: ReturnType<typeof getArraysDiff<T>>): string => items
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.

This is a great finding — it looks like these methods are not only useful for testing, but could also define the API between submodules.
Currently, isNeedToAdd and isNeedToRemove seem somewhat scattered and are used only in tests.
An API that directly states whether an item should be added, left unchanged, or removed would be much more convenient than passing separate flags like needToAdd: true, etc.
As a suggestion for future refactoring, it might be worth applying this approach both in tests and in the submodules’ API to make it consistent and easier to work with.

const n = a.length;
const m = b.length;

const dp: number[][] = Array.from({ length: n + 1 }, () => new Array<number>(m + 1).fill(0));
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.

An n*m array can be quite memory-intensive (and thus impact performance). We could potentially reduce memory usage here.

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.

The performance tests result:

  1. 1000 of recurrence appointments in timeline view without virtual scrolling. Before: 5.57s, After: 1.5s
  2. 100 appointments for 100 resources with virtual scrolling. Before: 1.73s, After: 1.326s

@Ambrozy Ambrozy merged commit cdd7e6e into DevExpress:25_2 Aug 14, 2025
412 of 414 checks passed
@Ambrozy Ambrozy deleted the 25_2_view_model_output branch August 14, 2025 13:06
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