persist the chosen theme per repo across loads (T-293)
ThemeController.select() applied live but never persisted, so every restart reset to the first bundled theme. Add wireThemePersistence (facade): on theme change write app.theme (global default) + project.theme (the open repo's .clide/settings.yaml); on settings change — notably when a repo opens and its project values load — restore the most specific saved theme (project then app). The name encodes the -hc variant so high-contrast persists; an unknown/removed theme is ignored so a stale value can't wedge startup. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -5,6 +5,7 @@ import 'package:clide/kernel/src/clipboard.dart';
|
||||
import 'package:clide/kernel/src/commands/keybindings.dart';
|
||||
import 'package:clide/kernel/src/keymap/keymap_service.dart';
|
||||
import 'package:clide/kernel/src/text_zoom.dart';
|
||||
import 'package:clide/kernel/src/theme/theme_persistence.dart';
|
||||
import 'package:clide/kernel/src/toast.dart';
|
||||
import 'package:clide/kernel/src/commands/palette.dart';
|
||||
import 'package:clide/kernel/src/commands/registry.dart';
|
||||
@@ -158,6 +159,7 @@ class KernelServices {
|
||||
}
|
||||
|
||||
final theme = ThemeController(bundled: bundledThemes);
|
||||
wireThemePersistence(theme, settings);
|
||||
final panels = PanelRegistry();
|
||||
final arrangement = LayoutArrangement();
|
||||
final commands = CommandRegistry();
|
||||
|
||||
Reference in New Issue
Block a user