Skip to content

Expand the pragmatics guide for ActivityPub objects#709

Open
dahlia wants to merge 9 commits intofedify-dev:mainfrom
dahlia:docs/pragmatics
Open

Expand the pragmatics guide for ActivityPub objects#709
dahlia wants to merge 9 commits intofedify-dev:mainfrom
dahlia:docs/pragmatics

Conversation

@dahlia
Copy link
Copy Markdown
Member

@dahlia dahlia commented Apr 21, 2026

Closes #28.

Read it at https://bd790823.fedify.pages.dev/manual/pragmatics#objects.

Summary

This expands docs/manual/pragmatics.md beyond actor-focused guidance and documents how common ActivityPub object types are interpreted by Mastodon in practice.

It adds pragmatic guidance for Note, Article, Question, Mention, Hashtag, and Emoji, including the HTML and tagging conventions that Mastodon expects for mentions and hashtags, and the way poll option counts map to rendered results.

It also refreshes the supporting screenshots in docs/manual/pragmatics/ so they match the documented examples, with separate captures for content warnings, single-choice polls, multiple-choice polls, hashtag interactions, and custom emoji rendering.

Why

The existing pragmatics guide was useful for actor metadata, but it left a gap around object-level behavior. In practice, this is where Fedify users tend to run into interoperability problems: an object may be valid ActivityPub, but remote software does not render it the way they expect.

This change makes those expectations explicit by tying concrete object properties to concrete Mastodon UI behavior. That should make the guide more useful when someone is deciding which object type to publish, how to structure content, and how to pair HTML markup with tags so remote clients treat mentions, hashtags, emoji, and polls correctly.

Scope

The changes are limited to docs/manual/pragmatics.md and the screenshots under docs/manual/pragmatics/.

Verification

  • Ran mise run fmt
  • Ran mise run docs:build

dahlia added 7 commits April 22, 2026 00:36
Add the first pragmatics object entry so Fedify users can map
Note content warnings and attachments to Mastodon UI when
publishing short posts.

fedify-dev#28

Assisted-by: OpenCode:gpt-5.4
Explain how Mastodon renders Article objects with a title,
canonical URL, and hashtags so Fedify users can choose the
right object type for long-form posts.

This also tightens the highlighted line ranges in the
existing Note and new Article examples so the docs emphasize
the relevant properties more clearly.

fedify-dev#28

Assisted-by: OpenCode:gpt-5.4
Describe how Mastodon turns Question objects into poll UI,
including the mapping from options to choices and from
metadata like voters and endTime to the footer below.

fedify-dev#28

Assisted-by: OpenCode:gpt-5.4
Tighten the new pragmatics examples by switching from line-range
highlights to field-level highlights, and crop the Mastodon
screenshots so they focus on the relevant UI instead of the
search chrome.

Also ignore temporary Playwright and demo-server artifacts used
while collecting documentation screenshots.

fedify-dev#28

Assisted-by: OpenCode:gpt-5.4
Document how Fedify object properties map to Mastodon UI for
short notes, content warnings, poll options, mentions,
hashtags, and custom emoji.

The new screenshots are refreshed at higher resolution and now
match the example payloads, including separate views for
single-choice and multiple-choice poll results.

fedify-dev#28

Assisted-by: OpenCode:gpt-5.4
Make the object-property subheadings follow the same style as
the Actors section by using bare property names, and expand the
inclusiveOptions explanation with both the choice view and the
results view.

fedify-dev#28

Assisted-by: OpenCode:gpt-5.4
Update the pragmatics examples to match Mastodon's expected
anchor attributes for mentions and hashtags, so the sample
HTML matches how those tags are actually recognized in remote
clients.

Also document the hashtag context menu that Mastodon opens
from a rendered hashtag instead of treating it as a plain
external link.

fedify-dev#28

Assisted-by: OpenCode:gpt-5.4
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 21, 2026

📝 Walkthrough

Walkthrough

Adds a new "Objects" section to the pragmatics documentation describing fediverse content object types and updates .gitignore to exclude .playwright-mcp/ and tmp/. No code or public API changes.

Changes

Cohort / File(s) Summary
Configuration
/.gitignore
Added .playwright-mcp/ and tmp/ to ignored paths.
Documentation
docs/manual/pragmatics.md
Added "Objects" section covering Note, Article, Question (polls), and link-like objects (Mention, Hashtag, Emoji) with rendering rules, HTML-escaping constraints, alignment requirements, and examples.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • sij411
  • 2chanhaeng
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely describes the main change: expanding the pragmatics guide documentation to cover ActivityPub objects beyond actors.
Linked Issues check ✅ Passed The PR successfully addresses issue #28 by documenting de facto norms for ActivityPub object usage in Mastodon, mapping object properties to UI behaviors and rendering patterns.
Out of Scope Changes check ✅ Passed Changes are appropriately scoped to documentation (.gitignore updates are minimal and support the documentation build setup).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The pull request description clearly relates to the changeset, explaining the expansion of pragmatics documentation for ActivityPub objects with specific examples of covered types (Note, Article, Question, Mention, Hashtag, Emoji) and the scope of changes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@dahlia dahlia self-assigned this Apr 21, 2026
@dahlia dahlia added the type/documentation Improvements or additions to documentation label Apr 21, 2026
@dahlia dahlia added this to the Fedify 2.2 milestone Apr 21, 2026
@dahlia dahlia requested a review from Copilot April 21, 2026 15:42
@dahlia
Copy link
Copy Markdown
Member Author

dahlia commented Apr 21, 2026

