Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

vole
Clone

Read only, no credentials:

https://rodent.software/vole.git

Write over SSH with a registered key:

git clone ssh://git@rodent.software:2222/vole.git

A free and open-source forge that lives in your Git repo.

#51

Add a Projects link to the global bar

merged · by keenan 13d ago · merged into main at d74d4de8 by keenan 13d ago

keenan opened this 13d ago

The global bar offered Activity (and Accounts to an instance admin) and nothing that said “the repository list”. The landing page was reachable only through the emblem, which links there without saying so — and a mark is not a label.

What

<a class="{{if eq .Section "repos"}}active{{end}}" href="/"
   {{if eq .Section "repos"}}aria-current="page"{{end}}>{{icon "grid-2x2"}}Projects</a>
  • Goes first in the bar, before Activity, because it is the widest destination.
  • Marks itself current wherever the repository list is the context. pageSection already maps /, /repos/new and /r/<name> to repos, so a repository page shows Projects as current and the repository’s own tabs carry the finer context — the same rule the existing items follow.
  • The glyph is Lucide grid-2x2, added to the vendored set. The bar could have reused layout-dashboard, but that is already the icon for both “Overview” subnavs (the repository one and the status page one), and a global destination sharing a tab’s glyph reads as a tab.
  • aria-current="page" is set only when the section matches, so the link says “you are here” to a screen reader rather than relying on colour.

Test

server/nav_test.go asserts the link exists, is marked current on both / and /r/<name>, renders an icon, and stops being current on /activity — where Activity takes over. TestTemplatesOnlyUseKnownIcons would have caught a typo in the icon name.

gofmt, go vet ./..., go test ./... and vole workflow run verify (format, vet, build, govulncheck, packaging, links, race) are clean.

Discussion (0)

No discussion yet.