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

Truncate filter chips #59696

Open
jameskoster opened this issue Mar 7, 2024 · 9 comments
Open

Truncate filter chips #59696

jameskoster opened this issue Mar 7, 2024 · 9 comments
Assignees
Labels
[Feature] Data Views Work surrounding upgrading and evolving views in the site editor and beyond Needs Dev Ready for, and needs developer efforts [Type] Enhancement A suggestion for improvement.

Comments

@jameskoster
Copy link
Contributor

jameskoster commented Mar 7, 2024

Screenshot 2024-08-05 at 12 07 49
  • Chips can only grow to the width of the container, at that point they are truncated.
  • All active filters are visible.
  • Chips are slightly squished (24px height down from 32).

Codepen including updated metrics and styles.

@jameskoster jameskoster added [Type] Enhancement A suggestion for improvement. Needs Design Needs design efforts. [Feature] Data Views Work surrounding upgrading and evolving views in the site editor and beyond labels Mar 7, 2024
@jameskoster
Copy link
Contributor Author

Even if we restrict the number of values to two, and truncate the values, chips can still be quite long:

truncate

This one may be best to finesse in a PR.

@jameskoster jameskoster added Needs Design Feedback Needs general design feedback. and removed Needs Design Needs design efforts. labels Mar 7, 2024
@jasmussen
Copy link
Contributor

Can it be "Status is: Published, Pending, +3 more"?

@oandregal oandregal self-assigned this Mar 11, 2024
@jameskoster
Copy link
Contributor Author

I think that's what I suggested above? Show two values then a count for additional.

I think we probably need to truncate the values at a certain point too as some could be very long. Think of custom tags, category names, dates, etc. It would be fine to address that spearately when the need arises though.

@jasmussen
Copy link
Contributor

Right, but perhaps without the eliding 🤔

My take: for those advanced chips that get really long, it's okay that they get really long, because you are building advanced queries. I guess they should still not be so long that a single chip breaks in two and wraps, perhaps that's what you mean about eliding?

Finally, controversial take and would be subject to reduce motion of course: how about a marquee behavior? I.e. if longer than n pixels, bounce the label back and forth, slowly?

@jameskoster
Copy link
Contributor Author

Ah, the ellipsis was to indicate the truncation of 'Pending review', as an example. We could just shorten that label to 'Pending', but we won't always be able to shorten this way.

I agree it's fine for the number of chips to grow when adding many filters. But I also think there could be a point where the chips themselves become egregiously long, even if we limit the display of values to two or three. For example a filter between dates with a longer date format, and a tag filter:

[Publish date is between: 2024-03-10 10:00:00, 2024-04-11 10:00:00] [Tag contains: Month in WordPress, WordCamp Europe, + 3]

That might be an edge case though, so fine to address later.

@jasmussen
Copy link
Contributor

There has to be a more compact way of showing datestamps than that, across WordPress. But yes, point made. I do believe mobile app stores have scrolling filter chips too.

@colorful-tones
Copy link
Member

Hi folks,
We are only one week away from the Beta 1 cut-off date for WordPress 6.6. This issue hasn’t seen any movement in a while, so we (the editor triage leads of the 6.6 release) have decided to remove it from the WordPress 6.6 Editor Tasks project board.

@jameskoster jameskoster added Needs Dev Ready for, and needs developer efforts and removed Needs Design Feedback Needs general design feedback. labels Jul 2, 2024
@jameskoster jameskoster added Needs Design Needs design efforts. and removed Needs Dev Ready for, and needs developer efforts labels Jul 8, 2024
@jameskoster
Copy link
Contributor Author

This still needs some design to handle wrapping:
Screenshot 2024-07-08 at 13 56 23

@jameskoster
Copy link
Contributor Author

I tried a couple of experiments to explore options here.

Option 1 – Codepen

Screenshot 2024-07-09 at 14 00 16
  • Chips can only grow to the width of the container, at that point they are truncated.
  • All active filters are visible.
  • Chips are slightly squished (24px height down from 32).

Option 2 – Codepen

Screenshot 2024-07-09 at 14 03 22
  • Container scrolls horizontally to conserve vertical space
  • Individual chips can only span 90% of the container width

Give we intend to move the filtering UI to a dedicated panel (#60696) I think option 1 is the way to go. I don't love how much vertical space the filters occupy, but if the user finds them too noisy they can easily be hidden by closing the filter panel.

Option 2 is a good one to have up the sleeve in case the filter panel doesn't work out.

@jameskoster jameskoster added Needs Dev Ready for, and needs developer efforts and removed Needs Design Needs design efforts. labels Jul 9, 2024
@oandregal oandregal removed their assignment Jul 22, 2024
@jorgefilipecosta jorgefilipecosta self-assigned this Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Data Views Work surrounding upgrading and evolving views in the site editor and beyond Needs Dev Ready for, and needs developer efforts [Type] Enhancement A suggestion for improvement.
Projects
Status: Next
Development

No branches or pull requests

5 participants