schema_provider.go RawHistoryFolder

1package config
2
3import (
4	"fmt"
5
6	"github.com/bnema/dumber/internal/domain/entity"
7)
8
9// Section names for grouping config keys.
10const (
11	SectionAppearance       = "Appearance"
12	SectionLogging          = "Logging"
13	SectionHistory          = "History"
14	SectionWorkspace        = "Workspace"
15	SectionSession          = "Session"
16	SectionOmnibox          = "Omnibox"
17	SectionClipboard        = "Clipboard"
18	SectionContentFiltering = "Content Filtering"
19	SectionRendering        = "Rendering"
20	SectionMedia            = "Media"
21	SectionPrivacy          = "Privacy"
22	SectionUpdate           = "Update"
23	SectionDmenu            = "Dmenu"
24	SectionDebug            = "Debug"
25	SectionPerformance      = "Performance"
26	SectionRuntime          = "Runtime"
27	SectionDatabase         = "Database"
28	SectionSearch           = "Search"
29	SectionDownloads        = "Downloads"
30)
31
32// SchemaProvider implements port.ConfigSchemaProvider.
33type SchemaProvider struct{}
34
35// NewSchemaProvider creates a new SchemaProvider.
36func NewSchemaProvider() *SchemaProvider {
37	return &SchemaProvider{}
38}
39
40// GetSchema returns all configuration keys with their metadata.
41func (p *SchemaProvider) GetSchema() []entity.ConfigKeyInfo {
42	defaults := DefaultConfig()
43
44	keys := make([]entity.ConfigKeyInfo, 0, 100)
45
46	// Appearance section
47	keys = append(keys, p.getAppearanceKeys(defaults)...)
48
49	// Logging section
50	keys = append(keys, p.getLoggingKeys(defaults)...)
51
52	// History section
53	keys = append(keys, p.getHistoryKeys(defaults)...)
54
55	// Search section
56	keys = append(keys, p.getSearchKeys(defaults)...)
57
58	// Dmenu section
59	keys = append(keys, p.getDmenuKeys(defaults)...)
60
61	// Workspace section
62	keys = append(keys, p.getWorkspaceKeys(defaults)...)
63
64	// Session section
65	keys = append(keys, p.getSessionKeys(defaults)...)
66
67	// Omnibox section
68	keys = append(keys, p.getOmniboxKeys(defaults)...)
69
70	// Clipboard section
71	keys = append(keys, p.getClipboardKeys(defaults)...)
72
73	// Content Filtering section
74	keys = append(keys, p.getContentFilteringKeys(defaults)...)
75
76	// Rendering section
77	keys = append(keys, p.getRenderingKeys(defaults)...)
78
79	// Media section
80	keys = append(keys, p.getMediaKeys(defaults)...)
81
82	// Privacy section
83	keys = append(keys, p.getPrivacyKeys(defaults)...)
84
85	// Update section
86	keys = append(keys, p.getUpdateKeys(defaults)...)
87
88	// Debug section
89	keys = append(keys, p.getDebugKeys(defaults)...)
90
91	// Performance section
92	keys = append(keys, p.getPerformanceKeys(defaults)...)
93
94	// Runtime section
95	keys = append(keys, p.getRuntimeKeys(defaults)...)
96
97	// Database section
98	keys = append(keys, p.getDatabaseKeys()...)
99
100	// Downloads section
101	keys = append(keys, p.getDownloadsKeys(defaults)...)
102
103	return keys
104}
105
106func (*SchemaProvider) getAppearanceKeys(defaults *Config) []entity.ConfigKeyInfo {
107	return []entity.ConfigKeyInfo{
108		{
109			Key:         "appearance.color_scheme",
110			Type:        "string",
111			Default:     defaults.Appearance.ColorScheme,
112			Description: "Theme preference (follows system by default)",
113			Values:      []string{"default", "prefer-dark", "prefer-light"},
114			Section:     SectionAppearance,
115		},
116		{
117			Key:         "appearance.default_font_size",
118			Type:        "int",
119			Default:     fmt.Sprintf("%d", defaults.Appearance.DefaultFontSize),
120			Description: "Default font size in CSS pixels",
121			Range:       "1-72",
122			Section:     SectionAppearance,
123		},
124		{
125			Key:         "appearance.sans_font",
126			Type:        "string",
127			Default:     defaults.Appearance.SansFont,
128			Description: "Sans-serif font family for web pages",
129			Section:     SectionAppearance,
130		},
131		{
132			Key:         "appearance.serif_font",
133			Type:        "string",
134			Default:     defaults.Appearance.SerifFont,
135			Description: "Serif font family for web pages",
136			Section:     SectionAppearance,
137		},
138		{
139			Key:         "appearance.monospace_font",
140			Type:        "string",
141			Default:     defaults.Appearance.MonospaceFont,
142			Description: "Monospace font family for code",
143			Section:     SectionAppearance,
144		},
145		{
146			Key:         "appearance.gtk_font",
147			Type:        "string",
148			Default:     defaults.Appearance.GtkFont,
149			Description: "Native GTK UI font family for app chrome",
150			Section:     SectionAppearance,
151		},
152		{
153			Key:         "default_webpage_zoom",
154			Type:        "float64",
155			Default:     fmt.Sprintf("%.1f", defaults.DefaultWebpageZoom),
156			Description: "Default zoom level for web pages (1.0 = 100%%)",
157			Range:       "0.1-5.0",
158			Section:     SectionAppearance,
159		},
160		{
161			Key:         "default_ui_scale",
162			Type:        "float64",
163			Default:     fmt.Sprintf("%.1f", defaults.DefaultUIScale),
164			Description: "UI scale multiplier for GTK widgets",
165			Range:       "0.5-3.0",
166			Section:     SectionAppearance,
167		},
168		{
169			Key:         "sidebar_width",
170			Type:        "int",
171			Default:     fmt.Sprintf("%d", defaults.SidebarWidth),
172			Description: "Preferred width (px) for the history sidebar. 0 = default",
173			Range:       "0 or 280-380",
174			Section:     SectionAppearance,
175		},
176		{
177			Key:         "appearance.light_palette.*",
178			Type:        "string",
179			Default:     "(hex colors)",
180			Description: "Light theme color palette (background, surface, surface_variant, text, muted, accent, border)",
181			Section:     SectionAppearance,
182		},
183		{
184			Key:         "appearance.dark_palette.*",
185			Type:        "string",
186			Default:     "(hex colors)",
187			Description: "Dark theme color palette (background, surface, surface_variant, text, muted, accent, border)",
188			Section:     SectionAppearance,
189		},
190		{
191			Key:         "appearance.external_theme.enabled",
192			Type:        "bool",
193			Default:     fmt.Sprintf("%t", defaults.Appearance.ExternalTheme.Enabled),
194			Description: "Enable loading theme settings from an external provider",
195			Section:     SectionAppearance,
196		},
197		{
198			Key:         "appearance.external_theme.provider",
199			Type:        "string",
200			Default:     defaults.Appearance.ExternalTheme.Provider,
201			Description: "External theme provider",
202			Values:      []string{"noctalia"},
203			Section:     SectionAppearance,
204		},
205		{
206			Key:         "appearance.external_theme.format",
207			Type:        "string",
208			Default:     defaults.Appearance.ExternalTheme.Format,
209			Description: "External theme file format",
210			Values:      []string{"colors-json", "dumber-json"},
211			Section:     SectionAppearance,
212		},
213		{
214			Key:         "appearance.external_theme.path",
215			Type:        "string",
216			Default:     defaults.Appearance.ExternalTheme.Path,
217			Description: "Path to the external theme file",
218			Section:     SectionAppearance,
219		},
220	}
221}
222
223func (*SchemaProvider) getLoggingKeys(defaults *Config) []entity.ConfigKeyInfo {
224	return []entity.ConfigKeyInfo{
225		{
226			Key:         "logging.level",
227			Type:        "string",
228			Default:     defaults.Logging.Level,
229			Description: "Log verbosity level",
230			Values:      []string{"trace", "debug", "info", "warn", "error", "fatal"},
231			Section:     SectionLogging,
232		},
233		{
234			Key:         "logging.format",
235			Type:        "string",
236			Default:     defaults.Logging.Format,
237			Description: "Log output format",
238			Values:      []string{"text", "json", "console"},
239			Section:     SectionLogging,
240		},
241		{
242			Key:         "logging.max_age",
243			Type:        "int",
244			Default:     fmt.Sprintf("%d", defaults.Logging.MaxAge),
245			Description: "Maximum age of log files in days",
246			Range:       ">=0",
247			Section:     SectionLogging,
248		},
249		{
250			Key:         "logging.max_files",
251			Type:        "int",
252			Default:     fmt.Sprintf("%d", defaults.Logging.MaxFiles),
253			Description: "Maximum number of session log files to keep (0 disables count-based cleanup)",
254			Range:       ">=0",
255			Section:     SectionLogging,
256		},
257		{
258			Key:         "logging.log_dir",
259			Type:        "string",
260			Default:     defaults.Logging.LogDir,
261			Description: "Directory for log files",
262			Section:     SectionLogging,
263		},
264		{
265			Key:         "logging.enable_file_log",
266			Type:        "bool",
267			Default:     fmt.Sprintf("%t", defaults.Logging.EnableFileLog),
268			Description: "Enable logging to file",
269			Section:     SectionLogging,
270		},
271		{
272			Key:         "logging.capture_console",
273			Type:        "bool",
274			Default:     fmt.Sprintf("%t", defaults.Logging.CaptureConsole),
275			Description: "Capture browser console messages to log",
276			Section:     SectionLogging,
277		},
278		{
279			Key:         "logging.capture_gtk_logs",
280			Type:        "bool",
281			Default:     fmt.Sprintf("%t", defaults.Logging.CaptureGTKLogs),
282			Description: "Capture GTK and GLib log messages",
283			Section:     SectionLogging,
284		},
285	}
286}
287
288func (*SchemaProvider) getHistoryKeys(defaults *Config) []entity.ConfigKeyInfo {
289	return []entity.ConfigKeyInfo{
290		{
291			Key:         "history.max_entries",
292			Type:        "int",
293			Default:     fmt.Sprintf("%d", defaults.History.MaxEntries),
294			Description: "Maximum number of history entries to keep",
295			Range:       ">=0",
296			Section:     SectionHistory,
297		},
298		{
299			Key:         "history.retention_period_days",
300			Type:        "int",
301			Default:     fmt.Sprintf("%d", defaults.History.RetentionPeriodDays),
302			Description: "Number of days to retain history",
303			Range:       ">=0",
304			Section:     SectionHistory,
305		},
306		{
307			Key:         "history.cleanup_interval_days",
308			Type:        "int",
309			Default:     fmt.Sprintf("%d", defaults.History.CleanupIntervalDays),
310			Description: "Days between automatic history cleanup",
311			Range:       ">=0",
312			Section:     SectionHistory,
313		},
314	}
315}
316
317func (*SchemaProvider) getSearchKeys(defaults *Config) []entity.ConfigKeyInfo {
318	return []entity.ConfigKeyInfo{
319		{
320			Key:         "default_search_engine",
321			Type:        "string",
322			Default:     defaults.DefaultSearchEngine,
323			Description: "Default search engine URL (must contain %s placeholder)",
324			Section:     SectionSearch,
325		},
326		{
327			Key:         "search_shortcuts.<key>",
328			Type:        "object",
329			Default:     "(see defaults)",
330			Description: "Search shortcuts map with url and description fields",
331			Section:     SectionSearch,
332		},
333	}
334}
335
336func (*SchemaProvider) getDmenuKeys(defaults *Config) []entity.ConfigKeyInfo {
337	return []entity.ConfigKeyInfo{
338		{
339			Key:         "dmenu.max_history_days",
340			Type:        "int",
341			Default:     fmt.Sprintf("%d", defaults.Dmenu.MaxHistoryDays),
342			Description: "Number of days of history to show in dmenu (0 = all)",
343			Range:       ">=0",
344			Section:     SectionDmenu,
345		},
346		{
347			Key:         "dmenu.show_visit_count",
348			Type:        "bool",
349			Default:     fmt.Sprintf("%t", defaults.Dmenu.ShowVisitCount),
350			Description: "Show visit count in dmenu entries",
351			Section:     SectionDmenu,
352		},
353		{
354			Key:         "dmenu.show_last_visited",
355			Type:        "bool",
356			Default:     fmt.Sprintf("%t", defaults.Dmenu.ShowLastVisited),
357			Description: "Show last visited date in dmenu entries",
358			Section:     SectionDmenu,
359		},
360		{
361			Key:         "dmenu.history_prefix",
362			Type:        "string",
363			Default:     defaults.Dmenu.HistoryPrefix,
364			Description: "Prefix for history entries in dmenu",
365			Section:     SectionDmenu,
366		},
367		{
368			Key:         "dmenu.shortcut_prefix",
369			Type:        "string",
370			Default:     defaults.Dmenu.ShortcutPrefix,
371			Description: "Prefix for search shortcuts in dmenu",
372			Section:     SectionDmenu,
373		},
374		{
375			Key:         "dmenu.url_prefix",
376			Type:        "string",
377			Default:     defaults.Dmenu.URLPrefix,
378			Description: "Prefix for URL entries in dmenu",
379			Section:     SectionDmenu,
380		},
381		{
382			Key:         "dmenu.date_format",
383			Type:        "string",
384			Default:     defaults.Dmenu.DateFormat,
385			Description: "Go time format for dates in dmenu",
386			Section:     SectionDmenu,
387		},
388		{
389			Key:         "dmenu.sort_by_visit_count",
390			Type:        "bool",
391			Default:     fmt.Sprintf("%t", defaults.Dmenu.SortByVisitCount),
392			Description: "Sort dmenu entries by visit count",
393			Section:     SectionDmenu,
394		},
395	}
396}
397
398func (*SchemaProvider) getWorkspaceKeys(defaults *Config) []entity.ConfigKeyInfo {
399	return []entity.ConfigKeyInfo{
400		{
401			Key:         "workspace.new_pane_url",
402			Type:        "string",
403			Default:     defaults.Workspace.NewPaneURL,
404			Description: "URL loaded when creating a new pane",
405			Section:     SectionWorkspace,
406		},
407		{
408			Key:         "workspace.tab_bar_position",
409			Type:        "string",
410			Default:     defaults.Workspace.TabBarPosition,
411			Description: "Position of the tab bar",
412			Values:      []string{"top", "bottom"},
413			Section:     SectionWorkspace,
414		},
415		{
416			Key:         "workspace.hide_tab_bar_when_single_tab",
417			Type:        "bool",
418			Default:     fmt.Sprintf("%t", defaults.Workspace.HideTabBarWhenSingleTab),
419			Description: "Hide tab bar when only one tab exists",
420			Section:     SectionWorkspace,
421		},
422		{
423			Key:         "workspace.switch_to_tab_on_move",
424			Type:        "bool",
425			Default:     fmt.Sprintf("%t", defaults.Workspace.SwitchToTabOnMove),
426			Description: "Switch focus to tab when moving pane to it",
427			Section:     SectionWorkspace,
428		},
429		// Pane mode
430		{
431			Key:         "workspace.pane_mode.activation_shortcut",
432			Type:        "string",
433			Default:     defaults.Workspace.PaneMode.ActivationShortcut,
434			Description: "Shortcut to enter pane mode",
435			Section:     SectionWorkspace,
436		},
437		{
438			Key:         "workspace.pane_mode.timeout_ms",
439			Type:        "int",
440			Default:     fmt.Sprintf("%d", defaults.Workspace.PaneMode.TimeoutMilliseconds),
441			Description: "Pane mode timeout in milliseconds (0 = no timeout)",
442			Range:       ">=0",
443			Section:     SectionWorkspace,
444		},
445		{
446			Key:         "workspace.pane_mode.actions.<action>",
447			Type:        "[]string",
448			Default:     "(see defaults)",
449			Description: "Key bindings for pane mode actions",
450			Section:     SectionWorkspace,
451		},
452		// Tab mode
453		{
454			Key:         "workspace.tab_mode.activation_shortcut",
455			Type:        "string",
456			Default:     defaults.Workspace.TabMode.ActivationShortcut,
457			Description: "Shortcut to enter tab mode",
458			Section:     SectionWorkspace,
459		},
460		{
461			Key:         "workspace.tab_mode.timeout_ms",
462			Type:        "int",
463			Default:     fmt.Sprintf("%d", defaults.Workspace.TabMode.TimeoutMilliseconds),
464			Description: "Tab mode timeout in milliseconds (0 = no timeout)",
465			Range:       ">=0",
466			Section:     SectionWorkspace,
467		},
468		{
469			Key:         "workspace.tab_mode.actions.<action>",
470			Type:        "[]string",
471			Default:     "(see defaults)",
472			Description: "Key bindings for tab mode actions",
473			Section:     SectionWorkspace,
474		},
475		// Vim mode
476		{
477			Key:         "workspace.vim_mode.activation_shortcut",
478			Type:        "string",
479			Default:     defaults.Workspace.VimMode.ActivationShortcut,
480			Description: "Shortcut to enter vim scroll mode",
481			Section:     SectionWorkspace,
482		},
483		{
484			Key:         "workspace.vim_mode.timeout_ms",
485			Type:        "int",
486			Default:     fmt.Sprintf("%d", defaults.Workspace.VimMode.TimeoutMilliseconds),
487			Description: "Vim mode timeout in milliseconds (0 = no timeout)",
488			Range:       ">=0",
489			Section:     SectionWorkspace,
490		},
491		{
492			Key:         "workspace.vim_mode.sequence_timeout_ms",
493			Type:        "int",
494			Default:     fmt.Sprintf("%d", defaults.Workspace.VimMode.SequenceTimeoutMilliseconds),
495			Description: "Vim mode multi-key sequence timeout in milliseconds (0 = immediate ambiguity resolution)",
496			Range:       ">=0",
497			Section:     SectionWorkspace,
498		},
499		{
500			Key:         "workspace.vim_mode.preload_accessibility",
501			Type:        "bool",
502			Default:     fmt.Sprintf("%t", defaults.Workspace.VimMode.PreloadAccessibility),
503			Description: "Pre-enable browser accessibility when a WebView is shown (default false; enable on Vim Mode enter otherwise)",
504			Section:     SectionWorkspace,
505		},
506		{
507			Key:         "workspace.vim_mode.actions.<action>",
508			Type:        "object",
509			Default:     "(see defaults)",
510			Description: "Vim mode action object with keys ([]string) and desc (string)",
511			Section:     SectionWorkspace,
512		},
513		// Resize mode
514		{
515			Key:         "workspace.resize_mode.activation_shortcut",
516			Type:        "string",
517			Default:     defaults.Workspace.ResizeMode.ActivationShortcut,
518			Description: "Shortcut to enter resize mode",
519			Section:     SectionWorkspace,
520		},
521		{
522			Key:         "workspace.resize_mode.timeout_ms",
523			Type:        "int",
524			Default:     fmt.Sprintf("%d", defaults.Workspace.ResizeMode.TimeoutMilliseconds),
525			Description: "Resize mode timeout in milliseconds (0 = no timeout)",
526			Range:       ">=0",
527			Section:     SectionWorkspace,
528		},
529		{
530			Key:         "workspace.resize_mode.step_percent",
531			Type:        "float64",
532			Default:     fmt.Sprintf("%.1f", defaults.Workspace.ResizeMode.StepPercent),
533			Description: "Percentage to resize panes per step",
534			Section:     SectionWorkspace,
535		},
536		{
537			Key:         "workspace.resize_mode.min_pane_percent",
538			Type:        "float64",
539			Default:     fmt.Sprintf("%.1f", defaults.Workspace.ResizeMode.MinPanePercent),
540			Description: "Minimum pane size as percentage",
541			Section:     SectionWorkspace,
542		},
543		{
544			Key:         "workspace.resize_mode.actions.<action>",
545			Type:        "[]string",
546			Default:     "(see defaults)",
547			Description: "Key bindings for resize mode actions",
548			Section:     SectionWorkspace,
549		},
550		// Global shortcuts - managed via dedicated keybindings UI
551		{
552			Key:         "workspace.shortcuts.actions",
553			Type:        "object",
554			Default:     "(see defaults)",
555			Description: "Global keyboard shortcuts (use Keybindings tab to edit)",
556			Section:     SectionWorkspace,
557		},
558		// Floating pane
559		{
560			Key:         "workspace.floating_pane.width_pct",
561			Type:        "float64",
562			Default:     fmt.Sprintf("%.2f", defaults.Workspace.FloatingPane.WidthPct),
563			Description: "Floating pane width as a fraction of workspace width",
564			Range:       "(0,1]",
565			Section:     SectionWorkspace,
566		},
567		{
568			Key:         "workspace.floating_pane.height_pct",
569			Type:        "float64",
570			Default:     fmt.Sprintf("%.2f", defaults.Workspace.FloatingPane.HeightPct),
571			Description: "Floating pane height as a fraction of workspace height",
572			Range:       "(0,1]",
573			Section:     SectionWorkspace,
574		},
575		{
576			Key:         "workspace.floating_pane.profiles.<name>",
577			Type:        "object",
578			Default:     "(empty)",
579			Description: "Named floating pane URL profiles with keys, url, and optional desc",
580			Section:     SectionWorkspace,
581		},
582		// External links
583		{
584			Key:         "workspace.external_links.behavior",
585			Type:        "string",
586			Default:     string(defaults.Workspace.ExternalLinks.Behavior),
587			Description: "How URLs opened from external applications are placed",
588			Values:      []string{"windowed", "tabbed", "split", "stacked"},
589			Section:     SectionWorkspace,
590		},
591		{
592			Key:         "workspace.external_links.placement",
593			Type:        "string",
594			Default:     string(defaults.Workspace.ExternalLinks.Placement),
595			Description: "Placement direction for split external links",
596			Values:      []string{"right", "left", "top", "bottom"},
597			Section:     SectionWorkspace,
598		},
599		// Browsing contexts
600		{
601			Key:         "workspace.browsing_contexts.behavior",
602			Type:        "string",
603			Default:     string(defaults.Workspace.BrowsingContexts.Behavior),
604			Description: "How to handle JavaScript popup windows",
605			Values:      []string{"split", "stacked", "tabbed", "windowed"},
606			Section:     SectionWorkspace,
607		},
608		{
609			Key:         "workspace.browsing_contexts.placement",
610			Type:        "string",
611			Default:     defaults.Workspace.BrowsingContexts.Placement,
612			Description: "Placement direction for split popups",
613			Values:      []string{"right", "left", "top", "bottom"},
614			Section:     SectionWorkspace,
615		},
616		{
617			Key:         "workspace.browsing_contexts.blank_target_behavior",
618			Type:        "string",
619			Default:     defaults.Workspace.BrowsingContexts.BlankTargetBehavior,
620			Description: "How to handle target=\"_blank\" links",
621			Values:      []string{"split", "stacked", "tabbed"},
622			Section:     SectionWorkspace,
623		},
624		{
625			Key:         "workspace.browsing_contexts.open_in_new_pane",
626			Type:        "bool",
627			Default:     fmt.Sprintf("%t", defaults.Workspace.BrowsingContexts.OpenInNewPane),
628			Description: "Open popups in workspace instead of blocking",
629			Section:     SectionWorkspace,
630		},
631		{
632			Key:         "workspace.browsing_contexts.follow_pane_context",
633			Type:        "bool",
634			Default:     fmt.Sprintf("%t", defaults.Workspace.BrowsingContexts.FollowPaneContext),
635			Description: "Popup placement follows parent pane context",
636			Section:     SectionWorkspace,
637		},
638		{
639			Key:         "workspace.browsing_contexts.enable_smart_detection",
640			Type:        "bool",
641			Default:     fmt.Sprintf("%t", defaults.Workspace.BrowsingContexts.EnableSmartDetection),
642			Description: "Use window properties to detect popup intent",
643			Section:     SectionWorkspace,
644		},
645		{
646			Key:         "workspace.browsing_contexts.oauth_auto_close",
647			Type:        "bool",
648			Default:     fmt.Sprintf("%t", defaults.Workspace.BrowsingContexts.OAuthAutoClose),
649			Description: "Auto-close OAuth popups after success",
650			Section:     SectionWorkspace,
651		},
652		// Styling
653		{
654			Key:         "workspace.styling.border_width",
655			Type:        "int",
656			Default:     fmt.Sprintf("%d", defaults.Workspace.Styling.BorderWidth),
657			Description: "Active pane border width in pixels",
658			Range:       ">=0",
659			Section:     SectionWorkspace,
660		},
661		{
662			Key:         "workspace.styling.border_color",
663			Type:        "string",
664			Default:     defaults.Workspace.Styling.BorderColor,
665			Description: "Active pane border color (CSS or @theme variable)",
666			Section:     SectionWorkspace,
667		},
668		{
669			Key:         "workspace.styling.mode_border_width",
670			Type:        "int",
671			Default:     fmt.Sprintf("%d", defaults.Workspace.Styling.ModeBorderWidth),
672			Description: "Reserved; mode frame borders currently use fixed widths",
673			Range:       ">=0",
674			Section:     SectionWorkspace,
675		},
676		{
677			Key:         "workspace.styling.pane_mode_color",
678			Type:        "string",
679			Default:     defaults.Workspace.Styling.PaneModeColor,
680			Description: "Color for pane mode indicator",
681			Section:     SectionWorkspace,
682		},
683		{
684			Key:         "workspace.styling.tab_mode_color",
685			Type:        "string",
686			Default:     defaults.Workspace.Styling.TabModeColor,
687			Description: "Color for tab mode indicator",
688			Section:     SectionWorkspace,
689		},
690		{
691			Key:         "workspace.styling.session_mode_color",
692			Type:        "string",
693			Default:     defaults.Workspace.Styling.SessionModeColor,
694			Description: "Color for session mode indicator",
695			Section:     SectionWorkspace,
696		},
697		{
698			Key: "workspace.styling.vim_mode_color", Type: "string", Default: defaults.Workspace.Styling.VimModeColor,
699			Description: "Color for Vim mode indicator", Section: SectionWorkspace,
700		},
701		{
702			Key:         "workspace.styling.resize_mode_color",
703			Type:        "string",
704			Default:     defaults.Workspace.Styling.ResizeModeColor,
705			Description: "Color for resize mode indicator",
706			Section:     SectionWorkspace,
707		},
708		{
709			Key:         "workspace.styling.mode_indicator_toaster_enabled",
710			Type:        "bool",
711			Default:     fmt.Sprintf("%t", defaults.Workspace.Styling.ModeIndicatorToasterEnabled),
712			Description: "Show the mode toast while a mode is active",
713			Section:     SectionWorkspace,
714		},
715		{
716			Key:         "workspace.styling.mode_legend",
717			Type:        "string",
718			Default:     defaults.Workspace.Styling.ModeLegend,
719			Description: "Mode legend visibility",
720			Values:      []string{"always", "delay", "off"},
721			Section:     SectionWorkspace,
722		},
723		{
724			Key:         "workspace.styling.mode_legend_delay_ms",
725			Type:        "int",
726			Default:     fmt.Sprintf("%d", defaults.Workspace.Styling.ModeLegendDelayMs),
727			Description: "Delay before showing the mode legend in milliseconds",
728			Range:       ">=0",
729			Section:     SectionWorkspace,
730		},
731		{
732			Key: "workspace.styling.mode_legend_linger", Type: "bool", Default: fmt.Sprintf("%t", defaults.Workspace.Styling.ModeLegendLinger),
733			Description: "Keep the legend visible, read-only, after its mode ends while the pointer is over it, until the next key press or click.",
734			Section:     SectionWorkspace,
735		},
736		{
737			Key:         "workspace.styling.mode_legend_animations",
738			Type:        "bool",
739			Default:     fmt.Sprintf("%t", defaults.Workspace.Styling.ModeLegendAnimations),
740			Description: "Animate the mode legend and pressed keycaps",
741			Section:     SectionWorkspace,
742		},
743		{
744			Key:         "workspace.styling.transition_duration",
745			Type:        "int",
746			Default:     fmt.Sprintf("%d", defaults.Workspace.Styling.TransitionDuration),
747			Description: "Border animation duration in milliseconds",
748			Range:       ">=0",
749			Section:     SectionWorkspace,
750		},
751	}
752}
753
754func (*SchemaProvider) getSessionKeys(defaults *Config) []entity.ConfigKeyInfo {
755	return []entity.ConfigKeyInfo{
756		{
757			Key:         "session.auto_restore",
758			Type:        "bool",
759			Default:     fmt.Sprintf("%t", defaults.Session.AutoRestore),
760			Description: "Automatically restore last session on startup",
761			Section:     SectionSession,
762		},
763		{
764			Key:         "session.snapshot_interval_ms",
765			Type:        "int",
766			Default:     fmt.Sprintf("%d", defaults.Session.SnapshotIntervalMs),
767			Description: "Minimum interval between session snapshots",
768			Range:       ">=0",
769			Section:     SectionSession,
770		},
771		{
772			Key:         "session.max_exited_sessions",
773			Type:        "int",
774			Default:     fmt.Sprintf("%d", defaults.Session.MaxExitedSessions),
775			Description: "Maximum number of exited sessions to keep",
776			Range:       ">=0",
777			Section:     SectionSession,
778		},
779		{
780			Key:         "session.max_exited_session_age_days",
781			Type:        "int",
782			Default:     fmt.Sprintf("%d", defaults.Session.MaxExitedSessionAgeDays),
783			Description: "Maximum age of exited sessions in days",
784			Range:       ">=0",
785			Section:     SectionSession,
786		},
787		{
788			Key:         "session.session_mode.activation_shortcut",
789			Type:        "string",
790			Default:     defaults.Session.SessionMode.ActivationShortcut,
791			Description: "Shortcut to enter session mode",
792			Section:     SectionSession,
793		},
794		{
795			Key:         "session.session_mode.timeout_ms",
796			Type:        "int",
797			Default:     fmt.Sprintf("%d", defaults.Session.SessionMode.TimeoutMilliseconds),
798			Description: "Session mode timeout in milliseconds",
799			Range:       ">=0",
800			Section:     SectionSession,
801		},
802		{
803			Key:         "session.session_mode.actions.<action>",
804			Type:        "[]string",
805			Default:     "(see defaults)",
806			Description: "Key bindings for session mode actions",
807			Section:     SectionSession,
808		},
809	}
810}
811
812func (*SchemaProvider) getOmniboxKeys(defaults *Config) []entity.ConfigKeyInfo {
813	return []entity.ConfigKeyInfo{
814		{
815			Key:         "omnibox.style",
816			Type:        "string",
817			Default:     defaults.Omnibox.Style,
818			Description: "Visual treatment for the omnibox",
819			Values:      []string{"multiplexer", "command", "minimal"},
820			Section:     SectionOmnibox,
821		},
822		{
823			Key:         "omnibox.initial_behavior",
824			Type:        "string",
825			Default:     string(defaults.Omnibox.InitialBehavior),
826			Description: "What to show when omnibox opens with empty input",
827			Values: []string{
828				string(OmniboxInitialBehaviorRecent),
829				string(OmniboxInitialBehaviorMostVisited),
830				string(OmniboxInitialBehaviorNone),
831			},
832			Section: SectionOmnibox,
833		},
834		{
835			Key:         "omnibox.max_history_days",
836			Type:        "int",
837			Default:     fmt.Sprintf("%d", defaults.Omnibox.MaxHistoryDays),
838			Description: "Days of omnibox suggestion history (typed and initial); 0 = all history, never deletes",
839			Range:       ">=0",
840			Section:     SectionOmnibox,
841		},
842		{
843			Key:         "omnibox.auto_open_on_new_pane",
844			Type:        "bool",
845			Default:     fmt.Sprintf("%t", defaults.Omnibox.AutoOpenOnNewPane),
846			Description: "Auto-open omnibox when creating new pane",
847			Section:     SectionOmnibox,
848		},
849	}
850}
851
852func (*SchemaProvider) getContentFilteringKeys(defaults *Config) []entity.ConfigKeyInfo {
853	return []entity.ConfigKeyInfo{
854		{
855			Key:         "content_filtering.enabled",
856			Type:        "bool",
857			Default:     fmt.Sprintf("%t", defaults.ContentFiltering.Enabled),
858			Description: "Enable ad blocking and content filtering",
859			Section:     SectionContentFiltering,
860		},
861		{
862			Key:         "content_filtering.auto_update",
863			Type:        "bool",
864			Default:     fmt.Sprintf("%t", defaults.ContentFiltering.AutoUpdate),
865			Description: "Auto-update filter lists from GitHub",
866			Section:     SectionContentFiltering,
867		},
868	}
869}
870
871func (*SchemaProvider) getClipboardKeys(defaults *Config) []entity.ConfigKeyInfo {
872	return []entity.ConfigKeyInfo{
873		{
874			Key:         "clipboard.auto_copy_on_selection",
875			Type:        "bool",
876			Default:     fmt.Sprintf("%t", defaults.Clipboard.AutoCopyOnSelection),
877			Description: "Auto-copy selected text to clipboard (zellij-style)",
878			Section:     SectionClipboard,
879		},
880	}
881}
882
883func (*SchemaProvider) getRenderingKeys(defaults *Config) []entity.ConfigKeyInfo {
884	return []entity.ConfigKeyInfo{
885		{
886			Key:         "engine.type",
887			Type:        "string",
888			Default:     defaults.Engine.Type,
889			Description: "Browser engine selection; CEF is the default and WebKitGTK is the fallback",
890			Values:      []string{"cef", "webkit"},
891			Section:     SectionRendering,
892		},
893		{
894			Key:         "engine.webkit.gsk_renderer",
895			Type:        "string",
896			Default:     string(defaults.Engine.WebKit.GSKRenderer),
897			Description: "GTK Scene Kit renderer selection",
898			Values:      []string{"auto", "opengl", "vulkan", "cairo"},
899			Section:     SectionRendering,
900		},
901		{
902			Key:         "engine.webkit.disable_dmabuf_renderer",
903			Type:        "bool",
904			Default:     fmt.Sprintf("%t", defaults.Engine.WebKit.DisableDMABufRenderer),
905			Description: "Disable DMA-BUF accelerated renderer",
906			Section:     SectionRendering,
907		},
908		{
909			Key:         "engine.webkit.force_compositing_mode",
910			Type:        "bool",
911			Default:     fmt.Sprintf("%t", defaults.Engine.WebKit.ForceCompositingMode),
912			Description: "Force accelerated compositing",
913			Section:     SectionRendering,
914		},
915		{
916			Key:         "engine.webkit.disable_compositing_mode",
917			Type:        "bool",
918			Default:     fmt.Sprintf("%t", defaults.Engine.WebKit.DisableCompositingMode),
919			Description: "Disable accelerated compositing",
920			Section:     SectionRendering,
921		},
922		{
923			Key:         "engine.webkit.disable_mipmaps",
924			Type:        "bool",
925			Default:     fmt.Sprintf("%t", defaults.Engine.WebKit.DisableMipmaps),
926			Description: "Disable mipmap generation",
927			Section:     SectionRendering,
928		},
929		{
930			Key:         "engine.webkit.prefer_gl",
931			Type:        "bool",
932			Default:     fmt.Sprintf("%t", defaults.Engine.WebKit.PreferGL),
933			Description: "Force OpenGL over GLES",
934			Section:     SectionRendering,
935		},
936		{
937			Key:         "engine.webkit.draw_compositing_indicators",
938			Type:        "bool",
939			Default:     fmt.Sprintf("%t", defaults.Engine.WebKit.DrawCompositingIndicators),
940			Description: "Show compositing layer borders",
941			Section:     SectionRendering,
942		},
943		{
944			Key:         "engine.webkit.show_fps",
945			Type:        "bool",
946			Default:     fmt.Sprintf("%t", defaults.Engine.WebKit.ShowFPS),
947			Description: "Display WebKit FPS counter",
948			Section:     SectionRendering,
949		},
950		{
951			Key:         "engine.webkit.sample_memory",
952			Type:        "bool",
953			Default:     fmt.Sprintf("%t", defaults.Engine.WebKit.SampleMemory),
954			Description: "Enable memory sampling",
955			Section:     SectionRendering,
956		},
957		{
958			Key:         "engine.webkit.debug_frames",
959			Type:        "bool",
960			Default:     fmt.Sprintf("%t", defaults.Engine.WebKit.DebugFrames),
961			Description: "Enable frame timing debug output",
962			Section:     SectionRendering,
963		},
964	}
965}
966
967func (*SchemaProvider) getMediaKeys(defaults *Config) []entity.ConfigKeyInfo {
968	return []entity.ConfigKeyInfo{
969		{
970			Key:         "media.hardware_decoding",
971			Type:        "string",
972			Default:     string(defaults.Media.HardwareDecodingMode),
973			Description: "Hardware vs software video decoding",
974			Values:      []string{"auto", "force", "disable"},
975			Section:     SectionMedia,
976		},
977		{
978			Key:         "media.prefer_av1",
979			Type:        "bool",
980			Default:     fmt.Sprintf("%t", defaults.Media.PreferAV1),
981			Description: "Prioritize AV1 codec when available",
982			Section:     SectionMedia,
983		},
984		{
985			Key:         "media.show_diagnostics",
986			Type:        "bool",
987			Default:     fmt.Sprintf("%t", defaults.Media.ShowDiagnosticsOnStartup),
988			Description: "Show media capability warnings at startup",
989			Section:     SectionMedia,
990		},
991		{
992			Key:         "engine.webkit.force_vsync",
993			Type:        "bool",
994			Default:     fmt.Sprintf("%t", defaults.Engine.WebKit.ForceVSync),
995			Description: "Force VSync for WebKit fallback video playback",
996			Section:     SectionMedia,
997		},
998		{
999			Key:         "engine.webkit.gl_rendering_mode",
1000			Type:        "string",
1001			Default:     string(defaults.Engine.WebKit.GLRenderingMode),
1002			Description: "WebKit fallback GStreamer/OpenGL API selection",
1003			Values:      []string{"auto", "gles2", "gl3", "none"},
1004			Section:     SectionMedia,
1005		},
1006		{
1007			Key:         "engine.webkit.gstreamer_debug_level",
1008			Type:        "int",
1009			Default:     fmt.Sprintf("%d", defaults.Engine.WebKit.GStreamerDebugLevel),
1010			Description: "WebKit fallback GStreamer debug verbosity",
1011			Range:       "0-5",
1012			Section:     SectionMedia,
1013		},
1014	}
1015}
1016
1017func (*SchemaProvider) getPrivacyKeys(defaults *Config) []entity.ConfigKeyInfo {
1018	return []entity.ConfigKeyInfo{
1019		{
1020			Key:         "engine.cookie_policy",
1021			Type:        "string",
1022			Default:     string(defaults.Engine.CookiePolicy),
1023			Description: "Cookie acceptance policy",
1024			Values:      []string{"always", "no_third_party", "never"},
1025			Section:     SectionPrivacy,
1026		},
1027		{
1028			Key:         "engine.webkit.itp_enabled",
1029			Type:        "bool",
1030			Default:     fmt.Sprintf("%t", defaults.Engine.WebKit.ITPEnabled),
1031			Description: "Enable WebKit fallback Intelligent Tracking Prevention",
1032			Section:     SectionPrivacy,
1033		},
1034	}
1035}
1036
1037func (*SchemaProvider) getUpdateKeys(defaults *Config) []entity.ConfigKeyInfo {
1038	return []entity.ConfigKeyInfo{
1039		{
1040			Key:         "update.enable_on_startup",
1041			Type:        "bool",
1042			Default:     fmt.Sprintf("%t", defaults.Update.EnableOnStartup),
1043			Description: "Check for updates on browser startup",
1044			Section:     SectionUpdate,
1045		},
1046		{
1047			Key:         "update.auto_download",
1048			Type:        "bool",
1049			Default:     fmt.Sprintf("%t", defaults.Update.AutoDownload),
1050			Description: "Auto-download updates in background",
1051			Section:     SectionUpdate,
1052		},
1053		{
1054			Key:         "update.notify_on_new_settings",
1055			Type:        "bool",
1056			Default:     fmt.Sprintf("%t", defaults.Update.NotifyOnNewSettings),
1057			Description: "Show toast when new config settings available",
1058			Section:     SectionUpdate,
1059		},
1060	}
1061}
1062
1063func (*SchemaProvider) getDebugKeys(defaults *Config) []entity.ConfigKeyInfo {
1064	return []entity.ConfigKeyInfo{
1065		{
1066			Key:         "debug.enable_devtools",
1067			Type:        "bool",
1068			Default:     fmt.Sprintf("%t", defaults.Debug.EnableDevTools),
1069			Description: "Enable browser developer tools (F12)",
1070			Section:     SectionDebug,
1071		},
1072		{
1073			Key:         "engine.cef.log_file",
1074			Type:        "string",
1075			Default:     defaults.Engine.CEF.LogFile,
1076			Description: "Path to the CEF runtime log file written during startup and browser process execution",
1077			Section:     SectionDebug,
1078		},
1079		{
1080			Key:         "engine.cef.log_severity",
1081			Type:        "int32",
1082			Default:     fmt.Sprintf("%d", defaults.Engine.CEF.LogSeverity),
1083			Description: "CEF internal log verbosity (0=default, 1=verbose, 2=info, 3=warning, 4=error, 99=disable)",
1084			Section:     SectionDebug,
1085		},
1086		{
1087			Key:         "engine.cef.trace_handlers",
1088			Type:        "bool",
1089			Default:     fmt.Sprintf("%t", defaults.Engine.CEF.TraceHandlers),
1090			Description: "Trace purego-cef handler wrapping and refcount activity",
1091			Section:     SectionDebug,
1092		},
1093		{
1094			Key:         "engine.cef.enable_audio_handler",
1095			Type:        "bool",
1096			Default:     fmt.Sprintf("%t", defaults.Engine.CEF.EnableAudioHandler),
1097			Description: "Enable the experimental CEF audio handler bridge",
1098			Section:     SectionDebug,
1099		},
1100	}
1101}
1102
1103func (*SchemaProvider) getPerformanceKeys(defaults *Config) []entity.ConfigKeyInfo {
1104	return []entity.ConfigKeyInfo{
1105		{
1106			Key:         "engine.profile",
1107			Type:        "string",
1108			Default:     string(defaults.Engine.Profile),
1109			Description: "Performance profile preset (custom enables manual tuning)",
1110			Values:      []string{"default", "lite", "balanced", "max", "custom"},
1111			Section:     SectionPerformance,
1112		},
1113		{
1114			Key:         "engine.zoom_cache_size",
1115			Type:        "int",
1116			Default:     fmt.Sprintf("%d", defaults.Engine.ZoomCacheSize),
1117			Description: "Number of domain zoom levels to cache",
1118			Range:       ">=0",
1119			Section:     SectionPerformance,
1120		},
1121		{
1122			Key:         "engine.pool_prewarm_count",
1123			Type:        "int",
1124			Default:     fmt.Sprintf("%d", defaults.Engine.PoolPrewarmCount),
1125			Description: "WebViews to pre-create at startup",
1126			Range:       ">=0",
1127			Section:     SectionPerformance,
1128		},
1129		{
1130			Key:         "engine.cef.render_stack",
1131			Type:        "string",
1132			Default:     string(defaults.Engine.CEF.CEFRenderStack()),
1133			Description: "CEF GPU render stack",
1134			Values:      []string{"vulkan", "egl"},
1135			Section:     SectionPerformance,
1136		},
1137		{
1138			Key:         "engine.cef.adaptive_windowless_frame_rate",
1139			Type:        "bool",
1140			Default:     fmt.Sprintf("%t", defaults.Engine.CEF.AdaptiveWindowlessFrameRate),
1141			Description: "Adapt CEF OSR frame rate to the active Wayland monitor refresh rate when no explicit windowless_frame_rate is set",
1142			Section:     SectionPerformance,
1143		},
1144		{
1145			Key:         "engine.cef.windowless_frame_rate",
1146			Type:        "int32",
1147			Default:     fmt.Sprintf("%d", defaults.Engine.CEF.WindowlessFrameRate),
1148			Description: "Explicit maximum off-screen frame rate for the CEF engine; 0 enables adaptive mode when configured",
1149			Range:       ">=0",
1150			Section:     SectionPerformance,
1151		},
1152		{
1153			Key:         "engine.cef.windowless_frame_rate_max",
1154			Type:        "int32",
1155			Default:     fmt.Sprintf("%d", defaults.Engine.CEF.CEFWindowlessFrameRateMax()),
1156			Description: "Hard cap for adaptive CEF OSR frame rate; 0 uses the built-in default cap",
1157			Range:       ">=0",
1158			Section:     SectionPerformance,
1159		},
1160		{
1161			Key:         "engine.cef.idle_runtime_timeout_ms",
1162			Type:        "int",
1163			Default:     fmt.Sprintf("%d", defaults.Engine.CEF.IdleRuntimeTimeoutMs),
1164			Description: "Bounded opt-in CEF runtime residency in milliseconds after the last window closes; 0 disables, changes require restart",
1165			Range:       "0..300000",
1166			Section:     SectionPerformance,
1167		},
1168		{
1169			Key:         "engine.cef.input.scroll_wheel_multiplier",
1170			Type:        "float64",
1171			Default:     fmt.Sprintf("%.2f", defaults.Engine.CEF.Input.ScrollWheelMultiplier),
1172			Description: "CEF mouse wheel scroll delta multiplier",
1173			Range:       ">0",
1174			Section:     SectionPerformance,
1175		},
1176		{
1177			Key:         "engine.cef.input.scroll_precise_multiplier",
1178			Type:        "float64",
1179			Default:     fmt.Sprintf("%.2f", defaults.Engine.CEF.Input.ScrollPreciseMultiplier),
1180			Description: "CEF precise/surface scroll delta multiplier for touchpads and high-resolution wheels",
1181			Range:       ">0",
1182			Section:     SectionPerformance,
1183		},
1184		{
1185			Key:         "engine.cef.input.scroll_horizontal_multiplier",
1186			Type:        "float64",
1187			Default:     fmt.Sprintf("%.2f", defaults.Engine.CEF.Input.ScrollHorizontalMultiplier),
1188			Description: "CEF horizontal scroll delta multiplier",
1189			Range:       ">0",
1190			Section:     SectionPerformance,
1191		},
1192		{
1193			Key:         "engine.cef.input.scroll_vertical_multiplier",
1194			Type:        "float64",
1195			Default:     fmt.Sprintf("%.2f", defaults.Engine.CEF.Input.ScrollVerticalMultiplier),
1196			Description: "CEF vertical scroll delta multiplier; touchpad vertical speed uses this together with scroll_precise_multiplier",
1197			Range:       ">0",
1198			Section:     SectionPerformance,
1199		},
1200		{
1201			Key:         "engine.cef.input.scroll_max_delta",
1202			Type:        "int32",
1203			Default:     fmt.Sprintf("%d", defaults.Engine.CEF.Input.ScrollMaxDelta),
1204			Description: "CEF maximum absolute scroll delta after scaling; 0 disables clamping",
1205			Range:       ">=0",
1206			Section:     SectionPerformance,
1207		},
1208		{
1209			Key:         "engine.cef.input.scroll_touchpad_inertia",
1210			Type:        "bool",
1211			Default:     fmt.Sprintf("%t", defaults.Engine.CEF.Input.ScrollTouchpadInertia),
1212			Description: "Enable direct touchpad tracking with exponential release decay for CEF views",
1213			Section:     SectionPerformance,
1214		},
1215		{
1216			Key:         "engine.cef.input.scroll_wheel_smoothing",
1217			Type:        "bool",
1218			Default:     fmt.Sprintf("%t", defaults.Engine.CEF.Input.ScrollWheelSmoothing),
1219			Description: "Interpolate accepted CEF wheel impulses across frames without a long coast",
1220			Section:     SectionPerformance,
1221		},
1222		{
1223			Key:         "engine.cef.input.touchpad_navigation_enabled",
1224			Type:        "bool",
1225			Default:     fmt.Sprintf("%t", defaults.Engine.CEF.Input.TouchpadNavigationEnabled),
1226			Description: "Enable deliberate two-finger touchpad swipe back/forward navigation for CEF views",
1227			Section:     SectionPerformance,
1228		},
1229		{
1230			Key:         "engine.cef.input.touchpad_navigation_min_delta",
1231			Type:        "float64",
1232			Default:     fmt.Sprintf("%.2f", defaults.Engine.CEF.Input.TouchpadNavigationMinDelta),
1233			Description: "Minimum accumulated horizontal touchpad swipe delta required before release triggers CEF back/forward navigation",
1234			Range:       ">0",
1235			Section:     SectionPerformance,
1236		},
1237		{
1238			Key:     "engine.cef.input.touchpad_navigation_max_vertical_ratio",
1239			Type:    "float64",
1240			Default: fmt.Sprintf("%.2f", defaults.Engine.CEF.Input.TouchpadNavigationMaxVerticalRatio),
1241			Description: "Maximum vertical-to-horizontal delta ratio allowed for CEF touchpad back/forward swipes; " +
1242				"does not affect vertical scroll speed",
1243			Range:   ">0",
1244			Section: SectionPerformance,
1245		},
1246		{
1247			Key:         "engine.webkit.skia_cpu_painting_threads",
1248			Type:        "int",
1249			Default:     fmt.Sprintf("%d", defaults.Engine.WebKit.SkiaCPUPaintingThreads),
1250			Description: "Skia CPU rendering threads (0=unset, custom profile only)",
1251			Range:       ">=0",
1252			Section:     SectionPerformance,
1253		},
1254		{
1255			Key:         "engine.webkit.skia_gpu_painting_threads",
1256			Type:        "int",
1257			Default:     fmt.Sprintf("%d", defaults.Engine.WebKit.SkiaGPUPaintingThreads),
1258			Description: "Skia GPU rendering threads (-1=unset, 0=disable, custom profile only)",
1259			Range:       ">=-1",
1260			Section:     SectionPerformance,
1261		},
1262		{
1263			Key:         "engine.webkit.skia_enable_cpu_rendering",
1264			Type:        "bool",
1265			Default:     fmt.Sprintf("%t", defaults.Engine.WebKit.SkiaEnableCPURendering),
1266			Description: "Force CPU rendering (custom profile only)",
1267			Section:     SectionPerformance,
1268		},
1269		{
1270			Key:         "engine.webkit.web_process_memory_limit_mb",
1271			Type:        "int",
1272			Default:     fmt.Sprintf("%d", defaults.Engine.WebKit.WebProcessMemoryLimitMB),
1273			Description: "Web process memory limit in MB (0=unset, custom profile only)",
1274			Range:       ">=0",
1275			Section:     SectionPerformance,
1276		},
1277		{
1278			Key:         "engine.webkit.web_process_memory_poll_interval_sec",
1279			Type:        "float64",
1280			Default:     fmt.Sprintf("%.1f", defaults.Engine.WebKit.WebProcessMemoryPollIntervalSec),
1281			Description: "Memory check interval in seconds (0=default 30s, custom profile only)",
1282			Range:       ">=0",
1283			Section:     SectionPerformance,
1284		},
1285		{
1286			Key:         "engine.webkit.web_process_memory_conservative_threshold",
1287			Type:        "float64",
1288			Default:     fmt.Sprintf("%.2f", defaults.Engine.WebKit.WebProcessMemoryConservativeThreshold),
1289			Description: "Conservative memory cleanup threshold (0-1, custom profile only)",
1290			Range:       "0-1",
1291			Section:     SectionPerformance,
1292		},
1293		{
1294			Key:         "engine.webkit.web_process_memory_strict_threshold",
1295			Type:        "float64",
1296			Default:     fmt.Sprintf("%.2f", defaults.Engine.WebKit.WebProcessMemoryStrictThreshold),
1297			Description: "Strict memory cleanup threshold (0-1, custom profile only)",
1298			Range:       "0-1",
1299			Section:     SectionPerformance,
1300		},
1301		{
1302			Key:         "engine.webkit.network_process_memory_limit_mb",
1303			Type:        "int",
1304			Default:     fmt.Sprintf("%d", defaults.Engine.WebKit.NetworkProcessMemoryLimitMB),
1305			Description: "Network process memory limit in MB (0=unset, custom profile only)",
1306			Range:       ">=0",
1307			Section:     SectionPerformance,
1308		},
1309		{
1310			Key:         "engine.webkit.network_process_memory_poll_interval_sec",
1311			Type:        "float64",
1312			Default:     fmt.Sprintf("%.1f", defaults.Engine.WebKit.NetworkProcessMemoryPollIntervalSec),
1313			Description: "Network memory check interval in seconds (custom profile only)",
1314			Range:       ">=0",
1315			Section:     SectionPerformance,
1316		},
1317		{
1318			Key:         "engine.webkit.network_process_memory_conservative_threshold",
1319			Type:        "float64",
1320			Default:     fmt.Sprintf("%.2f", defaults.Engine.WebKit.NetworkProcessMemoryConservativeThreshold),
1321			Description: "Network conservative memory threshold (0-1, custom profile only)",
1322			Range:       "0-1",
1323			Section:     SectionPerformance,
1324		},
1325		{
1326			Key:         "engine.webkit.network_process_memory_strict_threshold",
1327			Type:        "float64",
1328			Default:     fmt.Sprintf("%.2f", defaults.Engine.WebKit.NetworkProcessMemoryStrictThreshold),
1329			Description: "Network strict memory threshold (0-1, custom profile only)",
1330			Range:       "0-1",
1331			Section:     SectionPerformance,
1332		},
1333	}
1334}
1335
1336func (*SchemaProvider) getRuntimeKeys(defaults *Config) []entity.ConfigKeyInfo {
1337	return []entity.ConfigKeyInfo{
1338		{
1339			Key:     "engine.cef.cef_dir",
1340			Type:    "string",
1341			Default: defaults.Engine.CEF.CEFDir,
1342			Description: "Optional CEF runtime directory containing libcef.so and Resources; overrides the default " +
1343				"runtime discovery order (CEF_DIR env, /usr/lib/cef, ~/.local/share/cef)",
1344			Section: SectionRuntime,
1345		},
1346		{
1347			Key:         "engine.webkit.prefix",
1348			Type:        "string",
1349			Default:     defaults.Engine.WebKit.Prefix,
1350			Description: "Custom runtime prefix for WebKitGTK/GTK",
1351			Section:     SectionRuntime,
1352		},
1353	}
1354}
1355
1356func (*SchemaProvider) getDatabaseKeys() []entity.ConfigKeyInfo {
1357	// Get actual default path for display
1358	dbPath := "$XDG_DATA_HOME/" + appName + "/" + databaseName
1359	if path, err := GetDatabaseFile(); err == nil {
1360		dbPath = path
1361	}
1362
1363	return []entity.ConfigKeyInfo{
1364		{
1365			Key:         "database.path",
1366			Type:        "string",
1367			Default:     dbPath,
1368			Description: "Path to SQLite database file",
1369			Section:     SectionDatabase,
1370		},
1371	}
1372}
1373
1374func (*SchemaProvider) getDownloadsKeys(_ *Config) []entity.ConfigKeyInfo {
1375	return []entity.ConfigKeyInfo{
1376		{
1377			Key:         "downloads.path",
1378			Type:        "string",
1379			Default:     "(empty = $XDG_DOWNLOAD_DIR or ~/Downloads)",
1380			Description: "Directory where downloads are saved",
1381			Section:     SectionDownloads,
1382		},
1383	}
1384}

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