Skip to content

Polish: admin, backup, import and history P3s from the UX review #836

Closed

Description

@EVWorth

Severity: P3 (polish)

Smaller items found while using ?mock=connected. Each is independent.

  • Debounce the history search. Typing "select" in HISTORY's search box makes 12 IPC calls (history_list + history_count_matching per keystroke). Cause: src/components/history/QueryHistory.tsx:223 calls setFilters({ search }) on every change. Fix: keep the input value local and debounce the store update by ~200 ms.
  • Format history durations. Entries show "184300ms", "51204ms", "30012ms". Cause: QueryHistory.tsx:519 renders executionTimeMs raw. Fix: use a shared duration formatter ("3m 4s", "51.2s", "18ms").
  • Use local midnight for the history date filter. Choosing From/To dates builds YYYY-MM-DDT00:00:00Z / T23:59:59Z, i.e. UTC bounds from a local date, so outside UTC the range is shifted by the offset (in UTC-7, "From Oct 21" includes Oct 20 evening and drops Oct 21 evening). Cause: QueryHistory.tsx:283,296. Fix: build bounds with new Date(y, m - 1, d) / end-of-day local and send .toISOString().
  • Tidy the process list's text and labels. An empty Database shows italic "NULL", an empty Info shows "—" and an empty State is blank; the auto-refresh select has no label (its accessible name is the selected option). Cause: src/components/admin/ProcessListTab.tsx:187,191,207 and :138. Fix: use "—" consistently; add aria-label="Auto-refresh interval".
  • Tie the Backup/Restore field labels to their controls. The Connection and Database selects have no associated label (accessible name is "Select connection...Local dev"); "Tables", "Content", "Options", "Insert Format" and "Output File" are <label>s bound to nothing. Cause: src/components/backup/BackupDialog.tsx:247,266 and src/components/backup/RestoreDialog.tsx:222,244. Fix: add htmlFor/id pairs; use <fieldset><legend> for the checkbox/radio groups.
  • Show the DROP/CREATE line itself in Import's destructive list. In Import → SQL File with shop_backup.sql, the "6 statements … will drop or overwrite data" box shows each statement with its leading comments, e.g. "-- Read from a single consistent snapshot. -- -- Table: customers -- DROP TABLE IF EXISTS…", so the DROP is truncated off the end of the line. Cause: src/components/import/ImportDialog.tsx:136 stores the raw split statements and the list renders them as-is. Fix: strip leading -- / /* */ comments before display.

Part of #783.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions