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

Consistent Sorting of Workspace Buttons Across Browsers #3222

Merged

Conversation

Jeong-Min-Cho
Copy link
Contributor

Summary

This pull request addresses the issue of inconsistent button order in the workspace across different browsers.

Problem

  • The sorting function returns 0, which leaves the order of equal elements up to the browser's JavaScript engine implementation.

Solution

  • The sorting function always returns a positive or negative number, leading to a consistent order of buttons across all browsers.

Changes:

  1. Updated the sorting function in ObjectMetadataNavItems.tsx to handle 'person', 'company', and 'opportunity' explicitly and ensure a consistent order.

Testing:

  1. Open the workspace in different browsers (Chrome, Firefox, Edge).
  2. Verify that the order of buttons is consistent and follows the person, company, and opportunity order.

Screenshots:

Before

Chrome

Before-Chrome

Firefox

Before-Firefox

Edge

Before-Edge

After

Chrome

After-Chrome

Firefox

After-Firefox

Edge

After-Edge

Copy link

github-actions bot commented Jan 3, 2024

CLA

Hello there and welcome to our project!
By submitting your Pull Request, you acknowledge that you agree with the terms of our Contributor License Agreement.
Although we don't have a dedicated legal counsel, having this kind of agreement can protect us from potential legal issues or patent trolls.
Thank you for your understanding.

Generated by 🚫 dangerJS against 751dfe7

Copy link
Member

@FelixMalfait FelixMalfait left a comment

Choose a reason for hiding this comment

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

Wow great level of details on the PR description and elegant solution. Thanks a lot!

@FelixMalfait FelixMalfait merged commit f4405b1 into twentyhq:main Jan 3, 2024
9 of 10 checks passed
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.

None yet

2 participants