Skip to content

2.x ports: panel status tags, multiple files, and the 1.2.x fixes - #5

Merged
senid231 merged 11 commits into
mainfrom
2x-ports
Dec 3, 2026
Merged

senid231 merged 11 commits into
mainfrom
2x-ports

Conversation

@senid231

@senid231 senid231 commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

Ports to 2.x (ActiveAdmin 4) what 1.x gained in 1.1.0 to 1.2.1, plus helpers apps asked for: panel status tags, several files in FileField#fill, PaginationInfo and have_semantic_errors(message, count:). The CHANGELOG lists each change.

Decisions the diff does not show:

  • ActiveAdmin 4 has no tabs component and no built-in batch-action dialog, so the 1.2.x items about them stay out: Tabs#body(label), ModalDialog#has_field? and the enabled-button wait. MainMenu#has_submenu? waits until an ActiveAdmin 4 app needs it.
  • Extension point: Comments#add calls the private reveal_comments(panel), which does nothing here. A theme that hides the panel overrides it.
  • BatchActions#click accepts no confirmation; the spec handles it.
  • The default form section stays unscoped: ActiveAdmin 4's filter form is not formtastic. The README shows declaring a form root.
  • The keyless has_status_tag?(label) lives on Panel only; rows and attributes tables keep has_status_tag?(key, label).
  • FileField#fill passes a single path as a String: rack_test raises TypeError for an Array on an input without multiple.
  • PaginationInfo is its own section, not part of Pagination: ActiveAdmin renders the line on a single page, where the pagination nav is missing.

Verified with the full suite (446 examples) and RuboCop. New specs failed before their change.

Apps read status tags placed straight in a panel body, and attach several
files to a multiple input; both needed a subclass in each app.

Co-Authored-By: Clanker

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are recorded for the panel status-tag helpers and multiple-file upload changes.

No open issues 🎉

What changed in this PR

Adds panel status-tag helpers and multiple-file uploads to the ActiveAdmin 4-compatible 2.x API.

Changes:

  • Adds keyless panel status-tag queries with label, status, and count filtering.
  • Allows file fields to accept arrays of paths while preserving single-path behavior.
  • Adds supporting fixtures, specs, and documentation.
File Description
spec/​support/​pages.rb Enables query parameters on document form URLs.
spec/​fixtures/​second_upload.txt Adds a second upload fixture.
spec/​dummy/​app/​models/​document.rb Records names from multiple uploaded files.
spec/​dummy/​app/​admin/​documents.rb Supports multiple-file inputs and parameters.
spec/​dummy/​app/​admin/​dashboard.rb Adds panel status-tag fixtures.
spec/​active_admin_page_objects/​panel_spec.rb Covers panel status-tag queries across drivers.
spec/​active_admin_page_objects/​file_field_spec.rb Covers multiple-file uploads.
README.md Documents both new capabilities.
lib/​active_admin_page_objects/​status_tag.rb Shares query logic and adds panel matchers.
lib/​active_admin_page_objects/​form/​file_field.rb Accepts arrays of file paths.
CHANGELOG.md Records the new APIs under Unreleased.

Review effort: Balanced

Reads the <tfoot> row by column key, such as the totals row of
activeadmin_table_footer, which also supports ActiveAdmin 4.

Co-Authored-By: Clanker
A select widget may need to type text other than the option label. The
keyword reaches choose_option only when given, so widget modules written
for the two-argument form keep working.

Co-Authored-By: Clanker
A Symbol field key keeps its leading underscore as formtastic ids it, the
field prefix skips collection_selection[] or comes from Form.object_name,
and required? also reads the label's abbr marker.

Co-Authored-By: Clanker
Includes the 1.2.1 fix: a label that Rails wraps in div.field_with_errors
after a validation error still counts.

Co-Authored-By: Clanker
With automatic reload off, Comments#add raised ObsoleteNode on the panel
found before the submit. ActiveAdmin 4 has no tabs, so a theme that hides
the panel overrides reveal_comments to show it again.

Co-Authored-By: Clanker
ActiveAdmin renders the line on a single page too, where the pagination
nav is missing, so it is its own section. It reads the numbers from the
bold parts, which keeps it working with a translated line.

Co-Authored-By: Clanker
has_semantic_errors? and has_no_semantic_errors? take count: for the
errors that match one message. On ActiveAdmin 4 the default form section
only meets another formtastic form in a custom sidebar section, where a
declared root is simpler than scoping the default.

Co-Authored-By: Clanker
@senid231 senid231 self-assigned this Dec 3, 2026
@senid231
senid231 marked this pull request as ready for review December 3, 2026 15:00
@senid231
senid231 merged commit 8410950 into main Dec 3, 2026
5 checks passed
@senid231
senid231 deleted the 2x-ports branch December 3, 2026 15:04
@senid231 senid231 mentioned this pull request Dec 3, 2026
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.

2 participants