Fix pre-existing test failure: EmailListScreen tapping search icon shows search bar #486

Closed
opened 2026-06-06 15:19:14 +00:00 by guettlibot · 5 comments
guettlibot commented 2026-06-06 15:19:14 +00:00 (Migrated from codeberg.org)

Problem

The widget test EmailListScreen tapping search icon shows search bar in test/widget/email_list_screen_test.dart (line 107) is permanently failing.

Error

Exception: Asset 'shaders/ink_sparkle.frag' manifest could not be decoded:
INVALID_ARGUMENT: Unsupported runtime stages format version. Expected 2, got 1.

The pre-compiled InkSparkle shader in the test asset bundle was built against an older Flutter SDK version and does not match the current runtime (Flutter 3.44.0).

Context

The test was written when the search bar was hidden behind a toggle icon. The SearchBar is now always visible in the AppBar, so the test's premise ("tapping icon shows search bar") is also stale — the bar is already there without any tap.

Fix

Two things need to happen:

  1. Update or delete the stale test — verify it still makes sense against the current UI (SearchBar always visible), or replace it with a test that reflects current behaviour.
  2. Investigate the ink_sparkle.frag shader version mismatch. Either rebuild the shader assets for Flutter 3.44.0 or configure the relevant tests to skip shader warm-up.
## Problem The widget test `EmailListScreen tapping search icon shows search bar` in `test/widget/email_list_screen_test.dart` (line 107) is permanently failing. ## Error ``` Exception: Asset 'shaders/ink_sparkle.frag' manifest could not be decoded: INVALID_ARGUMENT: Unsupported runtime stages format version. Expected 2, got 1. ``` The pre-compiled InkSparkle shader in the test asset bundle was built against an older Flutter SDK version and does not match the current runtime (Flutter 3.44.0). ## Context The test was written when the search bar was hidden behind a toggle icon. The SearchBar is now **always visible** in the AppBar, so the test's premise ("tapping icon shows search bar") is also stale — the bar is already there without any tap. ## Fix Two things need to happen: 1. Update or delete the stale test — verify it still makes sense against the current UI (SearchBar always visible), or replace it with a test that reflects current behaviour. 2. Investigate the `ink_sparkle.frag` shader version mismatch. Either rebuild the shader assets for Flutter 3.44.0 or configure the relevant tests to skip shader warm-up.
guettlibot commented 2026-06-06 15:25:02 +00:00 (Migrated from codeberg.org)

Now I have a complete picture. Let me write the implementation plan.

Here is the implementation plan for issue #486:


Implementation Plan

Root cause analysis

There are two independent problems:

1. Stale test logic (lines 107–129)
The test "tapping search icon shows search bar" taps Icons.search and then asserts find.byType(TextField) and find.text('Search…'). Both assertions are now trivially true without any tap — the SearchBar widget is permanently mounted in AppBar.bottom (email_list_screen.dart:247–268). The Icons.search icon in the tap is the leading icon inside the SearchBar, not a toggle button. The test title, interaction, and premise are all stale.

There is already a test at line 240, "SearchBar is always visible in the AppBar", that directly checks find.byType(SearchBar) and find.text('Search…') without any tap — it fully covers the stale test's intent.

2. Shader version mismatch
test/widget/helpers.dart:583 builds the test theme with useMaterial3: true and no splashFactory override. Material 3's default splash factory is InkSparkle, which at paint-time tries to decode shaders/ink_sparkle.frag from the asset bundle. The pre-compiled shader in the test bundle targets an older Flutter SDK format version (1), but Flutter 3.44.0 expects version 2 — causing the INVALID_ARGUMENT exception during pumpAndSettle.


Changes required

File: test/widget/email_list_screen_test.dart

  • Delete the test block at lines 107–129 (testWidgets('tapping search icon shows search bar', ...)).
    • Rationale: Its assertions are covered entirely by the existing "SearchBar is always visible in the AppBar" test (line 240). Keeping a renamed/repurposed variant would duplicate what subsequent search tests (lines 131–189) already exercise as setup steps.

File: test/widget/helpers.dart

  • In buildApp(), add splashFactory: NoSplash.splashFactory to both ThemeData instances (light and dark) at lines ~583 and ~589.
    theme: ThemeData(
      colorScheme: ColorScheme.fromSeed(seedColor: Colors.indigo),
      useMaterial3: true,
      splashFactory: NoSplash.splashFactory,   // ← add
    ),
    darkTheme: ThemeData(
      colorScheme: ColorScheme.fromSeed(
        seedColor: Colors.indigo,
        brightness: Brightness.dark,
      ),
      useMaterial3: true,
      splashFactory: NoSplash.splashFactory,   // ← add
    ),
    
    • NoSplash.splashFactory is part of package:flutter/material.dart — no new dependency needed.
    • This prevents Flutter from ever trying to load the pre-compiled ink_sparkle.frag asset during widget tests, eliminating the version-mismatch crash for all current and future tests in this suite.

What is NOT needed

  • No shader asset rebuild. The shaders/ directory in the test bundle is Flutter-SDK-internal; apps cannot ship a replacement.
  • No flutter test --no-shader-warmup flag. The theme-level override is narrower and applies automatically without build-system changes.
  • No changes to the production EmailListScreen code — it is correct; the issue is entirely in the test suite.
Now I have a complete picture. Let me write the implementation plan. Here is the implementation plan for issue #486: --- ## Implementation Plan ### Root cause analysis There are two independent problems: **1. Stale test logic (lines 107–129)** The test "tapping search icon shows search bar" taps `Icons.search` and then asserts `find.byType(TextField)` and `find.text('Search…')`. Both assertions are now trivially true without any tap — the `SearchBar` widget is permanently mounted in `AppBar.bottom` (`email_list_screen.dart:247–268`). The `Icons.search` icon in the tap is the *leading icon inside the SearchBar*, not a toggle button. The test title, interaction, and premise are all stale. There is already a test at line 240, "SearchBar is always visible in the AppBar", that directly checks `find.byType(SearchBar)` and `find.text('Search…')` without any tap — it fully covers the stale test's intent. **2. Shader version mismatch** `test/widget/helpers.dart:583` builds the test theme with `useMaterial3: true` and no `splashFactory` override. Material 3's default splash factory is `InkSparkle`, which at paint-time tries to decode `shaders/ink_sparkle.frag` from the asset bundle. The pre-compiled shader in the test bundle targets an older Flutter SDK format version (1), but Flutter 3.44.0 expects version 2 — causing the `INVALID_ARGUMENT` exception during `pumpAndSettle`. --- ### Changes required **File: `test/widget/email_list_screen_test.dart`** - Delete the test block at lines 107–129 (`testWidgets('tapping search icon shows search bar', ...)`). - Rationale: Its assertions are covered entirely by the existing "SearchBar is always visible in the AppBar" test (line 240). Keeping a renamed/repurposed variant would duplicate what subsequent search tests (lines 131–189) already exercise as setup steps. **File: `test/widget/helpers.dart`** - In `buildApp()`, add `splashFactory: NoSplash.splashFactory` to **both** `ThemeData` instances (light and dark) at lines ~583 and ~589. ```dart theme: ThemeData( colorScheme: ColorScheme.fromSeed(seedColor: Colors.indigo), useMaterial3: true, splashFactory: NoSplash.splashFactory, // ← add ), darkTheme: ThemeData( colorScheme: ColorScheme.fromSeed( seedColor: Colors.indigo, brightness: Brightness.dark, ), useMaterial3: true, splashFactory: NoSplash.splashFactory, // ← add ), ``` - `NoSplash.splashFactory` is part of `package:flutter/material.dart` — no new dependency needed. - This prevents Flutter from ever trying to load the pre-compiled `ink_sparkle.frag` asset during widget tests, eliminating the version-mismatch crash for all current and future tests in this suite. --- ### What is NOT needed - No shader asset rebuild. The `shaders/` directory in the test bundle is Flutter-SDK-internal; apps cannot ship a replacement. - No `flutter test --no-shader-warmup` flag. The theme-level override is narrower and applies automatically without build-system changes. - No changes to the production `EmailListScreen` code — it is correct; the issue is entirely in the test suite.
guettlibot commented 2026-06-06 15:35:03 +00:00 (Migrated from codeberg.org)

The PR is open at https://codeberg.org/guettli/sharedinbox/pulls/489.


What I did:

Two root causes were fixed in a single commit:

  1. Deleted the stale test 'tapping search icon shows search bar' (email_list_screen_test.dart lines 107–129). The SearchBar is now always rendered in AppBar.bottom, so both assertions (find.byType(TextField), find.text('Search…')) were trivially true before any tap. The existing test 'SearchBar is always visible in the AppBar' already covers this intent.

  2. Added splashFactory: NoSplash.splashFactory to both ThemeData instances in test/widget/helpers.dart. Material 3's default InkSparkle splash factory tries to load the pre-compiled shaders/ink_sparkle.frag asset at paint time. The bundled shader targets SDK format version 1, but Flutter 3.44.0 expects version 2 — causing the INVALID_ARGUMENT crash. Using NoSplash prevents that asset from ever being loaded in tests, fixing the crash for all current and future tests in the suite without any build-system changes.

The PR is open at https://codeberg.org/guettli/sharedinbox/pulls/489. --- **What I did:** Two root causes were fixed in a single commit: 1. **Deleted the stale test** `'tapping search icon shows search bar'` (`email_list_screen_test.dart` lines 107–129). The `SearchBar` is now always rendered in `AppBar.bottom`, so both assertions (`find.byType(TextField)`, `find.text('Search…')`) were trivially true before any tap. The existing test `'SearchBar is always visible in the AppBar'` already covers this intent. 2. **Added `splashFactory: NoSplash.splashFactory`** to both `ThemeData` instances in `test/widget/helpers.dart`. Material 3's default `InkSparkle` splash factory tries to load the pre-compiled `shaders/ink_sparkle.frag` asset at paint time. The bundled shader targets SDK format version 1, but Flutter 3.44.0 expects version 2 — causing the `INVALID_ARGUMENT` crash. Using `NoSplash` prevents that asset from ever being loaded in tests, fixing the crash for all current and future tests in the suite without any build-system changes.
guettlibot commented 2026-06-06 17:50:06 +00:00 (Migrated from codeberg.org)

agentloop: agent exceeded its 2h0m0s runtime budget and was stopped.

agent stderr tail:

[acpx] session agentloop-sharedinbox-issue-486 (cd257d7a-2012-49bd-854b-c28c33e09a57) · /home/si/agentloop/loop-data/sharedinbox/issues/486 · agent needs reconnect
agentloop: agent exceeded its 2h0m0s runtime budget and was stopped. agent stderr tail: ``` [acpx] session agentloop-sharedinbox-issue-486 (cd257d7a-2012-49bd-854b-c28c33e09a57) · /home/si/agentloop/loop-data/sharedinbox/issues/486 · agent needs reconnect ```
guettlibot commented 2026-06-06 17:50:38 +00:00 (Migrated from codeberg.org)

agentloop: previous agent process exited unexpectedly; resuming acpx session (restart 1/3).

agentloop: previous agent process exited unexpectedly; resuming acpx session (restart 1/3).
guettlibot commented 2026-06-06 19:55:03 +00:00 (Migrated from codeberg.org)

agentloop: agent exceeded its 2h0m0s runtime budget and was stopped.

agent stderr tail:

[acpx] session agentloop-sharedinbox-issue-486 (cd257d7a-2012-49bd-854b-c28c33e09a57) · /home/si/agentloop/loop-data/sharedinbox/issues/486 · agent connected
agentloop: agent exceeded its 2h0m0s runtime budget and was stopped. agent stderr tail: ``` [acpx] session agentloop-sharedinbox-issue-486 (cd257d7a-2012-49bd-854b-c28c33e09a57) · /home/si/agentloop/loop-data/sharedinbox/issues/486 · agent connected ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: guettli/sharedinbox#486