Skip to content

refactor: migrate port/service rule dialogs from AlertDialog to UI Kit dialog pattern #1166

Description

@AustinChangLinksys

Summary

Three port/service rule dialogs render with raw Material AlertDialog + Text()
instead of the UI Kit dialog pattern (showSimpleAppDialog / UI Kit widgets).
This is pre-existing tech debt — surfaced by the pre-PR readiness review on
feat/e2e-usp-transport (the counts of AlertDialog/Text( are identical in
base and head, so that branch did not introduce it).

Files

  • lib/page/dashboard/views/dialogs/port_forwarding_dialog.dart
  • lib/page/ipv6_port_service/views/dialogs/ipv6_port_service_rule_dialog.dart
  • lib/page/port_forwarding/views/dialogs/port_range_forwarding_dialog.dart

All three are StatefulWidget dialogs with their own TextEditingControllers,
FocusNodes, and focus-loss validation.

Why it wasn't fixed in the transport/E2E PR

Converting these to showSimpleAppDialog / UI Kit means restructuring each
StatefulWidget dialog into the UI Kit builder pattern — a sizeable, higher-risk
refactor. Those dialogs were just modified (validation moved to focus-loss +
semanticLabels added for E2E), so stacking a structural rewrite on top would
compound risk. Kept out of that PR deliberately; tracked here for a focused
follow-up.

Scope / acceptance

  • Replace AlertDialog with the UI Kit dialog entry point (showSimpleAppDialog
    or equivalent), and raw Text() with AppText, in all three dialogs.
  • Preserve behavior: focus-loss validation, _isFormValid/_hasRequiredInput
    submit gating, and the semanticLabels (port-forwarding-* etc.) that E2E
    relies on must all still work.
  • Keep the golden tests green (regenerate baselines only if the visual change is
    intentional).
  • Verify the E2E add/edit-rule flows still pass (they locate fields by the inner
    hintText node — see the ui_kit AppTextField excludeSemantics follow-up
    noted in the E2E repo's docs/test-inventory.md).

Related

  • Found during the E2E testing initiative (feat/e2e-usp-transport).
  • See also the ui_kit follow-up: AppTextField wraps its inner TextField in
    Semantics(textField, label) without excludeSemantics, producing two textbox
    nodes for a labelled field.

Metadata

Metadata

Labels

2.xLabeled for 2.x versionconfidence:lowInsufficient evidence; body-only speculation (not posted)refactorBehavior-preserving cleanup / tech-debt (Sweeper mode)ui_kitui_kit related issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions