Codeberg/Community
54
325
Fork
You've already forked Community
12

Disable repo units by default #1318

Closed
opened 2023年10月16日 21:29:41 +02:00 by fnetX · 18 comments
Owner
Copy link

Comment

Currently, all repo units are enabled by default. If you browse a new repo, you'll see

  • Code
  • Pull Requests
  • Releases
  • Wiki
  • Projects
  • Activity

However, most of them are probably empty.

I propose to improve the UX for visitors of repos Is the wiki present? Any projects?

I recommend to disable the units by default and make repo admins enable them when they are used (wiki, projects, releases?). Or a better way would actually be to hide them when empty and not actionable (e.g. if you have read access only and the wiki is empty, why show the tab?)

### Comment Currently, all repo units are enabled by default. If you browse a new repo, you'll see - Code - Pull Requests - Releases - Wiki - Projects - Activity However, most of them are probably empty. I propose to improve the UX for visitors of repos Is the wiki present? Any projects? I recommend to disable the units by default and make repo admins enable them when they are used (wiki, projects, releases?). Or a better way would actually be to hide them when empty and not actionable (e.g. if you have read access only and the wiki is empty, why show the tab?)

improve the UX for visitors of repos

I wonder if disabling repo units would also improve Codeberg's performance?

> improve the UX for visitors of repos I wonder if disabling repo units would also improve Codeberg's performance?
Author
Owner
Copy link

I don't think so.

I don't think so.

Is there any way that this could be done on Codeberg's fork without too much hasle for Forgejo people? I mean, they might not want to do this change.

Is there any way that this could be done on Codeberg's fork without too much hasle for Forgejo people? I mean, they might not want to do this change.

I don't think so.

I remember seeing a more detailed answer on Codeberg's Mastodon post for the same question but I can't find it again.

> I don't think so. I remember seeing a more detailed answer on Codeberg's Mastodon post for the same question but I can't find it again.
There's a option for that `DEFAULT_REPO_UNITS`, https://forgejo.org/docs/latest/admin/config-cheat-sheet/#repository-repository

There's a option for that DEFAULT_REPO_UNITS, https://forgejo.org/docs/latest/admin/config-cheat-sheet/#repository-repository

Didn't know about this, thanks!

> There's a option for that `DEFAULT_REPO_UNITS`, https://forgejo.org/docs/latest/admin/config-cheat-sheet/#repository-repository > > Didn't know about this, thanks!

Maybe we can just make the Releases tab invisible for anyone other than the people in a position to modify it from the main repository page, and then add an indicator saying that this unit is only visible to those people until it actually starts getting used? (And providing a proper error message through the web UI / API, as some third-party programs may try to get files using that endpoint.)

Maybe we can just make the Releases tab invisible for anyone other than the people in a position to modify it from the main repository page, and then add an indicator saying that this unit is only visible to those people until it actually starts getting used? (And providing a proper error message through the web UI / API, as some third-party programs may try to get files using that endpoint.)
Author
Owner
Copy link

For improving the user experience within Forgejo itself, I see the following options:

A: Repo units without content are hidden to visitors automatically, no need to disable them. A criterion could include: No release / tags. No wiki page. No release. This likely involves larger changes to the codebase, because for performance reasons it requires a cache instead of counting the content at every request. People with permission to act on them (e.g. create releases, projects, wiki pages) always see the tabs.

B: Repo units are hidden by default (using the config suggested above which already exists). However, people with sufficient privilege to enable the repo units see a button in the UI to do so. Again, there are two options: We either display a + button which opens a dropdown (Releases, Projects, WIki). Or, we display each disabled unit after another, but need to find a good indication that these can be enabled (also think of how to label them for accessibility reasons). The single "+" button is likely more convenient for hardcore Forgejo users, because it is less intrusive, but the individual buttons might be more intuitive for new users (but probably larger to design from a UX perspective).

I intuitively prefer option B with Plus-Style dropdown to enable the additional units. Releases, Projects, Wiki, Package Registry and Actions are hidden by default and available in the dropdown.

For improving the user experience within Forgejo itself, I see the following options: A: Repo units without content are hidden to visitors automatically, no need to disable them. A criterion could include: No release / tags. No wiki page. No release. This likely involves larger changes to the codebase, because for performance reasons it requires a cache instead of counting the content at every request. People with permission to act on them (e.g. create releases, projects, wiki pages) always see the tabs. B: Repo units are hidden by default (using the config suggested above which already exists). However, people with sufficient privilege to enable the repo units see a button in the UI to do so. Again, there are two options: We either display a <kbd>+</kbd> button which opens a dropdown (Releases, Projects, WIki). Or, we display each disabled unit after another, but need to find a good indication that these can be enabled (also think of how to label them for accessibility reasons). The single "+" button is likely more convenient for hardcore Forgejo users, because it is less intrusive, but the individual buttons might be more intuitive for new users (but probably larger to design from a UX perspective). I intuitively prefer option B with Plus-Style dropdown to enable the additional units. Releases, Projects, Wiki, Package Registry and Actions are hidden by default and available in the dropdown.

I would also prefer the option B, but I see the dropdown a bit unnecessary, since that config is already available at the "Settings" of a given repository.

Nevertheless, option B seems to be a better choice here.

I would also prefer the option B, but I see the dropdown a bit unnecessary, since that config is already available at the "Settings" of a given repository. Nevertheless, option B seems to be a better choice here.

B: Repo units are hidden by default (using the config suggested above which already exists). However, people with sufficient privilege to enable the repo units see a button in the UI to do so. Again, there are two options: We either display a + button which opens a dropdown (Releases, Projects, WIki). Or, we display each disabled unit after another, but need to find a good indication that these can be enabled (also think of how to label them for accessibility reasons). The single "+" button is likely more convenient for hardcore Forgejo users, because it is less intrusive, but the individual buttons might be more intuitive for new users (but probably larger to design from a UX perspective).

I think A is way too complicated, and puts too much logic into the presentation layer, thus, B feels like both a simpler, and more correct choice. I'd offer a third variant of it: if there are disabled units when an administrator is viewing the repo, show a + sign (or even better, something like Configure repo units). It wouldn't be a dropdown, but would simply take one to the repo settings page. We could add an anchor to the "Advanced Settings" section, and take the user directly there.

Come to think of it, the entire "Advanced Settings" section is really about repo units, so perhaps changing its name would make it even clearer what it is for? I kinda like "Configure repo units". We can add an explanatory text like there's one for the mirror settings section.

> B: Repo units are hidden by default (using the config suggested above which already exists). However, people with sufficient privilege to enable the repo units see a button in the UI to do so. Again, there are two options: We either display a <kbd>+</kbd> button which opens a dropdown (Releases, Projects, WIki). Or, we display each disabled unit after another, but need to find a good indication that these can be enabled (also think of how to label them for accessibility reasons). The single "+" button is likely more convenient for hardcore Forgejo users, because it is less intrusive, but the individual buttons might be more intuitive for new users (but probably larger to design from a UX perspective). I think `A` is way too complicated, and puts too much logic into the presentation layer, thus, `B` feels like both a simpler, and more correct choice. I'd offer a third variant of it: if there are disabled units when an administrator is viewing the repo, show a `+` sign (or even better, something like `Configure repo units`). It wouldn't be a dropdown, but would simply take one to the repo settings page. We could add an anchor to the "Advanced Settings" section, and take the user directly there. Come to think of it, the entire "Advanced Settings" section is really about repo units, so perhaps changing its name would make it even clearer what it is for? I kinda like "Configure repo units". We can add an explanatory text like there's one for the mirror settings section.
Author
Owner
Copy link

The motivation for the +-button and dropdown style was an easy representation for "See, you can add more tabs". The settings page is already linked, but I think people are not sure that there is more to enable. "Configure repo units" sounds cumbersome to me, but I won't insist on the plus button.

Good spot with the section. I think it would even make sense to declutter the long setting page and consider moving the unit part to a separate page, accessible via the sidebar?

The motivation for the +-button and dropdown style was an easy representation for "See, you can add more tabs". The settings page is already linked, but I think people are not sure that there is more to enable. "Configure repo units" sounds cumbersome to me, but I won't insist on the plus button. Good spot with the section. I think it would even make sense to declutter the long setting page and consider moving the unit part to a separate page, accessible via the sidebar?

The motivation for the +-button and dropdown style was an easy representation for "See, you can add more tabs".

Understood!

The settings page is already linked, but I think people are not sure that there is more to enable.

Indeed, it is, but explicitly linking to the section where you can enable more units, with a label that makes that clearer would be helpful to, well, make it clear that you can add more tabs!

"Configure repo units" sounds cumbersome to me, but I won't insist on the plus button.

