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
internal/web/templates/account.html +1 −1
@@ -163,7 +163,7 @@ never included; a replayed bundle's emails arrive unverified.</p>
163163<section id="cli"><h2>On the command line</h2>
164164<p class="meta">No page here yet, and nothing refusing one: a credential is
165165easier 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
167167gitbay web sessions list # browser sessions
168168gitbay admin ... # instance administration</pre>
169169<p class="meta">All of it works from stock OpenSSH too:
internal/web/templates/blame.html +1 −1
@@ -19,7 +19,7 @@
1919 <p class="subject"><a href="/{{$.Repo.OwnerName}}/{{$.Repo.Name}}/commit/{{.SHA}}">{{.Summary}}</a></p>
2020 <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>
2121 </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}}
2323{{end}}</pre>
2424</div>
2525{{else}}<p class="empty-note">empty file</p>{{end}}
internal/web/templates/build.html +1 −1
@@ -12,5 +12,5 @@
1212{{end}}
1313</div>
1414<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}}
1616{{end}}
internal/web/templates/builds.html +1 −1
@@ -32,7 +32,7 @@
3232{{end}}
3333<details class="editbox"><summary>Status badge</summary>
3434<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>
3636<p class="meta">Add <code>?job=name</code> for one job.</p>
3737</details>
3838<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 @@
99 <p class="meta">{{template "authorname" dict "Name" .AuthorName "User" .AuthorUser "Email" .AuthorEmail}} &lt;{{.AuthorEmail}}&gt; · {{when .Date}}
1010 {{if .CommitterEmail}}<br>committer: &lt;{{.CommitterEmail}}&gt;{{end}}</p>
1111</div>
12<pre class="message">{{.Message}}</pre>
12<pre class="message" tabindex="0">{{.Message}}</pre>
1313{{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}}
1414{{template "difffiles" dict "Files" .DiffFiles "Base" "" "Viewer" ""}}
1515{{end}}
internal/web/templates/login.html +3 −3
@@ -19,16 +19,16 @@ expires in fifteen minutes.</p>
1919<p>Browser sessions are minted over SSH — there is no password. From a machine
2020with your registered key:</p>
2121{{end}}
22<pre class="message">ssh git@{{.Host}} web login</pre>
22<pre class="message" tabindex="0">ssh git@{{.Host}} web login</pre>
2323<p>then open the printed URL within five minutes.</p>
2424{{end}}
2525<h2>New here?</h2>
2626{{if eq .Mode "open"}}<p><a href="/register">Create an account</a> — pick a username, paste your SSH
2727public 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>
2929{{else if eq .Mode "invite"}}<p>This instance is invite-only. With a code from an admin,
3030<a href="/register">create an account</a> — pick a username, paste your SSH public key. Or from
3131the 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>
3333{{else}}<p>This instance is not accepting new accounts.</p>{{end}}
3434{{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>
128128</details>
129129<p class="meta">Deleting an organization is a CLI operation, like deleting a
130130repository: 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>
132132{{end}}
133133{{end}}
internal/web/templates/registered.html +2 −2
@@ -3,13 +3,13 @@
33{{define "content"}}
44<div class="landing">
55<h1>Welcome, {{.Username}}</h1>
6<pre class="quickstart">{{.Message}}</pre>
6<pre class="quickstart" tabindex="0">{{.Message}}</pre>
77<h2>On the web</h2>
88<p>Check your mail for the code, <a href="/login">sign in</a> with an emailed
99link, and paste the code under <a href="/settings">Settings</a>. Then +
1010creates your first repository.</p>
1111<h2>From the terminal</h2>
12<pre class="quickstart">ssh git@{{.Host}} whoami
12<pre class="quickstart" tabindex="0">ssh git@{{.Host}} whoami
1313ssh git@{{.Host}} repo create {{.Username}}/hello
1414gitbay web login # mints a browser session from your terminal</pre>
1515</div>
internal/web/templates/search.html +1 −1
@@ -13,7 +13,7 @@
1313<ul class="matchlist">
1414{{range .Matches}}<li>
1515 <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>
1717</li>
1818{{end}}
1919</ul>
internal/web/templates/tree.html +2 −2
@@ -50,8 +50,8 @@
5050 </div>{{end}}
5151 <div class="clone">
5252 <h2>Clone</h2>
53 <span class="fieldname">SSH</span><pre><code>git clone {{.SSHCloneURL}}</code></pre>
54 <span class="fieldname">HTTPS</span><pre><code>git clone {{.CloneURL}}</code></pre>
53 <span class="fieldname">SSH</span><pre tabindex="0"><code>git clone {{.SSHCloneURL}}</code></pre>
54 <span class="fieldname">HTTPS</span><pre tabindex="0"><code>git clone {{.CloneURL}}</code></pre>
5555 </div>
5656</div>{{end}}
5757</div>