Modules: notice when activating a theme alongside another active theme - #311
Merged
Merged
Conversation
Activating a second theme is allowed — a theme may be built to coexist — but it can be unpredictable, so surface a modal NOTICE (TigerModal, not an alert/warning) before it runs, and proceed on OK. Active themes are the rows already tagged with a data-theme="1" Deactivate button, so the check is client-side with no new server round-trip. - modules/system/views/scripts/modules/index.phtml: in the activate path of handleToggle, when activating a theme and another active theme exists, show the notice, then run() on OK. - modules/system/languages/en/system.php: system.js.activate_theme_multi(_title). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ASauLLscjqdsNqBNsx2Typ
WebTigers
added a commit
that referenced
this pull request
Sep 25, 2026
…checkbox) (#312) * Themes: allow multiple active at once; default site theme is opt-in Activating a theme no longer deactivates the others. A theme's "active" state is now the same module flag every module uses (multiple can be active, their layouts/assets available); which one is the DEFAULT site theme is the separate `tiger.theme` config, changed only on request. This replaces the "one active theme per scope" behavior (activating one silently replaced the previous), and supersedes the Flag 3 "multiple active is unpredictable" notice (#311) — multiple active is now the normal, supported case. - library/Tiger/Theme.php: `activate($slug, $makeDefault = true)` — always links assets; sets `tiger.theme` only when $makeDefault (default true keeps the headless installer's behavior). - modules/system/services/Modules.php: `_toggleTheme` maintains the module active flag (setActive) and passes `make_default` through to `Tiger_Theme::activate`; `_isModuleActive` (delete guard) reads the flag like any module. - modules/system/controllers/ModulesController.php: theme "active" = the flag; exposes `is_default` (the theme whose key == tiger.theme). - modules/system/views/scripts/modules/index.phtml: on theme Activate, a confirm with a "Make <name> the default site theme" CHECKBOX (pre-checked only when nothing is default yet); only sends make_default=1 when ticked. A "Default" badge marks the current default theme. - themes/puma/assets/js/tiger.modal.js: TigerModal.confirm gains an optional `checkbox: {label, checked}` — with it, confirm resolves { confirmed, checked } (backward-compatible; without it, a bare boolean as before). Proven: the shipped handleToggle sends make_default only when the box is ticked (JS harness), and the server keeps every theme active while moving the default only on request (dev: activate B without the box → A and B both active, default stays A; deactivating the default clears it). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ASauLLscjqdsNqBNsx2Typ * Update theme tests for multiple-active + opt-in default The theme-activation semantics changed (Themes: allow multiple active): activating a theme sets the module active FLAG (multiple can be active) and writes tiger.theme only when make_default is set; Tiger_Theme::activate() returns a 'default' flag. Bring the integration tests to the new contract. - ModulesServiceThemeTest: activating sets the flag and does NOT change the default unless make_default is passed; deactivating the default clears the flag + tiger.theme. - ThemeActivateTest: activate() return array now carries 'default' => true. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ASauLLscjqdsNqBNsx2Typ --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Merged
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.
What
Activating a second theme while one is already active is allowed — a theme may be built to coexist — but it can produce unpredictable results. This adds a modal notice (via
TigerModal, not a browser alert or a scary warning) in the Modules admin: when you click Activate on a theme and another theme is already active, you get "Another theme is already active. Activating more than one theme at a time can have unpredictable results — unless the theme is designed to work alongside others. Activate anyway?" — and it proceeds on OK.How
modules/system/views/scripts/modules/index.phtml— in the activate branch ofhandleToggle, when the target is a theme (data-theme="1") and another active theme exists, show the notice andrun()on confirm. Active themes are already the rows rendering adata-mod-toggle="deactivate" data-theme="1"button, so the check is client-side with no new server round-trip. Reuses the exactTigerModal.confirmpattern already used in this file for the mutex-conflict and deactivate confirmations.modules/system/languages/en/system.php— addssystem.js.activate_theme_multi+system.js.activate_theme_multi_title.Notes
enonly, consistent with this file (en is already the superset; other locales fall back to en). Full localization is a separate i18n pass.🤖 Generated with Claude Code
https://claude.ai/code/session_01ASauLLscjqdsNqBNsx2Typ