[v10.0/forgejo] ui: update language stats layout and click behavior (#6854)

**Backport:** https://codeberg.org/forgejo/forgejo/pulls/6700

Fix regression of https://codeberg.org/forgejo/forgejo/pulls/6344. It was reported by @Beowulf.

JS toggle [used](49c5102b40/templates/repo/sub_menu.tmpl (L38)) a selector which was broken by that PR, which caused the legend to appear separately instead of replacing the primary repo info.

## Changes

* use clear IDs `language-stats-bar` and `language-stats-legend`
* add simple e2e test

Instead of restoring the previous behavior, I moved the legend under the stats bar. To me it didn't make a lot of sense in the first place to replace the information in the primary bar with with completely different information. It did not save much space either.

Co-authored-by: 0ko <0ko@noreply.codeberg.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6854
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
This commit is contained in:
forgejo-backport-action 2025-02-08 13:52:03 +00:00 committed by Gusted
parent 6ef900899e
commit bdb78d42b6
3 changed files with 28 additions and 8 deletions

View file

@ -2046,13 +2046,14 @@ details.repo-search-result summary::marker {
font-weight: var(--font-weight-medium);
}
.repository .repository-summary .segment.language-stats {
.repository .repository-summary #language-stats-bar {
display: flex;
gap: 2px;
padding: 0;
height: 10px;
white-space: nowrap;
border-radius: 0 0 3px 3px !important;
border-top-left-radius: 0 !important;
border-top-right-radius: 0 !important;
overflow: hidden;
}