mysociety / alaveteli

Provide a Freedom of Information request system for your jurisdiction
https://alaveteli.org
Other
389 stars 196 forks source link

Badges #8225

Open garethrees opened 5 months ago

garethrees commented 5 months ago

A badge is not much more than a fancy tag. Badges will serve two key purposes:

We may also use badges in the future to add additional context where a full note doesn’t make sense.

Eventually, anything that’s Taggable will be able to have a Badge applied, but we’ll focus on applying them to OutgoingMessage and IncomingMessage for now. If we get time, applying them to User should be next on the list.

Creating Badges

A Badge has an Icon and a Title, and is mapped to a Tag.

Screenshot 2024-04-26 at 16 58 44

Icon: Let’s initially hard-code an icon and we can later add some more hard-coded options, or make it customisable with an emoji picker if we have time.

Title: This is the short title of what the Badge is about. Could also call it “Name” if it feels beneficial to keep it in line with Tag#name. This field should be translatable

A Badge can be mapped to a single Tag only (i.e a Badge can’t apply to both foo and bar tags), and there can only be one Badge per Tag. A different tag value is fine (so you could have different Badges for foo:bar and foo:baz).

A future vision of what our badges might look like:

Screenshot 2024-04-26 at 17 03 06

Displaying Badges

Badges should be displayed at the front of the Tag list for the content, and never be folded away. It doesn’t really matter if we include both the Badge and then the related tag in the list of tags.

Screenshot 2024-04-26 at 17 15 43

They’ll need to tread a fine line between being visible, but not too obtrusive that they compete against the core content of the page. Badges should feel a bit more human-friendly than Tags.

A Badge should only be displayed if the associated tag has a “normal” prominence value.

Learning More

Clicking a tag should link through to one of (in this prioritisation order):

  1. A Category that has the same tag as the Badge if it exists (i.e. Badge mapped to tag “foo” should link to a Category mapped to tag “foo”).
  2. A generic advanced search for the tag (/search/tag:foo/all)

This will allow us to use the existing Category system to provide long form content related to a Badge, but also give us the flexibility not to require one if the Badge title is enough on its own to convey the relevant message.