Skip to content

feat(social): new comark-social package with a static ::post card - #496

Merged
vite-hub[bot] merged 3 commits into
mainfrom
feat/social-post
Nov 28, 2026
Merged

vite-hub[bot] merged 3 commits into
mainfrom
feat/social-post

Conversation

@onmax

@onmax onmax commented Nov 28, 2026 •

Copy link
Copy Markdown
Owner

Adds comark-social, a new package whose ::post block draws a post from X, Bluesky, Mastodon, Threads, LinkedIn, or any other site as a static card. The card has the platform's logo, the author, the text, pictures, a quoted post, and the counts. There's no iframe, no script, and no request when the page opens, so a quoted post stays readable after it's deleted.

Plan: https://drop.vitehub.dev/d/wtn1zg3tajmt/social-poll-drop-plan

What changed

  • Package. packages/social with HTML, Vue, React, and Svelte renderers, ./info, ./client, and ./style.css.
    • Classes use the csl prefix.
    • The outer card carries data-comark-frame.
    • Styles are on the --comark-* tokens in the comark layer.
  • Props. platform, url, author, handle, avatar, time, and the counts replies, reposts, quotes, likes, views, and bookmarks.
    • The body is Markdown. Images in a paragraph of their own become a grid of up to four.
    • A nested :::post is the quoted post.
  • Fetch. fetch: true fills a post from its url while parsing: fxtwitter for X, public.api.bsky.app, or the post's Mastodon server.
    • The avatar and pictures are inlined, up to maxImageSize.
    • fetchPost() is exported for scripts. Requests send the generic user agent comark-social.
  • Issues. Every problem goes in meta.issues and meta.issueRules under comark/social/*.
    • The lint rules are COMARK4901 to COMARK4909, each with a page in docs/pages/doctor/social/.
  • Wiring.
    • comark-ui registers it before chips, and the tags, info, and vue-lazy lists include it.
    • comark-linter loads it.
    • The skill reference, SKILL.md, and the docs page are new.

Decisions

  • Chips and GitHub links. With comark-chips on, the card sets chip="false", so mentions and links keep the platform's look rather than becoming chips. With comark-github's references on, the card sets references="false", so a handle such as @ada isn't linked to a GitHub profile. That opt-out is new in comark-github: references() now skips any element with references="false", and its docs and skill reference say so.
  • Avatars. An avatar may be a path, an https address, or a data:image/ URI. Any other scheme is dropped with invalid-url, and the card shows the author's initial instead.
  • Dates. A time that isn't a date shows as written, with invalid-time.
  • Quotes. A quoted post takes the outer post's platform unless it has its own url or platform. One quote shows; a second one, or a quote inside a quote, gets extra-quote.
  • Fetch platforms. Fetching works only for X, Bluesky, and Mastodon, because Threads and LinkedIn have no public API.
  • Screen readers. Comark writes aria-hidden="true" as a bare aria-hidden, which screen readers ignore. The HTML renderer writes the value back, so the visible count and the initial aren't read twice.
  • Doctor suppressions. no-runtime-typeof is suppressed in src/fetch.ts, src/post.ts, and src/text.ts, where the code reads JSON the package didn't write and Comark's string-or-element nodes. Each suppression gives its reason in doctor.config.json.

Before merging

comark-social needs an npm trusted publisher before its first release, with workflow release.yaml, environment npm, and npm publish allowed.

How it was checked

  • vp test run for packages/social: parse and render tests, plus HTML, Vue, React, and Svelte giving the same markup.
  • comark-ui's tags, info, and browser-plugins tests, a comark-ui test that a post's handles stay as written with every plugin on, comark-github's references tests, and the root doctor and workspace tests.
  • pnpm typecheck, the package's Vite Doctor run under the strict preset, vp fmt, and vp lint.

🤖 Generated with Claude Code

@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-28T12:15:10.993273Z
We couldn’t complete this review. Comment @codex review to try again.
18b50b3 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@pkg-pr-new

pkg-pr-new Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

comark-annotate

pnpm add https://pkg.pr.new/onmax/comark-ui/comark-annotate@496

comark-badge

pnpm add https://pkg.pr.new/onmax/comark-ui/comark-badge@496

comark-bundle

pnpm add https://pkg.pr.new/onmax/comark-ui/comark-bundle@496

comark-cards

pnpm add https://pkg.pr.new/onmax/comark-ui/comark-cards@496

comark-carousel

pnpm add https://pkg.pr.new/onmax/comark-ui/comark-carousel@496

comark-cast

pnpm add https://pkg.pr.new/onmax/comark-ui/comark-cast@496

comark-charts

pnpm add https://pkg.pr.new/onmax/comark-ui/comark-charts@496

comark-chat

pnpm add https://pkg.pr.new/onmax/comark-ui/comark-chat@496

comark-chips

pnpm add https://pkg.pr.new/onmax/comark-ui/comark-chips@496

comark-cjk

pnpm add https://pkg.pr.new/onmax/comark-ui/comark-cjk@496

comark-code

pnpm add https://pkg.pr.new/onmax/comark-ui/comark-code@496

comark-code-notes

pnpm add https://pkg.pr.new/onmax/comark-ui/comark-code-notes@496

comark-colors

pnpm add https://pkg.pr.new/onmax/comark-ui/comark-colors@496

comark-comments

pnpm add https://pkg.pr.new/onmax/comark-ui/comark-comments@496

comark-critic

pnpm add https://pkg.pr.new/onmax/comark-ui/comark-critic@496

comark-deflist

pnpm add https://pkg.pr.new/onmax/comark-ui/comark-deflist@496

comark-details

pnpm add https://pkg.pr.new/onmax/comark-ui/comark-details@496

comark-diagrams

pnpm add https://pkg.pr.new/onmax/comark-ui/comark-diagrams@496

comark-diff

pnpm add https://pkg.pr.new/onmax/comark-ui/comark-diff@496

comark-embed

pnpm add https://pkg.pr.new/onmax/comark-ui/comark-embed@496

comark-fields

pnpm add https://pkg.pr.new/onmax/comark-ui/comark-fields@496

comark-figure

pnpm add https://pkg.pr.new/onmax/comark-ui/comark-figure@496

comark-file-tree

pnpm add https://pkg.pr.new/onmax/comark-ui/comark-file-tree@496

comark-footnotes

pnpm add https://pkg.pr.new/onmax/comark-ui/comark-footnotes@496

comark-git-graph

pnpm add https://pkg.pr.new/onmax/comark-ui/comark-git-graph@496

comark-github

pnpm add https://pkg.pr.new/onmax/comark-ui/comark-github@496

comark-icon

pnpm add https://pkg.pr.new/onmax/comark-ui/comark-icon@496

comark-include

pnpm add https://pkg.pr.new/onmax/comark-ui/comark-include@496

comark-keys

pnpm add https://pkg.pr.new/onmax/comark-ui/comark-keys@496

comark-links

pnpm add https://pkg.pr.new/onmax/comark-ui/comark-links@496

comark-linter

pnpm add https://pkg.pr.new/onmax/comark-ui/comark-linter@496

comark-magic-move

pnpm add https://pkg.pr.new/onmax/comark-ui/comark-magic-move@496

comark-mark

pnpm add https://pkg.pr.new/onmax/comark-ui/comark-mark@496

markdown-it-to-comark

pnpm add https://pkg.pr.new/onmax/comark-ui/markdown-it-to-comark@496

marked-to-comark

pnpm add https://pkg.pr.new/onmax/comark-ui/marked-to-comark@496

comark-mathml

pnpm add https://pkg.pr.new/onmax/comark-ui/comark-mathml@496

comark-media

pnpm add https://pkg.pr.new/onmax/comark-ui/comark-media@496

comark-metrics

pnpm add https://pkg.pr.new/onmax/comark-ui/comark-metrics@496

migrate-to-comark

pnpm add https://pkg.pr.new/onmax/comark-ui/migrate-to-comark@496

comark-motion

pnpm add https://pkg.pr.new/onmax/comark-ui/comark-motion@496

comark-outline

pnpm add https://pkg.pr.new/onmax/comark-ui/comark-outline@496

comark-properties

pnpm add https://pkg.pr.new/onmax/comark-ui/comark-properties@496

comark-qr

pnpm add https://pkg.pr.new/onmax/comark-ui/comark-qr@496

comark-quiz

pnpm add https://pkg.pr.new/onmax/comark-ui/comark-quiz@496

comark-reading-time

pnpm add https://pkg.pr.new/onmax/comark-ui/comark-reading-time@496

remark-to-comark

pnpm add https://pkg.pr.new/onmax/comark-ui/remark-to-comark@496

comark-social

pnpm add https://pkg.pr.new/onmax/comark-ui/comark-social@496

comark-sources

pnpm add https://pkg.pr.new/onmax/comark-ui/comark-sources@496

comark-steps

pnpm add https://pkg.pr.new/onmax/comark-ui/comark-steps@496

comark-table

pnpm add https://pkg.pr.new/onmax/comark-ui/comark-table@496

comark-tabs

pnpm add https://pkg.pr.new/onmax/comark-ui/comark-tabs@496

comark-tests

pnpm add https://pkg.pr.new/onmax/comark-ui/comark-tests@496

comark-time

pnpm add https://pkg.pr.new/onmax/comark-ui/comark-time@496

comark-ui

pnpm add https://pkg.pr.new/onmax/comark-ui@496

comark-xref

pnpm add https://pkg.pr.new/onmax/comark-ui/comark-xref@496

comark-zoom

pnpm add https://pkg.pr.new/onmax/comark-ui/comark-zoom@496

commit: 3b8d61d

@pullfrog pullfrog Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Keep parse-time fetching off for untrusted content until the package has an outbound request policy. The current opt-in can send server-side requests to destinations chosen by the document or by a remote response.

Approach: A static card built during parsing is a good fit; fetching needs a separate trust boundary and should work consistently for both the main post and its quote.

Reviewed changes — I traced ::post from Markdown through the four renderers, including provider fetching and the preset and linter integrations.

  • Static cards: Reviewed props, body links, media, quotes, counts, and renderer markup.
  • Fetch and inlining: Reviewed which URLs are requested, how provider responses fill missing content, and how failures fall back.
  • Integration: Checked the default preset, chips opt-out, Doctor rules, and public docs. The 45 focused social/chips tests and 377 preset/Doctor tests passed; separate public-API checks confirmed the cases noted in this review.

⚠️ Generic posts get GitHub links in the default preset

P1 — Class: the preset relinks plain social handles. With the default preset, Thanks @grace in a platform="generic" card links to GitHub, although the social docs say generic posts leave handles as text.

Technical details
# Keep GitHub references out of social cards

## Affected sites
- `packages/ui/src/index.ts:386` — enables GitHub references after social has drawn the card.
- `packages/github/src/references.ts:46` — the walker descends into the card and rewrites text that social deliberately left unlinked.
- `packages/social/src/post.ts:397` — the existing opt-out is specific to chips.

## Required outcome
- With both plugins on, a generic post's plain handles stay plain, while GitHub references still work outside the card.

Comment thread packages/social/src/fetch.ts Resolved
Comment thread packages/social/src/complete.ts Resolved
Comment thread packages/social/src/complete.ts Resolved
Comment thread packages/social/src/post.ts Resolved
Comment thread packages/social/src/index.ts Resolved
@vite-hub

vite-hub Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor
Session Status Started Duration
Pending Completed Not started —
View session Last seen running 2026-11-28T13:48:01.499Z 1s
View session Last seen running 2026-11-28T13:34:24.097Z 0s

Latest result

Pull request merged.

Final answers

Session

Pull request merged.

Session

Pull request evidence changed.

Session

Pull request evidence changed.

Session

Pull request evidence changed.

Session

Pull request evidence changed.

Session

Pull request evidence changed.

@onmax

onmax commented Nov 28, 2026

Copy link
Copy Markdown
Owner Author

Before/after on Drop

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No new issues found in 2173b4c. The default preset now leaves generic social handles as plain text. The remaining findings from the prior review are unchanged.

Reviewed changes — I reviewed the GitHub references opt-out and its use in social cards.

  • Added a subtree opt-out: references=false leaves text inside the marked block alone without changing reference linking elsewhere.
  • Applied the opt-out to social cards: The default preset respects each card’s platform-specific linking rules, including leaving generic handles unlinked.

All 50 social and GitHub package tests and both targeted preset tests passed.

Pullfrog  | Fix it ➔ | View workflow run | Using gpt-6.2-sol(high) | 𝕏

@onmax onmax mentioned this pull request Nov 28, 2026

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Important

The outbound policy closes the original unrestricted fetch path. Two supported cases still regress: official Bluesky video thumbnails and authored quote avatars can now stay remote instead of being inlined.

Approach: Keep the exact origin checks and apply them on every redirect. The fixes should preserve that boundary.

Reviewed changes — I reviewed the delta from 2173b4c to 57342a4.

  • Restricted outbound requests: Added purpose-specific HTTPS allowlists and checked each redirect hop. A host transport can supply policy for federated destinations.
  • Completed quotes independently: Fetched authored quotes from their own URLs, preserved written overrides, and reported missing authors against the quote.
  • Fixed media and lint handling: Capped media before download and rendering, validated malformed avatars, and aligned post ordinals with lint locations.

364 focused tests passed. I verified both regressions separately through parsing and HTML rendering.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using gpt-6.2-sol(high) | 𝕏

Comment thread packages/social/src/request.ts Resolved
Comment thread packages/social/src/complete.ts Resolved

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

ℹ️ No P0 or P1 findings remain; one documentation gap is noted inline.

Reviewed changes — I reviewed 57342a4 → 3b8d61d; all 26 social package tests passed.

  • Allowed official Bluesky video stills: Added both exact image origins so a thumbnail can be inlined after its checked CDN redirect.
  • Restored authored quote avatars: Inlined the avatar after a successful parent fetch without looking up a URL-less quote or downloading its written body images.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using gpt-6.2-sol(high) | 𝕏

Comment thread packages/social/docs/index.md Resolved
@vite-hub
vite-hub Bot merged commit 6658334 into main Nov 28, 2026
7 checks passed
@vite-hub
vite-hub Bot deleted the feat/social-post branch November 28, 2026 13:50
@github-actions github-actions Bot mentioned this pull request Nov 28, 2026
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