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

Don't show Followers / Following if both equal to zero #26292

Closed
wants to merge 5 commits into from

Conversation

n0toose
Copy link
Contributor

@n0toose n0toose commented Aug 2, 2023

  • This setting will not affect instances not running in prod mode.
  • This optimization aims to alleviate the "gamification" phenomenon
    present in other big platforms, while not compromising the social
    features of Gitea in any capacity.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Aug 2, 2023
@pull-request-size pull-request-size bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Aug 2, 2023
@n0toose
Copy link
Contributor Author

n0toose commented Aug 2, 2023

Screenshots

Screenshot of user profile as they have been followed. "1 Followers, 0 Following" is visible

Screenshot of user profile that doesn't have any followers. The followers / following indicator is not shown.

@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 2, 2023
@yardenshoham yardenshoham added the topic/ui Change the appearance of the Gitea UI label Aug 2, 2023
@lunny lunny added this to the 1.21.0 milestone Aug 3, 2023
@yp05327
Copy link
Contributor

yp05327 commented Aug 3, 2023

Maybe we can also remove the link if there's no followers or no following.

@n0toose
Copy link
Contributor Author

n0toose commented Aug 6, 2023

Maybe we can also remove the link if there's no followers or no following.

"the link" as in https://instance/user/followers, or do you want me to reinstate the "0 Followers" indicator and just make it so that it doesn't point anywhere?

@wxiaoguang
Copy link
Contributor

TBH I am not a fan of toggling the UI elements too much.

The questions are:

  1. Does the "0 followers" text really affect users or does it have any side effect?
  2. If an element is hidden, during development/refactoring, such element would be broken because developers won't notice it (the "users" in development instance usually don't have followers)

@yardenshoham yardenshoham self-requested a review August 8, 2023 06:19
@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 8, 2023
@n0toose
Copy link
Contributor Author

n0toose commented Aug 8, 2023

Does the "0 followers" text really affect users or does it have any side effect?

It is my opinion that it is unhealthy to "throw" people straight into a social media-like numbers game - without trying to downplay the importance of the existence of those features. I think it's one of the weakest points of the "GitHub model" - I find that it is distracting and counter-productive, both in the context of open-source and in a hypothetical, more "serious" business environment. From a purely aesthetic point of view, I could say that it is redundant.

Of course, this can't be measured.

If an element is hidden, during development/refactoring, such element would be broken because developers won't notice it (the "users" in development instance usually don't have followers)

We could use the RUN_MODE variable to establish this.

- This setting will not affect instances not running in prod mode.
- This optimization aims to alleviate the "gamification" phenomenon
  present in other big platforms, while not compromising the social
  features of Gitea in any capacity.
@n0toose n0toose changed the title Don't show Followers / Following on profiles if both equal to zero Don't show Followers / Following if both equal to zero Aug 8, 2023
@silverwind
Copy link
Member

silverwind commented Aug 8, 2023

FWIW, this behaviour is consistent with GitHub, so I'm okay with it. Just would like to see the mode dependency removed as well.

@yp05327
Copy link
Contributor

yp05327 commented Aug 9, 2023

Maybe we can also remove the link if there's no followers or no following.

"the link" as in https://instance/user/followers, or do you want me to reinstate the "0 Followers" indicator and just make it so that it doesn't point anywhere?

I mean in this case:
image
You can also click 0 Following and then get an empty page like:
image
So, maybe we can remove this link (make it unclickable) when there's no followers or no following.

@pull-request-size pull-request-size bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Aug 9, 2023
@n0toose
Copy link
Contributor Author

n0toose commented Aug 9, 2023

Keep in mind that this makes the person icon unclickable in some arbitrary cases, and clickable in some others. I think I'll remove the "clickability" (oh hey, new word!) entirely.

@silverwind
Copy link
Member

silverwind commented Aug 18, 2023

I think we can simplify the template significantly with a CSS pseudo element, only needs a class on the parent to be able to select it:

.follow-links a + a:before {
  content: " · ";
}

Then, just render the <a> with simple {{if .NumFollowers}} conditions.

@lunny lunny modified the milestones: 1.21.0, 1.22.0 Sep 21, 2023
@lunny lunny modified the milestones: 1.22.0, 1.23.0 Mar 29, 2024
@lunny
Copy link
Member

lunny commented Sep 21, 2024

Since there are no more interesting to hide the numbers, I think we can close this.

@lunny lunny closed this Sep 21, 2024
@GiteaBot GiteaBot removed this from the 1.23.0 milestone Sep 21, 2024
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. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. topic/ui Change the appearance of the Gitea UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants