fix(app): restore green Flutter suite on main

Closed
GI
3d ago
+46-10

What changed and why

The Flutter suite on main (Mobile App Checks › Dart Analyze & Tests) is red, so any PR that touches app/ fails. This restores a green suite.

  1. test/widgets/settings/ai_app_generator_large_text_test.dart — looks for Try something like, but English l10n is Try something like…. Breaking PR: #21341 (8c2909e5faf). The assertion was wrong when that test landed; the ellipsis has been in app_en.arb since #18436. Fix: expect the ellipsis the page already paints.

  2. test/widgets/settings/settings_search_header_stability_test.dart — SettingsDrawer watches UsageProvider and the harness does not provide it, so the first frame throws ProviderNotFoundException. Breaking PR: #21343 (2d77690f5b1). The watch has been in the drawer since #18723; the new header test omitted the provider. Fix: provide UsageProvider in the harness.

  3. test/widgets/apps_category_section_large_text_test.dart — two failures, both from #21340 (ac1b866d569). find.text('Productivity') matches the section title and each card's category label. And the card column overflows by 13px at text scale 1.3: row height was measured with TextPainter on the raw OmiType style, while painted text inherits Material's line height (~1.43), and the header was measured as title2 instead of the title3 it paints. Fix: measure the effective style (theme line height included) and the real title, chip, artwork, and action extents so the row grows with the text. Point the test at the title3 title so the card labels are not ambiguous.

  4. test/services/device_service_connection_failure_test.dart — "launch timeout preserves the connection and transport for native background reconnection" stays disconnected immediately after emitConnected(). Breaking PR: #21302 (ce3826d2fd1). No later commit changed DeviceConnection's transport listener or this test. The product is right: a launch timeout keeps the connection and transport, and a later connected event updates status. Production transports and the test fake both use an asynchronous broadcast stream, so the listener runs on a later microtask. The failed expect was followed by the debug log device connection state changed … connected. Fix: the test waits for that event. Product reconnect behavior is unchanged.

Product invariants affected

none

How it was verified

  • cd app && flutter test on each of the four files: all passed.
  • cd app && flutter test (full suite): 5493 passed, 21 skipped, 0 failed.
  • app/scripts/analyze_ratchet.sh: passed.
  • scripts/pr-preflight --lane local: passed (23 checks).

Tests

The four failing files are the regression coverage. The category-section test still fails on a real overflow; the row-height fix is what makes text scale 1.3 and 1.5 lay out.

UI evidence

UI-Evidence: none -- text-scale overflow is asserted by the category-section widget test; no new screen

Failure class (fixes)

Failure-Class: none

🤖 Generated with Claude Code