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
senid231
force-pushed
the
activeadmin-v4
branch
from
November 12, 2026 08:16
de9cf34 to
66fc739
Compare
The top menu and a plain with_tooltip had only Tailwind classes or a title to select them by. The page objects need a stable attribute. Co-Authored-By: Clanker
Loaded with require "active_admin_theme/page_objects", never by the theme itself. The base sections break on the theme's two menus and on tabs, so those are patched. The searchable select and the components get sections of their own. Co-Authored-By: Clanker
Co-Authored-By: Clanker
The class Flowbite toggles is a Tailwind utility; the attribute is not. Co-Authored-By: Clanker
Rails already loads an engine's lib/tasks, so the rake_tasks block ran the task body a second time on every call. Co-Authored-By: Clanker
A host that defined it before the theme's initializer ran, from a gem or another engine, lost to the theme's later include. Co-Authored-By: Clanker
confirm_dialog takes trigger: false, trigger_html: and params:, and confirm_dialog_tag renders it from ERB and action_item blocks. truncate_text takes popup: true. Co-Authored-By: Clanker
active_admin_page_objects now has a public registry of field and filter classes, so the theme no longer overrides its private detection. Co-Authored-By: Clanker
The select script joins the default scripts and upgrades filter and form selects on its own; tom_select: sets or skips it per select. The searchable select gains a 3 character minimum, load-all, per_page and a value other than the id. The endpoint now answers with pagination.more instead of has_more, sorts newest first and pages by 50. Co-Authored-By: Clanker
Only a Symbol name is titlecased now, so "Estimated spend" no longer renders as "Estimated Spend". Co-Authored-By: Clanker
Inside the action items it took the white .action-item-button look while its neighbours were primary buttons. confirm_dialog also takes class: for the trigger. Co-Authored-By: Clanker
Four action items squeezed the page title and wrapped the breadcrumbs at 390px. Co-Authored-By: Clanker
Typing a query again while its next page was still due showed that page in place of the first. The select also marks itself as searching from the keystroke, which the page objects wait on before they click. Co-Authored-By: Clanker
There was a problem hiding this comment.
🟡 Changes recommended
The selected-option lookup bypasses source and authorization scopes, allowing crafted filter values to expose restricted record labels.
6 open issues
Selected-option lookup bypasses authorization and source scopes · New Focus trap skips links and custom tabbable elements · New Client timezone changes server clock when no zone is set · New Callable option values cannot hydrate selected options · New Tab groups generate duplicate and invalid target IDs · New Override checks miss deleted or renamed upstream templates · New
1 file not reviewed
test/dummy/package-lock.json: Generated file
What changed in this PR
Rebuilds the theme for ActiveAdmin 4’s Tailwind CSS, Flowbite, and import-map frontend, replacing the previous Sass and jQuery integration.
Changes:
- Introduces compact layouts, responsive navigation, reusable components, and searchable selects.
- Adds engine integration, CSS delivery options, page objects, and migration documentation.
- Rebuilds the dummy app and expands automated coverage for the new frontend.
| File | Description |
|---|---|
test/trix_screenshot.rb |
Removes legacy Trix screenshots. |
test/smoke_test.rb |
Checks page rendering and theme configuration. |
test/searchable_select_test.rb |
Tests searchable-select browser behavior. |
test/searchable_select_options_test.rb |
Tests options endpoints and configuration. |
test/searchable_select_off_test.rb |
Tests opt-in-only select enhancement. |
test/screenshot.rb |
Captures multiple widths and color modes. |
test/rake_tasks_test.rb |
Checks CSS task registration. |
test/page_objects_select_control_test.rb |
Tests native and enhanced select controls. |
test/page_objects_searchable_select_test.rb |
Tests searchable-select page objects. |
test/page_objects_helper.rb |
Defines shared browser setup and pages. |
test/page_objects_components_test.rb |
Tests component page objects. |
test/host_dsl_test.rb |
Checks host DSL precedence. |
test/fixtures/active_admin_originals.yml |
Records upstream view digests. |
test/dummy/tailwind-active_admin.config.js |
Configures Tailwind source scanning. |
test/dummy/package.json |
Adds frontend dependencies and build scripts. |
test/dummy/config/initializers/active_admin.rb |
Configures demo authentication and modules. |
test/dummy/config/importmap.rb |
Documents the separate ActiveAdmin import map. |
test/dummy/config/environment.rb |
Creates and seeds demo tables. |
test/dummy/config/database.yml |
Switches to file-backed SQLite. |
test/dummy/config/application.rb |
Adopts Propshaft and import maps. |
test/dummy/app/tailwind/active_admin.css |
Imports Tailwind and theme styles. |
test/dummy/app/models/street.rb |
Adds dependent-select demo records. |
test/dummy/app/models/shipment.rb |
Supports advanced select demos. |
test/dummy/app/models/product.rb |
Adds searchable product data. |
test/dummy/app/models/parcel.rb |
Supports nested-form demos. |
test/dummy/app/models/order.rb |
Supports order forms and filters. |
test/dummy/app/models/customer.rb |
Adds customer demo records. |
test/dummy/app/models/country.rb |
Supports country selectors. |
test/dummy/app/models/city.rb |
Supports dependent city selectors. |
test/dummy/app/controllers/application_controller.rb |
Supplies a demo signed-in user. |
test/dummy/app/assets/stylesheets/active_admin.scss |
Removes the legacy Sass entry point. |
test/dummy/app/assets/javascripts/active_admin.js |
Removes the Sprockets script entry point. |
test/dummy/app/assets/config/manifest.js |
Removes the Sprockets manifest. |
test/dummy/app/assets/builds/.keep |
Preserves the CSS output directory. |
test/dummy/app/admin/wide_table.rb |
Updates navigation and action-item demos. |
test/dummy/app/admin/table.rb |
Groups the table demo in navigation. |
test/dummy/app/admin/shipments.rb |
Demonstrates advanced and dynamic selects. |
test/dummy/app/admin/searchable_select_demo.rb |
Demonstrates searchable forms and filters. |
test/dummy/app/admin/nested_menu_demo.rb |
Demonstrates deeper menu nesting. |
test/dummy/app/admin/layout_demo.rb |
Demonstrates column layouts. |
test/dummy/app/admin/editor.rb |
Removes the legacy Trix demo. |
test/dummy/app/admin/customers.rb |
Demonstrates themed resource pages. |
test/dummy/app/admin/confirm_dialog_demo.rb |
Demonstrates dialog forms and submissions. |
test/dummy/app/admin/components_demo.rb |
Demonstrates reusable UI components. |
test/css_import_test.rb |
Tests generated CSS imports. |
test/crisscross_screenshot.rb |
Removes legacy highlighting screenshots. |
test/confirm_dialog_test.rb |
Tests dialog interaction and validation. |
test/components_test.rb |
Tests component rendering and behavior. |
test/clock_test.rb |
Removes legacy clock and sticky-header tests. |
test/capybara_boot.rb |
Updates shared browser configuration. |
test/aa_overrides_test.rb |
Checks copied views against upstream digests. |
Rakefile |
Builds CSS before running test files. |
package.json |
Publishes theme CSS and ES modules. |
lib/tasks/active_admin_theme.rake |
Adds the host CSS-generation task. |
lib/active_admin_theme/views/with_tooltip.rb |
Loads the tooltip helper. |
lib/active_admin_theme/views/truncate_text.rb |
Adds truncation and popup rendering. |
lib/active_admin_theme/views/tabs.rb |
Restores tabs using Flowbite. |
lib/active_admin_theme/views/status_tag.rb |
Adds configurable status colors. |
lib/active_admin_theme/views/secret_reveal.rb |
Renders secret-reveal controls. |
lib/active_admin_theme/views/searchable_select.rb |
Loads the searchable-select DSL. |
lib/active_admin_theme/views/pre_wrap.rb |
Loads the preformatted-text helper. |
lib/active_admin_theme/views/confirm_dialog.rb |
Renders modal forms and fields. |
lib/active_admin_theme/views/columns.rb |
Restores weighted column layouts. |
lib/active_admin_theme/version.rb |
Sets the theme 4 prerelease version. |
lib/active_admin_theme/sidebar_title.rb |
Preserves sidebar title conventions. |
lib/active_admin_theme/resource_dsl/searchable_select.rb |
Adds paginated options endpoints. |
lib/active_admin_theme/page_objects/truncate_text.rb |
Exposes truncated text and popups. |
lib/active_admin_theme/page_objects/tooltip.rb |
Exposes tooltip content and visibility. |
lib/active_admin_theme/page_objects/tabs.rb |
Adds tab navigation helpers. |
lib/active_admin_theme/page_objects/status_tag.rb |
Exposes status values and colors. |
lib/active_admin_theme/page_objects/sidebar.rb |
Adds sidebar panel lookups. |
lib/active_admin_theme/page_objects/selectors.rb |
Registers theme-specific selectors. |
lib/active_admin_theme/page_objects/secret_reveal.rb |
Drives reveal controls and errors. |
lib/active_admin_theme/page_objects/pre_wrap.rb |
Reads preserved text formatting. |
lib/active_admin_theme/page_objects/main_menu.rb |
Supports desktop and drawer navigation. |
lib/active_admin_theme/page_objects/layout.rb |
Adds themed layout sections and controls. |
lib/active_admin_theme/page_objects/confirm_dialog.rb |
Drives dialog forms and actions. |
lib/active_admin_theme/page_objects/component.rb |
Provides component lookup helpers. |
lib/active_admin_theme/page_objects/columns.rb |
Exposes columns and weights. |
lib/active_admin_theme/page_objects.rb |
Adds the optional page-object entry point. |
lib/active_admin_theme/nested_menu.rb |
Restores nested menu chains. |
lib/active_admin_theme/inputs/searchable_select_input.rb |
Adds searchable inputs and select settings. |
lib/active_admin_theme/helpers/tooltip.rb |
Renders plain and HTML tooltips. |
lib/active_admin_theme/helpers/pre_wrap.rb |
Renders wrapping preformatted text. |
lib/active_admin_theme/helpers/confirm_dialog.rb |
Adds dialog rendering and trigger helpers. |
lib/active_admin_theme/helpers/config.rb |
Exports localized frontend configuration. |
lib/active_admin_theme/engine.rb |
Registers views, modules, and extensions. |
lib/active_admin_theme/css_import.rb |
Generates machine-specific stylesheet imports. |
lib/active_admin_theme.rb |
Defines theme loading and configuration. |
Gemfile |
Updates development and test dependencies. |
docs/migrating-from-v3.md |
Explains migration and removed features. |
config/importmap.rb |
Pins theme modules and Tom Select. |
app/views/layouts/active_admin_logged_out.html.erb |
Adds the themed logged-out layout. |
app/views/active_admin/shared/_sidebar_section.html.arb |
Wraps sidebar sections in panels. |
app/views/active_admin/resource/show.html.arb |
Adds panels around show-page attributes. |
app/views/active_admin/resource/_show_default.html.arb |
Themes default resource details. |
app/views/active_admin/_sidebar.html.erb |
Adds collapsible sidebar markup. |
app/views/active_admin/_page_title.html.erb |
Renders compact page titles. |
app/views/active_admin/_page_heading.html.erb |
Combines breadcrumbs, title, and sidebar toggle. |
app/views/active_admin/_page_content.html.erb |
Defines the sidebar/content grid. |
app/views/active_admin/_main_navigation.html.erb |
Renders the mobile drawer. |
app/views/active_admin/_header_navigation.html.erb |
Renders desktop dropdown navigation. |
app/views/active_admin/_header_leading.html.erb |
Renders site title and drawer control. |
app/views/active_admin/_header_actions.html.erb |
Renders clock, user, and header controls. |
app/views/active_admin/_breadcrumbs.html.erb |
Renders compact breadcrumbs. |
app/views/active_admin_theme/_menu_flyout.html.erb |
Renders nested desktop submenus. |
app/views/active_admin_theme/_menu_drawer.html.erb |
Renders nested drawer items. |
app/views_compat/layouts/active_admin.html.erb |
Supplies the pre-hook layout fallback. |
app/views_compat/active_admin/_site_header.html.erb |
Supplies the compact header fallback. |
app/views_compat/active_admin/_page_header.html.erb |
Supplies the page-header fallback. |
app/views_compat/active_admin/_html_head.html.erb |
Loads assets and configured modules. |
app/tailwind/components/truncate_text.css |
Styles truncation and popups. |
app/tailwind/components/status_tag.css |
Defines status color treatments. |
app/tailwind/components/secret_reveal.css |
Styles reveal controls and errors. |
app/tailwind/components/pre_wrap.css |
Preserves whitespace with wrapping. |
app/tailwind/components/confirm_dialog.css |
Styles responsive modal forms. |
app/javascript/active_admin_theme/table_crisscross.js |
Reimplements table highlighting without jQuery. |
app/javascript/active_admin_theme/server_clock.js |
Adds the ES-module server clock. |
app/javascript/active_admin_theme/secret_reveal.js |
Fetches and displays secret values. |
app/javascript/active_admin_theme/layout.js |
Handles sidebar state and flyout placement. |
app/javascript/active_admin_theme/confirm_dialog.js |
Adds dialog focus and validation behavior. |
app/assets/javascripts/wigu/theme_toggle.js |
Removes the legacy theme switcher. |
app/assets/javascripts/wigu/table_crisscross.js |
Removes jQuery-based highlighting. |
app/assets/javascripts/wigu/server_clock.js |
Removes the legacy clock implementation. |
app/assets/javascripts/wigu/scrollbar_width.js |
Removes obsolete scrollbar compensation. |
app/assets/javascripts/wigu/all.js |
Removes the Sprockets umbrella entry point. |
active_admin_theme.gemspec |
Updates metadata and compatibility requirements. |
.gitignore |
Adjusts generated-file exclusions. |
.github/workflows/ci.yml |
Runs tests with Ruby 3.3/3.4 and Node 22. |
Review effort: Balanced
The block kept the view as self, so Arbre tags such as para raised NoMethodError inside an action item. Co-Authored-By: Clanker
The input showed the label of any record id put in the URL or form. It now applies the endpoint resource's read scope and a param-free scope:, labels a value outside it with the value itself so a save keeps it, and raises for a lambda value:, which cannot be looked up. Co-Authored-By: Clanker
Co-Authored-By: Clanker
Co-Authored-By: Clanker
Flowbite passes each tab's target to querySelector, so a numeric title such as 2024 threw and left every tab on the page dead. Co-Authored-By: Clanker
Co-Authored-By: Clanker
Co-Authored-By: Clanker
Co-Authored-By: Clanker
Co-Authored-By: Clanker
Chrome reports the CSS-uppercased text, so specs comparing "verified" failed. has_text? now ignores case for a String. Co-Authored-By: Clanker
Reviewers found the tab content and attributes tables hard to tell from the page. This restores v3's surface boxes, cell padding and a faint label tint. Co-Authored-By: Clanker
The user compared the show page with a v3 screenshot: v3 has no inner box or label tint on attributes tables in a panel, boxed inactive tabs, and roomier padding. Co-Authored-By: Clanker
ActiveAdmin's base blue and an unlayered header link rule hid the v3 link colours and menu hover text. Status tags go back to v3's solid fills, as the user asked. Co-Authored-By: Clanker
Panel tables scroll sideways, yes tags are blue, body text uses the v3 font without antialiasing, disabled and read-only fields look read-only, flashes keep line breaks, and with-sticky-rows pins a table's first column. Co-Authored-By: Clanker
Co-Authored-By: Clanker
ActiveAdmin 4 drops flash types other than notice, alert and error, so v3 apps lost their warnings. Unknown types show gray; page objects take warning and registered types. Co-Authored-By: Clanker
The inline --aat-status-<value> style beat the CSS rules that map green, orange, red, blue and the other aliases onto the theme colors, so those tags rendered gray. Co-Authored-By: Clanker
tab :flow_links showed "flow_links" with id "flow_links"; ActiveAdmin 3 showed "Flow Links" with id "flow-links", and app anchors rely on it. Co-Authored-By: Clanker
Co-Authored-By: Clanker
Co-Authored-By: Clanker
Co-Authored-By: Clanker
Co-Authored-By: Clanker
Co-Authored-By: Clanker
Co-Authored-By: Clanker
Co-Authored-By: Clanker
Co-Authored-By: Clanker
Co-Authored-By: Clanker
Co-Authored-By: Clanker
senid231
commented
Nov 27, 2026
| fail-fast: false | ||
| matrix: | ||
| ruby: ['3.1', '3.4'] | ||
| ruby: ['3.3', '3.4'] |
Member
Author
There was a problem hiding this comment.
test it with ruby 4.0 as well
The options endpoint searches active_admin_filter_extensions' None marker as _null, so a dependent child lists the right records. A multi-select filter reads its values from the request when the search holds them in a grouping. Co-Authored-By: Clanker
Co-Authored-By: Clanker
Co-Authored-By: Clanker
Co-Authored-By: Clanker
Co-Authored-By: Clanker
Co-Authored-By: Clanker
Co-Authored-By: Clanker
Co-Authored-By: Clanker
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.