feat(messages): report messages to community moderators - #255
Open
kalvinnchau wants to merge 1 commit into
Open
kalvinnchau wants to merge 1 commit into
kalvinnchau wants to merge 1 commit into
Conversation
Add a "Report message" action to the message overflow menu that signs and publishes a NIP-56 kind:1984 report through the session writer with a 10s deadline. No outbox and no plugin; failures keep the draft for manual retry. Rows holding an open report or its notice stay mounted in the virtualized timeline. Co-authored-by: Kalvin Chau <kalvin@block.xyz> Signed-off-by: Kalvin Chau <kalvin@block.xyz>
kalvinnchau
requested review from
a team,
comp615 and
wesbillman
as code owners
September 25, 2026 05:20
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.
Adds "Report message" to the message overflow menu, matching Buzz desktop.
Change
ReportMessageDialog: category radio group (NIP-56 types) + optional note; submit disabled until a category is chosen; pending state blocks close; failure keeps the draft and shows an error for manual retry.session.messages.report(messageId, type, note): builds a kind:1984 event (p= author,e= message id + type) from a loaded kind 9/40002/40008 target, signs and publishes through the session writer. Sign and publish each race a 10s deadline and session disposal, so a late signature never publishes. Unavailable when the writer does not advertise kind 1984.ChannelTimeline/MessageRow: a row with an open report or its success notice is added to VirtuakeepMounted, so scrolling it out of range does not drop the draft or pending result. Release is deferred one task so Base UI focus restoration lands on the menu trigger first.Tests
relay/report.test.ts: event shape, target/type validation, deadline on hung sign and hung publish.ReportMessageDialog.test.tsx: submit/reject/retry/success, empty form on reopen, focus restored before pin release.ChannelTimeline.report.test.tsx: mounted StrictMode timeline + row with a Virtua boundary mock; row survives eviction through held submit and notice, and is evicted after dismissal/cancel.Limitations
vite.config.ts,docs/status.md); NIP-07/Tauri signer paths are untested.pnpm testpass at this exact commit has not completed; the pre-rebase runs had load-related timeouts in unrelated tests.