Skip to content

feat: post tags (Lemmy v1 + PieFed)#40

Merged
aeharding merged 1 commit into
mainfrom
feat/post-tags
May 26, 2026
Merged

feat: post tags (Lemmy v1 + PieFed)#40
aeharding merged 1 commit into
mainfrom
feat/post-tags

Conversation

@aeharding
Copy link
Copy Markdown
Owner

Summary

  • 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 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 lint
  • pnpm test:types
  • pnpm test (23 existing tests pass)
  • Verified against voyager.lemmy.ml (Lemmy v1) — PostView.tags populated from CommunityTag
  • Verified against piefed.social (c/fediverse, c/polls) — PostView.tags populated from flair_list

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.
@aeharding aeharding merged commit f4442d5 into main May 26, 2026
1 check passed
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.

1 participant