feat: post tags (Lemmy v1 + PieFed)#40
Merged
Merged
Conversation
Surface per-post tags on `PostView.tags` as a portable `PostTag[]` shape
(`{ name, display_name?, color? }`) so consumers can render them
uniformly across backends.
- Lemmy v1: maps each `CommunityTag` on `PostView.tags`. `color` is the
palette slot (e.g. `"color03"`).
- PieFed: maps `PostView.flair_list[]` (CommunityFlair). `color` is the
hex `background_color` (e.g. `"#a91b9c"`).
- Lemmy v0: `tags: []`.
`color` is opaque to threadiverse — consumers either render it directly
(hex) or resolve it from a palette (Lemmy v1). The minimal shape skips
v1-specific housekeeping (`id`, `ap_id`, `published_at`, `deleted`,
`community_id`) since they don't have PieFed analogs and aren't useful
for view-only rendering; mutation APIs can grow their own richer types
later.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PostView.tagsas a portablePostTag[]shape ({ name, display_name?, color? }) so consumers can render them uniformly across backends.CommunityTagonPostView.tags.coloris the palette slot (e.g."color03").PostView.flair_list[](CommunityFlair).coloris the hexbackground_color(e.g."#a91b9c").tags: [].coloris opaque to threadiverse — consumers either render it directly (hex) or resolve it via a palette (Lemmy v1). The minimal shape deliberately skips v1-specific housekeeping (id,ap_id,published_at,deleted,community_id); those don't have PieFed analogs and aren't useful for view-only rendering. Mutation APIs (assign-tag / assign-flair) can grow their own richer types when added.Test plan
pnpm lintpnpm test:typespnpm test(23 existing tests pass)voyager.lemmy.ml(Lemmy v1) —PostView.tagspopulated fromCommunityTagpiefed.social(c/fediverse,c/polls) —PostView.tagspopulated fromflair_list