-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Group commit list page by date #34098
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Group commit list page by date #34098
Conversation
kerwin612
commented
Apr 2, 2025
To be honest, I like the old UI. Although the new UI follows GitHub, it seems too loose and less informative. What are the benefits of introducing the new UI? |
I can see what you mean for repos that only you yourself contribute to: But precisely for repos with a large number of contributors and commits like Gitea, this feature is absolutely useful: |
I never meant that.
The old list is pretty clear, and contains all information. Why end users need to "distinguish where in the timeline you currently are" by the unit of "day"?
Then we just need to change it to the absolute time, or set From another perspective, there are so many pending proposals and bug reports, till now, I do not see any single user said that they need the "grouped commit list". |
I think you only need to update the frontend and keep the backend as it is. There’s no need to group commits on the backend. |
Something I've noticed doing myself is the following: Alternatively, consider any fork that wants to see what changed upstream since the last cherry-pick. |
58371f7
to
b29d401
Compare
I like the design with the timeline and icons from first screenshot better, it matches the issue/pr view. |
Hi, I like the first proposed change. It's follows GitHub/GitLab style. |
@delvh I use the date separation for a similar reason where as a packager of software for various OSes I need to catch up on what's changed, as well it helps me verify some things for changelogs on projects that don't use milestones (or use PRs for changes). |
If most people like GitHub style, feel free to ignore my comment for the old style. |
{{else if $.Reponame}} | ||
{{$commitBaseLink = printf "%s/commit" $commitRepoLink}} | ||
{{end}} | ||
<div class="commit_sign_badge"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a nit may forgatten
<div class="commit_sign_badge"> | |
<div class="commit-sign-badge"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually it is a wrong class ......
The real class="commit-sign-badge"
is only used in commit_sign_badge.tmpl
@@ -29,8 +29,8 @@ | |||
</div> | |||
{{end}} | |||
|
|||
{{if and .Commits (gt .CommitCount 0)}} | |||
{{template "repo/commits_list" .}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still the question, it seems that "wiki" is still using the repo/commits_list
, why not unify them to the new layout? Is there any strong reason that wiki must have a different layout?
|
||
// Truncate time to date part (remove hours, minutes, seconds) | ||
year, month, day := sigTime.Date() | ||
dateOnly := time.Date(year, month, day, 0, 0, 0, 0, sigTime.Location()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think this algorithm is right, or maybe it is right but it needs some tests.
For example:
- commit1 is at "2025-04-10T08:00:00+08:00"
- commit2 is at "2025-04-09T23:00:00-01:00"
Actually they are the same timestamp (1744243200), and the day depends on visitor's timezone.
- When visitor's timezone is
UTC
, time is2025-04-10T00:00:00Z
, on local day "2025-04-10" - When visitor's timezone is
-04:00
, time is2025-04-09T20:00:00-04:00
, on local day "2025-04-09"
ps: I have no idea how GitHub handles such timezone problem then renders the "date" to end users. Just FYI.
Or maybe some tests could help to clarify the expected behavior.
// Sort dates in descending order (most recent first) | ||
sort.Slice(dates, func(i, j int) bool { | ||
return dates[i] > dates[j] | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another edge case: git commit's date could be manually set.
So you could see a commit list like this:
commit4 2025-04-10
commit3 2025-04-01
commit2 2025-04-30
commit1 2025-04-15
And the graph is commit1->commit2->commit3->commit4.
What's the expected output for such commit list? It needs some tests to clarify the behavior.