Skip to content

Reset timer [Loading] and usage-error placeholders cannot be hidden #541

Description

@zachthedev

Problem

Block Reset Timer and Weekly Reset Timer render a [Loading] placeholder and the
[No credentials] family of usage errors with no way to turn either off:

  • src/widgets/BlockResetTimer.ts:136-142
  • src/widgets/WeeklyResetTimer.ts:220-226

WeeklyUsage.ts:86-90 answers the identical condition, absent usage data, by
returning null so the widget disappears, and the three usage widgets have a
hide state for it. So a status line that goes quiet when usage data is
unavailable still shows [Loading] from these two.

aae5add widened this: it turned a return null into a persistent placeholder, so
the widgets went from self-hiding to always-on with nothing to get the old
behavior back.

Proposal

Both widgets declare the shared USAGE_NO_DATA_HIDEABLE_STATE their usage
siblings already use, gating the error text and the [Loading] placeholder
together. Opt-in, so the default stays exactly what it is now.

This builds on #430, which is where the shared (h)ide… checklist lives.

#542 has it, stacked on #430. It also moves two keybinds on these widgets off
h, since h opens the hide checklist there and would otherwise leave the new
state unreachable in date mode.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions