package systemviews import ( "github.com/bnema/dumber/internal/application/dto" "github.com/bnema/dumber/internal/application/port" ) templ ConfigView(data configRenderData) { @Alert("success", data.Notice) @Alert("error", data.Error) @Section("sv-config-appearance", "Appearance") { @AppearanceForm(data.Config) } @Section("sv-config-search", "Search") { @SearchSettings(data.Config) } @Section("sv-config-performance", "Performance") { @PerformanceSettings(data.Config) } @Section("sv-config-keybindings", "Keybindings") { @Meta(configKeybindingSummary(data.Keybindings)) @ConfigKeybindings(data.Keybindings) } @Section("sv-config-values", "Current payload") { @KV(flattenValues(data.Config)) } } templ AppearanceForm(config dto.SystemviewConfigPayload) {
External theme

Provider noctalia supports colors-json (default Noctalia colors.json) and dumber-json (advanced user template).

@PaletteFields("Light palette", "light", config.Appearance.LightPalette) @PaletteFields("Dark palette", "dark", config.Appearance.DarkPalette)
} templ PaletteFields(title string, prefix string, palette dto.ColorPalette) {
{ title }
} templ SearchSettings(config dto.SystemviewConfigPayload) {

Search shortcuts

Shortcut URLs must include the %s placeholder for the search query.

{{ shortcuts := searchShortcutRows(config.SearchShortcuts) }} if len(shortcuts) == 0 { @EmptyState("No search shortcuts configured") } else { }
} templ SearchShortcutItem(shortcut searchShortcutRow) {
  • } templ PerformanceSettings(config dto.SystemviewConfigPayload) { {{ customProfile := performanceProfileSelected(config.Performance.Profile, "custom") }}

    Choose Custom to edit individual performance values.

    { formatConfigInt(config.Performance.Hardware.CPUThreads) }CPU threads
    { formatConfigInt(config.Performance.Hardware.TotalRAMMB) }RAM MB
    { config.Performance.Hardware.GPUName }GPU
    { config.EngineType }Engine
    if !engineIsWebKit(config.EngineType) {

    Performance tuning applies only to the WebKit engine.

    } else {

    Performance profile changes may require restarting the browser to affect existing engine processes.

    } } templ ConfigKeybindings(keybindings port.KeybindingsConfig) { {{ groups := configKeybindingGroups(keybindings) }} if groups == nil { @EmptyState("Keybindings unavailable") } else if len(groups) == 0 { @EmptyState("No keybindings configured") } else {
    for _, group := range groups { @ConfigKeybindingGroup(group) } } } templ ConfigKeybindingGroup(group renderedKeybindingGroup) {

    { keybindingGroupTitle(group) }

    if keybindingGroupMeta(group) != "" {

    { keybindingGroupMeta(group) }

    }
    if len(group.Bindings) == 0 { @EmptyState("No bindings in this group") } else { }
    } templ ConfigKeybinding(group renderedKeybindingGroup, binding renderedKeybinding) {
  • { keybindingDescription(binding) }

    { keybindingAction(binding) }

    @KeyList(binding.Keys) { keybindingStatus(binding) } if keybindingIsCustom(binding) && len(binding.DefaultKeys) > 0 { default: @KeyList(binding.DefaultKeys) }
  • }