Skip to content

Refactor DateSeparator using MVVM and move to shared-components#32482

Merged
rbondesson merged 46 commits intoelement-hq:developfrom
ZacksBot:refactor/date-separator
Mar 2, 2026
Merged

Refactor DateSeparator using MVVM and move to shared-components#32482
rbondesson merged 46 commits intoelement-hq:developfrom
ZacksBot:refactor/date-separator

Conversation

@rbondesson
Copy link
Copy Markdown
Contributor

@rbondesson rbondesson commented Feb 12, 2026

Checklist

Refactor and move DateSeparator to shared-components

Summary

  • Moved DateSeparator component to @element-hq/web-shared-components package as DateSeparatorView
  • Replaced the JumpToDatePicker component with a compound context menu in shared components

Changes

New shared component

  • Adopted the ViewModel pattern (MVVM) for the component, introducing the DateSeparatorViewSnapshot interface
  • Added CSS module for styling, Storybook for visual testing and unit tests with snapshot coverage

Codebase migration

  • Added DateSeparatorViewModel.tsx to element-web including unit-test
  • Components in element-web now renders DateSeparatorView instead of the old component.

Test plan

  • Verify date separator renders correctly in rooms
  • Check Storybook stories render correctly and create new screenshots
  • Run new unit tests in shared component
  • Run unit tests for affected components in element-web
  • Run visual tests for affected components in element-web

Tests

Before & After

  • Before Refactoring
image image
  • After Refactoring
image image

Closes element-hq/wat-internal#387

@github-actions github-actions Bot added the Z-Community-PR Issue is solved by a community member's PR label Feb 12, 2026
@rbondesson rbondesson added the T-Task Tasks for the team like planning label Feb 12, 2026
Comment thread src/viewmodels/timeline/DateSeparatorViewModel.tsx Outdated
Comment thread src/components/views/dialogs/MessageEditHistoryDialog.tsx Outdated
Copy link
Copy Markdown
Member

@MidhunSureshR MidhunSureshR left a comment

Choose a reason for hiding this comment

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

Almost there 👍

Comment thread packages/shared-components/src/timeline/DateSeparatorView/DateSeparatorButton.tsx Outdated
Comment thread packages/shared-components/src/timeline/DateSeparatorView/DateSeparatorView.tsx Outdated
Copy link
Copy Markdown
Member

@MidhunSureshR MidhunSureshR left a comment

Choose a reason for hiding this comment

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

Thanks 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-Task Tasks for the team like planning Z-Community-PR Issue is solved by a community member's PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants