Skip to content

feat(plugins): add mastodon column type - #26

Merged
aaronjmars merged 1 commit into
mainfrom
feat/mastodon-column
May 3, 2026
Merged

aaronjmars merged 1 commit into
mainfrom
feat/mastodon-column

Conversation

@aaronjmars

Copy link
Copy Markdown
Collaborator

What

31st column type, 6th in the Social cluster (X / Reddit / HN / Farcaster / Bluesky / Mastodon). Two keyless modes:

  • Hashtag — public timeline by tag via GET /api/v1/timelines/tag/{tag}
  • Author — federated user@server lookup via GET /api/v1/accounts/lookup + GET /api/v1/accounts/{id}/statuses

Mastodon's full-text status search (/api/v2/search?type=statuses) requires authentication on every public instance and is intentionally NOT used — the keyless contract is the whole point. Hashtag search is the keyless equivalent and covers the vast majority of monitoring use cases.

Why

Closes May-2 repo-actions idea #4 (Mastodon Column for minitor) — completes the decentralized social trifecta in minitor (Bluesky shipped May 2 in PR #25 + Farcaster + Mastodon today). With minitor's Bluesky column shipping yesterday and Farcaster already in main, Mastodon is the obvious gap in the federated/decentralized social cluster. README's Social row counts 5 → 6 entries; column total 30 → 31.

Mastodon-specific quirks (all handled in the integration layer)

  • HTML content — Mastodon returns content as a sanitized HTML fragment with p/br/a/span only. Stripped to plain text via targeted regex; newlines come from <br> and </p>. Safe without a full parser because the upstream sanitizer is the contract.
  • Local-account acct normalization — Mastodon's acct field is bare gargron for local accounts and user@server for federated ones. We normalize local accounts to user@instance so the rendered handle is unambiguous regardless of which instance the column queries.
  • Federated handle parsing — accepts user, @user, user@server, or @user@server. The user@server form transparently routes the lookup to that server, not the configured instance — so a mastodon.social column can still follow gargron@example.org without misconfiguring instance.
  • Reblog filter on author timelines — exclude_reblogs=true on the API plus a defensive if (s.reblog) return null guard in case the upstream contract changes. The column attribution would otherwise be misleading ("by @Actor" but content authored by someone else).
  • Content-warning prefix — statuses with spoiler_text get [CW: …] prepended so the warning isn't silently dropped.
  • Schema-drift safe — drops statuses missing id or url rather than rendering dead content.
  • Default avatar fallback — same dicebear seeding farcaster uses, for accounts without a pfp_url.

Files

  • lib/integrations/mastodon.ts — fetcher pair (fetchMastodonHashtag, fetchMastodonAuthor) + handle parser + HTML stripper. Keyless throughout.
  • lib/columns/plugins/mastodon/plugin.ts — Zod { instance: "mastodon.social" default, mode: "hashtag"|"author", query, handle }, AtSign icon, Mastodon brand purple #6364ff (distinct from x-search blue #1d9bf0, farcaster purple #7c65c1, and the Bluesky blue #0085ff once that lands so the social cluster stays visually differentiated).
  • lib/columns/plugins/mastodon/server.ts — typed fetcher, slice-based pagination via the existing sliceForPage helper.
  • lib/columns/plugins/mastodon/client.tsx — ConfigForm with instance + mode-conditional fields; ItemRenderer matches farcaster's avatar-led card layout with serif post text and engagement footer (replies / reblogs / favourites).
  • lib/columns/plugins/manifest.ts — +1 import, +1 array entry.
  • lib/columns/registry.ts — +1 import, +1 map entry (UI side).
  • lib/columns/server-registry.ts — +1 import, +1 map entry (server side; parity check at module init throws if drift).
  • README.md — column count 30 → 31, Social row 5 → 6 entries, description list adds Mastodon between Farcaster and YouTube.

Notes

  • No new env vars / build deps / schema migration. Works the moment users add it, preserving the "first column up in under a minute, zero infra" README promise.
  • No conflict with PR feat(plugins): add bluesky column type #25 (Bluesky column) — different file paths everywhere; both can land independently. README counts here assume Bluesky lands first; merging in either order is fine and produces the right count.
  • Federation — any public Mastodon instance works. Default mastodon.social is the most discoverable default; users can swap to fosstodon, hachyderm, infosec.exchange, etc.

Built autonomously by Aeon

31st column type, 6th in the Social cluster (X / Reddit / HN / Farcaster / Bluesky / Mastodon). Two keyless modes: hashtag (public timeline by tag) and author (federated user@server lookup). Mastodon's full-text status search requires authentication on every public instance and is intentionally NOT used — the keyless contract is the whole point. Hashtag search is the keyless equivalent and covers the vast majority of monitoring use cases. Mastodon-specific quirks handled in the integration layer: HTML status content stripped to plain text via targeted regex (Mastodon returns sanitized fragments with p/br/a/span only — safe without a full parser); local-account acct normalization (bare 'gargron' rendered as 'gargron@mastodon.social' for unambiguous attribution); federated handle parsing (user@server form transparently routes the lookup to that server, not the configured instance); reblog filter on author timelines (exclude_reblogs=true on the API plus a defensive guard in case upstream changes); content-warning prefix on statuses with spoiler_text; schema-drift safe (drops statuses missing id or url rather than rendering dead content). Standard 3-file plugin (plugin.ts / server.ts / client.tsx) + 3 registry edits (manifest, registry, server-registry parity check at server module init throws if drift). Zod schema { instance: 'mastodon.social' default, mode: hashtag|author, query, handle }, AtSign icon, Mastodon brand purple #6364ff (distinct from x-search blue #1d9bf0, farcaster purple #7c65c1, and the Bluesky blue #0085ff once that lands). Renderer matches farcaster's avatar-led card layout with serif post text + engagement footer (replies / reblogs / favourites). README column count 30 → 31, Social row 5 → 6.
@aaronjmars
aaronjmars force-pushed the feat/mastodon-column branch from 051748a to 2dc048c Compare May 3, 2026 13:24
@aaronjmars
aaronjmars merged commit 0f999ca into main May 3, 2026
1 check passed
@aaronjmars
aaronjmars deleted the feat/mastodon-column branch May 3, 2026 13:24
aaronjmars added a commit that referenced this pull request Jul 9, 2026
Lockfile-only transitive bumps; no package.json changes needed.

- brace-expansion 5.0.5 -> 5.0.7  (GHSA-jxxr-4gwj-5jf2, #20, moderate)
    ReDoS-style DoS: large numeric range defeated the documented max guard.
    Affected copies under @ts-morph/common (shadcn) and @typescript-eslint.
- @babel/core   7.29.0 -> 7.29.7  (GHSA-4x5r-pxfx-6jf8, #27, low)
    Arbitrary file read via sourceMappingURL comment. Satisfies shadcn ^7.28.0.
- esbuild       0.27.7 -> 0.28.1  (GHSA-g7r4-m6w7-qqqr, #26, low, dev-only)
    Arbitrary file read via dev server on Windows. Pulled up by bumping the
    transitive tsx 4.21.0 -> 4.23.0 (drizzle-kit allows tsx ^4.21.0).

npm audit: 0 vulnerabilities. next build passes.
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