You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.x maintenance branch.
Decisions to review
ActiveAdmin views copied. The theme overrides 10 ActiveAdmin 4.0.0.beta23 views (layout, header, navigation, page header, sidebar, show page, _html_head). Rails always renders the copy, so ActiveAdmin fixes to those files don't reach theme users. test/aa_overrides_test.rb records a digest of each original and fails when a new ActiveAdmin version changes one. Run it with UPDATE_AA_DIGESTS=1 after you merge the upstream change into the copy.
JavaScript. ActiveAdmin pages render only ActiveAdmin.importmap, so the engine pins the theme modules there. The theme's _html_head imports the modules listed in ActiveAdminTheme.javascripts. A pin in the host's own config/importmap.rb loads nothing on ActiveAdmin pages; the README says so.
CSS. The theme ships two delivery routes. The npm package exports ./css. The gem-path route uses rake active_admin_theme:css, which writes the machine-specific gem path into a git-ignored active_admin_theme.generated.css.
Requirements. Ruby 3.3 or later and ActiveAdmin 4.0.0.beta23 or later, the same as ActiveAdmin 4. The version is 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_head and _page_header, and overrides small partials instead. I tested this against a branch that merges all five.
Server clock and table crisscross as ES modules without jQuery
Docs and release:
README rewritten for theme 4
docs/migrating-from-v3.md
Switch to the ActiveAdmin hooks once they are released
Release 4.0.0
Verification
bundle exec rake test passes 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, with test/screenshot.rb.
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
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
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
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
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
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
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Unresolved tab ID collisions, missing nested-resource route parameters, tooltip and popup accessibility defects, and popup-dependent truncation detection leave functional and accessibility issues.
No open issues 🎉
5 previously missed issues
In code that hasn't changed since last review
Popup cannot be dismissed with Escape
app/tailwind/components/truncate_text.css:49
The popup remains visible for as long as its trigger is hovered or focused, and there is no Escape handler to dismiss it. Since it can cover surrounding content, users must move the pointer or keyboard focus just to uncover that content; this fails the dismissibility requirement for content shown on hover/focus (WCAG 1.4.13). Please add Escape dismissal that keeps focus on the trigger and suppresses the popup until the next hover/focus interaction.
Tooltip trigger is not keyboard-accessible or associated with its description
lib/active_admin_theme/helpers/tooltip.rb:15
For the documented text-content usage, this span is not keyboard-focusable and has no accessible description linking it to the tooltip. Keyboard users therefore cannot reveal the HTML tooltip, and assistive technology cannot associate its explanation with the displayed value. Make the trigger focusable and reference the tooltip with aria-describedby.
Popup text makes cut? report truncation when none occurred
Once a popup: true value is hovered or focused, the component's visible text includes both .aat-truncate-text and the popup's full text. Consequently cut? returns true even when no length: truncation occurred, and its result changes just by opening the popup. Compare the inner displayed-text span with full_text for popup components instead of reading the entire root.
For a target resource registered with a required belongs_to, this calls route_collection_path without the parent ID, so rendering the searchable select raises ActionController::UrlGenerationError even when the current request has that ID. ActiveAdmin's route contract accepts parent parameters. Please pass the relevant route parameters from the input's view/controller through searchable_select_path to the route builder.
Generated panel IDs can collide with tab button IDs
lib/active_admin_theme/views/tabs.rb:29
With tabs titled Summary and Summary tab, the second panel receives id="summary-tab", which is already the first tab button's ID. Only panel/base IDs are registered, not the derived button IDs, so Flowbite's #summary-tab target can resolve to the button instead of the second panel. Reserve all emitted IDs (including button and container IDs) when choosing generated IDs, and cover this pair of distinct titles in the regression test.
Page objects: ConfirmDialog fills and returns body controls by label, id
or name and can confirm without browser validation; TruncateText#clipped?
reads the CSS ellipsis. Only index tables keep cells on one line, and the
README explains the importmap sweeper order for hosts that watch a
directory of their own.
Co-Authored-By: Clanker
Hosts moving from theme 3.x asked for the old density and layout. The
attributes table becomes a grid in CSS only, so ActiveAdmin's row markup
stays and page objects keep working; ARIA roles restore the table
semantics the grid drops.
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
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
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.