Skip to content

feat(campaign): discussion board on campaign detail page#5964

Closed
yingshinlee wants to merge 2 commits into
thematters:developfrom
yingshinlee:feat/campaign-discussion
Closed

feat(campaign): discussion board on campaign detail page#5964
yingshinlee wants to merge 2 commits into
thematters:developfrom
yingshinlee:feat/campaign-discussion

Conversation

@yingshinlee

Copy link
Copy Markdown
Collaborator

這是什麼

寫作活動頁(/e/<shortHash>)新增「留言區」討論板的前端。依賴後端 PR(thematters/matters-server 的 feat/campaign-discussion,新增 campaignDiscussion 評論類型與 WritingChallenge.discussion 欄位),請先合後端。

  • 公開可讀;只有報名成功者可發言(前端以既有 application { state } 控制輸入框、後端最終把關)。
  • 桌機:右側欄、參與者下方放精簡模組(輸入框+最新 3 則+「展開全部」彈窗)。
  • 手機:主欄 InfoHeader 下方放單行入口entry="chip"),點開彈出完整留言對話框。useMediaQuery 確保同時只渲染一份(避免表單 DOM id 重複)。
  • 留言 240 字上限(比照 moment):輸入框字數計、超限鎖送出。長留言沿用既有 Expandable 收合。

改動

範圍 內容
src/views/CampaignDetail/Discussion/(新) index.tsx(精簡模組+chip 入口模式)、Dialog.tsx(完整討論串彈窗:分頁、回覆)、gql.tsstyles.module.css
src/views/CampaignDetail/index.tsx 雙落點掛載(桌機 aside/手機主欄 chip)
Forms/CircleCommentFormDialogs/CircleCommentFormDialog 一般化:circleId 改 optional、新增 campaignId;type 加 campaignDiscussion;campaign 留言顯示 0/240 字數計
CircleComment/FooterActions/ReplyButtonCircleComment/DropdownActions fragment node... on WritingChallenge { id },回覆/編輯傳回 campaignId
src/common/enums/ MAX_CAMPAIGN_COMMENT_LENGTH = 240COMMENT_TYPE_TEXT 加 campaignDiscussion
版面(產品已拍板,全活動頁生效) 封面高度 23.26% → 12%(InfoHeader/styles.module.css);右欄參與者頭像上限 60 → 12(SideParticipants

⚠️ Merge 前需要(Draft 原因)

貢獻環境 node < 22,以下生成步驟未跑,CI typecheck 預期會紅:

  1. GraphQL codegen:產生 CampaignDiscussionCommentsQuery 等型別(需後端 schema 先合)。
  2. formatjs 抽字:新文案(Discussion/報名提示/placeholder)需重跑抽取並補 zh-Hant / zh-Hans 翻譯(目前 fallback 英文)。
  3. lint / typecheck / 既有測試。

建議 QA

  • md 斷點切換:桌機右欄模組 ↔ 手機 chip(同時只存在一份表單)。
  • 權限矩陣:未登入/未報名/pending/succeeded 四種帳號的讀寫行為。
  • 彈窗在手機的呈現(底部抽屜)、分頁載入、回覆樓中樓。
  • 版面變更過目:封面高度與頭像數量(影響所有活動頁)。

範圍外(後續 PR)

InfoHeader 重構(標題壓封面、說明兩行收合,等新封面圖)、通知、檢舉、金句牆。

🤖 Generated with Claude Code

- CampaignDetail/Discussion: compact module (desktop right aside) with input
  box + latest 3 comments + view-all dialog; mobile renders a one-line chip
  entry that opens the dialog
- reuse CircleComment family: CircleCommentForm/Dialog accept campaignId and
  type campaignDiscussion; ReplyButton/DropdownActions resolve campaign node
- 240-char cap with counter on campaign comments (matches moments)
- layout: cover height halved (23.26% -> 12%), side participants avatars
  trimmed 60 -> 12 to make room for the discussion module

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

vercel Bot commented Jun 11, 2026

Copy link
Copy Markdown

@yingshinlee is attempting to deploy a commit to the DimensionDev Team on Vercel.

A member of the Team first needs to authorize it.

…arrowing

- add campaignDiscussion to CommentArgs.type union (route.ts) so the generated
  CommentType (now including campaignDiscussion) is assignable
- drop broken Extract<…, { __typename: 'WritingChallenge' }> narrowing in
  Discussion index/Dialog: campaign is generated as a single object with an
  optional __typename, so Extract resolved to never and comment.id failed
- align formatjs message ids with content hashes; fix two stylelint errors
- extract i18n strings for the discussion module

Verified locally on Node 22 against staging schema:
gen:type + tsc --noEmit + eslint + stylelint all pass with 0 errors.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@mashbean

Copy link
Copy Markdown
Contributor

改以 upstream 分支重開為 #5967(已合併)。原因:fork PR 的 CI/部署拿不到 repository secrets,required check 不會跑。本 PR 內容已整併進 #5967

@mashbean mashbean closed this Jun 14, 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.

2 participants