Skip to content

feat(messages): report messages to community moderators - #255

Merged
kalvinnchau merged 1 commit into
mainfrom
peon/report-message
Sep 25, 2026
Merged

kalvinnchau merged 1 commit into
mainfrom
peon/report-message

Conversation

@kalvinnchau

Copy link
Copy Markdown
Contributor

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.
  • No outbox and no plugin: reports are not persisted or retried automatically.
  • Own messages and read-only channels are reportable; membership rows and undelivered local messages are not.
  • ChannelTimeline/MessageRow: a row with an open report or its success notice is added to Virtua keepMounted, 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.
  • Dev broker: accepts and validates kind 1984 on sign and publish (two target tags, known category, 32,000-byte UTF-8 note).

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.
  • Broker API tests for kind 1984 validation.
  • Source-served E2E (Chromium → Vite → dev broker → local buzz-relay/Postgres) passed 15/15 on the pre-rebase tree; reports land in the moderation queue with no ordinary kind-1984 event.

Limitations

  • Packaged builds have no live signer yet (vite.config.ts, docs/status.md); NIP-07/Tauri signer paths are untested.
  • A lost ACK followed by manual retry can create a duplicate report.
  • Notes over 32,000 bytes get a generic error (no textarea limit).
  • A full pnpm test pass at this exact commit has not completed; the pre-rebase runs had load-related timeouts in unrelated tests.

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
kalvinnchau requested review from a team, comp615 and wesbillman as code owners September 25, 2026 05:20

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Star Lord’s automated source review via Wes’s account

Reviewed head 898a8b8dd4ea01e140ba6dc48491cbace9ba9822 against base df7b7e7f45739f3e06e12d81623385701acdc51d.

No actionable source-demonstrated defects found in this revision. Reviewed the 14-file diff and relevant callers: report availability and dialog retry/pending behavior, timeline row retention and shared focus/toast ownership, loaded-target event construction, writer capability/deadline/disposal behavior, and broker sign/publish validation. The independent session/broker source review was reconciled with the implementation.

Validation limits: source-only; no PR code, tests, installs, app launches, or live reports were executed. Test additions were inspected, not run; CI status was not assessed. This does not validate real-browser virtualization/focus, packaged or alternate signer paths, or exact-head end-to-end behavior. The PR description reports pre-rebase E2E evidence and incomplete exact-head full-suite validation; those claims were not independently verified. The disclosed lost-ACK/manual-retry duplication and generic oversized-note error remain limitations.

This is non-blocking COMMENT feedback, not approval or merge readiness.

@kalvinnchau
kalvinnchau merged commit 6cff43b into main Sep 25, 2026
12 checks passed
@kalvinnchau
kalvinnchau deleted the peon/report-message branch September 25, 2026 17:21
cynfria pushed a commit that referenced this pull request Sep 25, 2026
…sh-pr1

* origin/main:
  Refine direct message opening (#107)
  feat(messages): report messages to community moderators (#255)
  perf(channels): stop rerendering message rows after each channel switch (#269)

Signed-off-by: Peppermint Butler <29b529ff43be424db89f51bff58a38cf86942acbffff98a14ce50b38c2a57d8f@buzz.block.builderlab.xyz>
johnmatthewtennant pushed a commit that referenced this pull request Sep 25, 2026
* origin/main:
  Explain missing Pi provider models (#263)
  Browse Goose models and enter provider API keys (#230)
  test(agents): check model lookup Cancel by visible text (#259)
  Ask before mentioning people outside the channel (#257)
  Refine direct message opening (#107)
  feat(messages): report messages to community moderators (#255)

Signed-off-by: Sol <49aa1f65411fd096d2e2ec144f1e7aa36fdc76d1b907cfdf7be000c66f9d3b8e@buzz.block.builderlab.xyz>
zrmarley added a commit that referenced this pull request Sep 25, 2026
…-image

* origin/main: (23 commits)
  fix(agents): recover status polling and scope failure diagnostics (#283)
  Share avatar editing across community profiles and managed agents (#271)
  feat(profiles): archive, unarchive and delete agents from the profile pane (#256)
  ci: run browser journeys on three shards per engine (#280)
  ci: publish scheduled macOS test prereleases (#262)
  feat: add private text feedback plugin (#242)
  🤖 docs: add pre-PR checklist and review guidance to AGENTS.md (#268)
  perf(sidebar): stop rerendering every row's menu on channel switch (#265)
  Explain missing Pi provider models (#263)
  Browse Goose models and enter provider API keys (#230)
  test(agents): check model lookup Cancel by visible text (#259)
  Ask before mentioning people outside the channel (#257)
  Refine direct message opening (#107)
  feat(messages): report messages to community moderators (#255)
  perf(channels): stop rerendering message rows after each channel switch (#269)
  feat(profiles): open targeted agent editor from owner profile (#254)
  Let plugins declare local commands and HTTPS origins (#169)
  feat(profiles): show agent metadata and copyable nip05 (#253)
  Organize app and community settings (#173)
  Add status badge cutouts to avatars (#211)
  ...
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