Repository navigation
ADFA-7240: Warn before removing or disabling a bundled add-on - #2302
Draft
davidschachterADFA wants to merge 7 commits into
Draft
davidschachterADFA wants to merge 7 commits into
davidschachterADFA wants to merge 7 commits into
Conversation
- 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ADFA-7240
Part of epic ADFA-3905. Stacked on #2289 (ADFA-7238), whose
BundledAddonsRecordsays 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:
Disabling a bundled plugin:
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:
PluginManagerViewModelandTemplateManagerViewModeltake a requiredisBundledPlugin/isBundledTemplatefunction, called onDispatchers.IO.di/PluginModule.ktanddi/TemplateModule.ktsupply readers ofBundledAddonsRecord.ShowUninstallConfirmationeffects carrybundled. A newShowDisableConfirmation(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.action_continue.ARCHITECTURE.mdhas one added sentence.Verification
:app:assembleV8Debugpass on297e78d57(build C-d-1124-2145).88c6e02): no critical findings. Fixed in3865736:withTimeoutraced the real IO thread.bundled.297e78d57(2026-11-24, local), the merge of ADFA-7238: Bundle plugins and templates and install them at first installation #2289's branch at6e6a0f0a8, which brings instageand 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 inPluginManagerViewModelBundledTestand the 3 new bundled cases inTemplateManagerViewModelTest. The full:app:testV8DebugUnitTestpasses (1,852, none skipped),:plugin-manager(244) and:common(273) pass, andspotlessCheckis clean. The earlier merge's (8ae1ca5c8) only conflict wasstage's ADFA-6967 (ADFA-6967: Reload the Templates tab after a .cgt installs from outside #2273) addingcollectionInstallstoTemplateManagerViewModelbeside this PR'sisBundledTemplate; both are kept, and every test passes both.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_bundledPlugin_sendsBundledTrue;uninstall_userPlugin_sendsBundledFalse;disable_bundledPlugin_asksFirstAndDoesNotDisableanddisable_bundledPluginMissingFromTheList_asksAndNamesItById;disable_userPlugin_disablesAtOnce;disable_bundledPlugin_asksFirstAndDoesNotDisable;disable_bundledPluginMissingFromTheList_asksAndNamesItById;installed:uninstallTemplate_notInstalled_isNeverBundledEvenIfTheNameMatches;uninstallTemplate_installedAndInTheBundledRecord_isMarkedBundled.di/PluginModule.ktanddi/TemplateModule.kt, and the names in the dialogs, have no unit test; the device checks cover them.8ae1ca5c8, each a first install on cleared data): pass.fun-and-games-jme.cgtbundled): 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.Limitations accepted
🤖 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.