I just figured that if there's no dropdown, a more descriptive label would help. "+ Add more tabs" or something along those lines would be equally good.

Another reason I'm not a fan of the dropdown is that it duplicates what can be done in Settings, in a more limited way. I'd rather make it easier to both discover the appropriate settings parts, and to use them - no duplication then, and especially not with a more limited feature set.

Good spot with the section. I think it would even make sense to declutter the long setting page and consider moving the unit part to a separate page, accessible via the sidebar?

I like that idea. We can even use sub-pages like in the user settings page (the Actions part of the sidebar, which can be expanded, and then shows two sub-sections), so there's existing precedent for this kind of hierarchical preferences.

> The motivation for the +-button and dropdown style was an easy representation for "See, you can add more tabs". Understood! > The settings page is already linked, but I think people are not sure that there is more to enable. Indeed, it is, but explicitly linking to the section where you can enable more units, with a label that makes that clearer would be helpful to, well, make it clear that you can add more tabs! > "Configure repo units" sounds cumbersome to me, but I won't insist on the plus button. I just figured that if there's no dropdown, a more descriptive label would help. "+ Add more tabs" or something along those lines would be equally good. Another reason I'm not a fan of the dropdown is that it duplicates what can be done in Settings, in a more limited way. I'd rather make it easier to both discover the appropriate settings parts, and to use them - no duplication then, and especially not with a more limited feature set. > Good spot with the section. I think it would even make sense to declutter the long setting page and consider moving the unit part to a separate page, accessible via the sidebar? I like that idea. We can even use sub-pages like in the user settings page (the Actions part of the sidebar, which can be expanded, and then shows two sub-sections), so there's existing precedent for this kind of hierarchical preferences.

