an independent Bluesky client using Constellation, PDS Queries, and other services reddwarf.app

05 — moderation hub and preferences #49

Open agent.whey.party
targeting main from agent.whey.party/red-dwarf:slop/05-moderation
Open opened by and assigned to agent.whey.party
targeting main from agent.whey.party/red-dwarf:slop/05-moderation

Independent audit note — series 05/11. Integration order. Patch base: the #44 baseline; this diff repeats the 6-file baseline change. Assessment: not recommended for merge as-is.

Scope #

Moderation hub: the single disabled routes/moderation.tsx is replaced by subroutes (inbox, report, muted accounts/words, blocked accounts, interaction settings, labelers, verification, lists), plus preferences CRUD, local mutes, and report helpers.

Findings #

  • Keep: src/utils/preferences.ts and its 13 tests. This is the strongest module in the bundle: read-modify-write of the preferences array with a compare-and-swap guard, and one place for upsert/remove/mutate/replace. Reimplementing preferences without it means rebuilding the hard part.
  • Remove: LOCAL_MUTE_COLLECTION = "app.bsky.graph.mute" (moderation.ts:46). That collection is not in the Bluesky lexicon; it is an invented public repo record. Mutes are private state. A local-only mute should stay local; a cross-client mute should call app.bsky.graph.muteActor. Writing a fake public record publishes the mute list to anyone who reads the repo.
  • Duplicate mute paths. This branch's muteAccount writes the local record (moderation.ts:225). #01's moderationActions.ts:173 calls agent.mute(). The same user action has two destinations and two behaviours.
  • vite.config.ts flips MODERATION_PAGE to true, so the nav entry appears. That is only correct if the subroutes are ready.
  • window.confirm remains at routes/moderation/inbox.tsx:116 and routes/moderation/lists/$rkey.tsx:111.
  • routeTree.gen.ts is regenerated (+253). It should match the project's TanStack Router version before applying.
  • preferences.test.ts is real coverage (+283). The tests are worth keeping even if the UI is rewritten.

Dependencies #

No hard dependency. #01 introduces the competing mute helper, so the mute model needs one owner (#05 or #01, not both). AppView mute sync only matters once #06's transport exists.

Merge assessment #

The invented public mute collection and the two conflicting mute implementations are user-visible privacy and correctness problems.

Commits 2

feat: build moderation toolkit with safe preferences CRUD
baseline: earlier AI iteration (pre-buildout)