Skip to content

Upgrade AutocompleteWithPagination styling #7194

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

Merged
merged 12 commits into from
Apr 28, 2025

Conversation

zachariah-at-msupply
Copy link
Contributor

@zachariah-at-msupply zachariah-at-msupply commented Apr 3, 2025

Fixes part of #5336

πŸ‘©πŸ»β€πŸ’» What does this PR do?

Upgrades the styling of the options for a specific component (AutocompleteWithPagination) to truncate options with ellipses rather than wrapping them. (N.B. This only partially solves the original issue, all the other autocomplete components will need to be fixed too, but that will happen in a subsequent PR.)

πŸ’Œ Any notes for the reviewer?

I hope it looks good :)

πŸ§ͺ Testing

  • Add a store with a really really really really really really really really really long name.
  • Go to Cold chain -> Equipment
  • Create a new asset
  • Click on the store selector dropdown and see the long names get truncated with ellipses
  • Check other similar dropdowns on other pages have not been mucked up.

πŸ“ƒ Documentation

  • No documentation required: no user facing changes or a bug fix which isn't a change in behaviour
  • These areas should be updated or checked:

πŸ“ƒ Reviewer Checklist

The PR Reviewer(s) should fill out this section before approving the PR

Breaking Changes

  • No Breaking Changes in the Graphql API
  • Technically some Breaking Changes but not expected to impact any integrations

Issue Review

  • All requirements in original issue have been covered
  • A follow up issue(s) have been created to cover additional requirements

Tests Pass

  • Postgres
  • SQLite
  • Frontend

@github-actions github-actions bot added bug Something is borken good first issue Good for newcomers Severity: Normal Bugs which have an acceptable workaround. Moderate/tolerable user impact. Next minor release. labels Apr 3, 2025
@fergie-nz fergie-nz self-assigned this Apr 3, 2025
Comment on lines 158 to 163
'& .MuiTypography-root': {
maxWidth: 497,
whiteSpace: 'nowrap',
overflow: 'hidden',
textOverflow: 'ellipsis',
},
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm actually very hesitant to approve something like this because Autocomplete is used in so many places, and I don't fully understand the ramifications of these changes.

Particularly unsure about the hard coded values. I wonder would this affect other places Autocomplete is used?

Copy link
Contributor

Choose a reason for hiding this comment

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

This would affect other places for Autocomplete. Though shouldn't be harmful bur rather helpful.

@CarlosNZ
Copy link
Contributor

CarlosNZ commented Apr 3, 2025

@zachariah-at-msupply can you post some screenshots of it's supposed to look? (preferably a few in different contexts)? It's not looking right for me, just wondering if you're seeing something different?

@zachariah-at-msupply
Copy link
Contributor Author

After the modifications I added because I misinterpreted Mark's comment, here is the screenshot you asked for Carl:
image

@zachariah-at-msupply
Copy link
Contributor Author

zachariah-at-msupply commented Apr 3, 2025

It also crosses my mind that we might want to add a maximum length for table columns, with an option to expand it to show the full value? The table is scrollable so no information is hidden, but it might be a bit inconvenient at times.

Screen.Recording.2025-04-15.at.11.15.05.mov

@github-actions github-actions bot added this to the v2.8.0 milestone Apr 3, 2025
@github-actions github-actions bot added the Team Piwakawaka James, Carl, John, Zachariah, Ferg label Apr 3, 2025
@zachariah-at-msupply zachariah-at-msupply changed the base branch from develop to v2.7.0-RC April 7, 2025 23:22
Copy link

github-actions bot commented Apr 7, 2025

Bundle size difference

Comparing this PR to main

Old size New size Diff
6.13 MB 6.13 MB 217 B (0.00%)

@lache-melvin
Copy link
Contributor

Hi - what's holding up this PR?

@zachariah-at-msupply
Copy link
Contributor Author

zachariah-at-msupply commented Apr 15, 2025

I've come across these other issues (listed below) which are very similar. Shoul I include them in this PR, or create new issues for them? Seeing these other issues also makes me feel uneasy about the fix I have made - it seems like more sweeping changes are necessary than these fixes, which feel like they might be putting a plaster on a bigger problem. What are your thoughts? I'll await advice before spending time on them.

Here are the 3 things I found:

  1. All the dropdowns that use MUI's autocomplete component also have problems with long names:
    image

  2. The tables also have problems with long names:
    https://github.com/user-attachments/assets/9b336898-5d15-4bfa-8272-46171049b2e7

  3. The fix I've proposed is a trade off and will only work in a limited number of use cases (see my unresolved review comments, above).

@CarlosNZ
Copy link
Contributor

Screenshot 2025-04-16 at 10 39 57β€―AM

Hey @zachariah-at-msupply, I'm still seeing this in the Cold Chain->Equipment Store Selection, which is the one raised in the original issue.

@CarlosNZ CarlosNZ added Severity: Low Bugs that don't block workflows. UX like wrong fonts, bad layout and removed Severity: Normal Bugs which have an acceptable workaround. Moderate/tolerable user impact. Next minor release. labels Apr 16, 2025
@zachariah-at-msupply
Copy link
Contributor Author

zachariah-at-msupply commented Apr 16, 2025

This PR will now just fix the AutocompleteWithPagination component, subsequent PRs will introduce the upgrade the other components that need it.

N.B. I reverted the previous change to the store autocomplete (commit db2bbe9 above) as I did not know it was worth introducing a fixed width to the autocomplete for an issue that no one has actually raised - I think that might require a bit of design input, and is probably linked to the wider issue of fixing styling throughout the application.

@zachariah-at-msupply zachariah-at-msupply changed the title Upgrade autocomplete styling Upgrade AutocompleteWithPagination styling Apr 16, 2025
@github-actions github-actions bot added the Severity: Normal Bugs which have an acceptable workaround. Moderate/tolerable user impact. Next minor release. label Apr 16, 2025
Copy link
Contributor

@CarlosNZ CarlosNZ left a comment

Choose a reason for hiding this comment

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

Okay, I think we should get this in now, the whole issue has become too confused. It looks good for the Store selector in Assets, and that's the main thing for this specific issue. If further changes are needed we can do them in a new issue (with much more specific requirements!)

Thanks @zachariah-at-msupply !

@zachariah-at-msupply zachariah-at-msupply merged commit dd76f50 into v2.7.0-RC Apr 28, 2025
11 checks passed
@zachariah-at-msupply zachariah-at-msupply deleted the 5336-fix-store-selector-dropdown-width branch April 28, 2025 23:51
roxy-dao added a commit that referenced this pull request Apr 29, 2025
@roxy-dao roxy-dao restored the 5336-fix-store-selector-dropdown-width branch April 29, 2025 00:04
roxy-dao added a commit that referenced this pull request Apr 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is borken good first issue Good for newcomers Severity: Low Bugs that don't block workflows. UX like wrong fonts, bad layout Severity: Normal Bugs which have an acceptable workaround. Moderate/tolerable user impact. Next minor release. Team Piwakawaka James, Carl, John, Zachariah, Ferg
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Store selector window is not wide enough to fit the full names
5 participants