Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 5, 2025

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

This section details on the original issue you should resolve

<issue_title>Add a shortcut in the day view to create an event</issue_title>
<issue_description>### Priority

High (would significantly improve my experience)

Feature Description

Implement a keyboard shortcut in the day view of Compass to quickly create a new calendar event. Pressing the "c" key should immediately open the event creation form, allowing users to add details and schedule an event for the selected day. This shortcut should be context-aware; only triggering in the day view and when no other input fields or modals are focused, to avoid interfering with text entry or other interactions.

Use Case

Users who frequently add events throughout their workday can do so much faster by using a single key. For example, a user navigating through their agenda with keyboard shortcuts can press "c" to instantly bring up the event form, streamlining the workflow and minimizing context switching. This improves efficiency and increases comfort for power users who rely on keyboard-centric navigation.

Additional Context

Follow interaction and accessibility standards defined in AGENTS.md. Ensure the shortcut does not conflict with other commands; provide visual feedback or tooltips for discoverability.</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits December 5, 2025 18:35
… 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>
Copilot AI changed the title [WIP] Add keyboard shortcut to create event in day view feat(web): add context-aware 'c' shortcut to create events in day view Dec 5, 2025
Copilot AI requested a review from victor-enogwe December 5, 2025 18:45
@victor-enogwe victor-enogwe changed the title feat(web): add context-aware 'c' shortcut to create events in day view feat(web): add 'n' shortcut to create events in day view Dec 8, 2025
@victor-enogwe victor-enogwe marked this pull request as ready for review December 8, 2025 13:34
Copilot AI review requested due to automatic review settings December 8, 2025 13:34
Copy link
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 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 openEventForm from the draft context
  • Refactored DayViewContent to properly access useDraftContextV2 hook 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

@victor-enogwe victor-enogwe merged commit 41afcbc into main Dec 8, 2025
5 checks passed
@victor-enogwe victor-enogwe deleted the copilot/add-shortcut-day-view-event branch December 8, 2025 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a shortcut in the day view to create an event

2 participants