Skip to content

Scheduler - Refactor Appointments Collection - KBN#33643

Open
bit-byte0 wants to merge 5 commits into
DevExpress:26_1from
bit-byte0:refactor/scheduler-appointments-kbn
Open

Scheduler - Refactor Appointments Collection - KBN#33643
bit-byte0 wants to merge 5 commits into
DevExpress:26_1from
bit-byte0:refactor/scheduler-appointments-kbn

Conversation

@bit-byte0
Copy link
Copy Markdown
Contributor

What

Keyboard navigation for new appointments_new/ architecture (Del/Home/End/Enter/Space)

How

  • New props: allowDelete, onDeleteKeyPress, onItemActivate on AppointmentsProperties
  • focus_controller: switch(true) per key in onViewItemKeyDown
  • Del passes correct occurrence startDate, recurring delete excludes right instance

@bit-byte0 bit-byte0 self-assigned this May 20, 2026
@bit-byte0 bit-byte0 requested a review from a team as a code owner May 20, 2026 08:41
Copilot AI review requested due to automatic review settings May 20, 2026 08:41
@bit-byte0 bit-byte0 added the 26_1 label May 20, 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

This PR extends the new Scheduler appointments architecture (appointments_new/) with keyboard navigation/activation and delete-by-key support, wiring these behaviors up from Scheduler into the new Appointments component and adding Jest coverage for the new key interactions.

Changes:

  • Added allowDelete, onDeleteKeyPress, and onItemActivate to AppointmentsProperties and wired them from Scheduler.
  • Expanded AppointmentsFocusController key handling to support Delete/Home/End/Enter/Space.
  • Updated/added Jest tests to use @testing-library/dom key events and to cover the new keyboard behaviors.

Reviewed changes

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

Show a summary per file
File Description
packages/devextreme/js/__internal/scheduler/m_scheduler.ts Passes delete/activate callbacks + allowDelete into new Appointments configuration.
packages/devextreme/js/__internal/scheduler/appointments_new/appointments.ts Extends AppointmentsProperties and provides default options for new callbacks/flags.
packages/devextreme/js/__internal/scheduler/appointments_new/appointments.focus_controller.ts Implements the new key handling logic (Delete/Home/End/Enter/Space).
packages/devextreme/js/__internal/scheduler/appointments_new/appointments.test.ts Updates keydown simulation and adds unit tests for Home/End and keyboard actions.
packages/devextreme/js/__internal/scheduler/tests/appointments_new.test.ts Adds integration tests for deleting appointments via the Delete key (including recurring occurrences).

Comment on lines 52 to +56
public onViewItemKeyDown(viewItem: ViewItem, e: KeyboardKeyDownEvent): void {
if (e.key === 'Tab') {
this.handleTabKeyDown(e, viewItem.option().sortedIndex);
switch (true) {
case e.key === 'Tab':
this.handleTabKeyDown(e, viewItem.option().sortedIndex);
break;
private handleEnterKeyDown(sortedIndex: number): void {
const { onItemActivate } = this.appointments.option();
const entity = this.sortedAppointments[sortedIndex];
onItemActivate({ data: entity?.itemData, target: null });
Comment on lines +390 to +395
const appointment = POM.getAppointments()[0];
appointment.element.focus();
fireEvent.keyDown(appointment.element, { key: 'Delete' });

expect(POM.getAppointments().length).toBe(0);
});
Comment on lines +408 to +415
expect(POM.getAppointments().length).toBe(3);

const appointment = POM.getAppointments()[0];
appointment.element.focus();
fireEvent.keyDown(appointment.element, { key: 'Delete' });

expect(POM.getAppointments().length).toBe(2);
});
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.

2 participants