// Workspace display preferences (SidebarPrefs pattern: eager // ValueNotifier + SharedPreferences persistence, loaded once at // startup). import 'package:flutter/foundation.dart'; import 'package:shared_preferences/shared_preferences.dart'; class WorkspacePrefs { WorkspacePrefs._(); static const _kSealedNamesKey = 'workspace.sealed_names_visible'; /// Whether the workspace switcher lists sealed areas with their /// names right away. Default FALSE: area names often carry /// client/mandate identity, so the switcher shows an aggregated /// row ("2 sealed areas") until the operator deliberately /// expands it (usertest security finding). The Settings toggle /// restores the direct listing for single-operator machines. static final ValueNotifier sealedNamesVisible = ValueNotifier(false); static Future load() async { final prefs = await SharedPreferences.getInstance(); sealedNamesVisible.value = prefs.getBool(_kSealedNamesKey) ?? false; } static Future setSealedNamesVisible(bool value) async { sealedNamesVisible.value = value; final prefs = await SharedPreferences.getInstance(); await prefs.setBool(_kSealedNamesKey, value); } }