Skip to content

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

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

kerwin612
Copy link
Member

image

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Apr 2, 2025
@github-actions github-actions bot added modifies/go Pull requests that update Go code modifies/templates This PR modifies the template files modifies/frontend labels Apr 2, 2025
@delvh delvh changed the title Refactor the structure of the commit list page to grouping by date. Group commit list page by date Apr 2, 2025
@wxiaoguang
Copy link
Contributor

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?

@delvh
Copy link
Member

delvh commented Apr 2, 2025

I can see what you mean for repos that only you yourself contribute to:
I mean, how many commits can you commit in a day? 1? 2?

But precisely for repos with a large number of contributors and commits like Gitea, this feature is absolutely useful:
It helps you distinguish where in the timeline you currently are, and also on what date you are (if you go a few pages down the list).
At the moment, this somewhat crucial information for the commit list is "hidden" behind a (mostly) relative tooltip like a month ago.

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Apr 2, 2025

I can see what you mean for repos that only you yourself contribute to:

I never meant that.

But precisely for repos with a large number of contributors and commits like Gitea, this feature is absolutely useful:
It helps you distinguish where in the timeline you currently are, and also on what date you are (if you go a few pages down the list).

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"?

image

At the moment, this somewhat crucial information for the commit list is "hidden" behind a (mostly) relative tooltip like a month ago.

Then we just need to change it to the absolute time, or set PREFERRED_TIMESTAMP_TENSE in app.ini


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".

@wxiaoguang
Copy link
Contributor

I mean, how many commits can you commit in a day? 1? 2?

Off-topic: how many ? 4? 5? 6?

image

image

image

@lunny
Copy link
Member

lunny commented Apr 2, 2025

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.

@delvh
Copy link
Member

delvh commented Apr 2, 2025

Why end users need to "distinguish where in the timeline you currently are" by the unit of "day"?

Something I've noticed doing myself is the following:
From time to time, I watch over what happened in vim/vim since I last looked at the repo for a quick overview of changes to expect.
When the currently looked at date is publicly displayed, it's much easier to know the last time you've looked at the repo.

Alternatively, consider any fork that wants to see what changed upstream since the last cherry-pick.
When you know the day of the last cherry-pick, it becomes much easier to find the diff of commits visually.
(And yes, I am aware of the contextual irony in this argument. I haven't found a way to phrase it without triggering that association. )

@kerwin612 kerwin612 force-pushed the refactor-commit-list-page-group-by-date branch from 58371f7 to b29d401 Compare April 3, 2025 02:59
@pull-request-size pull-request-size bot added size/S and removed size/L labels Apr 3, 2025
@kerwin612
Copy link
Member Author

Complete the grouping design within the existing table.

3000-gogitea-gitea-y4ulxr46c4k ws-us118 gitpod io_test_test_commits_branch_main (1)

@silverwind
Copy link
Member

silverwind commented Apr 3, 2025

I like the design with the timeline and icons from first screenshot better, it matches the issue/pr view.

@sonjek
Copy link
Contributor

sonjek commented Apr 5, 2025

Hi, I like the first proposed change. It's follows GitHub/GitLab style.
Without this separation, it's harder to control which new commits have appeared since the previous review.
The new order is also easier to read, because the most important data is in front of your eyes and the commit SHA is secondary information.

@techknowlogick
Copy link
Member

@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).

@wxiaoguang
Copy link
Contributor

I like the design with the timeline and icons from first screenshot better, it matches the issue/pr view.

If most people like GitHub style, feel free to ignore my comment for the old style.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@kerwin612
Copy link
Member Author

This commit adds date grouping rows based on the optimization of the existing table:
b29d401
This commit and subsequent ones follow the date grouping design from GitHub's redesign:
0581b27

@techknowlogick techknowlogick added type/enhancement An improvement of existing functionality topic/ui Change the appearance of the Gitea UI labels Apr 14, 2025
@kerwin612 kerwin612 requested a review from a team April 16, 2025 02:41
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Apr 17, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
fix
fix
@kerwin612 kerwin612 marked this pull request as draft April 21, 2025 00:42
fix
fix
@kerwin612 kerwin612 marked this pull request as ready for review April 21, 2025 01:13

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
fix

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@kerwin612 kerwin612 requested a review from wxiaoguang April 22, 2025 00:17
{{else if $.Reponame}}
{{$commitBaseLink = printf "%s/commit" $commitRepoLink}}
{{end}}
<div class="commit_sign_badge">
Copy link
Member

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

Suggested change
<div class="commit_sign_badge">
<div class="commit-sign-badge">

Copy link
Contributor

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" .}}
Copy link
Contributor

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())
Copy link
Contributor

@wxiaoguang wxiaoguang Apr 22, 2025

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 is 2025-04-10T00:00:00Z, on local day "2025-04-10"
  • When visitor's timezone is -04:00, time is 2025-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]
})
Copy link
Contributor

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.

@wxiaoguang wxiaoguang marked this pull request as draft April 22, 2025 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm/need 1 This PR needs approval from one additional maintainer to be merged. modifies/frontend modifies/go Pull requests that update Go code modifies/templates This PR modifies the template files topic/ui Change the appearance of the Gitea UI type/enhancement An improvement of existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants