Skip to content

A tool built without .Status(...) shows no failure anywhere in the tray: restore, start and click errors only reach stderr #29

Open

Description

@matt-edmondson

What's wrong

LastError is the only place the tray reports failures. It holds failed clicks, a failed OnStart, and the restore error re-seeded by #12, and it is shown only through the status line. TrayMenu creates that status line only when status is not null (TrayApp/Menu/TrayMenu.cs:40-45). The tooltip falls back to the display name (TrayApp/Tray/TrayApplication.cs:332).

.Status(...) is optional: it is optional in the README API table, and Constructor_WithNoStatus_LeavesTheStatusLineOut tests that it can be left out. For any tool that leaves it out, every refusal is invisible to a tray user, who usually has no terminal attached. This contradicts the TrayMenu.Activate remarks, which say failures are "shown in the status line for everyone else".

Observed (main a96d122, real tray run; menu and tooltip read over D-Bus)

The test tool had no .Status, an OnStart that throws "device busy", and a toggle setter that throws "no inhibitor available":

nostatus: device busy                         (stderr only)
--- before click ---
  id=1 label='Keep awake' checked=0 enabled=True
  id=3 label='Quit nostatus'
nostatus: no inhibitor available              (stderr only)
--- after click ---
  id=1 label='Keep awake' checked=0 enabled=True      <- nothing changed, no reason shown
ToolTip: ['', [], '', '']

Why it matters

The failure-surfacing work from #6 and #12 does nothing for these tools. The user sees a toggle that simply won't tick, and nothing says why.

Suggested fix / acceptance criteria

  • When LastError is set, show it even if there is no status line. Either of these would do:
    • Always create a TrayStatusItem, and keep it hidden or empty while there is no error and no status.
    • Or put "{DisplayName} failed: {LastError}" in the tooltip.
  • Test: a TrayMenu built without status exposes the message of a failed Run through Items or through the tooltip.

Activity

  1. matt-edmondson commented on Sep 30, 2026

    @matt-edmondson
    ContributorAuthor

    Triage


    Generated by Claude Code

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions