Skip to content

Interactive command bar (vim-style :) for live session control #31

Description

@karava

Idea

Build on the live hotkeys (PR #30) with a vim-style command bar: press : during a running session to open an input line, type a command like channel jazz or mascot off, and hit Enter to apply — without leaving the session. Hotkeys cover the common toggles; the command bar adds discoverable, typed commands with arguments (especially picking a specific channel rather than just cycling with n).

UX

  • : opens an input field (a dim prompt line); Esc cancels, Enter submits.
  • The countdown keeps running; on submit/cancel the bar closes and the countdown resumes.
  • Tab-completion / showing valid options would be a nice later touch (e.g. channel names).

Commands to support (initially)

  • channel <name> — switch to a named channel (validates against the loaded list)
  • mascot on|off, voice on|off
  • volume <0-100>
  • pause / resume
  • maybe work <min> / break <min> to retune mid-session (later)

Where it hooks in

  • Reuses the live-input layer from PR Add live hotkeys to control a running session #30 in src/commands/start.ts (raw-mode keystroke handler + the mutable channel / mascot / voice / volume state + setVolume/restartMusic/heartbeat plumbing). The hotkey actions and command handlers should share the same underlying functions (cycleChannel/adjustVolume/etc. → generalize to setChannel(name) / setVolume(n)).

The one real consideration: rendering

Hotkeys today print a dim status line and let the countdown resume below (a scrolling log). A persistent input field needs a small 2-row layout — the live countdown on one row and the command bar on another — so typing into the bar doesn't fight the 1s \r redraw. This means:

This is the layout work intentionally deferred from the hotkey MVP.

Shared benefit

The same suspend-redraw + line-editor mechanism is exactly what #17's in-session feedback hotkey needs (type a message mid-session without leaving). Building the command bar's input layer should make #17's hotkey mostly free.

Constraints (per existing conventions)

  • Best-effort and cosmetic-adjacent: never affect timer accuracy or crash a session.
  • TTY-only (raw mode); piped/non-interactive sessions just don't offer it.
  • Keep the greyscale/compact aesthetic.

Acceptance

Refs

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions