Skip to content

Code quality and UI improvements, and i18n update#1215

Merged
GT-610 merged 14 commits into
mainfrom
fix/code-quality-issues
Jun 28, 2026
Merged

Code quality and UI improvements, and i18n update#1215
GT-610 merged 14 commits into
mainfrom
fix/code-quality-issues

Conversation

@GT-610

@GT-610 GT-610 commented Jun 28, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features
    • Added localized UI labels for “Port Forward (Beta)” and “Systemd”.
  • Bug Fixes
    • Improved page refresh stability by aborting work after leaving and showing snackbars only while still active.
    • Hardened server detail views (progress clamping, safer memory percentage, consistent sensor summary rendering).
    • Better handling for invalid SSH navigation by auto-closing instead of showing a blank screen.
  • UI Changes
    • Updated several screens to use two-line headers with SPI context; adjusted their ordering.
    • Tweaked tap/focus behavior, tab ordering behavior, and minor layout/expand-section rendering.

GT-610 added 10 commits June 28, 2026 20:51
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.
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.
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.
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.
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
- 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
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.
…ver detail

- _buildMemView: Return null when ss.mem.total is 0 to prevent NaN/Infinity
- _buildProgress: Use clamp() instead of mutating the method parameter
- 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()
@coderabbitai

coderabbitai Bot commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 2ac48048-6254-460d-b141-470fc188b876

📥 Commits

Reviewing files that changed from the base of the PR and between a179363 and ad572fd.

📒 Files selected for processing (1)
  • lib/view/page/server/detail/view.dart

📝 Walkthrough

Walkthrough

This PR updates several Flutter pages with lifecycle, rendering, gesture, and navigation adjustments. It also adds new localized strings for the port-forward beta title and systemd labels across multiple ARB files, and updates page titles to use two-line app bar layouts in the port-forward, process, and systemd screens.

Possibly related PRs

Suggested reviewers

  • lollipopkit
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the PR’s broad focus on code cleanup, UI tweaks, and added localization strings.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/code-quality-issues

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot requested a review from lollipopkit June 28, 2026 13:36

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@lib/view/page/port_forward.dart`:
- Around line 74-76: The page title in TwoLineText still hardcodes the “(Beta)”
suffix, so move the entire label into localization instead of concatenating it
in port_forward.dart. Update the title construction to use a localized string
from libL10n/l10n (prefer libL10n) that already includes the beta marker, and
adjust the relevant localization entries so the Port Forward title is fully
translated without any raw English suffix.

In `@lib/view/page/systemd.dart`:
- Around line 33-34: The app-bar title in SystemdPage is hardcoded as
user-facing text, so replace the literal in the title assignment with a
localized string from libL10n/l10n. Update the Systemd page widget to use the
existing localization accessor instead of the string constant, keeping the
dynamic subtitle from widget.args.spi.name unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: b6316419-f7f4-42b4-a92d-5a010385083b

📥 Commits

Reviewing files that changed from the base of the PR and between 47aef2c and 0f28efa.

📒 Files selected for processing (10)
  • lib/view/page/container/container.dart
  • lib/view/page/port_forward.dart
  • lib/view/page/process.dart
  • lib/view/page/server/detail/misc.dart
  • lib/view/page/server/detail/view.dart
  • lib/view/page/server/edit/edit.dart
  • lib/view/page/server/tab/tab.dart
  • lib/view/page/ssh/page/page.dart
  • lib/view/page/ssh/tab.dart
  • lib/view/page/systemd.dart
💤 Files with no reviewable changes (1)
  • lib/view/page/server/detail/misc.dart

Comment thread lib/view/page/port_forward.dart
Comment thread lib/view/page/systemd.dart Outdated
- 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
@GT-610 GT-610 changed the title Fix/code quality issues Code quality and UI improvements Jun 28, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@lib/l10n/app_de.arb`:
- Line 257: The new page title is still hardcoded in English for German users;
update the German localization entry used by Port Forward. Adjust the
translation for portForwardBetaTitle in the app localization resources so the
AppBar in PortForwardPage shows a German title instead of the English string.

In `@lib/l10n/app_fr.arb`:
- Line 257: The new Port Forward page title is still hardcoded in English in the
French localization bundle. Update the existing app bar string entry for port
forwarding in app_fr.arb so it uses a proper French translation, and make sure
the key used by the Port Forward title remains consistent with the rest of the
localization files.

