gitk: combine author and date columns#46
Conversation
239a0ed to
8ad95ee
Compare
|
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:
Both sentences describe the solution of a problem each, but not the problems. Please extend the commit message with problem descriptions. Furthermore:
"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:
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
8ad95ee to
2f71b64
Compare
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. |
|
Thank you for the update.
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. |
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
Before (default could look really bad):


User needs to drag 2 slider to make it look better:
After (note Author and Commit Time are in the same column now):


Resized
Testing