Skip to content

Draft: feat(donation-appeal): Create the logic to display the donation appeal - #11583

Open
dani-zilla wants to merge 9 commits into
thunderbird:mainfrom
dani-zilla:11547-new-donation-appeal-display-logic
Open

dani-zilla wants to merge 9 commits into
thunderbird:mainfrom
dani-zilla:11547-new-donation-appeal-display-logic

Conversation

@dani-zilla

@dani-zilla dani-zilla commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Contribution Summary

Closes: #11547

Description

This introduces the logic and tests that define when we display a second donation appeal after the first one.

It currently uses the same fragment and UI as the original, as the UI will be completed in another ticket.

This also introduces tests for the second funding reminder, as well as adding new tests for displaying the first funding reminder. We don't want these to overlap.

Screen Shots

Existing UI. Updating this is out of scope for this ticket:

Screenshot 2026-09-22 at 1 54 05 PM

AI Disclosure

Select one of the following (mandatory)

  • This contribution does not include any changes created or assisted by AI.
  • This contribution includes changes assisted by AI.
  • This contribution includes changes created by AI.

Contribution Checklist

  • I have read and affirm that my contribution adheres to Mozilla’s Community Participation Guidelines
  • This contribution is in Kotlin where possible
  • This contribution does not use merge commits
  • This contribution adheres to the existing codestyle (run gradlew spotlessCheck to check and gradlew spotlessApply to format your source code; will be checked by CI).
  • This contribution does not break existing unit tests (run gradlew testDebugUnitTest; will be checked by CI).
  • This contribution includes tests for any new functionality, and maintains tests for any updated functionality.
  • This contribution adheres to our Engineering process (RFC/Technical Design/ADR)
  • This PR has a descriptive title and body that accurately outlines all changes made, and contains a reference to any issues that it fixes (e.g. Closes #XXX or Fixes #XXX).

Testing Instructions

To test this, you'll have to go into FundingReminderContract.kt Adjust FUNDING_REMINDER_DELAY_MILLIS to be under 1000L Do the same for FUNDING_REMINDER_MIN_ACTIVITY_MILLIS Don't do 0L if you'd like to test the delay better. You can set the FUNDING_REMINDER_DELAY_MILLIS to 30000L, for example, to test that the alerts only show after 30 second has passed. You can then, after the amount of waiting required, open the account drawer, select settings, then go back to the message list. Now select a message and press back. It should appear as the message list appears. This is reflective of the current implementation, and changing it may be a part of a future ticket, but matching the behavior of the existing code is the current goal. You will have to clear app storage between tests.

…he logic for the first displayed appeal to prepare for a second.
…ell as the logic changes for the first appeal.
@dani-zilla
dani-zilla requested a review from a team as a code owner September 18, 2026 22:48
@github-actions github-actions Bot added the tb-team Tasks and features handled by project maintainers label Sep 18, 2026
@github-actions

github-actions Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Validation Passed: All report and feature-flag labels are correctly set.

@dani-zilla dani-zilla added the report: exclude Exclude changes from user-facing reports (internal, minor, or not relevant to users). label Sep 18, 2026
…ng, was launching the check between activities switching, now waits to do check after resume. Fixed bug with reading null values from datastore
@dani-zilla

Copy link
Copy Markdown
Contributor Author

Fixed two issues, but still seems to fail to launch the donation appeal fragment, despite passing all the checks. Looking into this currently as well

@dani-zilla
dani-zilla force-pushed the 11547-new-donation-appeal-display-logic branch from c143ba9 to 8ea0305 Compare September 22, 2026 17:41
@dani-zilla
dani-zilla force-pushed the 11547-new-donation-appeal-display-logic branch from 264ade0 to 3ba2b5c Compare September 22, 2026 21:55
@dani-zilla

Copy link
Copy Markdown
Contributor Author

There's an issue in main that this PR needs to address. While calling the initialization in the postResume() block allows the first donation appeal to display, we run into a problem later. When it's called multiple times, it resets the activity counter. This keeps it from being able to register the second appeal.

We need to ensure we're only calling the lifecycle observer for this once. One way to do that will be moving it entirely to the MessageHomeController class, and having it only pass in the elapsed time to the funding initialization. This way, as it's recreated, it won't duplicate this.

Currently, this is the only reason the second reminder does not display, and we can fix it once we fix this.

…ity observer to not register multiple times.
@dani-zilla
dani-zilla force-pushed the 11547-new-donation-appeal-display-logic branch from 5da78fe to de55e82 Compare September 23, 2026 15:12

This branch was successfully deployed

2 active (outdated) deployments
botmobile 0a1e80b8 Deployed Sep 18, 2026 by dani-zilla via pr-auto-assign-reviewer #1221
review 0a1e80b8 Deployed Sep 18, 2026 by dani-zilla via label-tb-team #519
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

report: exclude Exclude changes from user-facing reports (internal, minor, or not relevant to users). tb-team Tasks and features handled by project maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Donation Appeal — New Donation Display Logic

2 participants