Skip to content

feat(boards): surface Report action on posts (member-side moderation entry)#533

Merged
KishParikh13 merged 1 commit into
v2from
fix/board-post-report-ui
Jun 17, 2026
Merged

feat(boards): surface Report action on posts (member-side moderation entry)#533
KishParikh13 merged 1 commit into
v2from
fix/board-post-report-ui

Conversation

@KishParikh13

Copy link
Copy Markdown
Collaborator

The gap

reportBoardPost(postId, reason?) has lived in packages/frontend/utils/api.ts (the member-side moderation entry from #209) but had zero callers anywhere in components/** or app/**. There was no Report affordance in the UI, so members could never report a board/feed post — the moderation queue could only ever be filled from the admin side.

What this adds

A Report action in the shared post action menu, wired to reportBoardPost.

  • canReportPost(user, authorId) helper in components/feed/feedData.ts, sitting alongside the existing canModifyPost / canPinPosts gates.
  • Report row in PostThread's ActionMenuSheet, using the same MenuRow + inline-confirm pattern as Delete (a "Report this post to the moderators?" confirm with Cancel / Report buttons — no new modal style introduced).
  • On success it shows an inline notice ("Thanks — this post was reported to the moderators.") using colors.accent, mirroring how the menu already surfaces actionError. Errors are awaited and surfaced gracefully; busy state disables the buttons and shows a spinner.
  • Analytics: feed_post_reported / feed_post_report_failed / feed_post_report_confirm_shown / feed_post_report_cancelled, matching the existing feed_post_* event naming.
  • Uses className-free inline styles consistent with the rest of the file (no NativeWind style={({pressed}) => ...} footgun).

Gating / ownership rules

  • Hidden on your own posts — own posts already expose Edit/Delete, so Report would be noise there.
  • Verified members onlyisVerified or verificationLevel > 0, matching how the codebase reads the current user's verification for posting/replying.
  • Signed-out / unverified users don't see it.

Web + native parity

PostThread.tsx is not platform-split (there is only one PostThread.tsx, no .web.tsx). It is the single shared detail component used by the Connect feed, center boards, and event boards on both web and native (app/feed/[id].*FeedWorkspacePostThread, plus app/center/[id].*, app/events/[id].*, and the desktop *DetailPanel.web.tsx). One change covers every surface and both platforms. The menu is shared between the top-level post; replies do not currently render their own action menu, so the change applies wherever a menu exists today.

Verification

  • npm run typecheck (tsc --noEmit) in packages/frontendclean, exit 0.
  • npx vitest run198 passed (full suite); added 3 canReportPost cases to src/__tests__/feedData.test.ts (now 17 passed in that file).
  • No lint script exists in the repo; ESLint is not configured.
  • Note: vitest excludes app/**, so green tests don't exercise the rendered menu — the UI wiring was verified by reading + typecheck.

🤖 Generated with Claude Code

…Post)

reportBoardPost() existed in utils/api.ts but had no UI caller, so members
could not report posts and the moderation queue could only be filled from the
admin side. Surface a "Report" action in the shared PostThread action menu.

- canReportPost() gate in feedData: verified member, not the post author
  (own posts already expose edit/delete).
- Report row added to ActionMenuSheet with an inline confirm mirroring the
  existing delete-confirm, success notice on completion, graceful error.
- Shared PostThread covers web + native and every detail surface (feed,
  center, event boards), so one change wires them all.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying chinmaya-janata with  Cloudflare Pages  Cloudflare Pages

Latest commit: 488e1bd
Status: ✅  Deploy successful!
Preview URL: https://27ac236f.project-janatha.pages.dev
Branch Preview URL: https://fix-board-post-report-ui.project-janatha.pages.dev

View logs

@KishParikh13 KishParikh13 merged commit 758d175 into v2 Jun 17, 2026
3 checks passed
@KishParikh13 KishParikh13 deleted the fix/board-post-report-ui branch June 17, 2026 19:24
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