Merge upstream/dev (22 commits) [upstream-sync]
Conflicts resolved by hand, our fork changes carried over: - MainActivity.kt: keep the unread widget hooks next to upstream's scroll capture (attach and detach both). - app_settings_screen.dart: upstream wrapped the list in MeshSettingsTileTheme; image-message and translation sections stay gated on kOnDeviceMl (ML-free build). - channel_chat_screen.dart: upstream split build() into methods; took theirs and re-applied the terminal-theme list padding. - chat_composer.dart: both imports (terminal_theme, radio_guard). - mesh_nav_tile.dart: upstream's meshTileTitleStyle, with the smaller terminal-theme title kept. flutter analyze clean, flutter test 1522 passed (CI image, local). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
185d2aca53
210 files changed
+52066
-5541
No files matched your search
@@ -46,94 +46,96 @@ class AppSettingsScreen extends StatelessWidget {
|
||||
centerTitle: true,
|
||||
bottom: const SyncProgressAppBarBottom(),
|
||||
),
|
||||
body: SafeArea(
|
||||
top: false,
|
||||
// Each card subscribes to only what it shows, so connector traffic
|
||||
// and translation download ticks do not rebuild the whole list.
|
||||
child: ListView(
|
||||
padding: const EdgeInsets.fromLTRB(0, 8, 0, 24),
|
||||
children: [
|
||||
// APPEARANCE
|
||||
SectionHeader(context.l10n.appSettings_appearance),
|
||||
MeshCard(
|
||||
padding: EdgeInsets.zero,
|
||||
child: _settingsCard(_buildAppearanceContent),
|
||||
),
|
||||
|
||||
// NOTIFICATIONS
|
||||
SectionHeader(context.l10n.appSettings_notifications),
|
||||
MeshCard(
|
||||
padding: EdgeInsets.zero,
|
||||
child: _settingsCard(_buildNotificationsContent),
|
||||
),
|
||||
|
||||
// MESSAGING
|
||||
SectionHeader(context.l10n.appSettings_messaging),
|
||||
MeshCard(
|
||||
padding: EdgeInsets.zero,
|
||||
child: _settingsCard(_buildMessagingContent),
|
||||
),
|
||||
|
||||
// ROUTING
|
||||
SectionHeader(context.l10n.appSettings_routingSection),
|
||||
MeshCard(
|
||||
padding: EdgeInsets.zero,
|
||||
child: _settingsCard(_buildRoutingContent),
|
||||
),
|
||||
|
||||
// IMAGE MESSAGES
|
||||
if (kOnDeviceMl) ...[
|
||||
SectionHeader(context.l10n.appSettings_imageMessagesSection),
|
||||
body: MeshSettingsTileTheme(
|
||||
child: SafeArea(
|
||||
top: false,
|
||||
// Each card subscribes to only what it shows, so connector traffic
|
||||
// and translation download ticks do not rebuild the whole list.
|
||||
child: ListView(
|
||||
padding: const EdgeInsets.fromLTRB(0, 8, 0, 24),
|
||||
children: [
|
||||
// APPEARANCE
|
||||
SectionHeader(context.l10n.appSettings_appearance),
|
||||
MeshCard(
|
||||
padding: EdgeInsets.zero,
|
||||
child: _settingsCard(_buildImageMessagesContent),
|
||||
child: _settingsCard(_buildAppearanceContent),
|
||||
),
|
||||
],
|
||||
|
||||
// BATTERY
|
||||
SectionHeader(context.l10n.appSettings_battery),
|
||||
MeshCard(
|
||||
padding: const EdgeInsets.fromLTRB(16, 4, 16, 16),
|
||||
child: _settingsCard(_buildBatteryContent),
|
||||
),
|
||||
// NOTIFICATIONS
|
||||
SectionHeader(context.l10n.appSettings_notifications),
|
||||
MeshCard(
|
||||
padding: EdgeInsets.zero,
|
||||
child: _settingsCard(_buildNotificationsContent),
|
||||
),
|
||||
|
||||
// MAP
|
||||
SectionHeader(context.l10n.appSettings_mapDisplay),
|
||||
MeshCard(
|
||||
padding: EdgeInsets.zero,
|
||||
child: _settingsCard(_buildMapContent),
|
||||
),
|
||||
// MESSAGING
|
||||
SectionHeader(context.l10n.appSettings_messaging),
|
||||
MeshCard(
|
||||
padding: EdgeInsets.zero,
|
||||
child: _settingsCard(_buildMessagingContent),
|
||||
),
|
||||
|
||||
// NETWORK MAP
|
||||
SectionHeader(context.l10n.networkMap_settingsSection),
|
||||
const MeshCard(
|
||||
padding: EdgeInsets.zero,
|
||||
child: NetworkMapSettingsSection(),
|
||||
),
|
||||
// ROUTING
|
||||
SectionHeader(context.l10n.appSettings_routingSection),
|
||||
MeshCard(
|
||||
padding: EdgeInsets.zero,
|
||||
child: _settingsCard(_buildRoutingContent),
|
||||
),
|
||||
|
||||
// TRANSLATION (non-web only)
|
||||
if (!kIsWeb && kOnDeviceMl) ...[
|
||||
SectionHeader(context.l10n.translation_title),
|
||||
// IMAGE MESSAGES
|
||||
if (kOnDeviceMl) ...[
|
||||
SectionHeader(context.l10n.appSettings_imageMessagesSection),
|
||||
MeshCard(
|
||||
padding: EdgeInsets.zero,
|
||||
child: _settingsCard(_buildImageMessagesContent),
|
||||
),
|
||||
],
|
||||
|
||||
// BATTERY
|
||||
SectionHeader(context.l10n.appSettings_battery),
|
||||
MeshCard(
|
||||
padding: const EdgeInsets.fromLTRB(16, 4, 16, 16),
|
||||
child: _settingsCard(_buildBatteryContent),
|
||||
),
|
||||
|
||||
// MAP
|
||||
SectionHeader(context.l10n.appSettings_mapDisplay),
|
||||
MeshCard(
|
||||
padding: EdgeInsets.zero,
|
||||
child: _settingsCard(_buildMapContent),
|
||||
),
|
||||
|
||||
// NETWORK MAP
|
||||
SectionHeader(context.l10n.networkMap_settingsSection),
|
||||
const MeshCard(
|
||||
padding: EdgeInsets.zero,
|
||||
child: TranslationSettingsSection(),
|
||||
child: NetworkMapSettingsSection(),
|
||||
),
|
||||
|
||||
// TRANSLATION (non-web only)
|
||||
if (!kIsWeb && kOnDeviceMl) ...[
|
||||
SectionHeader(context.l10n.translation_title),
|
||||
const MeshCard(
|
||||
padding: EdgeInsets.zero,
|
||||
child: TranslationSettingsSection(),
|
||||
),
|
||||
],
|
||||
|
||||
// CYR2LAT
|
||||
SectionHeader(context.l10n.channels_cyr2latSettingsHeading),
|
||||
MeshCard(
|
||||
padding: const EdgeInsets.fromLTRB(16, 4, 16, 16),
|
||||
child: _settingsCard(_buildCyr2LatContent),
|
||||
),
|
||||
|
||||
// DEBUG
|
||||
SectionHeader(context.l10n.appSettings_debugCard),
|
||||
MeshCard(
|
||||
padding: EdgeInsets.zero,
|
||||
child: _settingsCard(_buildDebugContent),
|
||||
),
|
||||
],
|
||||
|
||||
// CYR2LAT
|
||||
SectionHeader(context.l10n.channels_cyr2latSettingsHeading),
|
||||
MeshCard(
|
||||
padding: const EdgeInsets.fromLTRB(16, 4, 16, 16),
|
||||
child: _settingsCard(_buildCyr2LatContent),
|
||||
),
|
||||
|
||||
// DEBUG
|
||||
SectionHeader(context.l10n.appSettings_debugCard),
|
||||
MeshCard(
|
||||
padding: EdgeInsets.zero,
|
||||
child: _settingsCard(_buildDebugContent),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -185,15 +187,19 @@ class AppSettingsScreen extends StatelessWidget {
|
||||
segments: [
|
||||
ButtonSegment(
|
||||
value: 'system',
|
||||
label: Text(context.l10n.appSettings_themeSystem),
|
||||
label: MeshSegmentLabel(
|
||||
context.l10n.appSettings_themeSystem,
|
||||
),
|
||||
),
|
||||
ButtonSegment(
|
||||
value: 'light',
|
||||
label: Text(context.l10n.appSettings_themeLight),
|
||||
label: MeshSegmentLabel(
|
||||
context.l10n.appSettings_themeLight,
|
||||
),
|
||||
),
|
||||
ButtonSegment(
|
||||
value: 'dark',
|
||||
label: Text(context.l10n.appSettings_themeDark),
|
||||
label: MeshSegmentLabel(context.l10n.appSettings_themeDark),
|
||||
),
|
||||
// tth fork: untranslated on purpose, it is a name.
|
||||
const ButtonSegment(value: 'terminal', label: Text('Term')),
|
||||
@@ -531,116 +537,6 @@ class AppSettingsScreen extends StatelessWidget {
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const Divider(height: 1),
|
||||
ListTile(
|
||||
title: Text(context.l10n.appSettings_maxRouteWeight),
|
||||
subtitle: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
context.l10n.appSettings_maxRouteWeightSubtitle,
|
||||
),
|
||||
Slider(
|
||||
value: settingsService.settings.maxRouteWeight,
|
||||
min: 1,
|
||||
max: 10,
|
||||
divisions: 9,
|
||||
label: settingsService.settings.maxRouteWeight
|
||||
.round()
|
||||
.toString(),
|
||||
onChanged: (value) =>
|
||||
settingsService.setMaxRouteWeight(value),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const Divider(height: 1),
|
||||
ListTile(
|
||||
title: Text(
|
||||
context.l10n.appSettings_initialRouteWeight,
|
||||
),
|
||||
subtitle: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
context
|
||||
.l10n
|
||||
.appSettings_initialRouteWeightSubtitle,
|
||||
),
|
||||
Slider(
|
||||
value:
|
||||
settingsService.settings.initialRouteWeight,
|
||||
min: 0.5,
|
||||
max: 5.0,
|
||||
divisions: 9,
|
||||
label: settingsService.settings.initialRouteWeight
|
||||
.toStringAsFixed(1),
|
||||
onChanged: (value) =>
|
||||
settingsService.setInitialRouteWeight(value),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const Divider(height: 1),
|
||||
ListTile(
|
||||
title: Text(
|
||||
context.l10n.appSettings_routeWeightSuccessIncrement,
|
||||
),
|
||||
subtitle: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
context
|
||||
.l10n
|
||||
.appSettings_routeWeightSuccessIncrementSubtitle,
|
||||
),
|
||||
Slider(
|
||||
value: settingsService
|
||||
.settings
|
||||
.routeWeightSuccessIncrement,
|
||||
min: 0.1,
|
||||
max: 2.0,
|
||||
divisions: 19,
|
||||
label: settingsService
|
||||
.settings
|
||||
.routeWeightSuccessIncrement
|
||||
.toStringAsFixed(1),
|
||||
onChanged: (value) => settingsService
|
||||
.setRouteWeightSuccessIncrement(value),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const Divider(height: 1),
|
||||
ListTile(
|
||||
title: Text(
|
||||
context.l10n.appSettings_routeWeightFailureDecrement,
|
||||
),
|
||||
subtitle: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
context
|
||||
.l10n
|
||||
.appSettings_routeWeightFailureDecrementSubtitle,
|
||||
),
|
||||
Slider(
|
||||
value: settingsService
|
||||
.settings
|
||||
.routeWeightFailureDecrement,
|
||||
min: 0.1,
|
||||
max: 2.0,
|
||||
divisions: 19,
|
||||
label: settingsService
|
||||
.settings
|
||||
.routeWeightFailureDecrement
|
||||
.toStringAsFixed(1),
|
||||
onChanged: (value) => settingsService
|
||||
.setRouteWeightFailureDecrement(value),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const Divider(height: 1),
|
||||
ListTile(
|
||||
title: Text(context.l10n.appSettings_maxMessageRetries),
|
||||
@@ -947,7 +843,7 @@ class AppSettingsScreen extends StatelessWidget {
|
||||
) {
|
||||
final textTheme = Theme.of(context).textTheme;
|
||||
final scheme = Theme.of(context).colorScheme;
|
||||
final alreadyHave = codec.availableModels.any((m) => m.id == spec.id);
|
||||
final alreadyHave = spec.hasCompleteInstalledRecord(codec.availableModels);
|
||||
// downloadPresetModel throws StateError on a placeholder URL, deliberately,
|
||||
// so the button must not be offerable until the weights are published.
|
||||
final blocked = spec.urlsArePlaceholders;
|
||||
@@ -1006,7 +902,7 @@ class AppSettingsScreen extends StatelessWidget {
|
||||
final l10n = context.l10n;
|
||||
try {
|
||||
await codec.downloadPresetModel(spec);
|
||||
} on Exception catch (error) {
|
||||
} catch (error) {
|
||||
messenger.showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(l10n.imageMessages_downloadFailedWithError('$error')),
|
||||
|
||||
Reference in new issue
Block a user