Skip to content

pushInfo cards pile up — no way to replace a live hint in-place #1573

@dacec354

Description

@dacec354

Problem
pushInfo always appends a new live card with a unique ID. There's no built-in way for a caller to
say "replace my last hint" — every call creates a permanent new card. For transient or repeatable
feedback (hotkey confirmations, mode toggles, status changes), this means stale cards accumulate in
the scrollback with no path to clean them up.

Proposed change
Allow live.show to replace an existing card when the same id is dispatched again. The reducer
already has mutateCard — the live.show case could check for an existing card with the same id + kind and mutate instead of always appending. Callers that pass a stable id get replace-in-place;
callers using nextId() (unique per call, which is the default today) keep current append behavior
unchanged. Zero breakage, backward-compatible.

Alternatives considered

  • Toast notifications (toast.show) — already in the reducer with auto-dismiss via ttlMs, but
    Scrollback doesn't expose pushToast. Adding one would also work, but a toast disappears entirely;
    replace-in-place keeps the most recent hint visible until explicitly dismissed.
  • Doing nothing — the workaround is to accept the pile-up, which is noisy UX for anything that fires
    a hint on a repeatable action.

Motivation
Working on a hotkey-driven feature (Alt+S input stash/recall, #1438) where each press shows a
confirmation hint — Recalled, Stashed, Nothing to stash. Without replace-in-place, rapid use creates a
string of stale cards that never go away.

Scope check

  • This belongs in core reasonix (not better as a separate npm package)
  • I've read CLAUDE.md and CONTRIBUTING.md

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