Add ActivityPub article preview metadata #33

Merged
erik merged 1 commit from task-2494df77-activitypub-preview-language into main 2026-06-27 23:14:04 -05:00
Owner

Summary

  • emit language-tagged ActivityPub content via contents/LanguageString so Mastodon receives contentMap
  • attach the first article markdown image as an ActivityPub Document with media type and alt/name
  • extend outbox tests for contentMap and article image attachments

Verification

  • npm run typecheck
  • npm test -- --run src/federation/tests/routes.test.ts
  • npm test
  • npm run build

Task: task-2494df77

Note: task stays open after merge until release/deploy and live Chromium/Mastodon verification show the card image and no unwanted Translate control.

## Summary - emit language-tagged ActivityPub content via `contents`/`LanguageString` so Mastodon receives `contentMap` - attach the first article markdown image as an ActivityPub `Document` with media type and alt/name - extend outbox tests for contentMap and article image attachments ## Verification - npm run typecheck - npm test -- --run src/federation/__tests__/routes.test.ts - npm test - npm run build Task: task-2494df77 Note: task stays open after merge until release/deploy and live Chromium/Mastodon verification show the card image and no unwanted Translate control.
Author
Owner

Review summary

Approved. The PR moves the remaining Mastodon-specific preview behavior into the ActivityPub object, matching the working pattern from erikcraddock.me.

Acceptance criteria coverage

  • Emits language-tagged ActivityPub content by using contents: [content, new LanguageString(content, "en")].
    • Fedify serializes this as both content and contentMap, which should prevent Mastodon from offering translation on future delivered statuses.
  • Adds article image attachment metadata.
    • The first markdown image is emitted as a Document attachment with absolute URL, media type, and alt/name.
  • Preserves existing Note/Article behavior.
    • Existing content still serializes as content; tests now additionally assert contentMap.
  • Tests cover the new ActivityPub serialized output.
    • Outbox test asserts article attachment metadata and contentMap for article/note objects.

Verification

  • npm run typecheck
  • npm test -- --run src/federation/__tests__/routes.test.ts
  • npm test
  • npm run build

Important follow-up gate

Do not close task task-2494df77 after merge alone. It should remain open until release/deploy and Chromium/Mastodon verification show the article card image and no unwanted Translate control for a newly delivered/refetched Mastodon status.

Blocking issues

None.

Verdict

Approved.

## Review summary Approved. The PR moves the remaining Mastodon-specific preview behavior into the ActivityPub object, matching the working pattern from `erikcraddock.me`. ## Acceptance criteria coverage - [x] Emits language-tagged ActivityPub content by using `contents: [content, new LanguageString(content, "en")]`. - Fedify serializes this as both `content` and `contentMap`, which should prevent Mastodon from offering translation on future delivered statuses. - [x] Adds article image attachment metadata. - The first markdown image is emitted as a `Document` attachment with absolute URL, media type, and alt/name. - [x] Preserves existing Note/Article behavior. - Existing content still serializes as `content`; tests now additionally assert `contentMap`. - [x] Tests cover the new ActivityPub serialized output. - Outbox test asserts article attachment metadata and `contentMap` for article/note objects. ## Verification - `npm run typecheck` - `npm test -- --run src/federation/__tests__/routes.test.ts` - `npm test` - `npm run build` ## Important follow-up gate Do not close task `task-2494df77` after merge alone. It should remain open until release/deploy and Chromium/Mastodon verification show the article card image and no unwanted Translate control for a newly delivered/refetched Mastodon status. ## Blocking issues None. ## Verdict Approved.
erik merged commit f73edd797d into main 2026-06-27 23:14:04 -05:00
erik deleted branch task-2494df77-activitypub-preview-language 2026-06-27 23:14:04 -05:00
Sign in to join this conversation.
No description provided.