Repository navigation
feat(social): new comark-social package with a static ::post card - #496
Conversation
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
comark-annotate
comark-badge
comark-bundle
comark-cards
comark-carousel
comark-cast
comark-charts
comark-chat
comark-chips
comark-cjk
comark-code
comark-code-notes
comark-colors
comark-comments
comark-critic
comark-deflist
comark-details
comark-diagrams
comark-diff
comark-embed
comark-fields
comark-figure
comark-file-tree
comark-footnotes
comark-git-graph
comark-github
comark-icon
comark-include
comark-keys
comark-links
comark-linter
comark-magic-move
comark-mark
markdown-it-to-comark
marked-to-comark
comark-mathml
comark-media
comark-metrics
migrate-to-comark
comark-motion
comark-outline
comark-properties
comark-qr
comark-quiz
comark-reading-time
remark-to-comark
comark-social
comark-sources
comark-steps
comark-table
comark-tabs
comark-tests
comark-time
comark-ui
comark-xref
comark-zoom
commit: |
There was a problem hiding this comment.
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.
Latest result Pull request merged. Final answersSession 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. |
18b50b3 to
2173b4c
Compare
There was a problem hiding this comment.
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=falseleaves 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.
gpt-6.2-sol(high) | 𝕏
There was a problem hiding this comment.
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.
gpt-6.2-sol(high) | 𝕏
There was a problem hiding this comment.
ℹ️ 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.
gpt-6.2-sol(high) | 𝕏

Adds
comark-social, a new package whose::postblock 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
packages/socialwith HTML, Vue, React, and Svelte renderers,./info,./client, and./style.css.cslprefix.data-comark-frame.--comark-*tokens in thecomarklayer.platform,url,author,handle,avatar,time, and the countsreplies,reposts,quotes,likes,views, andbookmarks.:::postis the quoted post.fetch: truefills a post from itsurlwhile parsing: fxtwitter for X,public.api.bsky.app, or the post's Mastodon server.maxImageSize.fetchPost()is exported for scripts. Requests send the generic user agentcomark-social.meta.issuesandmeta.issueRulesundercomark/social/*.docs/pages/doctor/social/.SKILL.md, and the docs page are new.Decisions
chip="false", so mentions and links keep the platform's look rather than becoming chips. With comark-github's references on, the card setsreferences="false", so a handle such as@adaisn't linked to a GitHub profile. That opt-out is new in comark-github:references()now skips any element withreferences="false", and its docs and skill reference say so.data:image/URI. Any other scheme is dropped withinvalid-url, and the card shows the author's initial instead.timethat isn't a date shows as written, withinvalid-time.urlorplatform. One quote shows; a second one, or a quote inside a quote, getsextra-quote.aria-hidden="true"as a barearia-hidden, which screen readers ignore. The HTML renderer writes the value back, so the visible count and the initial aren't read twice.no-runtime-typeofis suppressed insrc/fetch.ts,src/post.ts, andsrc/text.ts, where the code reads JSON the package didn't write and Comark's string-or-element nodes. Each suppression gives its reason indoctor.config.json.Before merging
comark-social needs an npm trusted publisher before its first release, with workflow
release.yaml, environmentnpm, andnpm publishallowed.How it was checked
vp test runforpackages/social: parse and render tests, plus HTML, Vue, React, and Svelte giving the same markup.tags,info, andbrowser-pluginstests, a comark-ui test that a post's handles stay as written with every plugin on, comark-github's references tests, and the rootdoctorandworkspacetests.pnpm typecheck, the package's Vite Doctor run under the strict preset,vp fmt, andvp lint.🤖 Generated with Claude Code