Skip to content

feat(web-pkg): optional unload warning for loading tasks - #3135

Merged
dschmidt merged 1 commit into
mainfrom
feat/warn-before-unload-option
Aug 15, 2026
Merged

feat(web-pkg): optional unload warning for loading tasks#3135
dschmidt merged 1 commit into
mainfrom
feat/warn-before-unload-option

Conversation

@dschmidt

Copy link
Copy Markdown
Contributor

LoadingService.addTask gains a warnBeforeUnload option (default true, no behavior change for existing callers). Tasks that opt out never arm the browser's beforeunload confirmation dialog; the listener follows warning tasks instead of any tasks, so an opted-out task cannot detach it while a warning task is still running.

Motivation: long-running tasks that only drive the global progress bar (e.g. a photo slideshow) are not unsaved operations and should not make the browser ask "changes you made may not be saved" on reload.

addTask gains a warnBeforeUnload option (default true). Tasks that opt
out never arm the browser's beforeunload confirmation, and the listener
now follows warning tasks instead of any tasks, so an opted-out task
cannot detach it while a warning task is still running.
@dschmidt
dschmidt marked this pull request as ready for review August 15, 2026 14:54
@dschmidt
dschmidt merged commit 0010af6 into main Aug 15, 2026
30 of 31 checks passed
@dschmidt
dschmidt deleted the feat/warn-before-unload-option branch August 15, 2026 15:10
@openclouders openclouders mentioned this pull request Aug 15, 2026
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants