Skip to content

Right-click answers: the context menu on the character #155

Closed

Description

@omesser

Related: #6 (Menu is one of the five verbs: "the same menu the tray opens"), #17 (chat needs a front door), #18 (tray, settings — the menu's sibling surface), #84 (Do Not Disturb needs a manual switch), #148 (the consent surface needs a home), #154 (asking for computer use starts from chat).

Why

Right-click is already a Verb: the Engine emits and accepts Menu, and nothing answers — the README says so outright. Meanwhile every recent spec needs an entry point: chat (#17) is reachable only by knowing the double-click, Do Not Disturb (#84) has an engine switch nothing calls, character switching (#18) has no UI, and the consent surface (#148) has no home. A UI-less app's one discoverable gesture is right-click on the thing itself. This issue is the front door.

Scope

Right-click on the sprite opens the menu at the cursor — the only entry point this issue ships, and today the app's only possible one: there is no tray icon yet and no OS bundle, only cargo run. Build the menu as its own component anyway, because #6's wording ("the same menu the tray opens") makes it the tray's menu too the day #18 adds one — that day adds an entry point, not a second menu.

v1 items, each an existing or specced mechanism, no new capability:

Mechanics: the shell already decides click-through per tick and the Menu verb already arrives from the right-button press over drawn pixels; on Menu, pop a native context menu at the cursor (Tauri/muda menu — machinery that works in the unbundled cargo run dev build, which is the only way the app runs today; verify that early, it is the issue's one platform risk). While the menu is open, the sprite pauses politely (no chase, no wander — the Engine already has the not-now gates; verify Menu holds them). Menu actions arrive as shell commands; none of them enter the frame loop.

Out of scope: the settings window, autostart, updater (all #18); any menu item that would need an Executor (ADR-0003); per-Instance menus (single Engine today).

Acceptance

  • Right-click on the sprite opens the menu at the cursor; right-click anywhere else passes through to the desktop as today.
  • Character ▸ lists what installed() finds, switches without restart, and the switch survives the next launch (or explicitly documents that persistence is Tray and settings #18's settings).
  • The DND checkbox flips set_do_not_disturb and the buddy audibly quiets: no self-started Behaviors, no dialogue, Poke still works (Do Not Disturb: the buddy stays, and stops starting things #84's semantics, already engine-tested).
  • Hide from the menu behaves exactly like the hotkey.
  • Engine: the Menu verb during walk/chase/drag interrupts like a Poke does (or holds — decide and pin it).

Tests

Engine-side: Menu verb interplay pinned in engine tests. Shell-side: menu construction from a fake installed-characters list (items, checkmarks) as a pure function; the popping itself is manual verification, like the overlay.

Activity

  1. omesser commented on Sep 1, 2026

    @omesser
    OwnerAuthor

    Implemented and merged in #170 (d1125dbf7). Recording what landed, what is deferred, and the one check that is still outstanding — this issue did not auto-close, and it should not until that check is done.

    Landed

    Right-click over drawn pixels opens a native context menu at the cursor. Rows: Chat…, Character ▸, Do Not Disturb, Hide, Quit.

    The shape is worth knowing, because it is what makes the menu portable and what #18's tray will reuse:

    • menu::describe() returns a MenuDescription of plain rows — owned strings and bools, so it crosses a thread — with no #[cfg] anywhere in menu.rs and nine tests that run on every platform.
    • menu::show() builds the native menu from that description on the main thread and pops it with popup_menu_at, through tauri::menu rather than a direct muda dependency. One copy of muda in the binary, and no raw view handle.
    • Selections arrive on Tauri's menu-event hook and are drained by the frame loop each tick. The Instance is held still while its menu is open by re-injecting Verb::Menu, with a timeout and a close signal so a menu dismissed with Escape cannot hold a buddy forever.

    Verb::Menu is the press edge of the right button, so holding it does not restack menus, and a right-click during a drag emits both Menu and Grab — the drag survives.

    Still to check by hand

    Right-click the sprite and choose Do Not Disturb. The buddy should go quiet.

    This decides whether popup_menu_at is modal on macOS, which decides whether a selection can be lost:

    • Modal — the call returns after dismissal, so the choice and the close land in the same tick. Routing runs before the holds are cleared, so the action applies. Correct.
    • Returns immediately — the close lands first and clears every hold, and a click arriving a tick later finds nothing to route against. The action is dropped silently.

    If the toggle does nothing, the fix is to send the close signal after the selection rather than after show() returns.

    Deliberately deferred, so it is not lost

    Closeable once the Do Not Disturb click is confirmed.

  2. omesser commented on Sep 2, 2026

    @omesser
    OwnerAuthor

    Do Not Disturb manually confirmed on macos to work

  3. omesser commented on Sep 2, 2026

    @omesser
    OwnerAuthor

    The Do Not Disturb checkbox now also sits a Character that was walking, via #204. Quiet is sit, not just silence.

  4. added this to the V1 milestone on Sep 6, 2026
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 requestready-for-agentFully specified, ready for an AFK agent

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions