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

Tags on content do not get displayed in consistent order #29460

Open
Deckel opened this issue Jul 2, 2024 · 2 comments
Open

Tags on content do not get displayed in consistent order #29460

Deckel opened this issue Jul 2, 2024 · 2 comments

Comments

@Deckel
Copy link

Deckel commented Jul 2, 2024

Screenshot

Screenshot 2024-07-02 at 22 26 25

Description

When adding multiple tags to multiple dashboards, charts or saved queries, the tags display in non alphabetical order.

Design input

[describe any input/collaboration you'd like from designers, and
tag accordingly. For design review, add the
label design:review. If this includes a design proposal,
include the label design:suggest]

Copy link

dosubot bot commented Jul 2, 2024

Hey @Deckel! 👋 I'm here to help you with any bugs, questions, or contributions you have. I'm Dosu, a bot designed to assist you while waiting for a human maintainer.

Tags should be consistently ordered alphabetically across different sections where they are used. This can be achieved by sorting the tags alphabetically using the localeCompare function. Here is an example of how tags are sorted alphabetically in the tags useMemo hook:

const tags = useMemo(
  () =>
    Object.keys(chartsByTags)
      .sort((a, b) =>
        // sort alphabetically
        a.localeCompare(b),
      )
      .filter(tag => RECOMMENDED_TAGS.indexOf(tag) === -1),
  [chartsByTags],
);

Designers could provide input or a proposal for this by suggesting any specific ordering criteria or additional sorting rules if needed [1].

To continue talking to Dosu, mention @dosu.

@rusackas
Copy link
Member

rusackas commented Jul 3, 2024

Seems reasonable to open as a PR if you're up for it. Seems like the bot is on the right track :)

I guess the question I might as @yousoph / @kasiazjc who might have thought more about this: Is alphabetical always the right order? It makes it easier to check if a tag is there, but I'm not sure if some other order (e.g. date tag was added, date tag was created, some relative importance of the tag) would ever be needed. Alphabetical is probably just fine, and seems like an improvement, but throwing the question out there for good measure :)

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

No branches or pull requests

2 participants