Tried to implement this, small complicating factor: Very easy in theory (just gotta check if a user has repository access and add a tooltip), but not consistently (disabling releases won't work because it's also used for the git tags, unless if we dynamically change the "Releases" tab into a "Tags" tab, and there is no package counter in the UI, and we don't know if the Wiki has any content in it)

Tried to implement this, small complicating factor: Very easy in theory (just gotta check if a user has repository access and add a tooltip), but not consistently (disabling releases won't work because it's also used for the git tags, unless if we dynamically change the "Releases" tab into a "Tags" tab, and there is no package counter in the UI, and we don't know if the Wiki has any content in it)

A mockup of the idea I posted earlier. This is just an idea at this point, there are a number of issues with the mockups, I just wanted to get to something I can show to demonstrate the idea. If this is something worth exploring further, let me know, and I'll polish it up and make a PR out of it. For the time being, the very much work in progress code is on my repo-units/ui-refactor branch.

An "Add more" button on the repo's tab bar:

Screenshot 2023年12月17日 at 10-38-21 asdf2.png

The button is displayed under the same conditions as the "Settings" label on the right: if the user viewing it is an admin of the repo. The "Add more" label would link to the new /{user}/{repo}/settings/units page.

Ideally, the label would only show if there are more units to enable. That shouldn't be terribly hard to accomplish, but I didn't get around to it with the mockup.

Revamped repo options

Screenshot 2023年12月17日 at 10-38-59 asdf2.png

The idea here is to break out the repository unit toggling (and their configuration) from /{user}/{repo}/settings, into /{user}/{repo}/settings/units. Things that have more options than a toggle, get their own section, and can be targeted from the navbar on the left.

As a side effect, the "Actions" item from the sidebar would also disappear, and would be folded into the /settings/units page instead. This is partially done in the mockup.

Rationale

This is relatively simple to implement, as it is mostly some UI refactoring. It does not make existing repos cleaner, there's no logic to hide things that may seem unnecessary (more on that later), but it does allow an admin to configure Forgejo so that newly created repositories start with fewer units enabled by default, because enabling more of them becomes more discoverable, and easier, because it is no longer hidden in an "Advanced settings" page, and we provide better navigation too.

The reason I dislike the "hide things that may seem unnecessary" idea is because we'd be second guessing the user. Just because a repository does not have Wiki contents doesn't mean I don't want to show the link. I'd find it reasonable to have it available for any project that wants to encourage people to use the wiki. Same goes for pretty much every other unit: issues, pull requests, actions, releases, packages. Just because there aren't any yet does not mean they should be hidden. An empty releases page can signal that the repo will eventually have releases, it's just isn't there yet. We simply can't know what the project owner intended, and we should not be second guessing them.

Thus, I think the better approach is to make it easier, more straightforward to enable units, and start with a reduced set of units enabled for newly created repositories.

A mockup of the idea I [posted earlier](https://codeberg.org/Codeberg/Community/issues/1318#issuecomment-1359894). This is just an idea at this point, there are a number of issues with the mockups, I just wanted to get to something I can show to demonstrate the idea. If this is something worth exploring further, let me know, and I'll polish it up and make a PR out of it. For the time being, the very much work in progress code is on my [repo-units/ui-refactor](https://codeberg.org/algernon/forgejo/src/branch/repo-units/ui-refactor) branch. ## An "Add more" button on the repo's tab bar: ![Screenshot 2023年12月17日 at 10-38-21 asdf2.png](/attachments/2fa394b6-23b4-4fa6-9200-16f0fce94a43) The button is displayed under the same conditions as the "Settings" label on the right: if the user viewing it is an admin of the repo. The "Add more" label would link to the new `/{user}/{repo}/settings/units` page. Ideally, the label would only show if there are more units to enable. That shouldn't be terribly hard to accomplish, but I didn't get around to it with the mockup. ## Revamped repo options ![Screenshot 2023年12月17日 at 10-38-59 asdf2.png](/attachments/0625708e-388c-48f6-8eea-f27a1018e6ae) The idea here is to break out the repository unit toggling (and their configuration) from `/{user}/{repo}/settings`, into `/{user}/{repo}/settings/units`. Things that have more options than a toggle, get their own section, and can be targeted from the navbar on the left. As a side effect, the "Actions" item from the sidebar would also disappear, and would be folded into the `/settings/units` page instead. This is partially done in the mockup. ## Rationale This is relatively simple to implement, as it is mostly some UI refactoring. It does not make existing repos cleaner, there's no logic to hide things that may seem unnecessary (more on that later), but it does allow an admin to configure Forgejo so that newly created repositories start with fewer units enabled by default, because enabling more of them becomes more discoverable, and easier, because it is no longer hidden in an "Advanced settings" page, and we provide better navigation too. The reason I dislike the "hide things that may seem unnecessary" idea is because we'd be second guessing the user. Just because a repository does not have Wiki contents doesn't mean I don't want to show the link. I'd find it reasonable to have it available for any project that wants to encourage people to use the wiki. Same goes for pretty much every other unit: issues, pull requests, actions, releases, packages. Just because there aren't any *yet* does not mean they should be hidden. An empty releases page can signal that the repo will eventually have releases, it's just isn't there yet. We simply can't know what the project owner intended, and we should not be second guessing them. Thus, I think the better approach is to make it easier, more straightforward to enable units, and start with a reduced set of units enabled for newly created repositories.

Pushed an update to my branch (linked in the previous comment) that makes most things kinda work. That's how far I can push it right now, ran out of steam. It should be reasonably easy to pick this up later (either by someone else, or myself after a bit of recharging).

Shortcomings of the current state of the branch:

  • The "Update settings" button POSTs to /{user}/{repo}/settings, so the user will end up on the repo settings page, rather than when they posted from. This should be reasonably easy to fix: just split the handler.
  • Actions runners aren't displayed on the /settings/units page yet, because those seem to require more context or something - I haven't investigated deeply. There's a commented out line in the template that'd pull those in.
    • The actions section looks a bit weird with the embedded boxes
    • I had to add a style="margin-top:1rem" to the section, because I had trouble figuring out how to make it all line up nicely.
  • The Actions section probably doesn't work at all.
  • The "Add more" button is always displayed, even if all units are already enabled. I can fix it in the template too, but ideally, the backend would let the frontend know whether this needs displaying or not. (Ie, do the checking on the Go side, rather than in templates)
  • Some of the texts aren't localized
  • Some removed texts aren't removed from the localization files

In the long run, I think the best would be to adjust the handlers so that everything on the /settings/units page would get posted back there, rather than to /settings and wherever the actions stuff are currently posted. That would let us wrap the entire thing in a single <form>, and remove the need for the extra styling around Actions.

Pushed an update to my branch (linked in the previous comment) that makes *most* things kinda work. That's how far I can push it right now, ran out of steam. It should be reasonably easy to pick this up later (either by someone else, or myself after a bit of recharging). Shortcomings of the current state of the branch: - The "Update settings" button `POST`s to `/{user}/{repo}/settings`, so the user will end up on the repo settings page, rather than when they posted from. This should be reasonably easy to fix: just split the handler. - Actions runners aren't displayed on the `/settings/units` page yet, because those seem to require more context or something - I haven't investigated deeply. There's a commented out line in the template that'd pull those in. - The actions section looks a bit weird with the embedded boxes - I had to add a `style="margin-top:1rem"` to the section, because I had trouble figuring out how to make it all line up nicely. - The Actions section probably doesn't work at all. - The "Add more" button is *always* displayed, even if all units are already enabled. I can fix it in the template too, but ideally, the backend would let the frontend know whether this needs displaying or not. (Ie, do the checking on the Go side, rather than in templates) - Some of the texts aren't localized - Some removed texts aren't removed from the localization files In the long run, I think the best would be to adjust the handlers so that everything on the `/settings/units` page would get posted back there, rather than to `/settings` and wherever the actions stuff are currently posted. That would let us wrap the entire thing in a single `<form>`, and remove the need for the extra styling around Actions.

Updated my branch, it is now based on top of the current forgejo branch, and it actually works!

  • All new strings are localized and can be translated
  • The form itself issubmitted to /{username}/{repo}/settings/units, rather than /settings
  • The "Add more" button is not displayed if all unit types are already enabled
  • I decided not to pull the "Actions" configuration into this, nor the Code-related ones: they remain a separate page. Might be worth looking into pulling those in, too, but that should be a followup.

I will clean up the history, write some tests, and will submit a pull request later today. It looks very similar to the screenshots above, so I'm not going to post new ones - there will be new ones posted in the upcoming pull request.

Updated [my branch](https://codeberg.org/algernon/forgejo/src/branch/repo-units/ui-refactor), it is now based on top of the current `forgejo` branch, and it actually works! - All new strings are localized and can be translated - The form itself issubmitted to `/{username}/{repo}/settings/units`, rather than `/settings` - The "Add more" button is not displayed if all unit types are already enabled - I decided not to pull the "Actions" configuration into this, nor the Code-related ones: they remain a separate page. Might be worth looking into pulling those in, too, but that should be a followup. I will clean up the history, write some tests, and will submit a pull request later today. It looks very similar to the screenshots above, so I'm not going to post new ones - there will be new ones posted in the upcoming pull request.

Further updates about my proposed approach will be over at forgejo/forgejo#2221

Further updates about my proposed approach will be over at https://codeberg.org/forgejo/forgejo/pulls/2221
Author
Owner
Copy link

This is now implemented, thanks.

This is now implemented, thanks.
Sign in to join this conversation.
No Branch/Tag specified
main
No results found.
Labels
Clear labels
accessibility

Reduces accessibility and is thus a "bug" for certain user groups on Codeberg.
bug

Something is not working the way it should. Does not concern outages.
bug
infrastructure

Errors evidently caused by infrastructure malfunctions or outages
Codeberg

This issue involves Codeberg's downstream modifications and settings and/or Codeberg's structures.
contributions welcome

Please join the discussion and consider contributing a PR!
docs

No bug, but an improvement to the docs or UI description will help
duplicate

This issue or pull request already exists
enhancement

New feature
infrastructure

Involves changes to the server setups, use `bug/infrastructure` for infrastructure-related user errors.
legal

An issue directly involving legal compliance
licence / ToS

involving questions about the ToS, especially licencing compliance
please chill
we are volunteers

Please consider editing your posts and remember that there is a human on the other side. We get that you are frustrated, but it's harder for us to help you this way.
public relations

Things related to Codeberg's external communication
question

More information is needed
question
user support

This issue contains a clearly stated problem. However, it is not clear whether we have to fix anything on Codeberg's end, but we're helping them fix it and/or find the cause.
s/Forgejo

Related to Forgejo. Please also check Forgejo's issue tracker.
s/Forgejo/migration

Migration related issues in Forgejo
s/Pages

Issues related to the Codeberg Pages feature
s/Weblate

Issue is related to the Weblate instance at https://translate.codeberg.org
s/Woodpecker

Woodpecker CI related issue
security

involves improvements to the sites security
service

Add a new service to the Codeberg ecosystem (instead of implementing into Gitea)
upstream

An open issue or pull request to an upstream repository to fix this issue (partially or completely) exists (i.e. Gitea, Forgejo, etc.)
wontfix

Codeberg's current set of contributors are not planning to spend time on delegating this issue.
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
6 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Codeberg/Community#1318
Reference in a new issue
Codeberg/Community
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?