Skip to content

Conversation

@silverwind
Copy link
Member

@silverwind silverwind commented Nov 27, 2025

  1. Use octicon-repo-locked to indicate private repos, also visible on the repo header now
  2. Use octicon-repo-forked to indicate forked repos
  3. Fix pull icons on pulse page
  4. Remove "gold" color from private icons, we have been removing this color on frontpage repolist, so now the rest of the UI is also consistent. Also remove the now-unused gold color.
Screenshot 2025-11-28 at 00 50 42
Screenshot 2025-11-28 at 00 45 21
Screenshot 2025-11-28 at 00 38 53
Screenshot 2025-11-28 at 00 36 34
Screenshot 2025-11-28 at 00 36 25

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Nov 27, 2025
@github-actions github-actions bot added modifies/templates This PR modifies the template files modifies/frontend labels Nov 27, 2025
@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 Nov 28, 2025
@github-actions github-actions bot added the modifies/go Pull requests that update Go code label Nov 28, 2025
@silverwind
Copy link
Member Author

Regarding octicon-repo-locked: I'm not sure it's actually right. I checked GH and they do not use it for the purpose of private repos at all. All they do is show a octicon-lock besides repo names in some places. So I think I will revert this change.

@github-actions github-actions bot removed the modifies/go Pull requests that update Go code label Nov 28, 2025
@silverwind
Copy link
Member Author

silverwind commented Nov 28, 2025

Regarding octicon-repo-locked: I'm not sure it's actually right. I checked GH and they do not use it for the purpose of private repos at all. All they do is show a octicon-lock besides repo names in some places. So I think I will revert this change.

Maybe this icon is actually fine. I think a repo book icon with a padlock is better than a padlock only. We do not have a "locked" state yet for repos, so this icon is unambiguous too.

@silverwind
Copy link
Member Author

One more minor change, ShowRepoAvatar is now enabled in repo lists, meaning they will render the repo avatar. This affects at least the explore repo list and org repo list.

@lunny
Copy link
Member

lunny commented Nov 28, 2025

A repository can fall into several state groups:

  • Group 1: IsMirror, IsFork, IsRegular
  • Group 2: IsTemplate
  • Group 3: Public, Private

We can add icons for the states in Group 1, and use text labels for the other groups to maintain consistency and avoid visual conflicts.

@silverwind
Copy link
Member Author

Sounds like a plan, I will try that.

@silverwind silverwind marked this pull request as draft December 1, 2025 13:24
@silverwind
Copy link
Member Author

Applied that logic, so there is only 3 states of the repo icon now.

Also, I disabled lint rules that forbid "else-return" constructs. I find those just annoying because they forbid code like this and fixing it breaks the symmetry of the block which looks ugly.

  } else {
    return 'octicon-repo';
  }

@silverwind silverwind changed the title Misc icon tweaks Misc icon tweaks, relax lint rules Dec 4, 2025
Signed-off-by: silverwind <me@silverwind.io>
@silverwind silverwind marked this pull request as ready for review December 4, 2025 20:54
@silverwind
Copy link
Member Author

Ready now, I think it's a good cleanup and now all repo icons are the same everywhere.

{{else}}
<span class="icon">{{svg "octicon-repo"}}</span>
{{end}}
{{template "repo/icon" (dict "Repo" $repo "Size" 16)}}
Copy link
Member

Choose a reason for hiding this comment

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

It's better to have labels(private, template & etc.) for this repository

Copy link
Member Author

Choose a reason for hiding this comment

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

You mean adding labels in this specific place (and below)?

Copy link
Member

Choose a reason for hiding this comment

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

I mean, it appears that the labels are only shown on the repository detail page. They could also be displayed on the list page, but I’m not sure whether we should enable that.

Copy link
Member Author

Choose a reason for hiding this comment

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

In lists we can add them, yes.

{{else}}
{{svg "octicon-repo"}}
{{end}}
{{template "repo/icon" (dict "Repo" . "Size" 16)}}
Copy link
Member

Choose a reason for hiding this comment

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

Same as the above

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Dec 5, 2025
{{else if $repo.IsMirror}}
<span class="icon">{{svg "octicon-mirror"}}</span>
{{else if $repo.IsTemplate}}
<span class="icon">{{svg "octicon-repo-template"}}</span>
Copy link
Contributor

@wxiaoguang wxiaoguang Dec 5, 2025

Choose a reason for hiding this comment

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

IsTemplate is missing in icon.tmpl

If intentionally, should the comment #36046 (comment) be added to the template code? ps: I don't understand why IsTemplate is in a separate "group".

Copy link
Member

@lunny lunny Dec 5, 2025

Choose a reason for hiding this comment

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

Both mirror repositories and regular repositories(public or private) could be template repositories.

Copy link
Contributor

Choose a reason for hiding this comment

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

If intentionally, should the comment #36046 (comment) be added to the template code? ps: I don't understand why IsTemplate is in a separate "group".

If intentionally, should the comment #36046 (comment) be added to the template code?

Copy link
Member Author

@silverwind silverwind Dec 6, 2025

Choose a reason for hiding this comment

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

I can add it. And yes I've implemented that only group 1 is represented with the icon, all other groups are represented with tags in places that have enough room to display them (not on frontpage repo list).

Copy link
Member Author

Choose a reason for hiding this comment

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

Thought maybe we should make an exception for templates. I think it's highly unlikely that a repo is both a mirror and a template, so I guess showing a template icon in such a case would make more sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/frontend modifies/internal modifies/templates This PR modifies the template files topic/code-linting

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants