feat(boards): surface Report action on posts (member-side moderation entry)#533
Merged
Conversation
…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>
Deploying chinmaya-janata with
|
| 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 |
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 gap
reportBoardPost(postId, reason?)has lived inpackages/frontend/utils/api.ts(the member-side moderation entry from #209) but had zero callers anywhere incomponents/**orapp/**. 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 incomponents/feed/feedData.ts, sitting alongside the existingcanModifyPost/canPinPostsgates.PostThread'sActionMenuSheet, using the sameMenuRow+ inline-confirm pattern as Delete (a "Report this post to the moderators?" confirm with Cancel / Report buttons — no new modal style introduced).colors.accent, mirroring how the menu already surfacesactionError. Errors are awaited and surfaced gracefully; busy state disables the buttons and shows a spinner.feed_post_reported/feed_post_report_failed/feed_post_report_confirm_shown/feed_post_report_cancelled, matching the existingfeed_post_*event naming.className-free inline styles consistent with the rest of the file (no NativeWindstyle={({pressed}) => ...}footgun).Gating / ownership rules
isVerifiedorverificationLevel > 0, matching how the codebase reads the current user's verification for posting/replying.Web + native parity
PostThread.tsxis not platform-split (there is only onePostThread.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].*→FeedWorkspace→PostThread, plusapp/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) inpackages/frontend— clean, exit 0.npx vitest run— 198 passed (full suite); added 3canReportPostcases tosrc/__tests__/feedData.test.ts(now 17 passed in that file).lintscript exists in the repo; ESLint is not configured.app/**, so green tests don't exercise the rendered menu — the UI wiring was verified by reading + typecheck.🤖 Generated with Claude Code