Skip to content

test: cover the failed-update branch of the filter save sheet#3580

Merged
matthiasn merged 1 commit into
mainfrom
test/filter-modal-save-error
Jul 25, 2026
Merged

test: cover the failed-update branch of the filter save sheet#3580
matthiasn merged 1 commit into
mainfrom
test/filter-modal-save-error

Conversation

@matthiasn

@matthiasn matthiasn commented Jul 25, 2026

Copy link
Copy Markdown
Owner

Closes the one line codecov/patch flagged on #3579 (98.98% against a 99% target).

The miss is design_system_filter_modal.dart:454 — the error text on the save
sheet's choice page, whose colour #3579 moved from alert.error.defaultColor to
alert.error.ink. The line predates that change and was never covered, but it
lands in the diff, so it owes a test.

The only path that sets the page's error state is onUpdateSavedFilter
throwing. The new test drives that and pins what a failure has to preserve:

  • the sheet stays open rather than dismissing — dismissing would discard the
    draft the user was trying to save
  • the failure is stated in alert.error.ink, not the fill strength, since this
    is body-size text and the default step measures 4.25:1 on a dark sheet
  • the update button is pressable again afterwards, rather than wedged by an
    _updating flag left set on the error path

Local coverage confirms line 454 is now hit; the remaining uncovered lines in
that file are pre-existing and outside #3579's diff.

No production changes.

Summary by CodeRabbit

  • Bug Fixes
    • Improved saved-filter update error handling so failures keep the save screen open.
    • Error messages now use the correct alert styling.
    • The update action remains available for retrying after a failed attempt.

codecov/patch on #3579 came back at 98.98% against a 99% target — one line:
the choice page's error text, whose colour that PR moved to alert.error.ink.
The line predates the change, but it is in the diff, so it owes a test.

Drives the only path that sets the page's error state — onUpdateSavedFilter
throwing — and pins what a failure has to preserve: the sheet stays open
rather than dismissing and discarding the draft, the failure is stated in
ink (the AA-safe step, since the fill strength measures 4.25:1 on a dark
sheet), and the button is pressable again afterwards rather than wedged by
a stuck _updating flag.
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 9b7d11f1-514b-47ed-90c9-b3fe255e55f0

📥 Commits

Reviewing files that changed from the base of the PR and between 56bf8f2 and 44c0ae0.

📒 Files selected for processing (1)
  • test/features/design_system/components/task_filters/design_system_filter_modal_test.dart

📝 Walkthrough

Walkthrough

Adds widget coverage for failed saved-filter updates, including retained modal state, alert styling, visible errors, and retry behavior.

Changes

Saved-filter update failure

Layer / File(s) Summary
Failed update and retry behavior
test/features/design_system/components/task_filters/design_system_filter_modal_test.dart
Adds design-token assertions and a widget test verifying that update failures keep the choice page open, display the styled error, and allow the update action to be retried.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • matthiasn/lotti#3467: Refactors the filter modal flow and adds related task-filter persistence tests.
  • matthiasn/lotti#3579: Updates alert token ramps and contrast behavior related to the tested error styling.
🚥 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 clearly matches the main change: a test covering the failed-update branch of the filter save sheet.
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 test/filter-modal-save-error

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@matthiasn
matthiasn merged commit 997b20c into main Jul 25, 2026
24 checks passed
@matthiasn
matthiasn deleted the test/filter-modal-save-error branch July 25, 2026 13:49
@codecov

codecov Bot commented Jul 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.15%. Comparing base (56bf8f2) to head (44c0ae0).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3580   +/-   ##
=======================================
  Coverage   99.15%   99.15%           
=======================================
  Files        1783     1783           
  Lines      130638   130638           
=======================================
+ Hits       129529   129538    +9     
+ Misses       1109     1100    -9     
Flag Coverage Δ
glados 14.10% <ø> (ø)
standard 98.90% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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