Skip to content
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

fix: 28114 shadow pr for 36504 #36778

Closed
wants to merge 4 commits into from

Conversation

alex-golovanov
Copy link
Contributor

@alex-golovanov alex-golovanov commented Oct 9, 2024

Description

This is a shadow PR for 36504

Fixes #28114

Automation

/ok-to-test tags="@tag.All"

🔍 Cypress test results

Warning

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/11254766134
Commit: 35e95b6
Cypress dashboard.
Tags: @tag.All
Spec:
It seems like no tests ran 😔. We are not able to recognize it, please check workflow here.


Wed, 09 Oct 2024 14:28:25 UTC

Communication

Should the DevRel and Marketing teams inform users about this change?

  • Yes
  • No

Summary by CodeRabbit

  • New Features

    • Improved interaction handling in the Navigation Menu to close the popover when clicking outside of it.
  • Bug Fixes

    • Enhanced state management for the popover, ensuring a smoother user experience.

Copy link
Contributor

coderabbitai bot commented Oct 9, 2024

Walkthrough

The pull request introduces a new function, handleInteractionOutside, within the NavigationMenu component of the application. This function utilizes the useCallback hook to manage the isPopoverOpen state, ensuring it is set to false when a user interacts outside the menu. Additionally, the MenuContent component is updated to include a prop that links to this new function, enhancing the interaction handling without altering the overall structure of the component.

Changes

File Path Change Summary
app/client/src/pages/Editor/EditorName/NavigationMenu.tsx Added handleInteractionOutside function to manage popover state on outside interactions. Updated MenuContent to use this function.

Assessment against linked issues

Objective Addressed Explanation
Close app title dropdown when omnibar is opened using hotkeys (#28114)

Possibly related PRs

Suggested labels

Bug, Production, Omnibar, Needs Triaging, ok-to-test

Suggested reviewers

  • hetunandu

🎉 In the land of code where functions play,
A new interaction found its way.
With handleInteractionOutside in tow,
The popover closes, as it should, you know!
So let’s cheer for the changes, both clever and bright,
Enhancing our app, making it just right! 🎈


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added Bug Something isn't working IDE Pod Issues that new developers face while exploring the IDE IDE Product Issues related to the IDE Product Inviting Contribution Issues that we would like contributions to Low An issue that is neither critical nor breaks a user flow Needs Triaging Needs attention from maintainers to triage Page Management Issues related to configuring pages Production labels Oct 9, 2024
@alex-golovanov alex-golovanov added the ok-to-test Required label for CI label Oct 9, 2024
@github-actions github-actions bot removed the ok-to-test Required label for CI label Oct 9, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (1)
app/client/src/pages/Editor/EditorName/NavigationMenu.tsx (1)

21-21: Great update to the MenuContent component, class!

You've added the onInteractOutside prop and connected it to our new handleInteractionOutside function. This is like adding a new rule to our classroom - when someone's attention wanders outside, we close the book. It's a smart way to address the issue with the menu not closing.

Here's a gold star suggestion to make your code even clearer:

Consider adding a comment explaining the purpose of this prop. It could look like this:

<MenuContent
  // Close the menu when user interacts outside
  onInteractOutside={handleInteractionOutside}
  width="214px"
>

This way, future students (I mean, developers) will understand the purpose at a glance!

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 71963b5 and 35e95b6.

📒 Files selected for processing (1)
  • app/client/src/pages/Editor/EditorName/NavigationMenu.tsx (2 hunks)
🧰 Additional context used
🔇 Additional comments (3)
app/client/src/pages/Editor/EditorName/NavigationMenu.tsx (3)

1-1: Good job adding the necessary import, class!

I see you've added the useCallback import from 'react'. This is exactly what we need for our new function. Keep up the good work!


16-18: Excellent addition of the handleInteractionOutside function, students!

This new function is like a hall monitor for our menu. It makes sure that when someone clicks outside the menu, it closes up shop. Here's what I like about it:

  1. You've used useCallback - that's good for performance, just like how we reuse our textbooks instead of buying new ones every year.
  2. The function does one job and does it well - setting isPopoverOpen to false.
  3. You've included setIsPopoverOpen in the dependency array - that's attention to detail!

This should help solve our issue with the menu not closing when using keyboard shortcuts. Well done!


Line range hint 1-33: Class, let's review what we've learned today!

Your changes to the NavigationMenu component are like adding a new chapter to our React textbook. Here's a summary of what you've accomplished:

  1. You've imported useCallback - a tool for optimizing our code's performance.
  2. You've created a new handleInteractionOutside function that acts as a watchful eye, closing our menu when it's not needed.
  3. You've updated the MenuContent component to use this new function, ensuring our menu behaves properly.

These changes directly address the issue of the app title drop-down menu not closing when opening the omnibar using keyboard shortcuts. It's a comprehensive solution that should improve the user experience.

Remember, clear code is like a well-organized classroom - it helps everyone understand and learn better. Keep up the excellent work, and don't forget to add comments to explain your code when it might not be immediately obvious to others.

Class dismissed, and great job on this assignment!

@alex-golovanov alex-golovanov added the ok-to-test Required label for CI label Oct 9, 2024
@alex-golovanov
Copy link
Contributor Author

image

Test reporting here seems to be broken, Cypress dashboard shows all tests as passing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working IDE Pod Issues that new developers face while exploring the IDE IDE Product Issues related to the IDE Product Inviting Contribution Issues that we would like contributions to Low An issue that is neither critical nor breaks a user flow Needs Triaging Needs attention from maintainers to triage ok-to-test Required label for CI Page Management Issues related to configuring pages Production
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: App title drop down pop up is not getting closed automatically when user opens up omnibar using hotkeys
2 participants