feat: moderation actions — mute/block/hide via PreferencesGateway (Stage 5 Branch 2) #59

Merged
starsetbyte merged 5 commits from feat/moderation-actions into main 2026-07-06 03:18:15 +00:00
Owner

What this is

Stage 5 Branch 2: mute/block/hide-post actions with optimistic apply-revert semantics, wired through the PostOverflowMenu on all surfaces.

What changed

Commit Description
f631c77 GraphService + ModerationActionsRepository with optimistic-apply-revert
8fa581f Wire PostOverflowMenu on PostCard, FeedHostScreen, ThreadScreen, ProfileRoute
5c5cc81 Bridge ModerationActionsRepository flows into ModerationPrefs for live resolver updates

Key decisions

  • In-memory only — no Room migration (Stage 6). Block rkeys stored in memory, lost on restart.
  • Optimistic pattern — local state updated first, API call follows, revert on failure.
  • Live resolver updates — ModerationActionsRepository flows bridge into ModerationPrefsRepository via collectActions.
  • Overflow menu hoisting — follows existing RepostBottomSheet/LabelsBottomSheet pattern.

Gate

  • Full suite: all tests green
  • assembleDebug green
  • Mute/block/hide round-trip on device (pending)

Dependencies

  • Requires feat/moderation-preferences-gateway (PR 58, merged)
## What this is Stage 5 Branch 2: mute/block/hide-post actions with optimistic apply-revert semantics, wired through the PostOverflowMenu on all surfaces. ## What changed | Commit | Description | |---|---| | `f631c77` | GraphService + ModerationActionsRepository with optimistic-apply-revert | | `8fa581f` | Wire PostOverflowMenu on PostCard, FeedHostScreen, ThreadScreen, ProfileRoute | | `5c5cc81` | Bridge ModerationActionsRepository flows into ModerationPrefs for live resolver updates | ## Key decisions - **In-memory only** — no Room migration (Stage 6). Block rkeys stored in memory, lost on restart. - **Optimistic pattern** — local state updated first, API call follows, revert on failure. - **Live resolver updates** — ModerationActionsRepository flows bridge into ModerationPrefsRepository via collectActions. - **Overflow menu hoisting** — follows existing RepostBottomSheet/LabelsBottomSheet pattern. ## Gate - Full suite: all tests green - assembleDebug green - Mute/block/hide round-trip on device (pending) ## Dependencies - Requires feat/moderation-preferences-gateway (PR 58, merged)
Author
Owner

Screenshot_20260705_114736 1 is before this update for detail. there's an issue in the post cards that is shown in Screenshot_20260705_223435

Manual device smoke found a user-visible regression after the moderation work. Please investigate and fix before continuing.

Observed in the new build:

  1. Post overflow menu anchoring is broken
  • Screenshot: the overflow menu for a feed post opens far to the left / over the lower-left content area instead of anchored near the post’s three-dot menu.
  • Expected: the menu should open from the tapped post’s overflow icon, matching the prior layout behavior.
  • Please compare current PostCard / overflow menu anchoring against the pre-moderation behavior. Do not do a broad UI refactor unless necessary.
  1. Post click navigation is wrong
  • No matter which post I tapped in the feed, the app navigated to the wrong / messed-up post/thread.
  • Expected: tapping a post row opens that exact post’s thread, using that row’s post.uri / post.cid.
  • This smells like a call-site or state/key regression from the PostCard signature changes, moderation wrapping, TimelineItem mapping, or Lazy/Paging item identity.
  • Audit every PostCard call site touched by Stage 4 and verify all click/overflow callbacks are bound to the correct row item, not a stale item, parent item, quoted item, or index-derived item.
  • Pay special attention to any positional Compose arguments added during moderation work. Convert suspicious PostCard(...) calls to named args if needed so callback parameters cannot shift silently.

Constraints:

  • Keep Stage 4 architecture intact: no render-time resolver calls, no preference writes, no PR #11 code.
  • Preserve the passive/directed moderation semantics already decided.
  • Do not weaken hot-path tests.

Acceptance:

  • Overflow menu appears anchored to the tapped post’s three-dot icon.
  • Tapping any visible feed post opens that exact post’s thread.
  • Mute/block/hide actions from the overflow menu apply to the author/post for the tapped row only.
  • Add a regression test if feasible, or document why this is only manually verifiable.
  • Run the relevant tests plus assembleDebug.
![Screenshot_20260705_114736](/attachments/f910ffb6-e1ea-4274-beaa-84ceead4aba3) 1 is before this update for detail. there's an issue in the post cards that is shown in ![Screenshot_20260705_223435](/attachments/01f06c99-24a1-4946-8257-338cd6c3df2a) Manual device smoke found a user-visible regression after the moderation work. Please investigate and fix before continuing. Observed in the new build: 1. Post overflow menu anchoring is broken - Screenshot: the overflow menu for a feed post opens far to the left / over the lower-left content area instead of anchored near the post’s three-dot menu. - Expected: the menu should open from the tapped post’s overflow icon, matching the prior layout behavior. - Please compare current `PostCard` / overflow menu anchoring against the pre-moderation behavior. Do not do a broad UI refactor unless necessary. 2. Post click navigation is wrong - No matter which post I tapped in the feed, the app navigated to the wrong / messed-up post/thread. - Expected: tapping a post row opens that exact post’s thread, using that row’s `post.uri` / `post.cid`. - This smells like a call-site or state/key regression from the `PostCard` signature changes, moderation wrapping, `TimelineItem` mapping, or Lazy/Paging item identity. - Audit every `PostCard` call site touched by Stage 4 and verify all click/overflow callbacks are bound to the correct row item, not a stale item, parent item, quoted item, or index-derived item. - Pay special attention to any positional Compose arguments added during moderation work. Convert suspicious `PostCard(...)` calls to named args if needed so callback parameters cannot shift silently. Constraints: - Keep Stage 4 architecture intact: no render-time resolver calls, no preference writes, no PR #11 code. - Preserve the passive/directed moderation semantics already decided. - Do not weaken hot-path tests. Acceptance: - Overflow menu appears anchored to the tapped post’s three-dot icon. - Tapping any visible feed post opens that exact post’s thread. - Mute/block/hide actions from the overflow menu apply to the author/post for the tapped row only. - Add a regression test if feasible, or document why this is only manually verifiable. - Run the relevant tests plus `assembleDebug`.
fix: move overflow menu inside PostHeader for proper anchoring, fix sizing
All checks were successful
peregrine-ci / assembleDebug Build succeeded (27s)
bb8cae062c
fix: tighten overflow icon to 20dp/14dp for better header density
All checks were successful
peregrine-ci / assembleDebug Build succeeded (9s)
3e54491c3f
Sign in to join this conversation.
No description provided.