@codex review

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/manual/pragmatics.md`:
- Around line 429-431: The three list entries for Article, Note, and Question
are repetitive because each starts with "represents"; update the wording to vary
phrasing for readability by rewording one or two items (for example: "`Article`
— a multi-paragraph written work.", "`Note` — a short post.", "`Question` — a
poll.") while preserving the same meanings and the symbols Article, Note, and
Question.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: e2b312e5-9a96-442a-97ac-2c462328e8cd

📥 Commits

Reviewing files that changed from the base of the PR and between 321811d and 971bcb8.

⛔ Files ignored due to path filters (10)
  • docs/manual/pragmatics/mastodon-article.png is excluded by !**/*.png
  • docs/manual/pragmatics/mastodon-emoji.png is excluded by !**/*.png
  • docs/manual/pragmatics/mastodon-hashtag-dropdown.png is excluded by !**/*.png
  • docs/manual/pragmatics/mastodon-hashtag.png is excluded by !**/*.png
  • docs/manual/pragmatics/mastodon-mention.png is excluded by !**/*.png
  • docs/manual/pragmatics/mastodon-note-body.png is excluded by !**/*.png
  • docs/manual/pragmatics/mastodon-note.png is excluded by !**/*.png
  • docs/manual/pragmatics/mastodon-question-multi-choices.png is excluded by !**/*.png
  • docs/manual/pragmatics/mastodon-question-multi.png is excluded by !**/*.png
  • docs/manual/pragmatics/mastodon-question.png is excluded by !**/*.png
📒 Files selected for processing (2)
  • .gitignore
  • docs/manual/pragmatics.md

Comment thread docs/manual/pragmatics.md Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Expands the manual’s pragmatics guide from actor-focused details to practical, Mastodon-oriented rendering expectations for common ActivityPub object types, aiming to reduce interoperability surprises for Fedify users.

Changes:

  • Added object-level guidance and examples for Note, Article, Question, Mention, Hashtag, and Emoji, including Mastodon-specific HTML/tagging conventions.
  • Documented poll rendering behavior (option vote counts vs. voters) with single- and multi-choice examples.
  • Refreshed/added Mastodon UI screenshots and updated .gitignore for local tooling artifacts.

Reviewed changes

Copilot reviewed 1 out of 12 changed files in this pull request and generated no comments.

Show a summary per file
File Description
docs/manual/pragmatics.md Adds a new “Objects” section with pragmatic rendering guidance + example objects and screenshots.
docs/manual/pragmatics/mastodon-mention.png Updated screenshot illustrating mention rendering.
docs/manual/pragmatics/mastodon-hashtag.png Updated screenshot illustrating hashtag rendering.
docs/manual/pragmatics/mastodon-emoji.png Updated screenshot illustrating custom emoji rendering.
.gitignore Ignores .playwright-mcp/ and tmp/ directories.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the .gitignore file to exclude Playwright and temporary directories and adds a comprehensive 'Objects' section to the pragmatics manual. This new documentation covers the usage and rendering of Note, Article, Question, Mention, Hashtag, and Emoji types within the fediverse, specifically focusing on Mastodon compatibility. Feedback suggests replacing the endTime property with closed in poll examples to ensure better interoperability with Mastodon and other ActivityPub implementations.

Comment thread docs/manual/pragmatics.md Outdated
Comment thread docs/manual/pragmatics.md Outdated
Comment thread docs/manual/pragmatics.md Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.
see 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

dahlia added 2 commits April 22, 2026 00:58
Update the pragmatics guide to use `closed` instead of
`endTime` in the poll examples and surrounding explanation,
so the documented pattern matches Mastodon's poll deadline
handling more closely.

fedify-dev#709 (comment)
fedify-dev#709 (comment)
fedify-dev#709 (comment)

Assisted-by: OpenCode:gpt-5.4
Rephrase the opening object list in the pragmatics guide so the
entries do not all begin with the same verb, while keeping the
same meanings and structure.

fedify-dev#709 (comment)

Assisted-by: OpenCode:gpt-5.4
@dahlia dahlia requested a review from Copilot April 21, 2026 16:08
@dahlia
Copy link
Copy Markdown
Member Author

dahlia commented Apr 21, 2026

@codex review

@dahlia
Copy link
Copy Markdown
Member Author

dahlia commented Apr 21, 2026

/gemini review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 12 changed files in this pull request and generated no new comments.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the .gitignore file to exclude .playwright-mcp/ and tmp/ directories. It also adds a substantial new section to docs/manual/pragmatics.md titled "Objects", which details the rendering conventions for various ActivityPub object types such as Note, Article, Question, Mention, Hashtag, and Emoji within the fediverse, including code examples and Mastodon-specific implementation notes. I have no feedback to provide.

@dahlia dahlia requested a review from 2chanhaeng April 21, 2026 16:52
@dahlia dahlia requested a review from sij411 April 21, 2026 16:52
@github-actions
Copy link
Copy Markdown
Contributor

Pre-release has been published for this pull request:

Packages

Package Version JSR npm
@fedify/fedify 2.2.0-pr.709.20+17eb3fa5 JSR npm
@fedify/cli 2.2.0-pr.709.20+17eb3fa5 JSR npm
@fedify/amqp 2.2.0-pr.709.20+17eb3fa5 JSR npm
@fedify/astro 2.2.0-pr.709.20+17eb3fa5 JSR npm
@fedify/cfworkers 2.2.0-pr.709.20+17eb3fa5 JSR npm
@fedify/create 2.2.0-pr.709.20+17eb3fa5 npm
@fedify/debugger 2.2.0-pr.709.20+17eb3fa5 JSR npm
@fedify/denokv 2.2.0-pr.709.20+17eb3fa5 JSR
@fedify/elysia 2.2.0-pr.709.20+17eb3fa5 JSR npm
@fedify/express 2.2.0-pr.709.20+17eb3fa5 JSR npm
@fedify/fastify 2.2.0-pr.709.20+17eb3fa5 JSR npm
@fedify/fixture 2.2.0-pr.709.20+17eb3fa5 JSR
@fedify/fresh 2.2.0-pr.709.20+17eb3fa5 JSR
@fedify/h3 2.2.0-pr.709.20+17eb3fa5 JSR npm
@fedify/hono 2.2.0-pr.709.20+17eb3fa5 JSR npm
@fedify/init 2.2.0-pr.709.20+17eb3fa5 JSR npm
@fedify/koa 2.2.0-pr.709.20+17eb3fa5 JSR npm
@fedify/lint 2.2.0-pr.709.20+17eb3fa5 JSR npm
@fedify/mysql 2.2.0-pr.709.20+17eb3fa5 JSR npm
@fedify/nestjs 2.2.0-pr.709.20+17eb3fa5 npm
@fedify/next 2.2.0-pr.709.20+17eb3fa5 npm
@fedify/nuxt 2.2.0-pr.709.20+17eb3fa5 JSR npm
@fedify/postgres 2.2.0-pr.709.20+17eb3fa5 JSR npm
@fedify/redis 2.2.0-pr.709.20+17eb3fa5 JSR npm
@fedify/relay 2.2.0-pr.709.20+17eb3fa5 JSR npm
@fedify/solidstart 2.2.0-pr.709.20+17eb3fa5 JSR npm
@fedify/sqlite 2.2.0-pr.709.20+17eb3fa5 JSR npm
@fedify/sveltekit 2.2.0-pr.709.20+17eb3fa5 JSR npm
@fedify/testing 2.2.0-pr.709.20+17eb3fa5 JSR npm
@fedify/vocab 2.2.0-pr.709.20+17eb3fa5 JSR npm
@fedify/vocab-runtime 2.2.0-pr.709.20+17eb3fa5 JSR npm
@fedify/vocab-tools 2.2.0-pr.709.20+17eb3fa5 JSR npm
@fedify/webfinger 2.2.0-pr.709.20+17eb3fa5 JSR npm

Documentation

The docs for this pull request have been published:

https://bd790823.fedify.pages.dev

@issues-auto-labeler issues-auto-labeler Bot added activitypub/interop Interoperability issues activitypub/mastodon Mastodon compatibility component/federation Federation object related labels Apr 22, 2026
@dahlia dahlia removed component/federation Federation object related activitypub/interop Interoperability issues activitypub/mastodon Mastodon compatibility labels Apr 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type/documentation Improvements or additions to documentation

Development

Successfully merging this pull request may close these issues.

Docs on pragmatics

2 participants