Skip to content

SPA: a filtered list with rows showing offers no way back to the unfiltered view #679

Description

@mforce

Found by a design review during #678 (the #666/#667 date-range work), and deliberately not fixed there — it is a new affordance rather than a defect in what that PR shipped, and the owner chose to file it.

The gap

clearFiltersButton appears on Expenses at exactly one call site: inside the zero-rows empty state. So the control that clears filters only exists once the filters have already hidden everything.

That was harmless while Expenses filtered by a month picker, because the picker was always set to some month and there was no all-time view to want. #667 replaced it with a from/to range defaulting to the current farm month — so there is now an unfiltered state (blank range), and the only ways to reach it are:

  • blank two <input type="date"> controls by hand, segment by segment, in both Firefox and Chrome; or
  • narrow the range until the list empties, so the button appears, then press it.

A user who wants "show me everything" has no discoverable control.

Audit has the same dead end, wider

AuditPage's empty state is a bare <p className="muted"> — deliberately, per #655, which classified it as not an EmptyState site. So it offers no action at all, across four controls (entityType, action, from, to) plus a URL-borne entityId that has no visible control whatsoever. The scoped message says "for this record match these filters" while the scope itself is invisible in the UI.

What a fix looks like

AuditPage already computes the exact condition: isNarrowed. Expenses has the equivalent inline. A persistent Clear-filters control in the .filters row, shown when anything is narrowing and regardless of whether rows are present, keys straight off it.

Two things to settle before implementing:

  1. Expenses' "clear" is ambiguous. Does it blank the range (all-time) or restore the current-month default? Those are different intents and the button can only mean one. The all-time view also makes periodTotalLabel describe an unbounded total, which is the thing SPA: Expenses filters by a single month, where every sibling screen filters by a date range #667 deliberately avoided making the default.
  2. Audit's empty state is a muted paragraph on purpose (SPA: empty states as invitations — icon, one sentence, the primary action #655). Giving it an action means either reopening that classification or putting the control in .filters rather than the empty state — the latter is probably right, and is what makes this one issue rather than two.

Not in scope here

StockPage already has this right — its lot filter's empty state offers Clear filters with the filter set, and its filters are section-local. It is the model, not a target.

Related: #666, #667, #678, #653, #655.

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