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

Open
wants to merge 12 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.

@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

<div class="timeline-body">
<h3 class="flex-text-block tw-py-2 timeline-heading">
Commits on {{DateUtils.AbsoluteShort .Date}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if the browser's timezone is different from the server's? Will the formatted "date" be overall right or misleading users?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should be correct to use the server time as the standard currently, right? The DateUtils.AbsoluteShort is also used in multiple places across the entire system. I believe there won't be any issues with consistency.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. Other AbsoluteShort calls uses timestamp directly, so the timezone is always right there.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I've now changed the type of Date here to timestamp as well.

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

Where is still using the repo/commits_list? Why not unify them to the new layout?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
repo/wiki/revision

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not unify them to the new layout?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The old logic is as follows. I noticed that the revision page of the GitHub wiki also uses a table layout, so I'm not sure if we should change our wiki to a timeline layout.

@kerwin612 kerwin612 marked this pull request as draft April 21, 2025 00:42
@kerwin612 kerwin612 marked this pull request as ready for review April 21, 2025 01:13
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.

8 participants