Skip to content

feat: let members embed commits on other sites - #1522

Draft
jubianchi wants to merge 1 commit into
dev-null-sh:productionfrom
jubianchi:feat/commit-embeds
Draft

jubianchi wants to merge 1 commit into
dev-null-sh:productionfrom
jubianchi:feat/commit-embeds

Conversation

@jubianchi

@jubianchi jubianchi commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

An implementation of the commit embeds described in #1521, so the RFC can be discussed on something that runs. This is a draft: the design is open for discussion in the issue, and this PR will follow what is decided there.

Changes

  1. Embeds setting. An Embeds switch in Settings → Profile and in an organization's settings (admins only). It is on by default and included in the export. When it is off, cards read [unavailable].
  2. The card, /embed/{uuid}. The card is signed, framable and sessionless, and reads without JavaScript. It shows the commit, the commit it quotes, its thread and its replies, drawn with the commit page's own components (CommitHeader, GraphRail, ReplyBranch, CommitPoll, QuotedCommit, TombstoneLine…). It is read-only, and its links are plain links: nothing is prefetched or previewed on hover.
  3. embed.js and /oembed. embed.js sizes the frame. /oembed returns the card for the signed commit link.
  4. The dialog. Embed commit in the "…" menu opens a dialog that previews the card and hands out HTML, Markdown and a link.

Validation

Check Result
Pest 5932 passed
vitest 1079 passed, 1 failed: StandaloneCommitGraphs, which also fails on production since #1454
PHPStan, Pint, tsc, lint Clean
Hosted CI Not run yet

Visual evidence

More screenshots, in light and dark, are in #1521. They predate the last design pass, so the card's header and the quoted commit look slightly different now.

A commit embedded in a blog post

Device verification

Tested in desktop Chrome on macOS, in light and dark, and on a page 420px wide. Not checked on a phone.

Independent review

An automated adversarial review ran locally; this is not a human review. Its findings on what the card exposes and on its links are fixed. The others are listed under Limitations.

Limitations

  • Not built yet:
    • the 30-second invalidated cache;
    • the 429 fallback;
    • building the tree in a constant number of queries.
  • Follow-ups from the review:
    • The card mounts with createRoot instead of hydrating the server's HTML.
    • Some server conventions to align: a form request for the card, app/Support → app/Services.
    • The dialog's tabs need accessibility work.
    • Docs to write: KNOWLEDGE_BASE.md, DESIGN.md, PRODUCT.md.
  • Open questions in [RFC] Commit embeds #1521: the name, and the rollout in smaller PRs.

@coderabbitai

coderabbitai Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@jubianchi jubianchi mentioned this pull request Nov 8, 2026
A commit can be shown on another site as a card that reads like /dev/null:
the commit, the commit it quotes, optionally the rest of its author's
thread, and its replies down to several levels, with the same header,
body, polls, link previews, actions row, tombstones and rail, drawn by the
app's own components. The card is served live, so a deletion, a rejection
or an opt-out shows on every page that embeds it.

- Users and organizations can turn embeds off in their settings; they are
  on by default, exported and erased with the account. Cards then read
  [unavailable], like any commit that can't be shown.
- /embed/{uuid} serves the card: signed, framable, sessionless, always the
  guest view, readable without JavaScript. Its links are plain links to
  /dev/null: nothing is prefetched or previewed on hover.
- embed.js sizes the frame to the card, and /oembed describes the signed
  commit link to blogging platforms.
- "Embed commit" in the commit's menu opens a dialog that previews the
  card and hands out HTML, Markdown and a link, signed for members only.

See dev-null-sh#1521 for the RFC.
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