kloudlite / web

Kloudlite Web
http://kloudlite.io
GNU Affero General Public License v3.0
2 stars 1 forks source link

popup issue fix #323

Closed tulsiojha closed 3 days ago

tulsiojha commented 1 month ago

Summary by Sourcery

Bug Fixes:

sourcery-ai[bot] commented 1 month ago

Reviewer's Guide by Sourcery

This pull request addresses a popup issue by modifying the navigation behavior in the account selection component. The changes involve replacing Link components with custom onClick handlers that use setTimeout to delay navigation, allowing the popup to close before redirecting.

Sequence diagram for popup issue fix in account selection

sequenceDiagram
    actor User
    participant UI as User Interface
    participant Nav as Navigation

    User->>UI: Click on account option
    UI->>UI: setOpen(false)
    UI->>UI: setTimeout(..., 200ms)
    UI-->>User: Close popup
    UI->>Nav: navigate to /{account}/environments

    User->>UI: Click on 'Create team'
    UI->>UI: setOpen(false)
    UI->>UI: setTimeout(..., 200ms)
    UI-->>User: Close popup
    UI->>Nav: navigate to /new-team

File-Level Changes

Change Details Files
Replaced Link components with custom navigation logic
  • Added useNavigate hook from React Router
  • Changed OptionList.Link to OptionList.Item for account options
  • Implemented custom onClick handler with setTimeout for navigation
  • Updated 'Create team' option to use the new navigation pattern
src/apps/console/routes/_main+/$account+/_layout.tsx
Modified popup closing behavior
  • Added setOpen(false) to close the popup before navigation
  • Introduced a 200ms delay before navigation to ensure proper popup closure
src/apps/console/routes/_main+/$account+/_layout.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](https://app.sourcery.ai) 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 - [Contact our support team](mailto:support@sourcery.ai) for questions or feedback. - Visit our [documentation](https://docs.sourcery.ai) for detailed guides and information. - Keep in touch with the Sourcery team by following us on [X/Twitter](https://x.com/SourceryAI), [LinkedIn](https://www.linkedin.com/company/sourcery-ai/) or [GitHub](https://github.com/sourcery-ai).