Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions packages/wonky_app/lib/src/core/preferences_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'dart:async';
import 'dart:convert';

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart' show ThemeMode;
import 'package:shad/shad.dart' show ShadThemeMode;
import 'package:wonky_client/wonky_client.dart';
import 'package:wonky_ui/wonky_ui.dart';

Expand Down Expand Up @@ -35,10 +35,10 @@ class PreferencesController extends ChangeNotifier {
final Map<String, Object?> _deviceValues = {};

AppThemeMode get appTheme => _theme;
ThemeMode get themeMode => switch (_theme) {
AppThemeMode.system => ThemeMode.system,
AppThemeMode.light => ThemeMode.light,
AppThemeMode.dark => ThemeMode.dark,
ShadThemeMode get themeMode => switch (_theme) {
AppThemeMode.system => ShadThemeMode.system,
AppThemeMode.light => ShadThemeMode.light,
AppThemeMode.dark => ShadThemeMode.dark,
};
UiDensity get density => _density;
WonkyDensity get wonkyDensity => _density == UiDensity.compact
Expand Down
6 changes: 3 additions & 3 deletions packages/wonky_app/lib/src/core/toasts.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ class Toasts {
title: Text(title),
description: description == null ? null : Text(description),
action: action,
duration: duration,
displayDuration: duration,
)
: ShadToast(
id: id,
title: Text(title),
description: description == null ? null : Text(description),
action: action,
duration: duration,
displayDuration: duration,
),
);
return id;
Expand Down Expand Up @@ -112,7 +112,7 @@ class Toasts {
child: Text(cancelLabel),
),
),
duration: duration,
displayDuration: duration,
),
);
return id;
Expand Down
7 changes: 4 additions & 3 deletions packages/wonky_app/lib/src/mcp_bridge/developer_settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:flutter/widgets.dart';
import 'package:intl/intl.dart' as intl;
import 'package:shad/shad.dart';
import 'package:wonky_client/wonky_client.dart';
import 'package:wonky_ui/wonky_ui.dart';
import 'package:wonky_core/wonky_core.dart' hide ActorKind;

import '../commands/shell_commands/general_commands.dart' show mcpUrl;
Expand Down Expand Up @@ -261,7 +262,7 @@ class _McpDeveloperSettingsState extends State<McpDeveloperSettings> {
Text(
'${t.prefix}… · ${t.scopes.join(', ')}',
style: theme.textTheme.muted.copyWith(
fontFamily: 'packages/shad/GeistMono',
fontFamily: WonkyFonts.geistMono,
fontSize: 12,
),
),
Expand Down Expand Up @@ -305,7 +306,7 @@ class _McpDeveloperSettingsState extends State<McpDeveloperSettings> {
child: Text(
text,
style: TextStyle(
fontFamily: 'packages/shad/GeistMono',
fontFamily: WonkyFonts.geistMono,
fontSize: 12,
color: theme.colorScheme.foreground,
),
Expand Down Expand Up @@ -349,7 +350,7 @@ class _McpDeveloperSettingsState extends State<McpDeveloperSettings> {
child: Text(
created.secret,
style: TextStyle(
fontFamily: 'packages/shad/GeistMono',
fontFamily: WonkyFonts.geistMono,
color: theme.colorScheme.foreground,
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:flutter/widgets.dart';
import 'package:intl/intl.dart' as intl;
import 'package:shad/shad.dart';
import 'package:wonky_client/wonky_client.dart';
import 'package:wonky_ui/wonky_ui.dart';

import '../bootstrap/app_urls.dart';
import '../data/api.dart';
Expand Down Expand Up @@ -438,7 +439,7 @@ class _PublicationsSectionState extends State<PublicationsSection> {
child: Text(
text,
style: TextStyle(
fontFamily: 'packages/shad/GeistMono',
fontFamily: WonkyFonts.geistMono,
fontSize: 12,
color: theme.colorScheme.foreground,
),
Expand Down
40 changes: 23 additions & 17 deletions packages/wonky_app/lib/src/shell/wonky_shell.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_web_plugins/url_strategy.dart';
import 'package:provider/provider.dart';
import 'package:shad/material.dart' show ShadMaterial;
import 'package:shad/shad.dart';
import 'package:wonky_client/wonky_client.dart';
import 'package:wonky_core/wonky_core.dart' hide ActorKind;
Expand Down Expand Up @@ -386,24 +387,29 @@ class _WonkyShellState extends State<WonkyShell> {
WonkyUiLocalizations.delegate,
...config.localizationsDelegates,
],
builder: (context, child) => WonkyThemeScope(
data: WonkyThemeExtension(
density: s.prefs.wonkyDensity,
reduceMotion: s.prefs.reduceMotion,
),
child: KeymapScope(
scope: KeyScope.global,
keymap: s.keymap,
child: config.wrap(
context,
s,
McpBridgeScope(
services: s,
appTools: config.mcpUiTools(s),
child: ShellOverlays(
// ShadMaterial: the Material theme, Material and localizations
// that super_editor, SelectableText, re_editor and the Material
// Scrollbar need (shad 1.0.1 no longer installs them).
builder: (context, child) => ShadMaterial(
child: WonkyThemeScope(
data: WonkyThemeExtension(
density: s.prefs.wonkyDensity,
reduceMotion: s.prefs.reduceMotion,
),
child: KeymapScope(
scope: KeyScope.global,
keymap: s.keymap,
child: config.wrap(
context,
s,
McpBridgeScope(
services: s,
ready: _ready,
child: child ?? const SizedBox.shrink(),
appTools: config.mcpUiTools(s),
child: ShellOverlays(
services: s,
ready: _ready,
child: child ?? const SizedBox.shrink(),
),
),
),
),
Expand Down
2 changes: 1 addition & 1 deletion packages/wonky_app/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ dependencies:
serverpod_auth_idp_client: 4.1.0-rc.1
serverpod_auth_idp_flutter: 4.1.0-rc.1
serverpod_flutter: 4.1.0-rc.1
shad: ^0.99.4
shad: ^1.0.2
shared_preferences: ^2.5.6
sqlite_async: ^0.14.5
url_launcher: ^6.3.3
Expand Down
22 changes: 10 additions & 12 deletions packages/wonky_charts_flutter/lib/src/render/chart_painter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,22 @@ import 'dart:ui' as ui;
import 'package:flutter/foundation.dart' show visibleForTesting;
import 'package:flutter/rendering.dart';
import 'package:wonky_charts/wonky_charts.dart';
import 'package:wonky_ui/wonky_ui.dart';

import '../three_d/chart3d_gpu.dart';

/// Font used for chart text when the spec names none (or one that isn't
/// bundled): the app UI font shipped with `shad`.
const String kChartDefaultFont = 'packages/shad/Inter';
/// bundled): Inter, shipped with `wonky_ui`.
const String kChartDefaultFont = WonkyFonts.inter;

const List<String> _fallbackFonts = [
'packages/shad/Inter',
'packages/shad/Geist',
];
const List<String> _fallbackFonts = [WonkyFonts.inter, WonkyFonts.geist];

/// Families the app can render (bundled fonts); others fall back to
/// [kChartDefaultFont] so layout and paint use the same metrics.
const Set<String> _bundled = {
'packages/shad/Inter',
'packages/shad/Geist',
'packages/shad/GeistMono',
WonkyFonts.inter,
WonkyFonts.geist,
WonkyFonts.geistMono,
};

/// The bundled Flutter family chart text of family [f] is drawn with
Expand All @@ -34,9 +32,9 @@ String _family(String? f) {
if (f == null || f.isEmpty) return kChartDefaultFont;
if (_bundled.contains(f)) return f;
return switch (f.toLowerCase()) {
'inter' => 'packages/shad/Inter',
'geist' => 'packages/shad/Geist',
'geist mono' || 'geistmono' => 'packages/shad/GeistMono',
'inter' => WonkyFonts.inter,
'geist' => WonkyFonts.geist,
'geist mono' || 'geistmono' => WonkyFonts.geistMono,
_ => kChartDefaultFont,
};
}
Expand Down
2 changes: 1 addition & 1 deletion packages/wonky_charts_flutter/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ dependencies:
flutter_scene: ^0.24.3
# The shared chart widgets (ChartView tooltips, data table dialog, chart
# type icons, ChartStyleEditor) are built with shad (02).
shad: ^0.99.4
shad: ^1.0.2
# Color picker of the ChartStyleEditor.
wonky_ui:
path: ../wonky_ui
Expand Down
2 changes: 1 addition & 1 deletion packages/wonky_rich_editor/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ dependencies:
flutter_test:
sdk: flutter
markdown: ^7.3.1
shad: ^0.99.4
shad: ^1.0.2
# The vendored, patched super_editor (pubspec_overrides.yaml at the root).
super_editor: ^0.3.0-dev.52
wonky_rich_text:
Expand Down
Loading
Loading