[PR #1058] [MERGED] fix: duplicate modal instances from hotkey activation #1351

Closed
opened 2026-02-26 19:32:53 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/documenso/documenso/pull/1058
Author: @deepgolani4
Created: 3/26/2024
Status: Merged
Merged: 4/16/2024
Merged by: @dguyen

Base: mainHead: Bug-fix-command-menu-renders


📝 Commits (10+)

  • e8eeabf fix: duplicate modal rendering on hotkeys activation
  • 7e64bb2 Merge branch 'main' of https://github.com/deepgolani4/documenso into Bug-fix-command-menu-renders
  • 82a7113 Merge branch 'main' into Bug-fix-command-menu-renders
  • f68439e Merge branch 'main' into Bug-fix-command-menu-renders
  • 0dc4a6d Merge branch 'main' into Bug-fix-command-menu-renders
  • 8c9ee66 Merge branch 'main' into Bug-fix-command-menu-renders
  • 3266439 Merge branch 'main' into Bug-fix-command-menu-renders
  • 8dc0761 Merge branch 'main' into Bug-fix-command-menu-renders
  • aaccf12 Merge branch 'main' into Bug-fix-command-menu-renders
  • 4263408 chore: refactor

📊 Changes

2 files changed (+6 additions, -11 deletions)

View changed files

📝 apps/web/src/components/(dashboard)/layout/desktop-nav.tsx (+5 -10)
📝 apps/web/src/components/(dashboard)/layout/header.tsx (+1 -1)

📄 Description

Description

Currently, when the command menu is opened using the Command+K hotkey, two modals are getting rendered.
This is because the modals are mounted in two components: header and desktop-nav. Upon triggering the hotkey, both modals are rendered.

#1032

Changes Made

The changes I made are in the desktop nav component. If the desktop nav receives the command menu state value and the state setter function, it will trigger only that. If not, it will trigger the state setter that is defined in the desktop nav. This way, we are preventing the modal from mounting two times.

Testing Performed

  • Tested behaviour of command menu in the portal
  • Tested on browsers chrome, arc, safari, chrome, firefox

Checklist

  • I have tested these changes locally and they work as expected.
  • I have added/updated tests that prove the effectiveness of these changes.
  • I have updated the documentation to reflect these changes, if applicable.
  • I have followed the project's coding style guidelines.
  • I have addressed the code review feedback from the previous submission, if applicable.

Summary by CodeRabbit

  • New Features
    • Enhanced the navigation experience by integrating command menu state management directly within the DesktopNav component, allowing for smoother interactions and control.
  • Refactor
    • Simplified the handling of the command menu by removing the CommandMenu component and managing its functionality within DesktopNav.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/documenso/documenso/pull/1058 **Author:** [@deepgolani4](https://github.com/deepgolani4) **Created:** 3/26/2024 **Status:** ✅ Merged **Merged:** 4/16/2024 **Merged by:** [@dguyen](https://github.com/dguyen) **Base:** `main` ← **Head:** `Bug-fix-command-menu-renders` --- ### 📝 Commits (10+) - [`e8eeabf`](https://github.com/documenso/documenso/commit/e8eeabf6e932e7812890c7664bd3c72011483327) fix: duplicate modal rendering on hotkeys activation - [`7e64bb2`](https://github.com/documenso/documenso/commit/7e64bb23f448518479dff53f167118c5a7afc80f) Merge branch 'main' of https://github.com/deepgolani4/documenso into Bug-fix-command-menu-renders - [`82a7113`](https://github.com/documenso/documenso/commit/82a7113a64dd901eb73b37d290ba36a9739d62b6) Merge branch 'main' into Bug-fix-command-menu-renders - [`f68439e`](https://github.com/documenso/documenso/commit/f68439e514c063855f84d707b5b6ff65ef19af13) Merge branch 'main' into Bug-fix-command-menu-renders - [`0dc4a6d`](https://github.com/documenso/documenso/commit/0dc4a6d34804f5b8e40dd6854ace692bc25d48e1) Merge branch 'main' into Bug-fix-command-menu-renders - [`8c9ee66`](https://github.com/documenso/documenso/commit/8c9ee6650c438874cdbe86ecf9a966ccf93d3d09) Merge branch 'main' into Bug-fix-command-menu-renders - [`3266439`](https://github.com/documenso/documenso/commit/3266439287c75dd83c501d5b872f9ac4f8eb51ea) Merge branch 'main' into Bug-fix-command-menu-renders - [`8dc0761`](https://github.com/documenso/documenso/commit/8dc0761fede6778101da77caebd7d07f738f82f1) Merge branch 'main' into Bug-fix-command-menu-renders - [`aaccf12`](https://github.com/documenso/documenso/commit/aaccf12f0807e87483f9d804ada577e60399d51c) Merge branch 'main' into Bug-fix-command-menu-renders - [`4263408`](https://github.com/documenso/documenso/commit/4263408627abb48d5110c356808798c39fabb60b) chore: refactor ### 📊 Changes **2 files changed** (+6 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `apps/web/src/components/(dashboard)/layout/desktop-nav.tsx` (+5 -10) 📝 `apps/web/src/components/(dashboard)/layout/header.tsx` (+1 -1) </details> ### 📄 Description ## Description Currently, when the command menu is opened using the Command+K hotkey, two modals are getting rendered. This is because the modals are mounted in two components: header and desktop-nav. Upon triggering the hotkey, both modals are rendered. ## Related Issue #1032 ## Changes Made The changes I made are in the desktop nav component. If the desktop nav receives the command menu state value and the state setter function, it will trigger only that. If not, it will trigger the state setter that is defined in the desktop nav. This way, we are preventing the modal from mounting two times. ## Testing Performed - Tested behaviour of command menu in the portal - Tested on browsers chrome, arc, safari, chrome, firefox ## Checklist - [x] I have tested these changes locally and they work as expected. - [ ] I have added/updated tests that prove the effectiveness of these changes. - [ ] I have updated the documentation to reflect these changes, if applicable. - [x] I have followed the project's coding style guidelines. - [ ] I have addressed the code review feedback from the previous submission, if applicable. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Enhanced the navigation experience by integrating command menu state management directly within the `DesktopNav` component, allowing for smoother interactions and control. - **Refactor** - Simplified the handling of the command menu by removing the `CommandMenu` component and managing its functionality within `DesktopNav`. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 19:32:53 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/documenso#1351
No description provided.