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/profile popup #319

Merged
merged 2 commits into from
Oct 9, 2024
Merged

Fix/profile popup #319

merged 2 commits into from
Oct 9, 2024

Conversation

tulsiojha
Copy link
Contributor

@tulsiojha tulsiojha commented Oct 9, 2024

Summary by Sourcery

Fix the profile popup functionality and enhance the handling of disabled states across components. Improve consistency in parameter list formatting and prevent default events in specific components to enhance user interaction.

Bug Fixes:

  • Fix the profile popup by ensuring the open state is correctly managed and the navigation is properly handled when clicking on profile settings.

Enhancements:

  • Improve the handling of disabled states in various components by using functions to determine the disabled status.
  • Enhance the OptionMenu components by adding commas to the end of parameter lists for consistency.
  • Prevent default events in the OptionMenuLink component to improve user interaction.
  • Stop event propagation on wheel and touch move events in the Select component to prevent unintended scrolling.

Copy link

sourcery-ai bot commented Oct 9, 2024

Reviewer's Guide by Sourcery

This pull request focuses on fixing issues related to the profile popup and making minor adjustments to various components. The changes primarily involve code formatting, event handling improvements, and small functional updates across multiple files.

User journey diagram for profile popup interaction

journey
    title User Journey for Profile Popup Interaction
    section Profile Menu Interaction
      User -> OptionList.Root: Open Profile Menu
      User -> OptionList.Trigger: Click Profile Trigger
      OptionList.Trigger -> OptionList.Item: Display Profile Options
      User -> OptionList.Item: Click Profile Settings
      OptionList.Item -> navigate: Navigate to Profile Settings
    section Profile Settings
      navigate -> Profile Settings Page: Load Profile Settings Page
      User -> Profile Settings Page: Interact with Profile Settings
Loading

Class diagram for OptionList components

classDiagram
    class OptionMenuTrigger {
        +forwardRef<HTMLButtonElement, ITrigger>
    }
    class OptionMenuContent {
        +forwardRef
    }
    class OptionItemRaw {
        +forwardRef
    }
    class OptionMenuItem {
        +forwardRef<HTMLDivElement, IOptionMenuItem>
    }
    class OptionMenuLink {
        +forwardRef<HTMLDivElement, IOptionMenuLink>
    }
    class OptionMenuTextInputItem {
        +forwardRef
    }
    class OptionMenuCheckboxItem {
        +forwardRef<HTMLDivElement, IOptionMenuCheckbox>
    }
    class OptionMenuRadioItem {
        +forwardRef<HTMLDivElement, IOptionMenuRadio>
    }
    class OptionMenuSeparator {
        +forwardRef<HTMLDivElement, IOptionMenuSeparator>
    }
    class OptionMenuTabs {
        +forwardRef<HTMLDivElement, IOptionMenuTabs>
    }
    class Root {
        +open: boolean
        +setOpen: function
    }
    OptionMenuTrigger --> OptionMenuContent
    OptionMenuContent --> OptionItemRaw
    OptionItemRaw --> OptionMenuItem
    OptionMenuItem --> OptionMenuLink
    OptionMenuLink --> OptionMenuTextInputItem
    OptionMenuTextInputItem --> OptionMenuCheckboxItem
    OptionMenuCheckboxItem --> OptionMenuRadioItem
    OptionMenuRadioItem --> OptionMenuSeparator
    OptionMenuSeparator --> OptionMenuTabs
    OptionMenuTabs --> Root
Loading

File-Level Changes

Change Details Files
Improved code formatting and consistency
  • Added missing commas at the end of function parameters and object properties
  • Fixed indentation issues
  • Removed unnecessary comments
src/design-system/components/atoms/option-list.tsx
src/apps/console/routes/_main+/$account+/new-managed-service/_index.tsx
Enhanced event handling in the OptionList component
  • Updated the Root component to use external open state
  • Improved onOpenChange handling
  • Added wheel and touch event handlers to prevent propagation
src/design-system/components/atoms/option-list.tsx
src/design-system/components/atoms/select.tsx
Updated ProfileMenu component functionality
  • Implemented open state management
  • Changed Profile Settings link to use navigation with a delay
  • Removed LinkComponent prop from OptionList.Link
src/apps/console/routes/_main+/_layout/_layout.tsx
Refactored cluster selection rendering
  • Changed disabled prop to be a function
  • Updated render prop to receive disabled state
src/apps/console/page-components/handle-environment.tsx
src/apps/console/routes/_main+/$account+/environments/clone-environment.tsx

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @tulsiojha - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@tulsiojha tulsiojha merged commit 2d711a6 into release-v1.0.8 Oct 9, 2024
5 checks passed
@tulsiojha tulsiojha deleted the fix/profile-popup branch October 9, 2024 10:33
abdheshnayak pushed a commit that referenced this pull request Oct 28, 2024
* fixed profile dropdown menu not closing issue, upgraded react-select and fixed react-select issue for disabled option
tulsiojha added a commit that referenced this pull request Nov 1, 2024
* fixed profile dropdown menu not closing issue, upgraded react-select and fixed react-select issue for disabled option
abdheshnayak pushed a commit that referenced this pull request Nov 5, 2024
* fixed profile dropdown menu not closing issue, upgraded react-select and fixed react-select issue for disabled option
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.

1 participant