-
Notifications
You must be signed in to change notification settings - Fork 50
feat(web): add 'n' shortcut to create events in day view #1346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
… view Co-authored-by: victor-enogwe <23452630+victor-enogwe@users.noreply.github.com>
Co-authored-by: victor-enogwe <23452630+victor-enogwe@users.noreply.github.com>
There was a problem hiding this 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 implements a keyboard shortcut ('n') to quickly create calendar events in the day view, addressing issue #1336. The implementation correctly avoids conflicts with the existing 'c' shortcut (used for creating tasks) by using 'n' instead. The code properly handles context-awareness through existing keyboard event filtering that prevents shortcuts from firing when users are typing in input fields.
Key changes:
- Added 'n' keyboard shortcut mapped to
openEventFormfrom the draft context - Refactored
DayViewContentto properly accessuseDraftContextV2hook within the provider boundary - Updated shortcut configuration to include "Create event" in the Calendar section of the shortcuts overlay
- Fixed shortcuts overlay section title from "Home" to "Day" for consistency
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/web/src/views/Day/view/DayViewContent.tsx | Refactored component structure to properly use useDraftContextV2 hook within DraftProviderV2, connected 'n' shortcut to openEventForm, and fixed section title from "Home" to "Day" |
| packages/web/src/views/Day/view/DayView.test.tsx | Updated test to handle multiple 'k' shortcuts now displayed (CMD+K for command palette and 'k' for next day) |
| packages/web/src/views/Day/hooks/shortcuts/useDayViewShortcuts.ts | Added onCreateEvent handler mapped to 'n' key in the shortcut configuration |
| packages/web/src/views/Day/hooks/shortcuts/useDayViewShortcuts.test.ts | Added comprehensive test coverage for the new 'n' shortcut, verifying it doesn't conflict with 'c' and respects input field context |
| packages/web/src/common/utils/shortcut/data/shortcuts.data.ts | Created new dayShortcuts section for day navigation, moved 't' shortcut there, and added 'n' shortcut to dayAgendaShortcuts |
| packages/web/src/common/utils/shortcut/data/shortcuts.data.test.ts | Updated tests to reflect the new dayShortcuts structure and verify 'n' shortcut configuration |
…n and add tests for DraftProviderV2
What does this PR do?
Implements keyboard shortcut to create calendar events in day view. Pressing 'n' opens the event form for creating a new event
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.