Commit 85130480d7

85130480d73a6cbc7827a6e16599f9c789551164

parent: 7c4afe2c80

Verified · cmc

cmc <hello@cleberg.net> · 2026-09-19 23:57 UTC

web: every pre block takes focus

A pre scrolls sideways, which makes it a scrollable region: without a
focusable child a keyboard cannot reach a blame view, a build log or a
search match. The rendered-markup blocks already get the attribute from
focusableBlocks; the authored ones now carry it too.

Ref #226

Layout: unified · split

internal/web/templates/account.html +1 −1
@@ -163,7 +163,7 @@ never included; a replayed bundle's emails arrive unverified.</p>
163<section id="cli"><h2>On the command line</h2> 163<section id="cli"><h2>On the command line</h2>
164<p class="meta">No page here yet, and nothing refusing one: a credential is 164<p class="meta">No page here yet, and nothing refusing one: a credential is
165easier to pipe than to paste, and a minted token is shown once.</p> 165easier to pipe than to paste, and a minted token is shown once.</p>
166<pre class="message">gitbay auth token create --name laptop # API tokens 166<pre class="message" tabindex="0">gitbay auth token create --name laptop # API tokens
167gitbay web sessions list # browser sessions 167gitbay web sessions list # browser sessions
168gitbay admin ... # instance administration</pre> 168gitbay admin ... # instance administration</pre>
169<p class="meta">All of it works from stock OpenSSH too: 169<p class="meta">All of it works from stock OpenSSH too:
internal/web/templates/blame.html +1 −1
@@ -19,7 +19,7 @@
19 <p class="subject"><a href="/{{$.Repo.OwnerName}}/{{$.Repo.Name}}/commit/{{.SHA}}">{{.Summary}}</a></p> 19 <p class="subject"><a href="/{{$.Repo.OwnerName}}/{{$.Repo.Name}}/commit/{{.SHA}}">{{.Summary}}</a></p>
20 <p class="meta"><code><a href="/{{$.Repo.OwnerName}}/{{$.Repo.Name}}/commit/{{.SHA}}">{{.ShortSHA}}</a></code> <span title="{{.AuthorEmail}}">{{.AuthorName}}</span> · {{when .Date}} {{template "sigbadge" .Sig}}</p> 20 <p class="meta"><code><a href="/{{$.Repo.OwnerName}}/{{$.Repo.Name}}/commit/{{.SHA}}">{{.ShortSHA}}</a></code> <span title="{{.AuthorEmail}}">{{.AuthorName}}</span> · {{when .Date}} {{template "sigbadge" .Sig}}</p>
21 </div> 21 </div>
22 <pre class="blamecode">{{range .Numbered}}<span class="lineno">{{.N}}</span>{{.Text}} 22 <pre class="blamecode" tabindex="0">{{range .Numbered}}<span class="lineno">{{.N}}</span>{{.Text}}
23{{end}}</pre> 23{{end}}</pre>
24</div> 24</div>
25{{else}}<p class="empty-note">empty file</p>{{end}} 25{{else}}<p class="empty-note">empty file</p>{{end}}
internal/web/templates/build.html +1 −1
@@ -12,5 +12,5 @@
12{{end}} 12{{end}}
13</div> 13</div>
14<p class="meta">{{.Build.Job}} on {{.Build.Ref}} · <code><a href="/{{.Repo.OwnerName}}/{{.Repo.Name}}/commit/{{.Build.SHA}}">{{printf "%.10s" .Build.SHA}}</a></code> · queued {{when .Build.CreatedAt}}{{if .Build.FinishedAt}} · finished {{when .Build.FinishedAt}}{{end}}</p> 14<p class="meta">{{.Build.Job}} on {{.Build.Ref}} · <code><a href="/{{.Repo.OwnerName}}/{{.Repo.Name}}/commit/{{.Build.SHA}}">{{printf "%.10s" .Build.SHA}}</a></code> · queued {{when .Build.CreatedAt}}{{if .Build.FinishedAt}} · finished {{when .Build.FinishedAt}}{{end}}</p>
15{{if .Log}}<pre class="code buildlog">{{.Log}}</pre>{{else}}<p class="empty-note">no log yet</p>{{end}} 15{{if .Log}}<pre class="code buildlog" tabindex="0">{{.Log}}</pre>{{else}}<p class="empty-note">no log yet</p>{{end}}
16{{end}} 16{{end}}
internal/web/templates/builds.html +1 −1
@@ -32,7 +32,7 @@
32{{end}} 32{{end}}
33<details class="editbox"><summary>Status badge</summary> 33<details class="editbox"><summary>Status badge</summary>
34<p class="meta">Paste into a README; it shows the newest build's state.</p> 34<p class="meta">Paste into a README; it shows the newest build's state.</p>
35<pre class="code">[![build](https://{{.Host}}/{{.Repo.OwnerName}}/{{.Repo.Name}}/badge/build.svg)](https://{{.Host}}/{{.Repo.OwnerName}}/{{.Repo.Name}}/builds)</pre> 35<pre class="code" tabindex="0">[![build](https://{{.Host}}/{{.Repo.OwnerName}}/{{.Repo.Name}}/badge/build.svg)](https://{{.Host}}/{{.Repo.OwnerName}}/{{.Repo.Name}}/builds)</pre>
36<p class="meta">Add <code>?job=name</code> for one job.</p> 36<p class="meta">Add <code>?job=name</code> for one job.</p>
37</details> 37</details>
38<p class="meta">{{len .Runs}} run{{if ne (len .Runs) 1}}s{{end}}{{if or .Filter.Ref .Filter.Status .Filter.Job}}, <a href="?">clear filters</a>{{end}}</p> 38<p class="meta">{{len .Runs}} run{{if ne (len .Runs) 1}}s{{end}}{{if or .Filter.Ref .Filter.Status .Filter.Job}}, <a href="?">clear filters</a>{{end}}</p>
internal/web/templates/commit.html +1 −1
@@ -9,7 +9,7 @@
9 <p class="meta">{{template "authorname" dict "Name" .AuthorName "User" .AuthorUser "Email" .AuthorEmail}} &lt;{{.AuthorEmail}}&gt; · {{when .Date}} 9 <p class="meta">{{template "authorname" dict "Name" .AuthorName "User" .AuthorUser "Email" .AuthorEmail}} &lt;{{.AuthorEmail}}&gt; · {{when .Date}}
10 {{if .CommitterEmail}}<br>committer: &lt;{{.CommitterEmail}}&gt;{{end}}</p> 10 {{if .CommitterEmail}}<br>committer: &lt;{{.CommitterEmail}}&gt;{{end}}</p>
11</div> 11</div>
12<pre class="message">{{.Message}}</pre> 12<pre class="message" tabindex="0">{{.Message}}</pre>
13{{if .DiffTruncated}}<p class="error" role="alert">This patch is larger than 4 MiB and is cut off below. Clone the repository to see all of it.</p>{{end}} 13{{if .DiffTruncated}}<p class="error" role="alert">This patch is larger than 4 MiB and is cut off below. Clone the repository to see all of it.</p>{{end}}
14{{template "difffiles" dict "Files" .DiffFiles "Base" "" "Viewer" ""}} 14{{template "difffiles" dict "Files" .DiffFiles "Base" "" "Viewer" ""}}
15{{end}} 15{{end}}
internal/web/templates/login.html +3 −3
@@ -19,16 +19,16 @@ expires in fifteen minutes.</p>
19<p>Browser sessions are minted over SSH — there is no password. From a machine 19<p>Browser sessions are minted over SSH — there is no password. From a machine
20with your registered key:</p> 20with your registered key:</p>
21{{end}} 21{{end}}
22<pre class="message">ssh git@{{.Host}} web login</pre> 22<pre class="message" tabindex="0">ssh git@{{.Host}} web login</pre>
23<p>then open the printed URL within five minutes.</p> 23<p>then open the printed URL within five minutes.</p>
24{{end}} 24{{end}}
25<h2>New here?</h2> 25<h2>New here?</h2>
26{{if eq .Mode "open"}}<p><a href="/register">Create an account</a> — pick a username, paste your SSH 26{{if eq .Mode "open"}}<p><a href="/register">Create an account</a> — pick a username, paste your SSH
27public key, verify your email. Or from the terminal:</p> 27public key, verify your email. Or from the terminal:</p>
28<pre class="message">ssh git@{{.Host}} register --username you --email you@example.org</pre> 28<pre class="message" tabindex="0">ssh git@{{.Host}} register --username you --email you@example.org</pre>
29{{else if eq .Mode "invite"}}<p>This instance is invite-only. With a code from an admin, 29{{else if eq .Mode "invite"}}<p>This instance is invite-only. With a code from an admin,
30<a href="/register">create an account</a> — pick a username, paste your SSH public key. Or from 30<a href="/register">create an account</a> — pick a username, paste your SSH public key. Or from
31the terminal:</p> 31the terminal:</p>
32<pre class="message">ssh git@{{.Host}} register --username you --invite &lt;code&gt;</pre> 32<pre class="message" tabindex="0">ssh git@{{.Host}} register --username you --invite &lt;code&gt;</pre>
33{{else}}<p>This instance is not accepting new accounts.</p>{{end}} 33{{else}}<p>This instance is not accepting new accounts.</p>{{end}}
34{{end}} 34{{end}}
internal/web/templates/owner.html +1 −1
@@ -128,6 +128,6 @@ of a team get its role on every repository it is granted.</p>
128</details> 128</details>
129<p class="meta">Deleting an organization is a CLI operation, like deleting a 129<p class="meta">Deleting an organization is a CLI operation, like deleting a
130repository: it wants a typed confirmation rather than a button.</p> 130repository: it wants a typed confirmation rather than a button.</p>
131<pre class="message">gitbay org delete {{$org}} --yes</pre> 131<pre class="message" tabindex="0">gitbay org delete {{$org}} --yes</pre>
132{{end}} 132{{end}}
133{{end}} 133{{end}}
internal/web/templates/registered.html +2 −2
@@ -3,13 +3,13 @@
3{{define "content"}} 3{{define "content"}}
4<div class="landing"> 4<div class="landing">
5<h1>Welcome, {{.Username}}</h1> 5<h1>Welcome, {{.Username}}</h1>
6<pre class="quickstart">{{.Message}}</pre> 6<pre class="quickstart" tabindex="0">{{.Message}}</pre>
7<h2>On the web</h2> 7<h2>On the web</h2>
8<p>Check your mail for the code, <a href="/login">sign in</a> with an emailed 8<p>Check your mail for the code, <a href="/login">sign in</a> with an emailed
9link, and paste the code under <a href="/settings">Settings</a>. Then + 9link, and paste the code under <a href="/settings">Settings</a>. Then +
10creates your first repository.</p> 10creates your first repository.</p>
11<h2>From the terminal</h2> 11<h2>From the terminal</h2>
12<pre class="quickstart">ssh git@{{.Host}} whoami 12<pre class="quickstart" tabindex="0">ssh git@{{.Host}} whoami
13ssh git@{{.Host}} repo create {{.Username}}/hello 13ssh git@{{.Host}} repo create {{.Username}}/hello
14gitbay web login # mints a browser session from your terminal</pre> 14gitbay web login # mints a browser session from your terminal</pre>
15</div> 15</div>
internal/web/templates/search.html +1 −1
@@ -13,7 +13,7 @@
13<ul class="matchlist"> 13<ul class="matchlist">
14{{range .Matches}}<li> 14{{range .Matches}}<li>
15 <a class="matchpath" href="/{{$.Repo.OwnerName}}/{{$.Repo.Name}}/blob/{{$.Ref}}/{{.Path}}#L{{.Line}}">{{.Path}}:{{.Line}}</a> 15 <a class="matchpath" href="/{{$.Repo.OwnerName}}/{{$.Repo.Name}}/blob/{{$.Ref}}/{{.Path}}#L{{.Line}}">{{.Path}}:{{.Line}}</a>
16 <pre class="matchline">{{.TextHTML}}</pre> 16 <pre class="matchline" tabindex="0">{{.TextHTML}}</pre>
17</li> 17</li>
18{{end}} 18{{end}}
19</ul> 19</ul>
internal/web/templates/tree.html +2 −2
@@ -50,8 +50,8 @@
50 </div>{{end}} 50 </div>{{end}}
51 <div class="clone"> 51 <div class="clone">
52 <h2>Clone</h2> 52 <h2>Clone</h2>
53 <span class="fieldname">SSH</span><pre><code>git clone {{.SSHCloneURL}}</code></pre> 53 <span class="fieldname">SSH</span><pre tabindex="0"><code>git clone {{.SSHCloneURL}}</code></pre>
54 <span class="fieldname">HTTPS</span><pre><code>git clone {{.CloneURL}}</code></pre> 54 <span class="fieldname">HTTPS</span><pre tabindex="0"><code>git clone {{.CloneURL}}</code></pre>
55 </div> 55 </div>
56</div>{{end}} 56</div>{{end}}
57</div> 57</div>