Skip to content

feat(ui): sortable Name & Start time columns, persist user sorting across navigation - #474

Open
xxxliqu1dxxx wants to merge 3 commits into
kopia:mainfrom
xxxliqu1dxxx:feat/ui-sortable-columns
Open

feat(ui): sortable Name & Start time columns, persist user sorting across navigation#474
xxxliqu1dxxx wants to merge 3 commits into
kopia:mainfrom
xxxliqu1dxxx:feat/ui-sortable-columns

Conversation

@xxxliqu1dxxx

Copy link
Copy Markdown

Three related improvements to table sorting in the htmlui:

  1. feat(ui): make the Name column sortable in the directory listing

    • Adds accessorFn + a custom sortingFn to the Name column in
      DirectoryItems.jsx.
    • File-manager style: directories before files (both directions),
      case-insensitive
      compare with exact-compare fallback; sortDescFirst so first click sorts
      descending, consistent with the other columns.
  2. feat(ui): persist user-applied table sorting across navigation

    • New TableSortContext keyed by a tableKey passed to KopiaTable; provider
      wraps
      the routes in App.jsx. Sort state now survives folder drill-down and
      cross-page navigation (directory, snapshots, snapshot-history, policies,
      tasks).
    • The context setter resolves TanStack v8's updater-function form of
      onSortingChange (typeof update === "function" ? update(current) : update).
  3. feat(ui): make the Start time column sortable in the snapshot history

    • Adds accessorFn: (x) => x.startTime to the Start time column in
      SnapshotHistory.jsx. First click is ascending (v8 auto-detects 'asc' for
      strings), a visible flip from the default newest-first order.

Known nuance: in descending Name sort, files appear before directories because
TanStack v8's getSortedRowModel globally inverts the comparator and sortingFn
receives no direction. Ascending (the default after first click on any column
with sortDescFirst) shows dirs-first. Happy to iterate on this if maintainers
feel strongly about it.

All commits are GPG-signed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant