Skip to content

Add label next to size number in repo submenu #24352

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

Closed
wants to merge 3 commits into from

Conversation

n0toose
Copy link
Contributor

@n0toose n0toose commented Apr 26, 2023

Every other label in that submenu has a clear indicator as to what it
does.

Even if the size is described using the format "12 MiB", the meaning
of the label doesn't seem to immediately register with the user
because the developer that worked on this feature may have thought
that this would have been superfluous, as "MiB" is a unit used to
describe the size of digital files.

The word "used" (example: "212 MiB used") was chosen over "Size:"
(example: "Size: 212 MiB") so as to preserve consistency. I also
thought about using the adjective "large", but it seemed way too
implicit.

Every other label in that submenu has a clear indicator as to what it
does.

Even if the size is described using the format "12 MiB", the meaning
of the label doesn't seem to immediately register with the user
because the developer that worked on this feature may have thought
that this would have been superfluous, as "MiB" is a unit to describe
the size of digital files.

The word "used" (example: "212 MiB used") was chosen over "Size:"
(example: "Size: 212 MiB") so as to preserve consistency. I also
thought about using the adjective "large", but it seemed way too
implicit.
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Apr 26, 2023
@silverwind
Copy link
Member

Screenshot would be helpful.

@silverwind silverwind added topic/ui Change the appearance of the Gitea UI type/enhancement An improvement of existing functionality labels Apr 26, 2023
@wxiaoguang
Copy link
Contributor

It's untranslatable for i18n.

Many languages do not use this syntax "123KB used"

@silverwind
Copy link
Member

silverwind commented Apr 26, 2023

Yes, this needs to be one translation string like %s used. Label it bytes_used and move it to a top-level translation (removing the repo prefix) because this is not repo-specific and generally useful.

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Apr 26, 2023

But the layout seems also strange for some languages:

[icon] 123KB used or [icon] (already-used) 123KB

Actually, I'd like to keep the old UI/text (no extra "used")

@n0toose
Copy link
Contributor Author

n0toose commented Apr 26, 2023

Yes, this needs to be one translation string like %s used. Label it bytes_used and move it to a top-level translation (removing the repo prefix) because this is not repo-specific and generally useful.

Didn't think about this, thanks.

@n0toose
Copy link
Contributor Author

n0toose commented Apr 26, 2023

However, there's a problem: Bold letters.

image

@n0toose
Copy link
Contributor Author

n0toose commented Apr 26, 2023

In this case, it may be better to use the "Size:" alternative, so that it's also translatable. However, it may not be as consistent.

@silverwind
Copy link
Member

silverwind commented Apr 26, 2023

However, there's a problem: Bold letters.

You can interpolate HTML tags into the %s from the translation, see example in https://github.com/go-gitea/gitea/pull/23951/files#diff-7f25271f6c80f878fdb80a556b5fb2066352bc24d79736b32215205b5fc908c4R138 for how to do it.

@silverwind
Copy link
Member

silverwind commented Apr 26, 2023

How about 123MB Space or 123MB Size? Still does sound a bit odd.

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Apr 26, 2023

However, there's a problem: Bold letters.

Personally I'd like to remove all these bold styles (they came from very old code base). Too many bold styles only affect reading IMO ...


If we'd like to keep the bold styles, that's also fine (I see GitHub also has bold styles for some numbers)

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Apr 26, 2023

I think I understand the problem now. The key point is MiB, it is already a unit "MegaByte / MebiByte"

So the UI should be:

123 MiB

The 123 gets bold styles, the MiB doesn't get bold.

Then it's consistent with: 12,345 commits

@n0toose
Copy link
Contributor Author

n0toose commented Apr 26, 2023

the MiB doesn't get bold.

Possibly too technical? Makes much more sense, I'll adjust it that way.

@wxiaoguang
Copy link
Contributor

the MiB doesn't get bold.

Possibly too technical? Makes much more sense, I'll adjust it that way.

I think MiB/MB could be very well-known.

And .... TBH I won't expect a user who doesn't understand "MiB/MB" could use git clone ......

@n0toose
Copy link
Contributor Author

n0toose commented Apr 26, 2023

I think MiB/MB could be very well-known.

And .... TBH I won't expect a user who doesn't understand "MiB/MB" could use git clone ......

Thought so as well, just wanted to be sure.

@silverwind
Copy link
Member

silverwind commented Apr 26, 2023

So the UI should be:
123 MiB

Sounds good. With that split we don't even need translation as MiB is universal.

@wxiaoguang
Copy link
Contributor

Sounds good. With that split we don't even need translation as MiB is universal.

But it's still challenge, because ... the whole text 123 MiB is formatted by backend ..... 😭

@yardenshoham
Copy link
Member

We could use PrettyNumber inside FileSize?

@n0toose
Copy link
Contributor Author

n0toose commented Apr 28, 2023

I think I don't have enough capacity to work on this problem in particular right now (as in, within the next 7-14 days), feel more than free to take over in the meantime.

I think that MiB should perhaps stay bold, as it's also a variable. Or that it should be moved elsewhere.

@wxiaoguang
Copy link
Contributor

Does this look good to you?

Make repo size style matches others (commits/branches/tags) #24408

@silverwind
Copy link
Member

silverwind commented Apr 28, 2023

Close in favor of #24408.

@silverwind silverwind closed this Apr 28, 2023
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Jul 31, 2023
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. 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.

5 participants