vole
Site
Clone
Read only, no credentials:
https://rodent.software/vole.git
Write over SSH with a registered key:
git clone ssh://git@rodent.software/vole.git
Self-hosted forge that lives in your Git repo.
Give channels and releases their own sections
1999687c755fc6048256709b4d06b5152a5dd593 · Keenan Nemetz · 15d ago · parent 5baf4e73
Give channels and releases their own sections The releases page put channels in a padded card with a heading and then ran the tag list straight after it with no heading at all, so the two lists read as one block. Channels and Releases are now sibling sections, each with its own heading, and both lists use the same panel shape the rest of the web UI uses. The empty states now agree with the CSS rule that a whole region gets .empty-state while a quiet line inside a card stays muted. Channels no longer falls back to a bare muted paragraph; its empty state explains what creating one buys. The Files region on a release page does the same, and drops the "Manage files" link that repeated the button already in the page head. The regression test reads an empty repository's releases page, pins the section order and headings, and counts one empty state per section. It also checks that a release with no files uses an empty state rather than the old muted line. Closes 01M7QSTRTDSAAH7MW0YC1G1TD3.
server/releases_test.go +36
| @@ -119,6 +119,42 @@ func TestReleaseListAndNotes(t *testing.T) { | |||
| 119 | 119 | } | |
| 120 | 120 | } | |
| 121 | 121 | ||
| 122 | // TestReleaseSections covers the page's shape: channels and releases are two | ||
| 123 | // labelled sections, and each one's empty list is a region-level empty state | ||
| 124 | // rather than a bare muted line. The Files region has the same shape. | ||
| 125 | func TestReleaseSectionsAndEmptyStates(t *testing.T) { | ||
| 126 | t.Parallel() | ||
| 127 | f := newFixture(t) | ||
| 128 | _, cookie := f.browserSession(t, f.ownerID) | ||
| 129 | _, page := f.browserGet(t, "/"+f.repo+"/releases", cookie) | ||
| 130 | |||
| 131 | channels := strings.Index(page, `<section id="channels">`) | ||
| 132 | releases := strings.Index(page, `<section id="releases">`) | ||
| 133 | if channels < 0 || releases < 0 || channels > releases { | ||
| 134 | t.Fatalf("releases page does not separate channels from releases:\n%s", page) | ||
| 135 | } | ||
| 136 | for _, heading := range []string{"<h2>Channels</h2>", "<h2>Releases</h2>"} { | ||
| 137 | if !strings.Contains(page, heading) { | ||
| 138 | t.Fatalf("releases page does not show %q:\n%s", heading, page) | ||
| 139 | } | ||
| 140 | } | ||
| 141 | if got := strings.Count(page, `class="empty-state"`); got != 2 { | ||
| 142 | t.Fatalf("releases page has %d empty states, want one per section:\n%s", got, page) | ||
| 143 | } | ||
| 144 | for _, want := range []string{"No channels yet.", "No releases yet."} { | ||
| 145 | if !strings.Contains(page, want) { | ||
| 146 | t.Fatalf("releases page does not show %q:\n%s", want, page) | ||
| 147 | } | ||
| 148 | } | ||
| 149 | |||
| 150 | g := releaseFixture(t) | ||
| 151 | _, page = g.get("/" + g.repo + "/releases/v1.0.0") | ||
| 152 | if !strings.Contains(page, "No files attached yet.") || | ||
| 153 | strings.Contains(page, `<p class="muted">No files attached yet.`) { | ||
| 154 | t.Fatalf("release page does not show the files empty state:\n%s", page) | ||
| 155 | } | ||
| 156 | } | ||
| 157 | |||
| 122 | 158 | // TestReleaseNotesAreSanitised matters because the notes are somebody's markdown: | |
| 123 | 159 | // a tag message is pushed content, so it goes through the same renderer as every | |
| 124 | 160 | // other pushed body. | |