Add resizable event preview with top/bottom handles#1372
Merged
Conversation
Co-authored-by: victor-enogwe <23452630+victor-enogwe@users.noreply.github.com>
…tion Co-authored-by: victor-enogwe <23452630+victor-enogwe@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add resizable event preview for event forms
Add resizable event preview with top/bottom handles
Dec 18, 2025
…review :package deps(rxjs-state-management): introduce rxjs state @ngneat/elf library - Updated EventContextMenu and related components to utilize activeEvent$ observable for managing active events. - Replaced setDraft with resetDraft and resetActiveEvent in event form hooks to improve state management. - Refactored tests to mock new event store structure and ensure proper event handling. - Introduced utility functions for calculating event height and rounding minutes to nearest fifteen. - Updated yarn.lock to include new dependencies for @ngneat/elf-entities and @ngneat/use-observable.
17eb600 to
ba0314d
Compare
victor-enogwe
approved these changes
Dec 23, 2025
Contributor
There was a problem hiding this comment.
Pull request overview
This PR implements resizable event previews for timed agenda events with drag handles on top and bottom edges. Users can now adjust event duration by dragging, with changes snapping to 15-minute intervals and updating in real-time via draft state.
Key Changes:
- Enabled top/bottom resize handles on timed events with snap-to-grid behavior
- Introduced Elf state management library alongside Redux for draft/active event state
- Enhanced floating UI positioning with full-width event detection and better overlap handling
Reviewed changes
Copilot reviewed 62 out of 67 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
packages/web/src/common/hooks/useEventResizeActions.ts |
New hook handling resize lifecycle (start/resize/stop) with 15-min snapping |
packages/web/src/views/Day/components/Agenda/Events/TimedAgendaEvent/DraggableTimedAgendaEvent.tsx |
Enabled resize handles and integrated resize actions |
packages/web/src/store/events.ts |
New Elf store managing draft state, active events, and event collections |
packages/web/src/common/hooks/useOpenAtCursor.ts |
Enhanced floating UI control with open state tracking |
packages/web/src/common/hooks/useFloatingAtCursor.ts |
Improved positioning logic for overlapping/full-width events |
packages/web/src/common/utils/dom/grid-organization.util.ts |
Enhanced grid layout with full-width detection for tall events |
packages/web/src/views/Forms/hooks/useOpenEventForm.ts |
Migrated to Elf store for draft management |
packages/web/src/views/Day/components/Agenda/Agenda.tsx |
Integrated Elf observables for event rendering |
packages/web/src/common/hooks/useUpdateEvent.ts |
New hook abstracting event updates with save control |
| Test files | Comprehensive test coverage for new hooks and components |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ons for improved resizing logic
…ing and update tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements resizable event previews for timed agenda events, allowing users to adjust event duration by dragging top or bottom edges. Resize operations update draft state in real-time and snap to 15-minute intervals.
Use Case
closes #1364
Changes
top: trueandbottom: trueinResizablecomponent configSchema_GridEvent.recurrence(allowsrule: null) toSchema_Eventformat (expectsrule?: string[])Implementation
Floating form placement already uses
right-start/left-startstrategy viauseFloatingAtCursor, ensuring preview remains visible during resize.Original prompt
This section details on the original issue you should resolve
<issue_title>Resizable event preview for event forms</issue_title>
<issue_description>### Priority
None
Feature Description
Add the ability to resize the event preview for both existing events and new events. When the event form is open, the preview should not be blocked (except when limited by available floating space). The floating form should be aligned right-start or left-start, so the preview is clearly visible and can be resized.
Use Case
Users will be able to see and interact with event previews more flexibly during event creation and editing. This ensures the preview is clearly visible and adjustable, improving usability and user experience.
Additional Context
<agent_instructions>a preliminary implementation starter code for
packages/web/src/views/Day/components/Agenda/Events/TimedAgendaEvent/DraggableTimedAgendaEvent.tsxis given below.