Skip to content
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

Improve display of empty files #26568

Closed
wants to merge 3 commits into from
Closed

Conversation

silverwind
Copy link
Member

@silverwind silverwind commented Aug 17, 2023

  1. Empty files were not rendering anything in their body, add a "Empty File" text to them, both markup and plaintext.
  2. Since go 1.19 it's possible to compare against nil in templates, so remove the NumLinesSet workaround.
  3. Always show file size, even at 0 B.
  4. Always show file size and line count for markdown files, even when rendered.

Diff without whitespace

Screenshot 2023-08-18 at 00 18 39 Screenshot 2023-08-18 at 00 18 49 Screenshot 2023-08-18 at 00 19 11 Screenshot 2023-08-18 at 00 19 35 Screenshot 2023-08-18 at 00 19 48

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Aug 17, 2023
@pull-request-size pull-request-size bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 17, 2023
@silverwind silverwind added the type/enhancement An improvement of existing functionality label Aug 17, 2023
@silverwind silverwind marked this pull request as draft August 18, 2023 11:40
@silverwind
Copy link
Member Author

This has a few good fixes but I'm not sure I'm interested in working on this further currently, especially to go parts.

Maybe @wxiaoguang you want to pick it up where it left off, the test files are all in my test repo:

@wxiaoguang
Copy link
Contributor

I will try to rework it if I get time

@wxiaoguang
Copy link
Contributor

-> Improve detecting empty files #31332

@silverwind
Copy link
Member Author

Replaced by #31332

@silverwind silverwind closed this Jun 12, 2024
@silverwind silverwind deleted the emptyfile branch June 12, 2024 16:40
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Sep 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. type/enhancement An improvement of existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants