Skip to content

Strategy "Alert sound" dropdown does not mark names this terminal has no file for #695

Description

@Alena-Selezneva

Follow-up to #694, from @tikhonow_u in the MoonTerminal chat. He has many strategies carrying his own Moonbot wav names, gets a "Звук не найден" toast for each, and asked whether he can switch every bot to a standard sound in one go.

He can: select the strategies (Ctrl+A) and set SoundKind for the whole selection. The gap is that the dropdown gives him no way to pick a sound that will actually play.

What the dropdown shows today

effective_picklist (crates/moon-ui-gpui/src/strategies/logic.rs) builds the sound rows as: the core's own list (Moonbot's sounds folder as the CORE sees it, NONE included), then every sound of this terminal the core's list lacks, then the stored value when nothing answers to it. That mixing is deliberate and should stay — a name the user gave in Moonbot must remain visible and selectable.

But the rows are rendered as plain labels (FieldControl::Picklist in crates/moon-ui-gpui/src/strategies/params.rs, around the MoonMenuItem::with_key(...) loop): nothing distinguishes a row this terminal can play from a row that will fall back to ding1 and raise the missing-sound toast. The user learns the difference only after a detect fires.

So the one gesture that fixes his noise — bulk-set a sound that exists on both sides — is guesswork from the UI. There are 18 embedded Moonbot sounds (crates/moon-ui-gpui/src/media/sound/embedded.rs) plus whatever is in his own sounds folder, and the dropdown does not say which rows those are.

Proposal

Mark the rows the sound catalog cannot answer to, reusing the existing mark rather than inventing a new one: sounds.missing_mark ("нет файла" / "no file"), already used by the sound picker in crates/moon-ui-gpui/src/panels/common.rs. The closed trigger showing such a value could carry it too.

Must not break

  • Core-supplied names stay in the list and stay selectable; this is a mark, not a filter.
  • Stem matching keeps one row per sound (BABYTOY, babytoy, BABYTOY.wav), so the mark must be decided by the same stem lookup, not by raw string compare.
  • NONE is Moonbot's reserved "silence" and must not be marked as a missing file.
  • The stored-value fallback row (a name neither side knows) must keep showing the strategy's value instead of blanking it.
  • The catalog is only authoritative after the folder scan lands; before it, the embedded set alone cannot say a name is missing (see the pending/settle logic in crates/moon-ui-gpui/src/media/sound/missing.rs) — the mark must not flash on every sound at startup.
  • Fields other than SoundKind use the core's picklist verbatim and must be untouched.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions