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

[WEB-2466] fix-Date Sorting Dropdown Not Mutating Between Ascending and Descending #5670

Merged
merged 1 commit into from
Sep 23, 2024

Conversation

Jimmycutie
Copy link
Contributor

@Jimmycutie Jimmycutie commented Sep 20, 2024

Problem Statement

The sorting icons weren't mutating when option was changed from ascending to descending and visa-versa in views, models and pages.

Solution

Icon was hard coded to downwards arrow. Added conditional to mutate icons as states change.

Screenshots and Media

Before:
image
image

After:
image
image

References

[WEB-2466]

Summary by CodeRabbit

  • New Features

    • Introduced dynamic sorting icons in the dropdown menus, allowing users to easily identify ascending or descending order.
    • Added the ArrowUpWideNarrow icon for improved visual representation of sorting states.
  • Bug Fixes

    • Enhanced icon rendering logic to ensure the correct icon displays based on the sorting order.

@Jimmycutie Jimmycutie added 🐛bug Something isn't working 🌐frontend 🌐web Issues related to our web product labels Sep 20, 2024
@Jimmycutie Jimmycutie added this to the v0.23-dev milestone Sep 20, 2024
@Jimmycutie Jimmycutie self-assigned this Sep 20, 2024
Copy link
Contributor

coderabbitai bot commented Sep 20, 2024

Walkthrough

The changes across the order-by.tsx files in various components introduce a new icon, ArrowUpWideNarrow, which enhances the visual representation of sorting order. The rendering logic for icons now conditionally displays either ArrowUpWideNarrow or ArrowDownWideNarrow based on the isDescending state. Additionally, class names for the icons have been standardized, improving consistency in styling across the dropdown menus.

Changes

File Path Change Summary
web/core/components/modules/dropdowns/order-by.tsx Added ArrowUpWideNarrow icon and updated rendering logic to conditionally display sorting icons based on isDescending state. Updated class names for icons.
web/core/components/pages/list/order-by.tsx Modified PageOrderByDropdown to include ArrowUpWideNarrow and conditionally render sorting icons based on isDescending.
web/core/components/views/filters/order-by.tsx Introduced conditional rendering for sorting icons using ArrowUpWideNarrow and ArrowDownWideNarrow, based on isDescending state.

Possibly related PRs

Suggested labels

🌟improvement

Poem

🐇 In the dropdowns where choices play,
Icons now dance in a clearer way.
Up and down, they twirl with glee,
Sorting made simple, just wait and see!
A hop, a skip, a visual delight,
Order by joy, from morning till night! 🌟


Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 66cfc73 and c3be50c.

Files selected for processing (3)
  • web/core/components/modules/dropdowns/order-by.tsx (2 hunks)
  • web/core/components/pages/list/order-by.tsx (2 hunks)
  • web/core/components/views/filters/order-by.tsx (2 hunks)
Additional comments not posted (9)
web/core/components/pages/list/order-by.tsx (2)

3-3: LGTM!

The import statement for the ArrowUpWideNarrow icon is correct and follows the existing import pattern.


29-29: Great work on implementing the conditional rendering of sorting icons!

The changes align perfectly with the PR objectives and enhance the user experience by providing visual feedback on the current sorting order. The conditional rendering logic is correct, and the icons are rendered with the appropriate CSS classes.

web/core/components/modules/dropdowns/order-by.tsx (3)

3-3: LGTM!

The import statement has been correctly updated to include the ArrowUpWideNarrow icon, which will be used to represent the ascending order state.


30-30: LGTM!

The rendering logic has been correctly updated to conditionally display the appropriate icon based on the isDescending state. The class name update maintains consistency with the naming convention used for other icons in the component.


32-32: LGTM!

The class name for the ChevronDown icon has been correctly updated to maintain consistency with the naming convention used for other icons in the component.

web/core/components/views/filters/order-by.tsx (4)

3-3: LGTM!

The import statement for the ArrowUpWideNarrow icon is correct and necessary for the new sorting icon functionality.


34-36: LGTM!

The conditional rendering logic for the sorting icon is implemented correctly. It ensures that the appropriate icon (ArrowUpWideNarrow or ArrowDownWideNarrow) is displayed based on the isDescending state, aligning with the PR objective.


41-41: LGTM!

The conditional rendering of the icon variable when not in mobile view is implemented correctly.


Line range hint 1-88: Overall, the changes look good!

The modifications made to the ViewOrderByDropdown component successfully address the issue of the sorting icon not mutating between ascending and descending states. The introduction of the icon variable and the conditional rendering logic ensures that the appropriate sorting icon is displayed based on the current sorting state.

The changes are well-integrated into the existing codebase and align with the PR objective and the provided summary. The code remains readable and maintainable.

Great job on implementing this fix!


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.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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.

@pushya22 pushya22 merged commit 76a3444 into preview Sep 23, 2024
14 of 15 checks passed
@pushya22 pushya22 deleted the fix-sortinng_icon_not_mutating branch September 23, 2024 11:01
@coderabbitai coderabbitai bot mentioned this pull request Jan 6, 2025
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛bug Something isn't working 🌐frontend 🌐web Issues related to our web product
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants