Skip to content

Rework mute mode: explicit panel toggle, mode-gated right-click#58

Open
phyceClaw wants to merge 1 commit into
phyce:1.3.0from
phyceClaw:feat/mute-mode-rework
Open

Rework mute mode: explicit panel toggle, mode-gated right-click#58
phyceClaw wants to merge 1 commit into
phyce:1.3.0from
phyceClaw:feat/mute-mode-rework

Conversation

@phyceClaw

@phyceClaw phyceClaw commented May 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Right-clicking "Listen" on a player or NPC currently calls `setListenMode(true)` behind the scenes, flipping the entire mute system from blocklist (default) to allowlist mode. This is the most common confusion report about the plugin — users want to listen to one person and end up silencing everyone else with no obvious recovery path.

This PR makes the mode an explicit, panel-driven setting and removes the silent flip:

  • New "Mute Settings" panel section with a button that toggles between blocklist (Mute these) and allowlist (Listen to only these) modes. The mode is the sole switch, and it persists immediately via `muteManager.saveConfig()`.
  • Right-click is now mode-aware:
    • Blocklist mode → primary action is `Mute` / `Unmute`.
    • Allowlist mode → primary action is `Listen` / `Unlisten`.
    • The "Stop Listen Mode" sub-entry is removed (the panel owns the mode).
  • Both lists are preserved across mode switches — toggling no longer calls `clearListens()`. Users can switch back and forth without losing their settings.

The `MuteManager` API is unchanged; only the call sites for `setListenMode` move. `isNpcAllowed` / `isUsernameAllowed` continue to honor the active mode for the speech path.

Closes Asana task "rework mute system: explicit allow/block toggle in panel".

Out of scope

  • The right-click `Mute`/`Listen` actions still don't call `saveConfig()` (pre-existing — mute lists persist only on plugin shutdown). Tracked separately.
  • A panel view of the current allowlist/blocklist contents (Asana view allow/blocklist from panel menu) is a natural follow-up.

Test plan

  • Fresh install: panel section shows "Blocklist mode". Right-click a player → "Mute" / "Unmute".
  • Toggle the panel button to allowlist mode → label updates, right-click on the same player now shows "Listen" / "Unlisten".
  • Add a player to the allowlist, switch back to blocklist mode → the allowlist entry is preserved (verify by switching to allowlist mode again).
  • Restart the client → mode and both lists persist.
  • Existing users mid-listen-mode-because-they-clicked-Listen: panel shows allowlist mode, they can flip it back from the panel.

🤖 Generated with Claude Code

On behalf of @phyce

Previously, right-click "Listen" on an actor silently called
setListenMode(true), flipping the global mute system from blocklist to
allowlist mode. Users repeatedly hit this by accident and ended up with
"everyone but this person" muted, with no obvious way back.

Now:

- A new "Mute Settings" section in the plugin panel exposes the mode
  toggle. This is the only place the mode flips, and the change persists
  immediately via muteManager.saveConfig().
- The right-click sub-menu shows only mode-appropriate actions:
  - Blocklist mode: Mute / Unmute
  - Allowlist mode: Listen / Unlisten
- Listen-click no longer flips mode behind the user's back.
- The old "Stop Listen Mode" sub-entry is removed — the panel owns the
  mode now. Switching modes preserves both lists (no auto clearListens),
  so users don't lose their settings when toggling.

Files touched:
- MainSettingsPanel: inject MuteManager, add buildMuteModeSegment().
- MenuEventHandler: gate the primary menu entry by mode, remove the
  silent setListenMode(true) and "Stop Listen Mode" branch.
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.

1 participant