Repository navigation
Grid time columns sort by time, not by their text, in Lite and the Darling viewer - #4858
Merged
Merged
Conversation
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.
…nd sort by their UTC instant (#4766)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
yyyy-MM-dd HH:mmformat, with the UTC offset in the repeated autumn hour. They sort by their UTC instant.What changes
SortMemberPathon 16 Lite columns and 47 viewer columns now names aDateTimeon the row. That is the UTC instant where the row has one, and otherwise the row's ownDateTime.DateTimemembers on viewer rows:EventTimeon the eight System Events rows,...Utcon 16 Postgres display rows,LastRunUtcandSampleTimeUtc.EventTimeis the naive-UTC event time that Lite's rows already carry.PgDisplaygains 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 throughPgDisplay.Timestampand keeps the value in a...Utcmember. The reader rows, which the MCP tools share, do not change.GridTimeColumnSortMemberTests(Lite) andViewerGridTimeColumnSortMemberTests(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 aDateTimeof its row. The scan fails on an emptySortMemberPathor 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 aDateTimedirectly, 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
EveryTimeColumn_SortsByADateTime_NotByItsText: aSortMemberPathremoved, one pointed at a string property (CachedTimeLocal), and a new time column with none.SortMemberPathremoved, and a new time column with none, each failEveryTimeColumnInTheViewer_SortsByADateTime_NotByItsText. One pointed at a string property (QueryHash) fails the table testATimeColumn_SortsByItsRowsUtcDateTime.ViewerPostgresGridTimeTextTestsuses an Eastern server clock and the instants 05:30Z and 06:30Z on 2026-11-01. Each of the five display rows reads them as2026-11-01 01:30 -04:00and2026-11-01 01:30 -05:00in server mode, and as05:30and06:30in UTC mode. Its...Utcmember holds the value, and its other columns carry the reader row's values. With a time written without the display zone,ALockRow_ReadsItsLastSeenInTheDisplayMode_AndKeepsTheInstantfails.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:
REF:
[Grid time columns sort by time, not by their text, in Lite and the Darling viewer #4858]: Grid time columns sort by time, not by their text, in Lite and the Darling viewer #4858