Skip to content

Conversation

@olorin99
Copy link
Contributor

Adds support for Piefed post flairs and user flairs/tags.

Adds user tags.

  • Multiple tags can be assigned to each user.
  • Tags can be created and destroyed from tags screen in settings
  • Tags can be added or removed from a user via the user menu.

@olorin99 olorin99 requested a review from jwr1 November 27, 2025 12:34
@jwr1
Copy link
Member

jwr1 commented Dec 3, 2025

After looking through the app a bit more with this, I have a few recommendations to make:

  • I don't think there should be separate options for foreground and background colors as it just unnecessarily complicates the tag creation. I think we should just allow configuration of the background color, and then when the tag is actually rendered, calculate a good foreground color (white, or black, or maybe an off tone variant of the bg). This is exactly what GitHub does with its labels, and I think it's a good approach.
  • On the screen where you can add tags to a user, there are buttons for "Add existing tag" and "Add new tag". If you click on the "Add existing tag" button, there is now another button for "Add new tag", which is a bit redundant. Maybe on the first screen there could be just one button "Add tag", and if you click on that, there would be a "New tag" button alongside existing tags.
  • I'm a bit unsure of the usefulness of having the additional "Tags" section in Settings. It provides exactly the same functionality as the Tags page while visiting users, including creating, editing, and deleting tags. If it provided additional functionality (such as seeing a list of tagged users), then I could see its usefulness. At the moment, though, I'm not really sure we need it.
  • It seems like it would be useful to display user tags right at the top of a user's profile page.

Copy link
Member

@jwr1 jwr1 Dec 3, 2025

Choose a reason for hiding this comment

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

Would there be a better way to display user tags without having to wrap every instance of a post or comment to add in the tags? For example, if we instead moved this to the ContentItem widget, and checked if the passed in username matched with any local tags, then it would add in the extra tags next to the PieFed flairs.

The way it's done right now just seems like it would be easy to mess up in the future (like forgetting to use applyUserTagsComment where it should be).

Another issue I see with it is that post flairs and local user tags are merged together and treated as the same. What happens if we allow editing the flairs of a post later on, and the local tags show up just the same as the flairs and are indistinguishable?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Doing it directly in content item is indeed much easier and cleaner. There is a little pop in when the tags are fetched but its not easily noticeable so no worries.

The post flairs and user tags are stored separately. I've started working on editing post flairs and user flairs getting in the way shouldn't be an issue. It would be nice to have a visual difference between them though. Maybe a border around one of them with the same colour as the text would work to differentiate them.

… based on background luminance.

- Remove add redundant add new tag on user_tags screen.
- Move add tags buttons to top of respective screens so don't have to scroll.
- Database adjustments for tags.
@olorin99
Copy link
Contributor Author

olorin99 commented Dec 4, 2025

  • I changed it so the text colour is calculated using ColorScheme. I also tried using _textColor = c.computeLuminance() < 0.5 ? Colors.white : Colors.black, which I think makes the text a little easier to read but is kind of boring just having the text be black or white so I think the dynamic colorscheme is the way to go with that.

  • Rearranged the add tags buttons so they're at the top of the screen. Should mean users don't have to scroll through all the tags when adding a new one. Also removed that redundant button.

  • Also added a page in the settings to show all the tagged users as well as a button to clear tags for each of them.

# Conflicts:
#	lib/src/models/post.dart
#	lib/src/screens/feed/post_item.dart
#	lib/src/utils/utils.dart
#	lib/src/widgets/content_item/content_item.dart
@olorin99 olorin99 requested a review from jwr1 December 4, 2025 11:03
jwr1
jwr1 previously approved these changes Dec 4, 2025
Copy link
Member

@jwr1 jwr1 left a comment

Choose a reason for hiding this comment

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

I'll go ahead and merge this, but I do have a few changes I want to personally make. I'll do it in a separate pr though so you can review them.

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