detached 9307970

fix(ui): address Copilot review for adw color scheme handling

commit
930797099ae5cb4925fc424f8bd0a86ad935a4a5
author
bnema · · 2025-12-29 18:45 UTC
parent
e7d5aff
signature
GPG Unverified2B82207D370127A0 The key is unknown
1 file · +8 -8
M internal/ui/app.go +8 -8
@@ -156,6 +156,10 @@ func (a *App) Run(ctx context.Context, args []string) int {
156156 log := logging.FromContext(ctx)
157157 log.Debug().Msg("creating GTK application")
158158
159+ // Initialize libadwaita once (required before using StyleManager).
160+ // This also initializes GTK implicitly.
161+ adw.Init()
162+
159163 // TODO: Use AppID once puregotk GC bug is fixed (nullable-string-gc-memory-corruption)
160164 a.gtkApp = gtk.NewApplication(nil, gio.GApplicationFlagsNoneValue)
161165 if a.gtkApp == nil {
@@ -218,12 +222,8 @@ func (a *App) onActivate(ctx context.Context) {
218222 func (a *App) applyGTKColorSchemePreference(ctx context.Context) {
219223 log := logging.FromContext(ctx)
220224
221- // Initialize libadwaita (required before using StyleManager).
222- // This also initializes GTK implicitly.
223- adw.Init()
224-
225- // Get the config color scheme preference
226- scheme := "system"
225+ // Get the config color scheme preference (default follows system theme)
226+ scheme := "default"
227227 if a.deps != nil && a.deps.Config != nil && a.deps.Config.Appearance.ColorScheme != "" {
228228 scheme = a.deps.Config.Appearance.ColorScheme
229229 }
@@ -244,8 +244,8 @@ func (a *App) applyGTKColorSchemePreference(ctx context.Context) {
244244 case "light", "prefer-light":
245245 adwScheme = adw.ColorSchemeForceLightValue
246246 default:
247- // "system" or empty - follow system preference
248- adwScheme = adw.ColorSchemePreferLightValue
247+ // "default" or empty - follow system preference
248+ adwScheme = adw.ColorSchemeDefaultValue
249249 }
250250
251251 styleMgr.SetColorScheme(adwScheme)
@@ -156,6 +156,10 @@ func (a *App) Run(ctx context.Context, args []string) int {
156 log := logging.FromContext(ctx)156 log := logging.FromContext(ctx)
157 log.Debug().Msg("creating GTK application")157 log.Debug().Msg("creating GTK application")
158 158
159+ // Initialize libadwaita once (required before using StyleManager).
160+ // This also initializes GTK implicitly.
161+ adw.Init()
162+
159 // TODO: Use AppID once puregotk GC bug is fixed (nullable-string-gc-memory-corruption)163 // TODO: Use AppID once puregotk GC bug is fixed (nullable-string-gc-memory-corruption)
160 a.gtkApp = gtk.NewApplication(nil, gio.GApplicationFlagsNoneValue)164 a.gtkApp = gtk.NewApplication(nil, gio.GApplicationFlagsNoneValue)
161 if a.gtkApp == nil {165 if a.gtkApp == nil {
@@ -218,12 +222,8 @@ func (a *App) onActivate(ctx context.Context) {
218 func (a *App) applyGTKColorSchemePreference(ctx context.Context) {222 func (a *App) applyGTKColorSchemePreference(ctx context.Context) {
219 log := logging.FromContext(ctx)223 log := logging.FromContext(ctx)
220 224
221- // Initialize libadwaita (required before using StyleManager).225+ // Get the config color scheme preference (default follows system theme)
222- // This also initializes GTK implicitly.226+ scheme := "default"
223- adw.Init()
224-
225- // Get the config color scheme preference
226- scheme := "system"
227 if a.deps != nil && a.deps.Config != nil && a.deps.Config.Appearance.ColorScheme != "" {227 if a.deps != nil && a.deps.Config != nil && a.deps.Config.Appearance.ColorScheme != "" {
228 scheme = a.deps.Config.Appearance.ColorScheme228 scheme = a.deps.Config.Appearance.ColorScheme
229 }229 }
@@ -244,8 +244,8 @@ func (a *App) applyGTKColorSchemePreference(ctx context.Context) {
244 case "light", "prefer-light":244 case "light", "prefer-light":
245 adwScheme = adw.ColorSchemeForceLightValue245 adwScheme = adw.ColorSchemeForceLightValue
246 default:246 default:
247- // "system" or empty - follow system preference247+ // "default" or empty - follow system preference
248- adwScheme = adw.ColorSchemePreferLightValue248+ adwScheme = adw.ColorSchemeDefaultValue
249 }249 }
250 250
251 styleMgr.SetColorScheme(adwScheme)251 styleMgr.SetColorScheme(adwScheme)

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