In `@lib/l10n/app_ko.arb`:
- Line 262: The new Port Forward page title is still hardcoded in English, so
update the localization entry in app_ko.arb for portForwardBetaTitle to a proper
Korean translation. Keep the key unchanged and make sure the translated value is
used by the Port Forward app bar so Korean users see localized text.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 22b9791b-92dc-4030-9a56-8281b7c264e4

📥 Commits

Reviewing files that changed from the base of the PR and between 0f28efa and 0d9564c.

⛔ Files ignored due to path filters (15)
  • lib/generated/l10n/l10n.dart is excluded by !**/generated/**
  • lib/generated/l10n/l10n_de.dart is excluded by !**/generated/**
  • lib/generated/l10n/l10n_en.dart is excluded by !**/generated/**
  • lib/generated/l10n/l10n_es.dart is excluded by !**/generated/**
  • lib/generated/l10n/l10n_fr.dart is excluded by !**/generated/**
  • lib/generated/l10n/l10n_id.dart is excluded by !**/generated/**
  • lib/generated/l10n/l10n_it.dart is excluded by !**/generated/**
  • lib/generated/l10n/l10n_ja.dart is excluded by !**/generated/**
  • lib/generated/l10n/l10n_ko.dart is excluded by !**/generated/**
  • lib/generated/l10n/l10n_nl.dart is excluded by !**/generated/**
  • lib/generated/l10n/l10n_pt.dart is excluded by !**/generated/**
  • lib/generated/l10n/l10n_ru.dart is excluded by !**/generated/**
  • lib/generated/l10n/l10n_tr.dart is excluded by !**/generated/**
  • lib/generated/l10n/l10n_uk.dart is excluded by !**/generated/**
  • lib/generated/l10n/l10n_zh.dart is excluded by !**/generated/**
📒 Files selected for processing (17)
  • lib/l10n/app_de.arb
  • lib/l10n/app_en.arb
  • lib/l10n/app_es.arb
  • lib/l10n/app_fr.arb
  • lib/l10n/app_id.arb
  • lib/l10n/app_it.arb
  • lib/l10n/app_ja.arb
  • lib/l10n/app_ko.arb
  • lib/l10n/app_nl.arb
  • lib/l10n/app_pt.arb
  • lib/l10n/app_ru.arb
  • lib/l10n/app_tr.arb
  • lib/l10n/app_uk.arb
  • lib/l10n/app_zh.arb
  • lib/l10n/app_zh_tw.arb
  • lib/view/page/port_forward.dart
  • lib/view/page/systemd.dart
✅ Files skipped from review due to trivial changes (12)
  • lib/l10n/app_pt.arb
  • lib/l10n/app_it.arb
  • lib/l10n/app_es.arb
  • lib/l10n/app_ru.arb
  • lib/l10n/app_tr.arb
  • lib/l10n/app_uk.arb
  • lib/l10n/app_en.arb
  • lib/l10n/app_zh.arb
  • lib/l10n/app_nl.arb
  • lib/l10n/app_ja.arb
  • lib/l10n/app_zh_tw.arb
  • lib/l10n/app_id.arb
🚧 Files skipped from review as they are similar to previous changes (2)
  • lib/view/page/systemd.dart
  • lib/view/page/port_forward.dart

Comment thread lib/l10n/app_de.arb Outdated
Comment thread lib/l10n/app_fr.arb Outdated
Comment thread lib/l10n/app_ko.arb Outdated
- German: 'Port Forwarding (Beta)'
- French: 'Transfert de port (Beta)'
- Korean: '포트 포워딩 (Beta)'

Regenerate l10n files with flutter gen-l10n.
@GT-610 GT-610 changed the title Code quality and UI improvements Code quality and UI improvements, and i18n update Jun 28, 2026
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 28, 2026
- 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)
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 28, 2026
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.
@GT-610 GT-610 merged commit c74175a into main Jun 28, 2026
3 checks passed
@GT-610 GT-610 deleted the fix/code-quality-issues branch June 28, 2026 15:35
@GT-610 GT-610 restored the fix/code-quality-issues branch June 28, 2026 15:35
@GT-610 GT-610 deleted the fix/code-quality-issues branch June 28, 2026 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant