v0.35.2 80d5067

overlays_templ.go RawHistoryFolder

1// Code generated by templ - DO NOT EDIT.
2
3// templ: version: v0.3.1020
4// SPDX-License-Identifier: AGPL-3.0-or-later
5
6package web
7
8//lint:file-ignore SA4006 This context is only used if a nested component is present.
9
10import "github.com/a-h/templ"
11import templruntime "github.com/a-h/templ/runtime"
12
13import (
14	"strconv"
15	"strings"
16)
17
18// OverlayHelp is the keyboard map panel; the keys of the merge request page
19// show on that page only.
20func OverlayHelp(mr bool) templ.Component {
21	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
22		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
23		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
24			return templ_7745c5c3_CtxErr
25		}
26		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
27		if !templ_7745c5c3_IsBuffer {
28			defer func() {
29				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
30				if templ_7745c5c3_Err == nil {
31					templ_7745c5c3_Err = templ_7745c5c3_BufErr
32				}
33			}()
34		}
35		ctx = templ.InitializeContext(ctx)
36		templ_7745c5c3_Var1 := templ.GetChildren(ctx)
37		if templ_7745c5c3_Var1 == nil {
38			templ_7745c5c3_Var1 = templ.NopComponent
39		}
40		ctx = templ.ClearChildren(ctx)
41		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "<dialog id=\"panel-help\" class=\"panel modal\" aria-label=\"Keyboard shortcuts\" hx-on:keydown=\"event.key === 'Escape' && (event.preventDefault(), this.close())\" hx-on:click=\"event.target === this && this.close()\"><div class=\"panel-head\"><h2>Keyboard shortcuts</h2><button type=\"button\" class=\"panel-x\" aria-label=\"Close (esc)\" hx-on:click=\"closest('dialog').close()\"><kbd>esc</kbd> close</button></div><div class=\"keys-pref\"><label><input type=\"checkbox\" id=\"keys-off\" aria-describedby=\"keys-note\" hx-on:change=\"ermite.setKeysOff(this.checked)\"> Turn off single-key shortcuts</label><p id=\"keys-note\" class=\"dim\">Single-key shortcuts are on. ctrl k and esc work whatever this says.</p></div><dl class=\"keys\"><div><dt><kbd>ctrl k</kbd> <kbd>:</kbd></dt><dd>go to a section, branch, tag, file or repository</dd></div><div><dt><kbd>?</kbd></dt><dd>this list</dd></div><div><dt><kbd>j</kbd> <kbd>k</kbd></dt><dd>move the row cursor down / up</dd></div><div><dt><kbd>enter</kbd></dt><dd>open the row under the cursor; on Files, a directory opens or closes in place</dd></div><div><dt><kbd>↑</kbd> <kbd>↓</kbd> <kbd>←</kbd> <kbd>→</kbd> <kbd>home</kbd> <kbd>end</kbd></dt><dd>in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file</dd></div><div><dt><kbd>l</kbd> <kbd>h</kbd></dt><dd>on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls</dd></div><div><dt><kbd>g g</kbd> <kbd>G</kbd></dt><dd>first / last row</dd></div><div><dt><kbd>/</kbd></dt><dd>filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)</dd></div><div><dt><kbd>b</kbd></dt><dd>")
42		if templ_7745c5c3_Err != nil {
43			return templ_7745c5c3_Err
44		}
45		var templ_7745c5c3_Var2 string
46		templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs("switch")
47		if templ_7745c5c3_Err != nil {
48			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/overlays.templ`, Line: 28, Col: 43}
49		}
50		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
51		if templ_7745c5c3_Err != nil {
52			return templ_7745c5c3_Err
53		}
54		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, " branch or tag</dd></div><div><dt><kbd>g s</kbd> <kbd>g f</kbd> <kbd>g c</kbd> <kbd>g b</kbd> <kbd>g m</kbd> <kbd>g i</kbd> <kbd>g r</kbd> <kbd>g a</kbd></dt><dd>tabs: summary, files, commits, branches &amp; tags, merge requests, issues, releases, actions (when available)</dd></div>")
55		if templ_7745c5c3_Err != nil {
56			return templ_7745c5c3_Err
57		}
58		if SignedIn(ctx) {
59			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "<div><dt><kbd>I</kbd></dt><dd>inbox</dd></div>")
60			if templ_7745c5c3_Err != nil {
61				return templ_7745c5c3_Err
62			}
63		}
64		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "<div><dt><kbd>g h</kbd></dt><dd>home</dd></div><div><dt><kbd>w</kbd></dt><dd>wide mode: use the whole width of the screen, or not (remembered)</dd></div><div><dt><kbd>y</kbd></dt><dd>copy a permalink pinned to the commit</dd></div><div><dt><kbd>d</kbd> <kbd>u</kbd> <kbd>x</kbd></dt><dd>diff: split / unified / collapse or expand all</dd></div><div><dt><kbd>e</kbd> <kbd>E</kbd></dt><dd>diff: the whole file in view / every file, with the lines the hunks hide</dd></div><div><dt><kbd>n</kbd></dt><dd>merge request: next note in the diff</dd></div>")
65		if templ_7745c5c3_Err != nil {
66			return templ_7745c5c3_Err
67		}
68		if mr {
69			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "<div><dt><kbd>l</kbd></dt><dd>merge request: the list of files (j k move, enter opens, esc back)</dd></div><div><dt><kbd>M</kbd></dt><dd>merge request: the merge menu; there 1–3 pick the mode, D deletes the branch, enter merges</dd></div><div><dt><kbd>R</kbd></dt><dd>merge request: mark the head read</dd></div>")
70			if templ_7745c5c3_Err != nil {
71				return templ_7745c5c3_Err
72			}
73		}
74		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "<div><dt><kbd>esc</kbd></dt><dd>close a dialog, leave a field</dd></div></dl></dialog>")
75		if templ_7745c5c3_Err != nil {
76			return templ_7745c5c3_Err
77		}
78		return nil
79	})
80}
81
82// OverlayRefs is the ref switcher. It exists only inside a repository.
83func OverlayRefs(l Layout) templ.Component {
84	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
85		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
86		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
87			return templ_7745c5c3_CtxErr
88		}
89		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
90		if !templ_7745c5c3_IsBuffer {
91			defer func() {
92				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
93				if templ_7745c5c3_Err == nil {
94					templ_7745c5c3_Err = templ_7745c5c3_BufErr
95				}
96			}()
97		}
98		ctx = templ.InitializeContext(ctx)
99		templ_7745c5c3_Var3 := templ.GetChildren(ctx)
100		if templ_7745c5c3_Var3 == nil {
101			templ_7745c5c3_Var3 = templ.NopComponent
102		}
103		ctx = templ.ClearChildren(ctx)
104		if l.Ref != "" {
105			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "<dialog id=\"panel-refs\" class=\"panel modal\" aria-label=\"Switch ref\" hx-on:keydown=\"event.key === 'Escape' && (event.preventDefault(), this.close())\" hx-on:click=\"event.target === this && this.close()\"><div class=\"panel-head\"><label for=\"refs-filter\" class=\"sr\">filter branches and tags</label> <input id=\"refs-filter\" type=\"search\" placeholder=\"Switch branch or tag…\" autocomplete=\"off\" data-pick=\"#panel-refs li\" hx-on:input=\"ermite.filter(this)\"> <button type=\"button\" class=\"panel-x\" aria-label=\"Close (esc)\" hx-on:click=\"closest('dialog').close()\"><kbd>esc</kbd></button></div><div class=\"panel-cols\" data-picklist><section aria-label=\"Branches\"><h2>Branches <span class=\"count\">")
106			if templ_7745c5c3_Err != nil {
107				return templ_7745c5c3_Err
108			}
109			var templ_7745c5c3_Var4 string
110			templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(len(l.Heads)))
111			if templ_7745c5c3_Err != nil {
112				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/overlays.templ`, Line: 67, Col: 58}
113			}
114			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
115			if templ_7745c5c3_Err != nil {
116				return templ_7745c5c3_Err
117			}
118			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "</span></h2><ul>")
119			if templ_7745c5c3_Err != nil {
120				return templ_7745c5c3_Err
121			}
122			for _, r := range l.Heads {
123				templ_7745c5c3_Err = refItem(r).Render(ctx, templ_7745c5c3_Buffer)
124				if templ_7745c5c3_Err != nil {
125					return templ_7745c5c3_Err
126				}
127			}
128			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "</ul></section><section aria-label=\"Tags\"><h2>Tags <span class=\"count\">")
129			if templ_7745c5c3_Err != nil {
130				return templ_7745c5c3_Err
131			}
132			var templ_7745c5c3_Var5 string
133			templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(len(l.Tags)))
134			if templ_7745c5c3_Err != nil {
135				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/overlays.templ`, Line: 75, Col: 53}
136			}
137			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
138			if templ_7745c5c3_Err != nil {
139				return templ_7745c5c3_Err
140			}
141			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "</span></h2><ul>")
142			if templ_7745c5c3_Err != nil {
143				return templ_7745c5c3_Err
144			}
145			for _, r := range l.Tags {
146				templ_7745c5c3_Err = refItem(r).Render(ctx, templ_7745c5c3_Buffer)
147				if templ_7745c5c3_Err != nil {
148					return templ_7745c5c3_Err
149				}
150			}
151			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "</ul></section></div></dialog>")
152			if templ_7745c5c3_Err != nil {
153				return templ_7745c5c3_Err
154			}
155		}
156		return nil
157	})
158}
159
160func refItem(r RefItem) templ.Component {
161	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
162		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
163		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
164			return templ_7745c5c3_CtxErr
165		}
166		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
167		if !templ_7745c5c3_IsBuffer {
168			defer func() {
169				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
170				if templ_7745c5c3_Err == nil {
171					templ_7745c5c3_Err = templ_7745c5c3_BufErr
172				}
173			}()
174		}
175		ctx = templ.InitializeContext(ctx)
176		templ_7745c5c3_Var6 := templ.GetChildren(ctx)
177		if templ_7745c5c3_Var6 == nil {
178			templ_7745c5c3_Var6 = templ.NopComponent
179		}
180		ctx = templ.ClearChildren(ctx)
181		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "<li><a href=\"")
182		if templ_7745c5c3_Err != nil {
183			return templ_7745c5c3_Err
184		}
185		var templ_7745c5c3_Var7 templ.SafeURL
186		templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(r.Href))
187		if templ_7745c5c3_Err != nil {
188			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/overlays.templ`, Line: 90, Col: 31}
189		}
190		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
191		if templ_7745c5c3_Err != nil {
192			return templ_7745c5c3_Err
193		}
194		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "\"")
195		if templ_7745c5c3_Err != nil {
196			return templ_7745c5c3_Err
197		}
198		if r.Current {
199			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, " aria-current=\"true\"")
200			if templ_7745c5c3_Err != nil {
201				return templ_7745c5c3_Err
202			}
203		}
204		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "><span class=\"mark\" aria-hidden=\"true\">")
205		if templ_7745c5c3_Err != nil {
206			return templ_7745c5c3_Err
207		}
208		if r.Current {
209			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, "●")
210			if templ_7745c5c3_Err != nil {
211				return templ_7745c5c3_Err
212			}
213		} else {
214			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "&nbsp;")
215			if templ_7745c5c3_Err != nil {
216				return templ_7745c5c3_Err
217			}
218		}
219		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "</span>")
220		if templ_7745c5c3_Err != nil {
221			return templ_7745c5c3_Err
222		}
223		var templ_7745c5c3_Var8 string
224		templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(r.Name)
225		if templ_7745c5c3_Err != nil {
226			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/overlays.templ`, Line: 101, Col: 18}
227		}
228		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8))
229		if templ_7745c5c3_Err != nil {
230			return templ_7745c5c3_Err
231		}
232		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "</a></li>")
233		if templ_7745c5c3_Err != nil {
234			return templ_7745c5c3_Err
235		}
236		return nil
237	})
238}
239
240// OverlayCmd is the ":" command line: one filterable list mixing sections,
241// refs and repos.
242func OverlayCmd(items []CmdItem) templ.Component {
243	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
244		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
245		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
246			return templ_7745c5c3_CtxErr
247		}
248		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
249		if !templ_7745c5c3_IsBuffer {
250			defer func() {
251				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
252				if templ_7745c5c3_Err == nil {
253					templ_7745c5c3_Err = templ_7745c5c3_BufErr
254				}
255			}()
256		}
257		ctx = templ.InitializeContext(ctx)
258		templ_7745c5c3_Var9 := templ.GetChildren(ctx)
259		if templ_7745c5c3_Var9 == nil {
260			templ_7745c5c3_Var9 = templ.NopComponent
261		}
262		ctx = templ.ClearChildren(ctx)
263		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "<dialog id=\"panel-cmd\" class=\"panel modal\" aria-label=\"Go to\" hx-on:close=\"ermiteFinder.paletteClose()\" hx-on:keydown=\"event.key === 'Escape' && (event.preventDefault(), this.close())\" hx-on:click=\"event.target === this && this.close()\"><div class=\"panel-head\"><label for=\"cmd-q\" class=\"sr\">go to</label> <input id=\"cmd-q\" type=\"search\" placeholder=\"Go to a section, branch, tag, file or repository…\" autocomplete=\"off\" spellcheck=\"false\" role=\"combobox\" aria-autocomplete=\"list\" aria-expanded=\"true\" aria-controls=\"cmd-list\" aria-activedescendant=\"cmd-o0\" hx-on:input=\"ermite.cmdFilter(this); ermiteFinder.palette(this)\" hx-on:keydown=\"ermite.cmdKey(event)\"> <button type=\"button\" class=\"panel-x\" aria-label=\"Close (esc)\" hx-on:click=\"closest('dialog').close()\"><kbd>esc</kbd></button></div><ul id=\"cmd-list\" class=\"cmd-list\" role=\"listbox\" aria-label=\"Targets\">")
264		if templ_7745c5c3_Err != nil {
265			return templ_7745c5c3_Err
266		}
267		for i, c := range items {
268			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "<li id=\"")
269			if templ_7745c5c3_Err != nil {
270				return templ_7745c5c3_Err
271			}
272			var templ_7745c5c3_Var10 string
273			templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.ResolveAttributeValue("cmd-o" + itoa(i))
274			if templ_7745c5c3_Err != nil {
275				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/overlays.templ`, Line: 130, Col: 30}
276			}
277			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var10)
278			if templ_7745c5c3_Err != nil {
279				return templ_7745c5c3_Err
280			}
281			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "\" role=\"option\" aria-selected=\"")
282			if templ_7745c5c3_Err != nil {
283				return templ_7745c5c3_Err
284			}
285			var templ_7745c5c3_Var11 string
286			templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.ResolveAttributeValue(strconv.FormatBool(i == 0))
287			if templ_7745c5c3_Err != nil {
288				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/overlays.templ`, Line: 130, Col: 89}
289			}
290			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var11)
291			if templ_7745c5c3_Err != nil {
292				return templ_7745c5c3_Err
293			}
294			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "\" data-k=\"")
295			if templ_7745c5c3_Err != nil {
296				return templ_7745c5c3_Err
297			}
298			var templ_7745c5c3_Var12 string
299			templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.ResolveAttributeValue(strings.ToLower(c.Kind + " " + c.Label))
300			if templ_7745c5c3_Err != nil {
301				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/overlays.templ`, Line: 130, Col: 140}
302			}
303			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var12)
304			if templ_7745c5c3_Err != nil {
305				return templ_7745c5c3_Err
306			}
307			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, "\"")
308			if templ_7745c5c3_Err != nil {
309				return templ_7745c5c3_Err
310			}
311			if i == 0 {
312				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, " data-cursor")
313				if templ_7745c5c3_Err != nil {
314					return templ_7745c5c3_Err
315				}
316			}
317			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 26, "><a role=\"presentation\" data-href=\"")
318			if templ_7745c5c3_Err != nil {
319				return templ_7745c5c3_Err
320			}
321			var templ_7745c5c3_Var13 string
322			templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.ResolveAttributeValue(c.Href)
323			if templ_7745c5c3_Err != nil {
324				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/overlays.templ`, Line: 130, Col: 208}
325			}
326			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var13)
327			if templ_7745c5c3_Err != nil {
328				return templ_7745c5c3_Err
329			}
330			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 27, "\"><span class=\"lbl\">")
331			if templ_7745c5c3_Err != nil {
332				return templ_7745c5c3_Err
333			}
334			var templ_7745c5c3_Var14 string
335			templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(c.Label)
336			if templ_7745c5c3_Err != nil {
337				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/overlays.templ`, Line: 130, Col: 238}
338			}
339			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14))
340			if templ_7745c5c3_Err != nil {
341				return templ_7745c5c3_Err
342			}
343			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 28, "</span><span class=\"k\">")
344			if templ_7745c5c3_Err != nil {
345				return templ_7745c5c3_Err
346			}
347			var templ_7745c5c3_Var15 string
348			templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(c.Kind)
349			if templ_7745c5c3_Err != nil {
350				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/overlays.templ`, Line: 130, Col: 271}
351			}
352			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15))
353			if templ_7745c5c3_Err != nil {
354				return templ_7745c5c3_Err
355			}
356			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 29, "</span></a></li>")
357			if templ_7745c5c3_Err != nil {
358				return templ_7745c5c3_Err
359			}
360		}
361		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 30, "<li id=\"")
362		if templ_7745c5c3_Err != nil {
363			return templ_7745c5c3_Err
364		}
365		var templ_7745c5c3_Var16 string
366		templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.ResolveAttributeValue("cmd-o" + itoa(len(items)))
367		if templ_7745c5c3_Err != nil {
368			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/overlays.templ`, Line: 132, Col: 38}
369		}
370		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var16)
371		if templ_7745c5c3_Err != nil {
372			return templ_7745c5c3_Err
373		}
374		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 31, "\" role=\"option\" aria-selected=\"")
375		if templ_7745c5c3_Err != nil {
376			return templ_7745c5c3_Err
377		}
378		var templ_7745c5c3_Var17 string
379		templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.ResolveAttributeValue(strconv.FormatBool(len(items) == 0))
380		if templ_7745c5c3_Err != nil {
381			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/overlays.templ`, Line: 132, Col: 106}
382		}
383		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var17)
384		if templ_7745c5c3_Err != nil {
385			return templ_7745c5c3_Err
386		}
387		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 32, "\"")
388		if templ_7745c5c3_Err != nil {
389			return templ_7745c5c3_Err
390		}
391		if len(items) == 0 {
392			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 33, " data-cursor")
393			if templ_7745c5c3_Err != nil {
394				return templ_7745c5c3_Err
395			}
396		}
397		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 34, " data-k=\"action turn single-key shortcuts on off keyboard\"><a role=\"presentation\" data-fire=\"keys\"><span class=\"lbl\">turn single-key shortcuts off</span><span class=\"k\">action</span></a></li></ul><p class=\"panel-foot\"><span><kbd>↑</kbd><kbd>↓</kbd> move</span><span><kbd>enter</kbd> open</span><span><kbd>esc</kbd> close</span></p></dialog>")
398		if templ_7745c5c3_Err != nil {
399			return templ_7745c5c3_Err
400		}
401		return nil
402	})
403}
404
405var _ = templruntime.GeneratedTemplate

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 4

Tags 45

↑↓ moveenter openesc close