feat(articles): long-form text expression — compose, publish, read - #424
Merged
Conversation
The north-star text surface: articles as long-form POSTS on timeline_events (metadata.is_article), NOT a new ENTITY_REGISTRY entity. One row, free feed distribution, ~¼ the code of a new entity — reuses the createEventWithVisibility pipeline verbatim (no migration, no RPC change; metadata carries slug/cover/ reading-time/markdown body). - config/articles.ts: SSOT (limits, slug + reading-time helpers, copy) - services/articles: publishArticle (client) + getArticleBySlug/listPublishedArticles (server) - /articles: index of published articles - /articles/[slug]: x.ai/Substack-grade reader — safe markdown via react-markdown + rehype-sanitize + remark-gfm (never executes JSX on user input), design tokens only, byline→profile, cover, reading time, OG + JSON-LD, private/ followers gated to author - /articles/new: focused composer with live Write/Preview, visibility, cover - PostContent: feed posts flagged is_article render a "Read article" card → reader - ROUTES: ARTICLES / ARTICLES_NEW / ARTICLE(slug) Verified: type-check + lint clean, production build green (all 3 routes), SSR render + graceful empty-state smoke. Authed create + feed appearance to verify post-deploy via UI (project convention for DB-touching changes). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
| {coverImage && ( | ||
| // eslint-disable-next-line @next/next/no-img-element | ||
| <img | ||
| src={coverImage} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The north star: OrangeCat as the best place to express thoughts via text
An article is a long-form POST on
timeline_events(metadata.is_article), not a newENTITY_REGISTRYentity. One row, free feed distribution, ~¼ the code of a new entity — reuses thecreateEventWithVisibilitypipeline verbatim (no migration, no RPC change;metadatacarries slug / cover / reading-time / markdown body).What's in it
config/articles.ts— SSOT (limits, slug + reading-time helpers, copy)services/articles/*—publishArticle(client) +getArticleBySlug/listPublishedArticles(server)/articles— index of published articles/articles/[slug]— x.ai/Substack-grade reader: design-tokens only, byline→profile, cover, reading time, OG + JSON-LD; private/followers gated to author/articles/new— focused composer with live Write/Preview, visibility, coverPostContent.tsx— feed posts flaggedis_articlerender a "Read article" card → readerroutes.ts—ARTICLES/ARTICLES_NEW/ARTICLE(slug)Deliberate calls
<as JSX (unsafe/fragile for user content). react-markdown never executes JSX and sanitizes HTML.metadataverbatim (it derivescontentfromdescriptionand can't setevent_subtype), so the article payload rides inmetadata. A slug→indexed column can be promoted later via expand/contract if volume warrants.Verification
/articlesƒ,/articles/[slug]ƒ,/articles/new○); 777 unit tests pass; SSR + graceful empty-state smoke.🤖 Generated with Claude Code