Skip to content

Grid time columns sort by time, not by their text, in Lite and the Darling viewer - #4858

Merged
erikdarlingdata merged 4 commits into
devfrom
fix/grid-time-columns-sort-by-time
Sep 30, 2026
Merged

erikdarlingdata merged 4 commits into
devfrom
fix/grid-time-columns-sort-by-time

Conversation

@erikdarlingdata

@erikdarlingdata erikdarlingdata commented Sep 30, 2026 •

Copy link
Copy Markdown
Owner

Follows #4766 and #4855.

Why

A grid column that shows a time as text sorts by that text when you click its header. In a "g" column, "10/1/2026" sorts before "9/30/2026", and no such column sorts by time. #4855 fixed the columns that show a UTC offset. The other time columns still sorted as text.

Behavior change

  • Every time column in both products' grids now sorts by a time, not by its text. The change covers 16 columns in Lite and 47 in the Darling viewer.
  • Where the row holds the UTC instant, the column sorts by it. The viewer's eight System Events grids now sort by each event's UTC time, as Lite's already did.
  • Some rows hold only the server's stored wall clock, and those columns sort by it. Inside the repeated autumn hour they can still sort out of order, because a stored wall time does not say which pass it was in:
Product Grid Columns
Lite Job History Run Time, Last Success
Lite Running Jobs Start Time
Lite Query Stats, Query Stats History Last Execution, Creation Time
Lite Procedure Stats, Procedure History Last Execution, Cached Time
Lite Wait Drill-Down Tran Start
Darling viewer Query Stats Last Execution, Creation Time
Darling viewer Procedure Stats Last Execution, Cached Time
Darling viewer Running Jobs Start Time
Darling viewer History windows Last Execution, Cached Time, Creation Time
Darling viewer Wait Drill-Down Tran Start
  • Default Trace Event Time (both products) and the viewer's Job History Last Success sort by an instant. It was converted from the stored wall clock, so the same limit applies.
  • "Never" in Mute Rules Expires and in Job History Last Success now sorts first in ascending order. As text, it sorted among the other words.
  • The FinOps daily grids' Day column sorts by the day.
  • Six Postgres time columns in the Darling viewer showed their raw UTC value in every display mode. They are Lock Stats Last Seen, Wait Sampling Last Seen, Replication Connected Since, Column Stats Captured, and Index Bloat Measured and Estimated. They now follow the display mode like the tab's other times, in the same yyyy-MM-dd HH:mm format, with the UTC offset in the repeated autumn hour. They sort by their UTC instant.

What changes

  • SortMemberPath on 16 Lite columns and 47 viewer columns now names a DateTime on the row. That is the UTC instant where the row has one, and otherwise the row's own DateTime.
  • New DateTime members on viewer rows: EventTime on the eight System Events rows, ...Utc on 16 Postgres display rows, LastRunUtc and SampleTimeUtc. EventTime is the naive-UTC event time that Lite's rows already carry.
  • PgDisplay gains display rows for the Lock Stats, Wait Sampling, Replication, Column Stats and Index Bloat grids, and those grids now bind them. Each row carries the reader row's columns unchanged. It words the time through PgDisplay.Timestamp and keeps the value in a ...Utc member. The reader rows, which the MCP tools share, do not change.
  • GridTimeColumnSortMemberTests (Lite) and ViewerGridTimeColumnSortMemberTests (viewer) now scan every grid column in the product's XAML. A column whose header or bound property reads as a time must sort by a DateTime of its row. The scan fails on an empty SortMemberPath or on one that names a string property. Its message gives the file, the column header and the fix. Columns whose names read as times but are not (durations, counts) are listed with a reason. The viewer's table now holds 87 columns. The viewer's scan no longer lets a column bind a DateTime directly, because such a column shows raw UTC. New pins check that each bound property resolves on its display row and that each of the five grids is fed its display rows.

Test plan

  • Lite RED: each of these fails EveryTimeColumn_SortsByADateTime_NotByItsText: a SortMemberPath removed, one pointed at a string property (CachedTimeLocal), and a new time column with none.
  • Viewer RED: a SortMemberPath removed, and a new time column with none, each fail EveryTimeColumnInTheViewer_SortsByADateTime_NotByItsText. One pointed at a string property (QueryHash) fails the table test ATimeColumn_SortsByItsRowsUtcDateTime.
  • ViewerPostgresGridTimeTextTests uses an Eastern server clock and the instants 05:30Z and 06:30Z on 2026-11-01. Each of the five display rows reads them as 2026-11-01 01:30 -04:00 and 2026-11-01 01:30 -05:00 in server mode, and as 05:30 and 06:30 in UTC mode. Its ...Utc member holds the value, and its other columns carry the reader row's values. With a time written without the display zone, ALockRow_ReadsItsLastSeenInTheDisplayMode_AndKeepsTheInstant fails.
  • Both test projects build with 0 warnings.
  • Lite.Tests: Total: 6371, Errors: 0, Failed: 0. Darling.Tests: Total: 18870, Errors: 0, Failed: 0, Skipped: 1188. The live PostgreSQL classes run in CI.

CHANGELOG

SECTION: Fixed
ENTRY:

A grid column that shows a time as text sorted by that text, so a 'g' date put 10/1/2026 before 9/30/2026 and 'ddd MM/dd' put Fri before Mon. Sixteen more Lite columns now name the row's DateTime in SortMemberPath: the UTC member where the row has one (Default Trace EventTimeUtc, Mute Rules ExpiresAtUtc, the UTC Day of the daily FinOps rows) and otherwise the row's own DateTime, a stored server wall clock (job history, running jobs, query and procedure stats, the open transaction's start). The pin lists the new columns and scans every DataGrid column in Lite's .xaml, so a time column added later without a DateTime sort member fails with its file, header and fix.
@erikdarlingdata
erikdarlingdata marked this pull request as ready for review September 30, 2026 08:12
@erikdarlingdata
erikdarlingdata merged commit 6913775 into dev Sep 30, 2026
21 of 22 checks passed
@erikdarlingdata
erikdarlingdata deleted the fix/grid-time-columns-sort-by-time branch September 30, 2026 08:16
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