Skip to content

Theme 4: columns chooser and more - #85

Open
senid231 wants to merge 5 commits into
activeadmin-plugins:masterfrom
senid231:theme-features-2
Open

senid231 wants to merge 5 commits into
activeadmin-plugins:masterfrom
senid231:theme-features-2

Conversation

@senid231

@senid231 senid231 commented Dec 4, 2026 •

Copy link
Copy Markdown
Member

Theme 4 features after beta3, in one PR. It stays open while more land.

So far:

  • Columns chooser. A columns button (an icon, tooltip "Columns") at the right of the index toolbar opens a menu that hides columns, and the browser remembers the choice per index in localStorage. It is off by default: ActiveAdminTheme.column_chooser = true turns it on everywhere, and index column_chooser: overrides one index. ActiveAdmin 4 puts no column classes on index cells, so a column is its position, named by its header text. The selection, id and untitled columns always show.
  • Batch action forms. ActiveAdmin 4 dropped batch_action form:. The theme brings it back in the ActiveAdmin 3 format, as a confirm_dialog that ActiveAdmin 4's batch script submits, so the inputs keep their keys and values. confirm: becomes the dialog message. Page objects get batch_actions.apply(label, with: {...}). Before the dialog opens, a cancelable aat:batch-form:open event lets an app check the selection on the server.
  • ActiveAdmin.ModalDialog. An opt-in script brings back ActiveAdmin 3's function, which went with jQuery UI, with the same signature and input types.
  • Searchable select switches for apps leaving select2: tom_select: {sortable: true} (the form sends the dragged order), {clear: false, search: false}, and an optional searchable_select_search_min_options. Dependent selects get depends_keep_value: and depends_empty_param:, and a result's attrs become attributes of the picked <option>.
  • Tests pin page objects v2.0.0.beta3.

Checked with bundle exec rake test against ActiveAdmin 4.0.0.beta23 and the layout-hooks branch: 438 runs each, no failures. The chooser's menu and both dialogs are hit-tested on a scrolled page with flash messages.

ActiveAdmin 4 puts no column classes on index cells, so the chooser keys a
column by its position and names it by its header text.

Co-Authored-By: Clanker
ActiveAdmin 4 replaced the form: option with a partial. The theme renders
the fields as a confirm_dialog whose form ActiveAdmin 4's batch script
submits, so the inputs keep their ActiveAdmin 3 keys and values.

Co-Authored-By: Clanker
ActiveAdmin 4 dropped ActiveAdmin.ModalDialog with jQuery UI. Apps that
check a batch selection on the server before the dialog opens can cancel
aat:batch-form:open and open the dialog later.

Co-Authored-By: Clanker
Covers what apps migrating from select2 used: a dragged order that the form
submits, a value kept across a parent change when still offered, a param
sent for an empty parent, and result attrs on the picked option.

Co-Authored-By: Clanker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant