Repository navigation
Conversation
Rebuilds the theme on ActiveAdmin 4's Tailwind layout. Theme 3 stays on the 3.x branch. The theme copies ten ActiveAdmin views, so test/aa_overrides_test.rb fails when ActiveAdmin changes one of them. Co-Authored-By: Clanker
The theme's markup now lives in the partials that ActiveAdmin's pending layout hooks render. When the installed ActiveAdmin lacks them, the engine adds app/views_compat, whose copies of the layout and headers render the same partials. The JavaScript list and the import map cache watch use the new ActiveAdmin settings when present. The searchable_select_options DSL is included before host initializers, so a host's own version wins. Co-Authored-By: Clanker
ActiveAdmin 4 dropped parent chains and raises TypeError for `menu parent: [...]`, which apps upgrading from ActiveAdmin 3 still use. The theme restores the chain and renders any depth in the top menu and the drawer. Co-Authored-By: Clanker
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.
Theme 4.0 for ActiveAdmin 4. ActiveAdmin 4 replaced its Sass and jQuery front end with Tailwind CSS v4, Flowbite and import maps, so theme 3 can't be ported file by file. This PR rebuilds the theme on the new layout. Theme 3 moves to the
3.xmaintenance branch.Decisions to review
_html_head). Rails always renders the copy, so ActiveAdmin fixes to those files don't reach theme users.test/aa_overrides_test.rbrecords a digest of each original and fails when a new ActiveAdmin version changes one. Run it withUPDATE_AA_DIGESTS=1after you merge the upstream change into the copy.ActiveAdmin.importmap, so the engine pins the theme modules there. The theme's_html_headimports the modules listed inActiveAdminTheme.javascripts. A pin in the host's ownconfig/importmap.rbloads nothing on ActiveAdmin pages; the README says so../css. The gem-path route usesrake active_admin_theme:css, which writes the machine-specific gem path into a git-ignoredactive_admin_theme.generated.css.4.0.0.pre.Upstream proposals
These would shrink the copied views. None has been merged or reviewed yet.
activeadmin/activeadmin#9146 makes the layout extensible without copying views. With all five pull requests below, the theme drops its copies of the layout,
_site_header,_main_navigation,_html_headand_page_header, and overrides small partials instead. I tested this against a branch that merges all five.javascript_modulessetting#site-header#page-headerand#action-itemsaa-menubreakpoint variant--aa-header-heightvariableactiveadmin/activeadmin#9147 supports running ActiveAdmin from a Rails engine and adding JavaScript to its pages:
importmap_watchessetting, so edits to the theme's JavaScript clear ActiveAdmin's import map cacheChecklist
Packaging:
Gemfile, npmpackage.json(exports./cssand./*), version4.0.0.prebundle exec rake test3.xto this repository; it is only on a fork todayLayout:
--aat-*CSS custom propertiesDSL and components:
columns/column,tabs/tab, panels around sidebar sections and the show pageconfirm_dialogon the Flowbite modal, with form fieldsstatus_tagcolor variants and acolor:optiontruncate_text,secret_reveal,with_tooltip,pre_wrapDocs and release:
docs/migrating-from-v3.mdVerification
bundle exec rake testpasses locally: 68 runs, including headless Chrome tests for the layout, components, confirm dialog and searchable select. I checked index, show and form pages at 1280px, 820px and 390px, in light and dark mode, withtest/screenshot.rb.