Skip to content

Conversation

@tpokorra
Copy link

@tpokorra tpokorra commented Aug 19, 2025

This PR adds a button to the issues list, and when you click on it, the currently displayed issues will be downloaded as an Excel file.

fixes #29906

Screenshot after adding the button "Export to Excel":

grafik

@GiteaBot
Copy link
Collaborator

@tpokorra I noticed you've updated the locales for non-English languages. These will be overwritten during the sync from our translation tool Crowdin. If you'd like to contribute your translations, please visit https://crowdin.com/project/gitea. Please revert the changes done on these files. 🍵

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Aug 19, 2025
@github-actions github-actions bot added modifies/translation modifies/go Pull requests that update Go code modifies/templates This PR modifies the template files modifies/dependencies labels Aug 19, 2025
@tpokorra tpokorra force-pushed the TP-20250818-export_issues_to_excel branch 2 times, most recently from d38901f to 1d87056 Compare August 19, 2025 14:57
@tpokorra tpokorra changed the title add button to export issues to Excel; related to #29906 add button to export issues to Excel Aug 19, 2025
@silverwind
Copy link
Member

silverwind commented Aug 19, 2025

The button is far too prominent and there should only ever be one primary button on a page indicating the most likely action the user will take.

I recommend making a right-aligned "..." button on the right side of "Sort" and putting it in there. Check repo frontpage on how to implement this "..." menu using tippy.js.

@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 Aug 21, 2025
@hiifong hiifong self-requested a review August 21, 2025 01:17
@GiteaBot GiteaBot added lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Aug 21, 2025
@tpokorra
Copy link
Author

tpokorra commented Oct 7, 2025

I recommend making a right-aligned "..." button on the right side of "Sort" and putting it in there. Check repo frontpage on how to implement this "..." menu using tippy.js.

Thanks for the hint @silverwind

I guess you are refering to initClonePanelButton in https://github.com/go-gitea/gitea/blob/main/web_src/js/features/repo-common.ts#L133 which uses Tippy.
and https://github.com/go-gitea/gitea/blob/main/templates/repo/clone_panel.tmpl#L6

I tried to find the place where I should add that new button.
This is where the sort dropdowns are defined: https://github.com/go-gitea/gitea/blob/main/templates/repo/issue/filter_list.tmpl#L121
this is included here: https://github.com/go-gitea/gitea/blob/main/templates/repo/issue/filters.tmpl#L22

I will have to continue trying to figure this out in the coming days.

@tpokorra
Copy link
Author

I finally got the tippy button to work. I still have a small css issue, but I will fix that.

One question: Now I wonder, if the "Export" button should actually be in a ... button right of the filters, or if it should be displayed with the other actions (close, delete, etc), once one or multiple issues are selected?

@tpokorra tpokorra force-pushed the TP-20250818-export_issues_to_excel branch from 2018f3d to 7212c2d Compare November 18, 2025 12:34
@tpokorra
Copy link
Author

The tippy.js dropdown now works beside the filter.

I also implemented the button with the actions, but I don't filter for the selected issues yet. If I would export only the selected issues, I can only export the currently displayed issues. That is probably not what we want.

So I tend to drop the export button from the Actions, and just keep the tippy dropdown beside the filter.

What do you think, @silverwind ?

@tpokorra tpokorra force-pushed the TP-20250818-export_issues_to_excel branch from 3d9b665 to 93dad9f Compare November 25, 2025 13:11
@tpokorra tpokorra force-pushed the TP-20250818-export_issues_to_excel branch from ca73d42 to 2ea731c Compare December 2, 2025 13:55
@tpokorra tpokorra marked this pull request as ready for review December 2, 2025 16:12
@lunny
Copy link
Member

lunny commented Dec 2, 2025

  • Please add the missing tests.
  • The action menu currently conflicts with the batch-close button. It may be a good time to merge batch actions into the action menu for a more unified UI.
  • The purpose of the actions is a bit ambiguous — it’s unclear whether they should apply to all search results or only to the selected items. Clarifying this behavior would help avoid confusion.

@TheFox0x7
Copy link
Contributor

Out of curiosity - what changed from #4808 (implement this as a separate thing) and #35066 (use api to generate it) that this is now considered as in scope and worth pulling in excel stuff?

@lunny
Copy link
Member

lunny commented Dec 2, 2025

Out of curiosity - what changed from #4808 (implement this as a separate thing) and #35066 (use api to generate it) that this is now considered as in scope and worth pulling in excel stuff?

It seems that now the excel library github.com/xuri/excelize/v2 is mature enough. And the binary size increment seems acceptable.

┌────────────────────────────────────────────────────────────────────────────┐
│ Diff between gitea-old and gitea                                           │
├─────────┬──────────────────────────────────┬──────────┬──────────┬─────────┤
│ PERCENT │ NAME                             │ OLD SIZE │ NEW SIZE │ DIFF    │
├─────────┼──────────────────────────────────┼──────────┼──────────┼─────────┤
│ +100%   │ github.com/xuri/excelize/v2      │          │ 416 kB   │ +416 kB │
│ +100%   │ github.com/tiendc/go-deepcopy    │          │ 50 kB    │ +50 kB  │
│ +100%   │ github.com/richardlehane/msoleps │          │ 49 kB    │ +49 kB  │
│ +2.67%  │ <autogenerated>                  │ 1.7 MB   │ 1.8 MB   │ +46 kB  │
│ +8.48%  │ archive/zip                      │ 68 kB    │ 74 kB    │ +5.8 kB │
│ +0.03%  │ code.gitea.io/gitea              │ 14 MB    │ 14 MB    │ +4.3 kB │
│ +0.06%  │ github.com/go-git/go-git/v5      │ 631 kB   │ 632 kB   │ +349 B  │
│ +100%   │ github.com/xuri/efp              │          │ 225 B    │ +225 B  │
│ +0.07%  │ math                             │ 244 kB   │ 244 kB   │ +163 B  │
│ +100%   │ github.com/richardlehane/mscfb   │          │          │ +0 B    │
│ +100%   │ github.com/xuri/nfp              │          │          │ +0 B    │
│ -0.06%  │ xorm.io/xorm                     │ 991 kB   │ 990 kB   │ -643 B  │
├─────────┼──────────────────────────────────┼──────────┼──────────┼─────────┤
│ +1.42%  │ __rodata __DATA_CONST            │ 15 MB    │ 15 MB    │ +211 kB │
│ +1.02%  │ __rodata __TEXT                  │ 12 MB    │ 12 MB    │ +123 kB │
│ +11.26% │ __data __DATA                    │ 1.0 MB   │ 1.2 MB   │ +117 kB │
│ +1.42%  │ __typelink __DATA_CONST          │ 131 kB   │ 133 kB   │ +1.9 kB │
│ +0.01%  │ __noptrdata __DATA               │ 15 MB    │ 15 MB    │ +1.3 kB │
│ +2.23%  │ __go_buildinfo __DATA            │ 25 kB    │ 26 kB    │ +560 B  │
│ +0.85%  │ __itablink __DATA_CONST          │ 38 kB    │ 38 kB    │ +320 B  │
├─────────┼──────────────────────────────────┼──────────┼──────────┼─────────┤
│ +0.94%  │ gitea-old                        │ 111 MB   │ 112 MB   │ +1.0 MB │
│         │ gitea                            │          │          │         │
└─────────┴──────────────────────────────────┴──────────┴──────────┴─────────┘

@TheFox0x7
Copy link
Contributor

This isn't really answering the question. I don't see maturity of the library being the issue in either of the issues and if tea would be the one handling this like you suggested it would hit the maturity topic as well.
The binary size is subjective here because it depends on usage IMO.

To be clear - I have no interest in this feature (though because of that I think it's best implemented via API where the end user can customize the export/report to their liking) but I won't block it if that's a concern.

@tpokorra tpokorra force-pushed the TP-20250818-export_issues_to_excel branch 2 times, most recently from b65fab8 to d775f1a Compare December 9, 2025 17:22
@tpokorra tpokorra force-pushed the TP-20250818-export_issues_to_excel branch from d775f1a to 4f79980 Compare December 9, 2025 17:24
@tpokorra
Copy link
Author

tpokorra commented Dec 9, 2025

@lunny
I have added now a test for exporting the issues to Excel file. Is that sufficient?

For the Actions: I did not mix it with the actions in the end, but added the export button to the filter toolbar.
I export all issues, that are covered by the current filter, no matter if they are listed on the current page of issues.
Actions only come into play, as soon as you tick an issue. That would not work for me, because I could only export the issues on the current page.

The motivation is for the user, to have a report for management about all the open issues. It would be nice to export directly from the Gitea Web interface, rather than via tea or another tool that calls the API.

@tpokorra tpokorra force-pushed the TP-20250818-export_issues_to_excel branch from 76bf86e to 0a93b9e Compare December 9, 2025 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. modifies/dependencies modifies/frontend modifies/go Pull requests that update Go code modifies/templates This PR modifies the template files modifies/translation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Print/Export List of Issues

6 participants