Skip to content

gitk: combine author and date columns#46

Open
lostindark wants to merge 1 commit into
j6t:masterfrom
lostindark:combine-author-date-columns
Open

gitk: combine author and date columns#46
lostindark wants to merge 1 commit into
j6t:masterfrom
lostindark:combine-author-date-columns

Conversation

@lostindark

@lostindark lostindark commented Jul 15, 2026

Copy link
Copy Markdown

Problem

Currently gitk uses 3 columns to show commit message/author/time. When window resize, those columns width often get reset, and user need to adjust them multi time to make them to fit screen better.

Solution

The goal of this change to simplify user operation by combine author and time into 1, so user only need to drag one slider. Also the ratio of the width is remembered, so user doesn't need to change column width most of the time.

Change Summary

  • combine the author and date fields into one metadata pane
  • keep dates right-aligned and truncate authors before they overlap
  • preserve accurate search highlighting for truncated authors
  • retain the user-selected pane ratio when the window is resized
  • relayout only visible rows so sash movement remains responsive

Before (default could look really bad):
image
User needs to drag 2 slider to make it look better:
image

After (note Author and Commit Time are in the same column now):
image
Resized
image

Testing

  • launched the modified gitk against this repository
  • resized the metadata pane and application window in both directions
  • verified hidden author text is not highlighted through the ellipsis
  • checked Tcl script structure and patch whitespace

@lostindark
lostindark force-pushed the combine-author-date-columns branch from 239a0ed to 8ad95ee Compare July 15, 2026 06:15
@j6t

j6t commented Jul 16, 2026

Copy link
Copy Markdown
Owner

Thank you. Generally, I think that this change has merit.

Without having looked at the code, yet, I have some questions.

The commit message of 9eb5975 says:

Track the visible author prefix so search highlighting does not cover hidden text or the ellipsis. Relayout only visible rows while resizing and refresh cached rows as they scroll into view to keep sash movement responsive.

Both sentences describe the solution of a problem each, but not the problems. Please extend the commit message with problem descriptions.

Furthermore:

Remember the user-selected pane ratio and preserve it when the window size changes. With only two panes, save and restore a single sash position.

"Preserve a ratio" and then also "restore a sash position"? Which one is it? Or do we need both and why is that? Or am I misunderstanding the text?

Commit 8ad95ee says:

Save the ratio alongside the sash position. For existing configuration files that do not contain it, derive an initial ratio from the saved sash and window width.

It is important that both the old and the new setting are saved in different variable names and that the old setting is still saved and restored even if it is not used, because people (like me) want to switch between the old and the new layout without having to rearrange columns every time. The old setting can be removed after everyone has settled with the new feature (that would be some time in the future).

You mention that you have been helped by AI.

Since this code is sent downstream to the Git repository, their AI rules must be obeyed.

Equally important is that I want to be sure that you have checked and carefully reviewed and understood everything the AI produced. I am not going to look at the code until there is sufficient insurance that you did. (Blatantly put, I don't want to review code produced by someone else with AI.)

Gitk uses three columns for commit message, author, and time.  After the
window is resized, users often need to adjust two sliders repeatedly to
make the columns fit the available space.

Combine author and time in one metadata pane so only one slider is
needed.  Keep time right-aligned, truncate author when necessary, and
preserve the pane ratio when the window width changes.  Use a 60:40
default split in favor of commit messages.

Store the new ratio separately and preserve the legacy two sash settings
so users can switch between old and new layouts without rearranging the
columns.

Clip search highlights to the visible author text, and relayout only
visible rows to keep resizing responsive.

Signed-off-by: Teddy Zhang <lostindark@gmail.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 6389903b-f004-43ef-ae89-cc56ac4281e6
@lostindark
lostindark force-pushed the combine-author-date-columns branch from 8ad95ee to 2f71b64 Compare July 17, 2026 06:20
@lostindark

Copy link
Copy Markdown
Author

Thank you. Generally, I think that this change has merit.

Without having looked at the code, yet, I have some questions.

The commit message of 9eb5975 says:

Track the visible author prefix so search highlighting does not cover hidden text or the ellipsis. Relayout only visible rows while resizing and refresh cached rows as they scroll into view to keep sash movement responsive.

Both sentences describe the solution of a problem each, but not the problems. Please extend the commit message with problem descriptions.

Furthermore:

Remember the user-selected pane ratio and preserve it when the window size changes. With only two panes, save and restore a single sash position.

"Preserve a ratio" and then also "restore a sash position"? Which one is it? Or do we need both and why is that? Or am I misunderstanding the text?

Commit 8ad95ee says:

Save the ratio alongside the sash position. For existing configuration files that do not contain it, derive an initial ratio from the saved sash and window width.

It is important that both the old and the new setting are saved in different variable names and that the old setting is still saved and restored even if it is not used, because people (like me) want to switch between the old and the new layout without having to rearrange columns every time. The old setting can be removed after everyone has settled with the new feature (that would be some time in the future).

You mention that you have been helped by AI.

Since this code is sent downstream to the Git repository, their AI rules must be obeyed.

Equally important is that I want to be sure that you have checked and carefully reviewed and understood everything the AI produced. I am not going to look at the code until there is sufficient insurance that you did. (Blatantly put, I don't want to review code produced by someone else with AI.)

Updated PR message and hope that clear things a bit.

I've also modified the code to preserve the old setting. However, the old behavior is not preserved in updated code (user can't toggle a setting to get back the old behavior). Is that what you're asking for? That will needs way more code to be able to support both behavior.

Regarding the AI code, yes I manually reviewed all the code generated and ensure I understand the logic and the code is doing what I expected.

@j6t

j6t commented Jul 17, 2026

Copy link
Copy Markdown
Owner

Thank you for the update.

However, the old behavior is not preserved in updated code (user can't toggle a setting to get back the old behavior). Is that what you're asking for?

Just to confirm: I was not asking for that, but only to preserve the old layout settings for the case when an old version of Gitk is used that does not have the new layout.

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.

2 participants