Skip to content

ADFA-7240: Warn before removing or disabling a bundled add-on - #2302

Draft
davidschachterADFA wants to merge 7 commits into
feature/ADFA-7238from
feature/ADFA-7240
Draft

davidschachterADFA wants to merge 7 commits into
feature/ADFA-7238from
feature/ADFA-7240

Conversation

@davidschachterADFA

@davidschachterADFA davidschachterADFA commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

ADFA-7240

Part of epic ADFA-3905. Stacked on #2289 (ADFA-7238), whose BundledAddonsRecord says which plugins and templates came with the app. Based on its branch so this diff shows only this ticket. Draft until #2289 merges. It does not depend on #2300 (ADFA-7239) and touches different files.

What changes

In the Add-ons Manager, add-ons that came with the app get a warning with Continue and Cancel (decisions in ADFA-7240 comments 41509 and 41510):

  • Removing a bundled plugin:

    • title "Remove a plugin that came with the app?";
    • text "'' was installed automatically. If you don't replace it with something equivalent, the installation will probably break."
  • Disabling a bundled plugin:

    • title "Disable a plugin that came with the app?";
    • text "'' was installed automatically. If you disable it without replacing it with something equivalent, the installation will probably break."

    Disabling a user-added plugin stays immediate.

  • Removing a bundled (installed) template: the template version of the removal warning, naming the template. Deleting a downloaded template that is not installed is unchanged.

  • Each warning's text names the plugin or template, as the existing dialogs do, so with several bundled add-ons the user sees which one they tapped (David, 2026-11-23).

  • Continue runs the existing uninstall or disable, so removal is never prohibited. User-added add-ons keep today's dialogs.

  • "Bundled" means listed in the record. A thin build installed fresh writes an empty record, so nothing warns. An installation from before ADFA-7238 has no record, and nothing warns there either.

How:

  • PluginManagerViewModel and TemplateManagerViewModel take a required isBundledPlugin / isBundledTemplate function, called on Dispatchers.IO. di/PluginModule.kt and di/TemplateModule.kt supply readers of BundledAddonsRecord.
  • ShowUninstallConfirmation effects carry bundled. A new ShowDisableConfirmation(pluginId, pluginName) is decided by ID, not by the loaded list, so a list being reloaded cannot skip it. The loaded list supplies only the name; when it lacks the plugin, the ID stands in.
  • The dialog states (Parcelize) carry the flag, so a warning survives rotation. Every dialog's text scrolls for large fonts, including the existing plugin uninstall dialog, which did not scroll before.
  • The record is only read, never changed. ADFA-7239 relies on that: a removed bundled add-on comes back only when the bundle changes.
  • Seven strings, English only like the neighbouring Add-ons Manager strings, including a new action_continue. ARCHITECTURE.md has one added sentence.

Verification

  • CI: Spotless and :app:assembleV8Debug pass on 297e78d57 (build C-d-1124-2145).
  • Independent review (Sonnet, on 88c6e02): no critical findings. Fixed in 3865736:
    • Tests that could time out falsely: a virtual-time withTimeout raced the real IO thread.
    • A stale plugin list skipped the disable warning.
    • Broken wiring would silently drop the warnings: the bundled checks are now required, and the effects no longer default bundled.
  • Unit tests on 297e78d57 (2026-11-24, local), the merge of ADFA-7238: Bundle plugins and templates and install them at first installation #2289's branch at 6e6a0f0a8, which brings in stage and ADFA-7238: Bundle plugins and templates and install them at first installation #2289's fix for a lost error bar (F30) and its load-pass tests: the *PluginManagerViewModel* and *TemplateManagerViewModel* tests pass (29), including the 6 in PluginManagerViewModelBundledTest and the 3 new bundled cases in TemplateManagerViewModelTest. The full :app:testV8DebugUnitTest passes (1,852, none skipped), :plugin-manager (244) and :common (273) pass, and spotlessCheck is clean. The earlier merge's (8ae1ca5c8) only conflict was stage's ADFA-6967 (ADFA-6967: Reload the Templates tab after a .cgt installs from outside #2273) adding collectionInstalls to TemplateManagerViewModel beside this PR's isBundledTemplate; both are kept, and every test passes both.
  • Each new test catches its rule (on 45b5ab1, before the merge). Eight rules were broken, one or three at a time, with no two in a run sharing a test. Each break failed only its own rule's tests, with the expected wrong value:
    • uninstall never marks a plugin bundled: uninstall_bundledPlugin_sendsBundledTrue;
    • uninstall always marks a plugin bundled: uninstall_userPlugin_sendsBundledFalse;
    • disable skips the bundled check: disable_bundledPlugin_asksFirstAndDoesNotDisable and disable_bundledPluginMissingFromTheList_asksAndNamesItById;
    • disable always asks first: disable_userPlugin_disablesAtOnce;
    • the disable warning names the plugin by ID: disable_bundledPlugin_asksFirstAndDoesNotDisable;
    • no ID fallback when the list lacks the plugin: disable_bundledPluginMissingFromTheList_asksAndNamesItById;
    • the template check ignores installed: uninstallTemplate_notInstalled_isNeverBundledEvenIfTheNameMatches;
    • a template is never marked bundled: uninstallTemplate_installedAndInTheBundledRecord_isMarkedBundled.
  • The record readers in di/PluginModule.kt and di/TemplateModule.kt, and the names in the dialogs, have no unit test; the device checks cover them.
  • Device checks (Galaxy Note 20, 2026-11-24, C-d-1124-0046 at 8ae1ca5c8, each a first install on cleared data): pass.
    • Fat build (AI Core, Shell Hooks and fun-and-games-jme.cgt bundled): the three warnings show their titles and name the add-on ("'Shell Hooks' was installed automatically…", "'AI Core'…", "'fun-and-games-jme'…", the template as its card labels it). Cancel leaves it unchanged; the dialog survives rotation; text and both buttons fit at font scale 1.0 and 2.0; Continue removes or disables it.
    • A user-added plugin and template get today's dialogs; disabling the plugin is immediate. The record still lists the removed bundled add-ons.
    • Thin build: the record is empty, and the same Shell Hooks and template added by the user get no warning.

Limitations accepted

  • The record is written only at first-time setup (ADFA-7238), so a thin APK installed over a fat installation keeps the old record and still warns for the old bundled add-ons. Once ADFA-7239: Apply a new APK's bundled add-ons at start-up #2300 (ADFA-7239) is in, its start-up sync replaces the record with the thin build's empty one and the warnings go away. On this PR alone they stay.
  • Matching is by plugin ID and template file name. A plugin or template the user installs later under a removed bundled add-on's ID or name also gets the warning.
  • The Compose dialogs have no UI tests; the device checks cover them.
  • The strings are English only for now; translations are a separate pass, as decided.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Vh2DAZ6QqzwTmigaKYLNVw


Code Reviewer: Code Reviewer couldn't review this pull request
The pull request author does not have access to AI for the associated Atlassian organization.

claude and others added 7 commits November 23, 2026 17:23
- Uninstalling a bundled plugin or template, and disabling a bundled plugin, now
  asks first with a warning that the installation will probably break.
- PluginManagerViewModel/TemplateManagerViewModel take isBundledPlugin /
  isBundledTemplate (default: nothing bundled), read from BundledAddonsRecord in
  the Koin modules and called on Dispatchers.IO.
- ShowUninstallConfirmation carries `bundled`; new ShowDisableConfirmation and
  public confirmDisablePlugin. The dialog states carry the flag through
  rememberSaveable (Parcelable).
- New dialog texts scroll for large fonts; strings are English only.
- The record is not changed.
- Tests for both view models; ARCHITECTURE.md sentence.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vh2DAZ6QqzwTmigaKYLNVw
- Tests: drop withTimeout around the first effect. The bundled check runs on
  Dispatchers.IO, outside runTest's virtual time, so a virtual-time timeout
  could fire before it returned and fail the bundled-path tests.
- Decide the disable warning by plugin ID, not by the loaded list, so a list
  being reloaded cannot skip it. ShowDisableConfirmation now carries the ID,
  and the dialog needs nothing else.
- Make isBundledPlugin and isBundledTemplate required, and drop the effects'
  default bundled = false, so broken wiring cannot silently remove the warnings.
  Tests pass the lambdas explicitly; the two "without a lambda" tests go.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vh2DAZ6QqzwTmigaKYLNVw
With several bundled plugins, "This plugin was installed automatically"
did not say which one the user had tapped. Each warning's text now starts
with the plugin's or template's name, as the non-bundled dialogs do.

The disable warning is decided by ID so a reloading list cannot skip it,
so ShowDisableConfirmation now carries the name from the loaded list,
with the ID standing in when the list lacks the plugin.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vh2DAZWMkFWJh7CY7P4kCH
Brings in 5a1a0b4, which merges stage into ADFA-7238. Stage's ADFA-6967
(#2273) gave TemplateManagerViewModel a collectionInstalls parameter where
this branch added isBundledTemplate; both are kept, in the order
(templateRepository, collectionInstalls, isBundledTemplate), and every test
passes both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vh2DAZWMkFWJh7CY7P4kCH
Brings in 9ee25dd, 020e45b, F30 (a9b0a49) and the load-pass tests (6e6a0f0).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vh2DAZWMkFWJh7CY7P4kCH
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.

2 participants