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

feat(quantic): Fix the styling of the quantic sort component when inside refine modal #4652

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

SimonMilord
Copy link
Contributor

@SimonMilord SimonMilord commented Nov 7, 2024

SFINT-4897

ISSUE:

The styling of the quanticSort component does not match what we do for the filters and Atomic's. Changing this styling is not as simple however. The lightning-combobox does not expose selectors to change its styling such as height, border, etc.

SOLUTION PROPOSED:

  • Used variants for both "default" and "refineModal". When in variant "refineModal", it will display the sort label differently and take the whole width.
  • Also deleted some of the deemed useless tests we had in quantic: should construct itself without throwing

LIMITATIONS:

  • Although not perfect (ie: the height of the dropdown could be the same as filters, shadowbox, etc.), this solution is simple and leverages SLDS design system. So we know it works well and is accessible.

POTENTIAL ALTERNATIVES:

  • The alternative would be to create a custom dropdown component whenever the quanticSort is in the refineModal. This is far more complicated as we will no longer have access to the built-in functionalities of the lightning-combobox for accessibility and so on. It make the quanticSort component a bit more complex than it needs to be.
  • Another thing I tried was playing with the container's styling, but it ended up being worse IMO.

BEFORE:

QuanticSort

AFTER:

Screen.Recording.2024-11-08.at.1.57.34.PM.mov

TESTS:

image

Copy link

github-actions bot commented Nov 7, 2024

Pull Request Report

PR Title

❌ Title should follow the conventional commit spec:
<type>(optional scope): <description>

Example: feat(headless): add result-list controller

Live demo links

Bundle Size

File Old (kb) New (kb) Change (%)
case-assist 236.8 236.8 0
commerce 341.5 341.5 0
search 412.8 412.8 0
insight 402.1 402.1 0
recommendation 249.1 249.1 0
ssr 406.3 406.3 0
ssr-commerce 353.7 353.7 0

SSR Progress

Use case SSR (#) CSR (#) Progress (%)
search 39 44 89
recommendation 0 4 0
case-assist 0 6 0
insight 0 27 0
commerce 0 15 0
Detailed logs search : buildInteractiveResult
search : buildInteractiveInstantResult
search : buildInteractiveRecentResult
search : buildInteractiveCitation
search : buildGeneratedAnswer
recommendation : missing SSR support
case-assist : missing SSR support
insight : missing SSR support
commerce : missing SSR support

@SimonMilord SimonMilord marked this pull request as ready for review November 8, 2024 19:01
@SimonMilord SimonMilord requested a review from a team as a code owner November 8, 2024 19:01
@mmitiche
Copy link
Contributor

mmitiche commented Nov 8, 2024

As an initial comment, the variant values need to be something generic and reflect the changes that would occur on the component it self and not where the component would be used.

that's why the variant value refineModal is not ideal. it can happen that a client or us need to use this version of the component in another place other than the refine modal, in that case having a the value refineModal would not make sense.

A better used values could be default and large or compact.

@SimonMilord
Copy link
Contributor Author

As an initial comment, the variant values need to be something generic and reflect the changes that would occur on the component it self and not where the component would be used.

that's why the variant value refineModal is not ideal. it can happen that a client or us need to use this version of the component in another place other than the refine modal, in that case having a the value refineModal would not make sense.

A better used values could be default and large or compact.

Good point, changed it to "wide" since it takes the whole width

Copy link
Collaborator

@erocheleau erocheleau left a comment

Choose a reason for hiding this comment

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

Some suggestions on the code structure, but overall it seems to be working fine

Copy link
Contributor

@mmitiche mmitiche left a comment

Choose a reason for hiding this comment

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

Changes required for better scalability of the sort component that requires avoid mixing the size of the sort input with the label.

@mmitiche
Copy link
Contributor

mmitiche commented Nov 13, 2024

Do you think we can also improve the border shadow to match the facet cards in the refine modal content?
Screenshot 2024-11-13 at 9 46 14 AM

Yeah improved it:

image

Copy link
Contributor

@mmitiche mmitiche left a comment

Choose a reason for hiding this comment

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

Nice job 👌 The final result blends well in the refine modal

Copy link
Collaborator

@erocheleau erocheleau left a comment

Choose a reason for hiding this comment

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

Slight changes and some unused code I think?

* @api
* @type {'default'|'wide'}
*/
@api variant = 'default';
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you do this instead?

Suggested change
@api variant = 'default';
@api variant = SORT_VARIANTS.DEFAULT;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nah I tried, its giving me a type error:
image
either I set the @type to string, or leave it as is and set the default value to 'default'

Copy link
Collaborator

@erocheleau erocheleau left a comment

Choose a reason for hiding this comment

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

Perfect!

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.

3 participants