detached 9d5a501

docs: ensure config correctness and improve documentation checker

commit
9d5a501655aa210ee705b86e7038c7626552a66b
author
brice · · 2025-12-22 21:41 UTC
committer
brice · · 2025-12-22 20:28 UTC
parent
b9b46e5
signature
unsigned
2 files · +50 -9
M dev/check-docs.go +32 -4
@@ -436,6 +436,7 @@ func verifyConfigDoc(report *Report, schemaKeys map[string]struct{}, configDocPa
436436
437437 func extractDocKeys(lines []string, schemaKeys map[string]struct{}) map[string]int {
438438 keyRe := regexp.MustCompile("`([a-zA-Z0-9_.-]+)`")
439+ tableRowRe := regexp.MustCompile(`^\|`)
439440 inCode := false
440441
441442 seen := map[string]int{}
@@ -448,6 +449,35 @@ func extractDocKeys(lines []string, schemaKeys map[string]struct{}) map[string]i
448449 if inCode {
449450 continue
450451 }
452+
453+ // Prefer extracting keys from the first column of Markdown tables.
454+ // This avoids false-positives from enum values shown in other columns.
455+ if tableRowRe.MatchString(trim) {
456+ // Skip table separator rows.
457+ if strings.Contains(trim, "---") {
458+ continue
459+ }
460+ parts := strings.Split(line, "|")
461+ if len(parts) >= 3 {
462+ firstCell := strings.TrimSpace(parts[1])
463+ matches := keyRe.FindAllStringSubmatch(firstCell, -1)
464+ for _, m := range matches {
465+ k := m[1]
466+ if k == "" || k[0] < 'a' || k[0] > 'z' {
467+ continue
468+ }
469+ if strings.ContainsAny(k, " /") {
470+ continue
471+ }
472+ if _, already := seen[k]; !already {
473+ seen[k] = i + 1
474+ }
475+ }
476+ }
477+ continue
478+ }
479+
480+ // Outside of tables, only accept dotted paths that look like config keys.
451481 matches := keyRe.FindAllStringSubmatch(line, -1)
452482 for _, m := range matches {
453483 k := m[1]
@@ -457,9 +487,6 @@ func extractDocKeys(lines []string, schemaKeys map[string]struct{}) map[string]i
457487 }
458488 continue
459489 }
460-
461- // For unknown backticked strings, only accept dotted paths that look
462- // like config keys (filters out enum values like `most_visited`).
463490 if !strings.Contains(k, ".") {
464491 continue
465492 }
@@ -584,7 +611,8 @@ func writeReport(path string, report *Report) error {
584611 _, _ = fmt.Fprintln(w)
585612 }
586613 if idx == 0 {
587- _, _ = fmt.Fprintln(w, "(none)\n")
614+ _, _ = fmt.Fprintln(w, "(none)")
615+ _, _ = fmt.Fprintln(w)
588616 }
589617 }
590618
@@ -436,6 +436,7 @@ func verifyConfigDoc(report *Report, schemaKeys map[string]struct{}, configDocPa
436 436
437 func extractDocKeys(lines []string, schemaKeys map[string]struct{}) map[string]int {437 func extractDocKeys(lines []string, schemaKeys map[string]struct{}) map[string]int {
438 keyRe := regexp.MustCompile("`([a-zA-Z0-9_.-]+)`")438 keyRe := regexp.MustCompile("`([a-zA-Z0-9_.-]+)`")
439+ tableRowRe := regexp.MustCompile(`^\|`)
439 inCode := false440 inCode := false
440 441
441 seen := map[string]int{}442 seen := map[string]int{}
@@ -448,6 +449,35 @@ func extractDocKeys(lines []string, schemaKeys map[string]struct{}) map[string]i
448 if inCode {449 if inCode {
449 continue450 continue
450 }451 }
452+
453+ // Prefer extracting keys from the first column of Markdown tables.
454+ // This avoids false-positives from enum values shown in other columns.
455+ if tableRowRe.MatchString(trim) {
456+ // Skip table separator rows.
457+ if strings.Contains(trim, "---") {
458+ continue
459+ }
460+ parts := strings.Split(line, "|")
461+ if len(parts) >= 3 {
462+ firstCell := strings.TrimSpace(parts[1])
463+ matches := keyRe.FindAllStringSubmatch(firstCell, -1)
464+ for _, m := range matches {
465+ k := m[1]
466+ if k == "" || k[0] < 'a' || k[0] > 'z' {
467+ continue
468+ }
469+ if strings.ContainsAny(k, " /") {
470+ continue
471+ }
472+ if _, already := seen[k]; !already {
473+ seen[k] = i + 1
474+ }
475+ }
476+ }
477+ continue
478+ }
479+
480+ // Outside of tables, only accept dotted paths that look like config keys.
451 matches := keyRe.FindAllStringSubmatch(line, -1)481 matches := keyRe.FindAllStringSubmatch(line, -1)
452 for _, m := range matches {482 for _, m := range matches {
453 k := m[1]483 k := m[1]
@@ -457,9 +487,6 @@ func extractDocKeys(lines []string, schemaKeys map[string]struct{}) map[string]i
457 }487 }
458 continue488 continue
459 }489 }
460-
461- // For unknown backticked strings, only accept dotted paths that look
462- // like config keys (filters out enum values like `most_visited`).
463 if !strings.Contains(k, ".") {490 if !strings.Contains(k, ".") {
464 continue491 continue
465 }492 }
@@ -584,7 +611,8 @@ func writeReport(path string, report *Report) error {
584 _, _ = fmt.Fprintln(w)611 _, _ = fmt.Fprintln(w)
585 }612 }
586 if idx == 0 {613 if idx == 0 {
587- _, _ = fmt.Fprintln(w, "(none)\n")614+ _, _ = fmt.Fprintln(w, "(none)")
615+ _, _ = fmt.Fprintln(w)
588 }616 }
589 }617 }
590 618
M docs/CONFIG.md +18 -5
@@ -174,13 +174,23 @@ border = "#363636"
174174 |-----|------|---------|-------------|
175175 | `debug.enable_devtools` | bool | `true` | Enable browser developer tools (F12, Inspect Element) |
176176
177-## Rendering & Zoom
177+## Rendering, UI Scale & Zoom
178178
179179 | Key | Type | Default | Valid Values | Description |
180180 |-----|------|---------|--------------|-------------|
181-| `rendering_mode` | string | `"gpu"` | `auto`, `gpu`, `cpu` | Rendering mode |
182-| `use_dom_zoom` | bool | `false` | - | Use DOM-based zoom |
183-| `default_zoom` | float | `1.2` | > 0 | Default zoom level (120%) |
181+| `rendering.mode` | string | `"gpu"` | `auto`, `gpu`, `cpu` | WebKit hardware acceleration policy |
182+| `rendering.disable_dmabuf_renderer` | bool | `false` | - | Disable WebKit DMA-BUF renderer (may fix flicker on Wayland; slower) |
183+| `rendering.force_compositing_mode` | bool | `false` | - | Force WebKit compositing mode (`WEBKIT_FORCE_COMPOSITING_MODE`) |
184+| `rendering.disable_compositing_mode` | bool | `false` | - | Disable WebKit compositing mode (`WEBKIT_DISABLE_COMPOSITING_MODE`) |
185+| `rendering.gsk_renderer` | string | `"vulkan"` | `auto`, `opengl`, `vulkan`, `cairo` | GTK renderer selection (`GSK_RENDERER`) |
186+| `rendering.disable_mipmaps` | bool | `false` | - | Disable GTK mipmaps (`GSK_GPU_DISABLE=mipmap`) |
187+| `rendering.prefer_gl` | bool | `false` | - | Prefer OpenGL over GLES (`GDK_DEBUG=gl-prefer-gl`) |
188+| `rendering.draw_compositing_indicators` | bool | `false` | - | Draw WebKit compositing indicators (debug) |
189+| `rendering.show_fps` | bool | `false` | - | Show WebKit FPS counter (`WEBKIT_SHOW_FPS`) |
190+| `rendering.sample_memory` | bool | `false` | - | Enable WebKit memory sampling (`WEBKIT_SAMPLE_MEMORY`) |
191+| `rendering.debug_frames` | bool | `false` | - | Enable GTK frame timing debug (`GDK_DEBUG=frames`) |
192+| `default_ui_scale` | float | `1.0` | > 0 | GTK widget UI scale (1.0=100%, 2.0=200%) |
193+| `default_webpage_zoom` | float | `1.2` | > 0 | Default page zoom (1.0=100%, 1.2=120%) |
184194
185195 ## Workspace Configuration
186196
@@ -357,8 +367,11 @@ All config values can be overridden via environment variables with the prefix `D
357367 # Database
358368 DUMBER_DATABASE_PATH=/custom/path/db.sqlite
359369
360-# Rendering
370+# Rendering (examples)
371+# Defaults: rendering.disable_dmabuf_renderer=false, rendering.gsk_renderer="vulkan"
361372 DUMBER_RENDERING_MODE=cpu
373+# DUMBER_RENDERING_DISABLE_DMABUF_RENDERER=true
374+# DUMBER_RENDERING_GSK_RENDERER=opengl
362375 DUMBER_DEFAULT_WEBPAGE_ZOOM=1.5
363376
364377 # Logging
@@ -174,13 +174,23 @@ border = "#363636"
174 |-----|------|---------|-------------|174 |-----|------|---------|-------------|
175 | `debug.enable_devtools` | bool | `true` | Enable browser developer tools (F12, Inspect Element) |175 | `debug.enable_devtools` | bool | `true` | Enable browser developer tools (F12, Inspect Element) |
176 176
177-## Rendering & Zoom177+## Rendering, UI Scale & Zoom
178 178
179 | Key | Type | Default | Valid Values | Description |179 | Key | Type | Default | Valid Values | Description |
180 |-----|------|---------|--------------|-------------|180 |-----|------|---------|--------------|-------------|
181-| `rendering_mode` | string | `"gpu"` | `auto`, `gpu`, `cpu` | Rendering mode |181+| `rendering.mode` | string | `"gpu"` | `auto`, `gpu`, `cpu` | WebKit hardware acceleration policy |
182-| `use_dom_zoom` | bool | `false` | - | Use DOM-based zoom |182+| `rendering.disable_dmabuf_renderer` | bool | `false` | - | Disable WebKit DMA-BUF renderer (may fix flicker on Wayland; slower) |
183-| `default_zoom` | float | `1.2` | > 0 | Default zoom level (120%) |183+| `rendering.force_compositing_mode` | bool | `false` | - | Force WebKit compositing mode (`WEBKIT_FORCE_COMPOSITING_MODE`) |
184+| `rendering.disable_compositing_mode` | bool | `false` | - | Disable WebKit compositing mode (`WEBKIT_DISABLE_COMPOSITING_MODE`) |
185+| `rendering.gsk_renderer` | string | `"vulkan"` | `auto`, `opengl`, `vulkan`, `cairo` | GTK renderer selection (`GSK_RENDERER`) |
186+| `rendering.disable_mipmaps` | bool | `false` | - | Disable GTK mipmaps (`GSK_GPU_DISABLE=mipmap`) |
187+| `rendering.prefer_gl` | bool | `false` | - | Prefer OpenGL over GLES (`GDK_DEBUG=gl-prefer-gl`) |
188+| `rendering.draw_compositing_indicators` | bool | `false` | - | Draw WebKit compositing indicators (debug) |
189+| `rendering.show_fps` | bool | `false` | - | Show WebKit FPS counter (`WEBKIT_SHOW_FPS`) |
190+| `rendering.sample_memory` | bool | `false` | - | Enable WebKit memory sampling (`WEBKIT_SAMPLE_MEMORY`) |
191+| `rendering.debug_frames` | bool | `false` | - | Enable GTK frame timing debug (`GDK_DEBUG=frames`) |
192+| `default_ui_scale` | float | `1.0` | > 0 | GTK widget UI scale (1.0=100%, 2.0=200%) |
193+| `default_webpage_zoom` | float | `1.2` | > 0 | Default page zoom (1.0=100%, 1.2=120%) |
184 194
185 ## Workspace Configuration195 ## Workspace Configuration
186 196
@@ -357,8 +367,11 @@ All config values can be overridden via environment variables with the prefix `D
357 # Database367 # Database
358 DUMBER_DATABASE_PATH=/custom/path/db.sqlite368 DUMBER_DATABASE_PATH=/custom/path/db.sqlite
359 369
360-# Rendering370+# Rendering (examples)
371+# Defaults: rendering.disable_dmabuf_renderer=false, rendering.gsk_renderer="vulkan"
361 DUMBER_RENDERING_MODE=cpu372 DUMBER_RENDERING_MODE=cpu
373+# DUMBER_RENDERING_DISABLE_DMABUF_RENDERER=true
374+# DUMBER_RENDERING_GSK_RENDERER=opengl
362 DUMBER_DEFAULT_WEBPAGE_ZOOM=1.5375 DUMBER_DEFAULT_WEBPAGE_ZOOM=1.5
363 376
364 # Logging377 # Logging

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 8

Tags 42

↑↓ moveenter openesc close