Skip to content

Commit c74175a

Browse files
authored
Code quality and UI improvements, and i18n update (#1215)
* fix: prevent zombie routes in SSHPage.restorableRouteBuilder Replace SizedBox.shrink() placeholder routes with _EmptyRoute that auto-pops via post-frame callback. Previously, invalid arguments or deleted servers would push invisible routes that persisted in the semantics tree, triggering AXTree update failures. * perf: eliminate O(n²) access patterns in SSH tab PageView Convert _tabMap.entries to a list once in PageView.builder and _syncVisibleTabs instead of calling .keys.elementAt(idx) and .values.elementAt(i) in loops, which are O(n) per iteration. * fix: change GestureDetector HitTestBehavior from opaque to translucent HitTestBehavior.opaque marked the entire server list body as a semantics tap target and could interfere with event routing to child widgets. Use translucent to preserve tap-for-unfocus behavior without swallowing events. * fix: narrow GestureDetector scope in server edit page Move GestureDetector from wrapping the entire Scaffold to only wrapping the form body. This prevents assigning a tap semantics role to the whole page including the app bar and FAB. * fix: unify server feature page AppBar title format Standardize all server sub-pages to use TwoLineText with feature name on top and server name on bottom: - systemd.dart: Text('Systemd') -> TwoLineText(up: 'Systemd', down: spi.name) - port_forward.dart: Text(portForward+Beta) -> TwoLineText(up: portForward+Beta, down: spi.name) - process.dart: swap TwoLineText up/down to match consistent layout * fix: remove dead code across server feature pages - container.dart: Remove unused _textController field and dispose call - container.dart: Remove unreachable null-coalescing fallback in _buildLoading - container.dart: Remove ineffective SizedBox(height: 3) inside a Row - container.dart: Remove always-false enum values.length checks - container.dart: Simplify redundant async/await in FAB onPressed - view.dart: Remove unused import of cmd_types.dart - misc.dart: Remove unused _NetSortType getters (isDevice, isIn, isOut) - view.dart: Remove unreachable null-coalescing on si.summary * fix: add error handling and guard setState in ProcessPage._refresh Wrap SSH command execution in try/catch to handle connection drops and timeouts gracefully. Add mounted checks before UI updates. Only call setState after successful data parse to avoid unnecessary rebuilds when data hasn't changed. * fix: guard against division by zero and fix parameter mutation in server detail - _buildMemView: Return null when ss.mem.total is 0 to prevent NaN/Infinity - _buildProgress: Use clamp() instead of mutating the method parameter * fix: correct async void methods and navigation inconsistency - systemd.dart: Change _showConfirmDialog from void to Future<void> - port_forward.dart: Change _onSave from void to Future<void> - port_forward.dart: Use context.pop() instead of Navigator.of(context).pop() * fix: replace hardcoded title strings with localized strings - port_forward.dart: Replace inline ' (Beta)' with localized libL10n.portForwardBetaTitle - systemd.dart: Replace hardcoded 'Systemd' with localized libL10n.systemd - Add portForwardBetaTitle and systemd strings to all 15 ARB files - Regenerate l10n with flutter gen-l10n * fix(l10n): add proper translations for portForwardBetaTitle - German: 'Port Forwarding (Beta)' - French: 'Transfert de port (Beta)' - Korean: '포트 포워딩 (Beta)' Regenerate l10n files with flutter gen-l10n. * fix: use local l10n for portForwardBetaTitle and systemd titles - port_forward.dart: Use l10n (local) instead of libL10n (fl_lib) for portForwardBetaTitle since the string is defined in local ARB files - systemd.dart: Use l10n (local) instead of libL10n for systemd, and add missing locale.dart import - ssh/tab.dart: Remove unreachable null-coalescing fallback on entries[idx].value.page (page is non-nullable Widget) * fix: restore cmd_types.dart import needed for StatusCmdType.i18n The cmd_types.dart import provides the StatusCmdTypeX extension that defines the i18n getter used at view.dart:206. It was incorrectly removed as 'unused' in a prior commit.
1 parent 47aef2c commit c74175a

40 files changed

Lines changed: 212 additions & 58 deletions

lib/generated/l10n/l10n.dart

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2039,6 +2039,18 @@ abstract class AppLocalizations {
20392039
/// In en, this message translates to:
20402040
/// **'Clear history'**
20412041
String get clearHistory;
2042+
2043+
/// No description provided for @portForwardBetaTitle.
2044+
///
2045+
/// In en, this message translates to:
2046+
/// **'Port Forward (Beta)'**
2047+
String get portForwardBetaTitle;
2048+
2049+
/// No description provided for @systemd.
2050+
///
2051+
/// In en, this message translates to:
2052+
/// **'Systemd'**
2053+
String get systemd;
20422054
}
20432055

20442056
class _AppLocalizationsDelegate

lib/generated/l10n/l10n_de.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1114,4 +1114,10 @@ class AppLocalizationsDe extends AppLocalizations {
11141114

11151115
@override
11161116
String get clearHistory => 'Clear history';
1117+
1118+
@override
1119+
String get portForwardBetaTitle => 'Port Forwarding (Beta)';
1120+
1121+
@override
1122+
String get systemd => 'Systemd';
11171123
}

lib/generated/l10n/l10n_en.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,4 +1104,10 @@ class AppLocalizationsEn extends AppLocalizations {
11041104

11051105
@override
11061106
String get clearHistory => 'Clear history';
1107+
1108+
@override
1109+
String get portForwardBetaTitle => 'Port Forward (Beta)';
1110+
1111+
@override
1112+
String get systemd => 'Systemd';
11071113
}

lib/generated/l10n/l10n_es.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,4 +1116,10 @@ class AppLocalizationsEs extends AppLocalizations {
11161116

11171117
@override
11181118
String get clearHistory => 'Clear history';
1119+
1120+
@override
1121+
String get portForwardBetaTitle => 'Port Forward (Beta)';
1122+
1123+
@override
1124+
String get systemd => 'Systemd';
11191125
}

lib/generated/l10n/l10n_fr.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,4 +1119,10 @@ class AppLocalizationsFr extends AppLocalizations {
11191119

11201120
@override
11211121
String get clearHistory => 'Clear history';
1122+
1123+
@override
1124+
String get portForwardBetaTitle => 'Transfert de port (Beta)';
1125+
1126+
@override
1127+
String get systemd => 'Systemd';
11221128
}

lib/generated/l10n/l10n_id.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,4 +1105,10 @@ class AppLocalizationsId extends AppLocalizations {
11051105

11061106
@override
11071107
String get clearHistory => 'Clear history';
1108+
1109+
@override
1110+
String get portForwardBetaTitle => 'Port Forward (Beta)';
1111+
1112+
@override
1113+
String get systemd => 'Systemd';
11081114
}

lib/generated/l10n/l10n_it.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1111,4 +1111,10 @@ class AppLocalizationsIt extends AppLocalizations {
11111111

11121112
@override
11131113
String get clearHistory => 'Clear history';
1114+
1115+
@override
1116+
String get portForwardBetaTitle => 'Port Forward (Beta)';
1117+
1118+
@override
1119+
String get systemd => 'Systemd';
11141120
}

lib/generated/l10n/l10n_ja.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1075,4 +1075,10 @@ class AppLocalizationsJa extends AppLocalizations {
10751075

10761076
@override
10771077
String get clearHistory => 'Clear history';
1078+
1079+
@override
1080+
String get portForwardBetaTitle => 'Port Forward (Beta)';
1081+
1082+
@override
1083+
String get systemd => 'Systemd';
10781084
}

lib/generated/l10n/l10n_ko.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,4 +1074,10 @@ class AppLocalizationsKo extends AppLocalizations {
10741074

10751075
@override
10761076
String get clearHistory => 'Clear history';
1077+
1078+
@override
1079+
String get portForwardBetaTitle => '포트 포워딩 (Beta)';
1080+
1081+
@override
1082+
String get systemd => 'Systemd';
10771083
}

lib/generated/l10n/l10n_nl.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1111,4 +1111,10 @@ class AppLocalizationsNl extends AppLocalizations {
11111111

11121112
@override
11131113
String get clearHistory => 'Clear history';
1114+
1115+
@override
1116+
String get portForwardBetaTitle => 'Port Forward (Beta)';
1117+
1118+
@override
1119+
String get systemd => 'Systemd';
11141120
}

0 commit comments

Comments
 (0)