Repository navigation
Support choosing the date-format for the history pane's commit date - #693
Merged
Merged
Conversation
goneng
force-pushed
the
choose-the-commit-date-format
branch
from
September 19, 2026 15:25
eb565bb to
ec0e58e
Compare
goneng
force-pushed
the
choose-the-commit-date-format
branch
7 times, most recently
from
September 19, 2026 20:01
9bc5fc8 to
1577118
Compare
goneng
marked this pull request as ready for review
September 19, 2026 20:21
Contributor
goneng
force-pushed
the
choose-the-commit-date-format
branch
2 times, most recently
from
September 19, 2026 21:56
7d1b11e to
5c50418
Compare
Collaborator
Author
Collaborator
Author
|
Chasing the diff images here turned up a separate app bug: the sidebar's checked-out badge is baked from the window's main state and never refreshed, so two runs of the same commit can differ by a few hundred pixels. Draft fix in #697. That removes one real source of screenshot noise here. The other one in these images is the context menu's translucency, where every differing pixel is off by exactly 1/255 - still open. |
goneng
force-pushed
the
choose-the-commit-date-format
branch
from
September 20, 2026 10:12
5c50418 to
588a240
Compare
goneng
marked this pull request as draft
September 20, 2026 10:13
This was referenced Sep 20, 2026
goneng
added a commit
that referenced
this pull request
Sep 20, 2026
Narrow the previous bisect further, now that removing #693's two new test suites left PBGitWindowWiringTests failing on macos-26 just the same, so the cause is the application change rather than the tests. * keep PBGitCommitDateFormatter and the defaults it reads, so the nib has a class to instantiate * keep the one line in PBGitHistoryView.xib that swaps the date column's dateFormatter for that custom formatter * drop the history controller's notification observer and column resize, and the preferences UI, so nothing listens for a format change and only the formatter itself is live Red here means the formatter the date column now builds is enough to disturb the suite. Green means the history controller's observer is what matters, and that the notification really does fire mid-run.
This was referenced Sep 20, 2026
goneng
marked this pull request as ready for review
September 20, 2026 21:56
goneng
force-pushed
the
choose-the-commit-date-format
branch
from
September 21, 2026 05:25
588a240 to
d3cb482
Compare
…issue #680) The date column's format was frozen in the nib, so every row read "19 September 2026 at 14:05" and there was no way to ask for anything else. * Add a Date format preference offering the system short, medium and long styles plus a free pattern, defaulting to the long style the column has always shown. Its tooltip says which list the format belongs to, since the label has no room to. * Format the column through PBGitCommitDateFormatter, which builds one formatter for every row on screen and rebuilds it only when the preference moves. * Mark the date cells that are already drawn for redraw when the format changes. A text field asks its formatter for a string as it draws, and the dates themselves do not change, so nothing else marks them. * Estimate the column width from one reference date rendered in the format in force, rather than from the dates on screen, so that a shorter format gives its room back and a longer one is not clipped the moment the list scrolls. It is an estimate the user can drag afterwards, and a date rather than a written down string, so that it stays in the reader's own locale. * Fall back to the long style for a pattern that is empty or all spaces, and show the rendered pattern under the field, so a pattern that does not say what its author meant is visible before it reaches the list. * Move the Git Executable row to Integration and put it first: it is the integration a git client rests on, and it frees the room in General that the date rows now take.
goneng
force-pushed
the
choose-the-commit-date-format
branch
from
September 21, 2026 06:27
d3cb482 to
f9e8f18
Compare
hannesa2
approved these changes
Sep 21, 2026
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.

First slice of #680. The date column's format was frozen in the nib
(
dateStyle="long" timeStyle="short"), so every row read "19 September2026 at 14:05" and nothing else was reachable.
styles, plus a free pattern for anyone who wants
yyyy-MM-dd HH:mm.The default is the long style, so an existing install looks the same.
The label column has no room to say which list the format belongs to,
so the tooltip does: "Date format of History-list". It governs the
Date column alone - the Relative Date column beside it is untouched.
PBGitCommitDateFormatter, which builds oneformatter for every row on screen and rebuilds it only when the
preference moves. The column formats once per visible row, so this
costs what the nib's formatter cost.
changes. A text field asks its formatter for a string as it draws,
and the dates themselves do not change, so nothing marks them
otherwise. Reloading the rows instead does not work here: the column
is bound to
arrangedObjects.date, so a reload re-hands the bindingthe commit it already had, the binding pushes nothing, and every row
but the selected one keeps the format it was drawn with until it is
scrolled away and back.
force - 28 September 2026 at 22:58, a two digit day in a long month
at a two digit hour - rather than from the dates on screen, so that a
shorter format gives its room back and a longer one is not clipped the
moment the list scrolls. It is an estimate the user can drag
afterwards, and a date rather than a written down string, so it stays
in the reader's own locale. The date is drawn 2pt in from each edge of
its cell, so the width is
ceil(text * 1.05) + 4, with the header asa floor since a pattern can render shorter than the word "Date".
and the rendered pattern shows under the field, so
YYYYand friendsare visible before they reach the list.
integration a git client rests on, and it frees the room in General
that the date rows now take.
The relative-date column,
NSRelativeDateTimeFormatterand the otherplaces a commit date is shown are the later slices of #680 and are not
touched here.
Test plan
make unit-test- 166 tests pass, 18 of them new. Ten cover theformatter: each style against the system formatter of that name, a
pattern used as written, an empty pattern falling back, a setting
outside the enum falling back, a non-date value not formatted, the
formatter in use following the preference, the change being
announced, that the sizing date does not depend on today, that it is
rendered by the format in force, and that it follows the preference.
Eight cover the redraw and the resize, over a table built in the
test: that the rows are drawn to begin with, that a format change
asks every drawn date cell to redraw, that a list with no date column
is left alone, that the column leaves room around the date, that a
shorter format narrows it, that the header still fits, that a list
with nothing to measure is left alone, and that a format change
through the handler sizes the column. The redraw test was run against
the previous implementation and fails there.
ibtool --errors --warnings --noticesonPreferences.xibagainstmaster: the only new notices are the intrinsic-height one every 17pt
label in this nib already produces.
keeping the 38pt top and 35pt bottom gutters. Picking Custom
enables the pattern field and the sample becomes
2026-09-19 17:57.editable=YES selectable=YESas the guide-column fields beside itare, and the tooltip is on both the label and the popup. It was
neither editable nor selectable before, so enabling it only
recoloured its text - it could not be clicked into or tabbed to.