Skip to content

feat(article): quote image generator with mobile bottom bar and license gate#5968

Merged
mashbean merged 7 commits into
developfrom
feat/quote-image-generator
Jun 14, 2026
Merged

feat(article): quote image generator with mobile bottom bar and license gate#5968
mashbean merged 7 commits into
developfrom
feat/quote-image-generator

Conversation

@mashbean

Copy link
Copy Markdown
Contributor

Upstream CI mirror of #5965(原 PR 來自 fork yingshinlee,fork 觸發的 CI 拿不到 secrets、build required check 不會跑)。

此 PR 從 thematters/matters-web 內部分支開啟,讓 CI 能在帶 secrets 的 context 跑、codegen 抓 server.matters.icu 的新 schema(campaign discussion / quote wall 後端已於今日部署上 staging)。

內容與 #5965 相同。Co-Authored-By: Claude Fable 5

@mashbean mashbean requested a review from a team as a code owner June 13, 2026 11:08
@vercel

vercel Bot commented Jun 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
matters-web Ready Ready Preview Jun 14, 2026 6:36am

Request Review

yingshinlee and others added 7 commits June 14, 2026 14:27
Let readers select text in an article and generate a shareable quote
image (download as JPG / Web Share). Extends the existing
TextSelectionPopover with a second button next to "quote to comment".

- New component: src/components/QuoteImageDialog (Card / Content / presets / gql)
  - 6 neutral color presets + 3 sizes (1:1, 4:5, 9:16) with platform hints
  - auto font-scaling + 80-char cap so long selections never overflow
  - QR code (qrcode) links back to the article; rendered via html-to-image
  - 七日書 (WritingChallenge) articles automatically swap the Matters
    wordmark for the seven-day-book logo (silent detection via campaigns)
- TextSelectionPopover: add icon-only "金句圖" button, thread article in
- ArticleDetail/Content + gql: pass article + spread QuoteImageArticle fragment
- analytics: register quote_image_* click events
- deps: html-to-image, qrcode (+ @types/qrcode)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- TextSelectionPopover: new variant='bottomBar' for mobile — fixed bottom
  action bar (Quote / Quote card) so it never fights with the iOS/Android
  native selection menu; selection detected via debounced selectionchange
- mount bottomBar on ArticleDetail/Content under Media lessThan md
  (previously the feature was desktop-only)
- license gate: hide quote-card button when article license is ARR
  (all rights reserved) unless the viewer is the author; CC licenses pass
  (card already quotes faithfully with author + link attribution)
- add license to QuoteImageArticle fragment

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…Discussion

- route.ts: widen CommentArgs.type union and ToPathArgs.commentDetail with
  campaignDiscussion / campaign, and handle it in toPath, matching the
  generated CommentType enum (backend added campaignDiscussion)
- sync package-lock.json with html-to-image / qrcode / @types/qrcode deps
  introduced by this branch
- QuoteImageDialog: fix formatjs enforce-id hashes, stylelint property
  ordering / modern color notation, and use the wired closeDialog prop
- TextSelectionPopover: refresh formatjs enforce-id hashes
- regenerate extracted lang/*.json messages

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The popover was gated on contentContainer.current in render; assigning a
ref does not trigger a re-render, so it only appeared after an unrelated
re-render (e.g. scroll). Gate on a mounted flag set in an effect instead.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@mashbean mashbean force-pushed the feat/quote-image-generator branch from 933b02f to dd8b60e Compare June 14, 2026 06:32
@mashbean mashbean merged commit 7f75a9b into develop Jun 14, 2026
4 checks passed
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.

2 participants