Skip to content

event form: duplicate shortcut tooltip is hidden and Cmd+D also changes view #1842

@tyler-dane

Description

@tyler-dane

Bug report

When a user opens a Week View Grid Event form and uses the Duplicate Event action, two related affordances break: the Duplicate Event menu item's Cmd+D tooltip renders behind the Event Form, and pressing Cmd+D duplicates the Event but also lets the underlying D view shortcut navigate back to Day View. This affects users editing existing Grid Events from Week View, especially on macOS where Cmd+D is the documented duplicate shortcut.

Where it happened

Route/screen: /week, Week View Timed Grid, existing Grid Event form opened from a clicked event.

Environment/account state: reported from Chrome on macOS against backend.compasscalendar.app/week; screenshot shows an authenticated Google-connected account.

Workflow

  1. In Week View, click an existing Grid Event so the Event Form opens.
  2. Open the form actions menu.
  3. Hover the Duplicate Event menu item.
  4. Observe the Cmd+D tooltip.
  5. With the Event Form open from the Grid Event, press Cmd+D on macOS.
  6. The Event is duplicated, but the D view shortcut also fires and redirects the user to Day View.

Expected outcome

The Duplicate Event tooltip should render above the Event Form/action menu stack so the shortcut hint is readable.

Cmd+D should only run the Event Form duplicate action while the form is open. It should not also trigger the global/view D shortcut or navigate away from Week View.

Screenshot

Image

Diagnosis

Reproduction status: not re-run locally against the staging account, but the attached screenshot directly shows the tooltip layering failure, and static inspection found a likely propagation path for the shortcut failure.

Evidence:

  • docs/Acceptance/events.md Scenario 11 documents Cmd+D/Ctrl+D as the Event Form duplicate shortcut.
  • docs/Acceptance/shortcuts.md says shortcuts are context-aware and should not fire while the user is typing in a form field, with Cmd+K as the exception.
  • The Duplicate Event menu item is rendered by packages/web/src/views/Forms/EventForm/DuplicateMenuButton.tsx through packages/web/src/views/Forms/ActionsMenu/MenuItem.tsx.
  • MenuItem wraps action items in the shared tooltip system. TooltipContent computes zIndex as useGridMaxZIndex() + ZIndex.LAYER_3, but the Event Form stack uses Z_INDEX_FLOATING_FORM = ZIndex.MAX + ZIndex.LAYER_1 and the actions menu uses Z_INDEX_FLOATING_MENU = Z_INDEX_FLOATING_FORM + 1. A tooltip at roughly grid max + 3 can therefore sit below the floating form/menu layer, matching the screenshot.
  • packages/web/src/views/Forms/EventForm/EventForm.tsx registers useAppHotkey("Mod+D", ...) with EVENT_FORM_PLAIN_HOTKEY_OPTIONS and calls preventDefault() but does not call stopPropagation().
  • The Someday form shortcut helper already uses a stopPropagationWrapper for Mod+D in packages/web/src/views/Forms/SomedayEventForm/useSomedayFormShortcuts.ts, which is a nearby pattern for preventing parent/global shortcut handling.
  • packages/web/src/common/constants/shortcuts.constants.ts maps the Day view shortcut to d, so a hotkey library or global listener that treats Mod+D as also satisfying d could explain why duplication succeeds and then Day navigation fires.

Confidence: medium-high. The screenshot confirms the layering issue; the shortcut diagnosis is based on code inspection plus the reporter's observed behavior.

Related issue: possibly related to #1610 (Duplicate event doesn't work), but this appears distinct because duplication now succeeds and the remaining failure is shortcut propagation/navigation plus tooltip layering.

Likely fix

Start in the Event Form action menu/tooltip stack and the Event Form shortcut handler.

  • For the tooltip, ensure action-menu tooltip content is layered above the floating Event Form and floating menu. Options include allowing TooltipContent to accept an explicit z-index/layer for floating-form contexts, or making menu-item tooltips use a z-index above Z_INDEX_FLOATING_MENU.
  • For Cmd+D, update the Event Form Mod+D handler to stop propagation in addition to preventing default, following the Someday form's stopPropagationWrapper behavior. Preserve Cmd+D duplication behavior and do not suppress unrelated form shortcuts such as Mod+Enter or Delete.
  • Add regression coverage around an existing Week Grid Event form: firing Cmd+D should call duplicate once and should not invoke view navigation to /day.

Verification

  1. Start the frontend with bun dev:web.
  2. In Week View, open an existing Grid Event form from the Timed Grid.
  3. Open the actions menu and hover Duplicate Event; the Cmd+D tooltip should be fully visible above the form/menu.
  4. Press Cmd+D/Ctrl+D with the form open; the Event duplicates and the app remains on /week.
  5. Run the focused web tests for the touched components/hooks, then bun test:web or the relevant narrower package tests if the fix stays localized.

Metadata

Metadata

Assignees

No one assigned

    Labels

    webFrontend/web related issue

    Type

    No fields configured for Bug.

    Projects

    Status
    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions