Skip to content

fix(deck-picker): retain scheduler upgrade prompt - #22635

Merged
mikehardy merged 1 commit into
ankidroid:mainfrom
n1snt:fix/scheduler-prompt-recreation
Oct 21, 2026
Merged

mikehardy merged 1 commit into
ankidroid:mainfrom
n1snt:fix/scheduler-prompt-recreation

Conversation

@n1snt

@n1snt n1snt commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #22632.

Restore the scheduler-upgrade prompt across DeckPicker recreation using a DialogFragment. Deliver upgrade and cancellation decisions to the current activity.

Adds phone and tablet regression tests for repeated recreation, collection refreshes, confirmation, Cancel, and Back.

Restore the mandatory scheduler decision with a DialogFragment and deliver its result to the current DeckPicker. Keep the existing upgrade, Cancel, Back and help behavior without retaining activity-owned callbacks.

Add phone and tablet regression tests for repeated recreation, collection refreshes, confirmation and cancellation.

Fixes ankidroid#22632

GPT-6.1 Sol implemented the lifecycle fix and regression tests.

Assisted-by: GPT-6.1 Sol

@david-allison david-allison left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Quick nit to use this extension method: I want to keep DeckPicker lean, and this would remove a few lines of code

    fun FragmentActivity.registerSchedulerUpgradeHandler(
        onUpgrade: () -> Unit,
        onCancel: () -> Unit,
    ) {
        setFragmentResultListener(REQUEST_UPGRADE_SCHEDULER) { _, result ->
            if (result.getBoolean(RESULT_UPGRADE)) {
                onUpgrade()
            } else {
                onCancel()
            }
        }
    }

@david-allison david-allison added Needs Second Approval Has one approval, one more approval to merge and removed Needs Review labels Oct 20, 2026

@mikehardy mikehardy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assisted-by: grok-4.7-medium

Thanks — the upgrade prompt now survives as a dialog the fragment manager restores.

Replayed the tip onto current main without pushing (PRE_TIP 8e581f95). Local lint/CQ, full unit, and the playRelease emulator suite on API 36 (emulator-5554 / API36_GAPI_PS16K) passed.

The scheduler upgrade prompt is a DialogFragment. OK, Cancel, and Back are delivered to the replacement DeckPicker instead of a window that rotation can drop. Looks good as the second approve.

@mikehardy mikehardy added Pending Merge Things with approval that are waiting future merge (e.g. targets a future release, CI wait, etc) and removed Needs Second Approval Has one approval, one more approval to merge labels Oct 21, 2026
@mikehardy
mikehardy added this pull request to the merge queue Oct 21, 2026
Merged via the queue into ankidroid:main with commit 03d36af Oct 21, 2026
24 of 25 checks passed
@github-actions github-actions Bot added this to the 2.26 release milestone Oct 21, 2026
@github-actions github-actions Bot removed the Pending Merge Things with approval that are waiting future merge (e.g. targets a future release, CI wait, etc) label Oct 21, 2026
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.

DeckPicker loses the required scheduler-upgrade prompt on recreation

3 participants