Commit c74175a
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
File tree
- lib
- generated/l10n
- l10n
- view/page
- container
- server
- detail
- edit
- tab
- ssh
- page
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2039 | 2039 | | |
2040 | 2040 | | |
2041 | 2041 | | |
| 2042 | + | |
| 2043 | + | |
| 2044 | + | |
| 2045 | + | |
| 2046 | + | |
| 2047 | + | |
| 2048 | + | |
| 2049 | + | |
| 2050 | + | |
| 2051 | + | |
| 2052 | + | |
| 2053 | + | |
2042 | 2054 | | |
2043 | 2055 | | |
2044 | 2056 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1114 | 1114 | | |
1115 | 1115 | | |
1116 | 1116 | | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
1117 | 1123 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1104 | 1104 | | |
1105 | 1105 | | |
1106 | 1106 | | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
1107 | 1113 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1116 | 1116 | | |
1117 | 1117 | | |
1118 | 1118 | | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
1119 | 1125 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1119 | 1119 | | |
1120 | 1120 | | |
1121 | 1121 | | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
1122 | 1128 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1105 | 1105 | | |
1106 | 1106 | | |
1107 | 1107 | | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
1108 | 1114 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1111 | 1111 | | |
1112 | 1112 | | |
1113 | 1113 | | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
1114 | 1120 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1075 | 1075 | | |
1076 | 1076 | | |
1077 | 1077 | | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
1078 | 1084 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1074 | 1074 | | |
1075 | 1075 | | |
1076 | 1076 | | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
1077 | 1083 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1111 | 1111 | | |
1112 | 1112 | | |
1113 | 1113 | | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
1114 | 1120 | | |
0 commit comments