Sign in

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

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.

Make releases and channels peer H1 sections

0bc4bc33836b89429fdbdb969083ad899407e927 · Keenan Nemetz · 15d ago · parent 1999687c

Make releases and channels peer H1 sections

Both lists now have their own H1 header, subtitle, and action. Releases comes
first with the New release button; Channels follows with the New channel
button. The two are separated by a rule, and each keeps the compact header
scale a repository page uses so neither reads as a subheading of the other.

The count line is gone. "1 tag(s)" said nothing about what a release or a
channel is, so the subtitles explain that instead: annotated tags with notes,
files, and source archives; channels as a stable name for a release.

The empty states stay region-level, and the test now pins the section order,
both H1s, both subtitles, and which header owns which action.

Closes 01M7QSTRTDSAAH7MW0YC1G1TD3.

server/releases_test.go +28−8

@@ -119,25 +119,45 @@ 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.
122 // TestReleaseSections covers the page's shape: releases and channels are two
123 // H1 sections with their own actions, and each one's empty list is a
124 // region-level empty state rather than a bare muted line. The Files region has
125 // the same shape.
125 126 func TestReleaseSectionsAndEmptyStates(t *testing.T) {
126 127 t.Parallel()
127 128 f := newFixture(t)
128 129 _, cookie := f.browserSession(t, f.ownerID)
129 130 _, page := f.browserGet(t, "/"+f.repo+"/releases", cookie)
130 131
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)
132 releases := strings.Index(page, `<section id="releases"`)
133 channels := strings.Index(page, `<section id="channels"`)
134 if releases < 0 || channels < 0 || releases > channels {
135 t.Fatalf("releases page does not put releases above channels:\n%s", page)
135 136 }
136 for _, heading := range []string{"<h2>Channels</h2>", "<h2>Releases</h2>"} {
137 for _, heading := range []string{"<h1>Releases</h1>", "<h1>Channels</h1>"} {
137 138 if !strings.Contains(page, heading) {
138 139 t.Fatalf("releases page does not show %q:\n%s", heading, page)
139 140 }
140 141 }
142 for _, sub := range []string{
143 "Annotated tags with notes, attached files, and source archives.",
144 "A stable name for a release, so its files stay at one URL when the release moves.",
145 } {
146 if !strings.Contains(page, sub) {
147 t.Fatalf("releases page does not show the subtitle %q:\n%s", sub, page)
148 }
149 }
150 if strings.Contains(page, "tag(s)") {
151 t.Fatalf("releases page still uses a count as its subtitle:\n%s", page)
152 }
153 newRelease := strings.Index(page, "/releases/new")
154 newChannel := strings.Index(page, "/releases/channels/new")
155 if newRelease < releases || newRelease > channels {
156 t.Fatalf("New release is not with the releases header:\n%s", page)
157 }
158 if newChannel < channels {
159 t.Fatalf("New channel is not with the channels header:\n%s", page)
160 }
141 161 if got := strings.Count(page, `class="empty-state"`); got != 2 {
142 162 t.Fatalf("releases page has %d empty states, want one per section:\n%s", got, page)
143 163 }