Skip to content

K2GO-382 fix(ui): deep-op notifications return to the op screen; run-in-background lands on Home - #556

Merged
luisguzman-adfa merged 2 commits into
mainfrom
feat/K2GO-382-deepop-notifications
Sep 6, 2026
Merged

K2GO-382 fix(ui): deep-op notifications return to the op screen; run-in-background lands on Home#556
luisguzman-adfa merged 2 commits into
mainfrom
feat/K2GO-382-deepop-notifications

Conversation

@luisguzman-adfa

Copy link
Copy Markdown
Collaborator

What

Tapping a deep-op foreground notification opened a bare LibraryActivity, which
fell back to the last tab (Settings) instead of the running op's own screen;
opening LibraryActivity mid-op also fights the boot gate. "Run in background"
did a bare finish(), popping to whatever launched the screen instead of Home.

  • Add OpReturnNavigator: the single owner of the "op -> its progress screen"
    Intent mapping. Stateless -- forActiveOp reads the run-state repositories
    (module queue, deep-op), which stay the source of truth for what is live.
    notify() wraps a per-op intent with one flag policy (and supplies the NEW_TASK
    clone was missing).
  • Notifications routed through it: backup/restore -> the BR job screen; install
    -> LibraryActivity (rootfs progress / module re-route); clone -> the clone tab;
    dashboard rebuild + kiwix/books/kolibri downloads -> their existing screens,
    now sharing the one mapping.
  • LibraryActivity's relaunch re-route now calls forActiveOp, so the
    "which op -> which screen" logic lives in one place instead of duplicated.
  • SetupProgressActivity "Run in background" -> goHome(false): lands on Home and
    keeps the download sessions running.

Part C (setProgress on the notification) is deferred -- it depends on the
progress model (T2/T3).

Verification

Device (OnePlus, arm64): tapping the notification for a content download, a
backup, and a restore each returns to that op's own progress screen (was
Settings); "Run in background" lands on Home and the download keeps running.
Two-pass review applied (fixed a module-install routing regression and removed a
dead duplicate helper).

…in-background lands on Home

Tapping a deep-op foreground notification opened a bare LibraryActivity, which
fell back to the last tab (Settings) instead of the running op's screen; opening
LibraryActivity mid-op also fights the boot gate. Run in background did a bare
finish(), popping to whatever launched the screen instead of Home.

Add OpReturnNavigator: the single owner of the op -> its progress screen mapping.
It is stateless -- forActiveOp reads the existing run-state repositories (module
queue, deep-op), which stay the source of truth for what is live. Notification
callers wrap a per-op intent with notify() (one flag policy; also supplies the
NEW_TASK clone was missing).

- DeepOpService (backup/restore): -> the backup/restore job screen.
- InstallService (ongoing): -> install progress (EXTRA_INSTALLING).
- CloneShareService: -> the clone tab (now with NEW_TASK).
- DashboardRebuildService + Zim/Books/KolibriSeedService: routed through the
  navigator (behavior unchanged; the reference pattern now shared).
- LibraryActivity relaunch re-route: now calls forActiveOp, so the which-op ->
  which-screen logic lives in one place instead of duplicated here.
- SetupProgressActivity Run in background: goHome(false) -- lands on Home and
  keeps the download sessions running (was finish()).

Part C (setProgress on the notification) is deferred: it depends on the progress
model (T2/T3). Compiles clean.
…ead home()

Two-pass review of the deep-op notification change:
- install() no longer sets EXTRA_INSTALLING. That flag forced
  LibraryActivity.installing=true, which suppressed the !installing module-queue
  re-route, so a proot/module install's notification tap stranded on the boot
  gate instead of the install index. A bare LibraryActivity is correct: a rootfs
  install is detected by InstallProgressRepository.isRunning(); a module install
  is forwarded by forActiveOp.
- Remove OpReturnNavigator.home(): it was unused (Run-in-background uses
  SetupProgressActivity.goHome) and was a second builder of the leave-to-Home
  intent -- the duplicated truth the one-source refactor set out to remove.
@luisguzman-adfa
luisguzman-adfa merged commit bced279 into main Sep 6, 2026
3 checks passed
@luisguzman-adfa
luisguzman-adfa deleted the feat/K2GO-382-deepop-notifications branch September 6, 2026 05:20
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