Skip to content

K2GO-449 refactor(app): generalize Forgejo's gated update action into ModuleActions - #655

Merged
luisguzman-adfa merged 1 commit into
mainfrom
refactor/K2GO-449-forgejo-registry
Oct 14, 2026
Merged

luisguzman-adfa merged 1 commit into
mainfrom
refactor/K2GO-449-forgejo-registry

Conversation

@luisguzman-adfa

Copy link
Copy Markdown
Collaborator

Fourth K2GO-449 slice. Moves Forgejo's installed-state "Update repos" action out of
the per-module "forgejo".equals(key) branch in ModuleActionSheet and into the
ModuleActions registry, so the shared UI stops carrying a per-module branch.

  • ModuleActions: InstalledAction gains an optional Gate { canShow() } (run off the
    main thread). Forgejo registers as a gated entry; ForgejoStatusClient runs only
    inside the gate lambda, not at class load.
  • ModuleActionSheet: the "forgejo".equals async branch is removed. The registry
    iteration handles both: plain entries (Add-ons / Build assets) add the row
    synchronously; a gated entry runs canShow() on AppExecutors.io() and inserts the
    row after "About" only when true and the sheet is still showing.
  • ModuleDetailFragment: the generic block is guarded with ia.gate == null, so the
    detail keeps its own richer Forgejo flow (install-repos / blocked / update, the
    repos opt-in checkbox, bankSeed/clearSeed). Its install-options "forgejo".equals
    is intentionally retained.

Verification: build + lint green; two-pass review. Device-checked (Samsung A16):
Add-ons and Build assets action sheets render their update row after "About" with no
crash. Forgejo is not installed on the test box, so its gated branch is a faithful
move of the removed sheet branch (same fetch, same after-About insertion, same
showing-guard), build- and review-verified.

… ModuleActions

Add an optional Gate to ModuleActions.InstalledAction (a check run off the main thread) and register Forgejo 'Update repos' as a gated entry. ModuleActionSheet now iterates the registry for both plain and gated entries, dropping its forgejo-keyed update-action branch. ModuleDetailFragment applies only ungated registry entries; its richer Forgejo install-repos/blocked/update flow, the repos opt-in checkbox and the seed prefs stay module-specific by design.
@luisguzman-adfa
luisguzman-adfa merged commit 9a48d40 into main Oct 14, 2026
3 checks passed
@luisguzman-adfa
luisguzman-adfa deleted the refactor/K2GO-449-forgejo-registry branch October 14, 2026 20:47
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