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

Fix #21406: Hide repo information from file view/blame mode #21420

Merged
merged 10 commits into from
Oct 13, 2022

Conversation

neel1996
Copy link
Contributor

@neel1996 neel1996 commented Oct 12, 2022

Summary

The repo information such as description, stats and topics are getting displayed in the top-bar when viewing a file. This has been fixed to display the repo information only while navigating the repo and not while viewing or blaming a file from the repo

Before fix

Screenshot from the issue

image

After the fix

  • Repo homepage

The repo description, topics and summary will be displayed

image

  • When opening a file

The repo description, topic and summary has been conditionally hidden from the view

image

  • When running blame on a file

This was originally not part of the issue #21406. However the fix seems relevant for the blame view as well.

image

  • From within a directory

The repo description, topics and summary will not be displayed

image

Supporting integration tests have also been added.

- Hide repository's description, website link, topics list, and statistics bar while viewing or blaming a file from the repo
- Resolves go-gitea#21406
- Asserts that repo description, topics and summary are not displayed in file view / blame mode
- Resolves go-gitea#21406
@lafriks lafriks added topic/ui Change the appearance of the Gitea UI topic/ui-interaction Change the process how users use Gitea instead of the visual appearance and removed topic/ui Change the appearance of the Gitea UI labels Oct 12, 2022
@lafriks lafriks added this to the 1.18.0 milestone Oct 12, 2022
@ell1e
Copy link

ell1e commented Oct 12, 2022

I think it would make more sense to hide it from the directory view as well, at the very least if it's not the repository root. If someone follows a directory link they probably want to primarily see the directory contents and not all the cluttery top info, right? I'd at least guess that's the case. Edit: other than that it looks great tho!! I'm excited, would be nice to be able to link stuff like the license files without people getting lost trying to actually read it 😊 this is good

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Oct 12, 2022
@lafriks
Copy link
Member

lafriks commented Oct 12, 2022

would be nice to add unit test that repository home page displays description and topics

@lafriks
Copy link
Member

lafriks commented Oct 12, 2022

I'm a bit skeptical about hiding commits/branches/langstats etc submenu. On the second thought yes would be probably ok to hide it also for directory view (except for repo home page of course)

@ell1e
Copy link

ell1e commented Oct 12, 2022

about hiding commits/branches/langstats etc

For what it's worth, they're not hard to find, repo main link to get to main page again and all the more project-wide stuff is back. While that does require more clicks, that's true, having too many things that aren't really about the scope of the file (and that menu isn't, it's about general project info and not e.g. commits or lang stats related to the file) risk confusing the user in that context. So IMHO I think it's better left away. For what it's worth, GitHub also leaves it away. Edit: I'm just a random user though, so ignore me if in doubt

@neel1996
Copy link
Contributor Author

Hi @lafriks,

would be nice to add unit test that repository home page displays description and topics

There is an existing integration test covering the home page view. Will it be fine if I add the required assertions to this existing test? (TestViewAsRepoAdmin)

On the second thought yes would be probably ok to hide it also for directory view (except for repo home page of course)

Will check this part. Is it fine to address this in the same PR ?

@lafriks
Copy link
Member

lafriks commented Oct 12, 2022

yes feel free to add assertions to existing test

Also yes it's ok to address that in this PR

- Asserts if repo description, topics and summary are displayed in the repo home page
- Test enhancement for go-gitea#21406
- The repo description, topics and summary will not be displayed within a directory
- The repo home page will still display the repo info
- Resolves go-gitea#21406
@neel1996
Copy link
Contributor Author

The change which hides the repo info from the directory view has also been incorporated

Before the fix

  • When opening a directory from the repo

image

After the fix

  • From within a directory

The repo description, topics and summary will not be displayed

image

  • Repo homepage

The repo description, topics and summary will be displayed

image

@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 Oct 12, 2022
- Asserts the presence of repo-files-table in directory view
- Revised zero check assertions
@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 Oct 13, 2022
@lafriks lafriks merged commit c35531d into go-gitea:main Oct 13, 2022
zjjhot added a commit to zjjhot/gitea that referenced this pull request Oct 14, 2022
* upstream/main:
  Add cynkra bronze sponsor (go-gitea#21325)
  Run `make fmt` (go-gitea#21437)
  Remove useless `appVer` from JS `window.config` (go-gitea#21445)
  Add support for Chocolatey/NuGet v2 API (go-gitea#21393)
  Fix go-gitea#21406: Hide repo information from file view/blame mode (go-gitea#21420)
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. topic/ui-interaction Change the process how users use Gitea instead of the visual appearance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants