feat(studio): theme-plugin picker + translate-hook wrapper
Some checks failed
Security / Security check (push) Failing after 2s
Some checks failed
Security / Security check (push) Failing after 2s
Two pieces of the Studio plugin host: - `data/theme_plugin.dart`: discovery, persistence, ColorScheme translation. Plugins listed via list_capabilities filtered to studio.theme.*; selection persisted in SharedPreferences; loadThemePluginSchemes builds a ColorScheme pair from the plugin's 14 ARGB tokens per brightness. - `main.dart`: StudioApp gains themePluginNotifier + setThemePlugin(). MaterialApp wraps a FutureBuilder that re-fetches the plugin's ColorSchemes whenever the capability flips; falls back to FaiTheme.light/dark on null or load failure. - `fai_settings_dialog.dart`: new `_ThemePluginPanel` shows a dropdown of installed studio.theme.* capabilities + a "Built-in" entry. Switching applies immediately. - HubService.invokePluginTranslate added as the typed wrapper for the new gRPC RPC — ready for the FaiEnBadge swap-out in the next iteration. - 4 new l10n keys (themePluginHeader / None / Hint / Empty), EN+DE. flutter analyze + flutter test (widget + friendly_error): both green. The integration test for the theme picker is the existing fai_runtime plugin_theme + Studio-side invokePluginTheme path that round-trips through the new mirror-installable studio-theme-solarized bundle. Signed-off-by: flemming-it <sf@flemming.it> Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
This commit is contained in:
parent
a5bcde6446
commit
91706cea2b
9 changed files with 430 additions and 13 deletions
|
|
@ -420,6 +420,27 @@ class HubService {
|
|||
return (brightness: r.brightness, tokens: r.tokens.toList());
|
||||
}
|
||||
|
||||
/// Invoke an installed Studio translate plugin and return
|
||||
/// the translated text. Empty `fromLocale` lets the plugin
|
||||
/// auto-detect; `toLocale` is the active Studio locale.
|
||||
///
|
||||
/// Caller catches the gRPC exception and routes it through
|
||||
/// `friendlyError` like every other RPC.
|
||||
Future<String> invokePluginTranslate({
|
||||
required String capability,
|
||||
required String text,
|
||||
required String toLocale,
|
||||
String fromLocale = '',
|
||||
}) async {
|
||||
final r = await _client.invokePluginTranslate(
|
||||
capability: capability,
|
||||
text: text,
|
||||
toLocale: toLocale,
|
||||
fromLocale: fromLocale,
|
||||
);
|
||||
return r.translated;
|
||||
}
|
||||
|
||||
/// Snapshot of every configured MCP server.
|
||||
Future<List<McpClientInfo>> listMcpClients() async {
|
||||
final r = await _client.listMcpClients();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue