refactor(theme): route consumer reads through ClideSettings.theme (T-473)

Migrate ClideTheme.of(context) reads across the widget, feature, and shell
layers to the unified ClideSettings.theme.of(context) facade (D-101), so
theme/i18n/fonts/settings share one widget-facing entry. The facade delegates
straight to ClideTheme, so behaviour is unchanged — goldens are unmoved.

The low-level theme provider keeps its direct ClideTheme.of: the facade is
built on it, and the two kernel sites (ClideTheme's own definition + the
panels drag-resize widget) stay direct to avoid a widgets→kernel import cycle.
Dead controller.dart/kernel.dart imports left by the sweep removed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-17 21:47:15 +02:00
co-authored by Claude Opus 4.8
parent 1c79c9c4dc
commit 18cd945380
83 changed files with 174 additions and 187 deletions
+7 -7
View File
@@ -68,7 +68,7 @@ class _GitPanelViewState extends State<GitPanelView> {
return ListenableBuilder(
listenable: c,
builder: (context, _) {
final tokens = ClideTheme.of(context).surface;
final tokens = ClideSettings.theme.of(context).surface;
return Semantics(
label: 'git panel',
container: true,
@@ -143,7 +143,7 @@ class _BranchHeader extends StatelessWidget {
@override
Widget build(BuildContext context) {
final tokens = ClideTheme.of(context).surface;
final tokens = ClideSettings.theme.of(context).surface;
final branch = controller.branch ?? '(detached)';
final parts = <String>[branch];
if (controller.ahead > 0) parts.add('${controller.ahead}');
@@ -173,7 +173,7 @@ class _CommitInput extends StatelessWidget {
@override
Widget build(BuildContext context) {
final tokens = ClideTheme.of(context).surface;
final tokens = ClideSettings.theme.of(context).surface;
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 4),
child: Column(
@@ -239,7 +239,7 @@ class _FileGroup extends StatelessWidget {
@override
Widget build(BuildContext context) {
final tokens = ClideTheme.of(context).surface;
final tokens = ClideSettings.theme.of(context).surface;
return Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
mainAxisSize: MainAxisSize.min,
@@ -271,7 +271,7 @@ class _GitFileRow extends StatelessWidget {
@override
Widget build(BuildContext context) {
final tokens = ClideTheme.of(context).surface;
final tokens = ClideSettings.theme.of(context).surface;
final path = entry['path'] as String? ?? '';
final name = path.split('/').last;
final indexState = entry['indexState'] as String?;
@@ -352,7 +352,7 @@ class _SmallAction extends StatelessWidget {
@override
Widget build(BuildContext context) {
final tokens = ClideTheme.of(context).surface;
final tokens = ClideSettings.theme.of(context).surface;
return Semantics(
button: true,
label: semanticsLabel ?? label,
@@ -376,7 +376,7 @@ class _DiscardConfirmDialog extends StatelessWidget {
@override
Widget build(BuildContext context) {
final tokens = ClideTheme.of(context).surface;
final tokens = ClideSettings.theme.of(context).surface;
final name = path.split('/').last;
return Container(
width: 360,
+3 -3
View File
@@ -56,7 +56,7 @@ class _GitStatusItemState extends State<GitStatusItem> {
@override
Widget build(BuildContext context) {
final tokens = ClideTheme.of(context).surface;
final tokens = ClideSettings.theme.of(context).surface;
if (_branch == null) return const SizedBox.shrink();
final parts = <String>[_branch!];
if (_ahead > 0) parts.add('$_ahead');
@@ -143,7 +143,7 @@ class _BranchPickerState extends State<_BranchPicker> {
@override
Widget build(BuildContext context) {
final tokens = ClideTheme.of(context).surface;
final tokens = ClideSettings.theme.of(context).surface;
return Focus(
focusNode: _focus,
onKeyEvent: _onKey,
@@ -215,7 +215,7 @@ class _BranchRow extends StatelessWidget {
@override
Widget build(BuildContext context) {
final tokens = ClideTheme.of(context).surface;
final tokens = ClideSettings.theme.of(context).surface;
return ClideTappable(
onTap: onTap,
cursor: onTap != null ? SystemMouseCursors.click : MouseCursor.defer,