Skip to content

Release 2.0.0.beta3: attributes table and form checks - #7

Merged
senid231 merged 1 commit into
mainfrom
attributes-table-helpers
Dec 4, 2026
Merged

senid231 merged 1 commit into
mainfrom
attributes-table-helpers

Conversation

@senid231

@senid231 senid231 commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

Releases 2.0.0.beta3: bumps VERSION and names the CHANGELOG section, so the v2.0.0.beta3 tag can go on the merge commit. The release adds helpers that apps wrote themselves: AttributesTable#row_keys for the row order, #empty?(key) with have_empty_row for ActiveAdmin's empty marker, and Form#has_input? and #has_submit?.

Decisions the diff does not show:

  • row_keys returns the keys and leaves the order check to the spec, as Table#header_names does for columns.
  • The empty marker is .attributes-table-empty-value, which ActiveAdmin 4 renders only in attributes tables. The check looks inside the row's cell, so a theme's selector with a comma stays scoped.
  • The field check is has_input?, not has_field?: a form section's has_field? is Capybara's lookup by label, and RSpec's have_field calls Capybara's matcher.
  • A table in a panel needs no helper: declare it as a section inside the panel's section, as the README shows.
  • A tab's attributes table belongs in the theme, since the theme renders the tabs.

After this merges, the tag goes on the merge commit with a GitHub pre-release; nothing goes to RubyGems. Verified with the full suite (460 examples) and RuboCop.

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.

🟡 Changes recommended

Empty-row checks mishandle hidden cells, violate the non-waiting contract, and leave comma-separated marker selectors unscoped, allowing incorrect results from other rows.

2 open issues
What changed in this PR

Adds reusable attributes-table helpers to the page-object API, reducing application-specific code.

Changes:

  • Exposes row keys in page order.
  • Adds empty-marker checks with a theme-overridable selector.
  • Provides panel-scoped attributes tables, with documentation and tests.
File Description
spec/​dummy/​app/​admin/​documents.rb Adds a panel containing a second attributes table.
spec/​active_admin_page_objects/​attributes_table_spec.rb Tests row order, empty markers, and panel access across drivers.
README.md Documents the new helpers.
lib/​active_admin_page_objects/​selectors.rb Registers the empty-marker selector.
lib/​active_admin_page_objects/​panel.rb Adds attributes-table access with subclass support.
lib/​active_admin_page_objects/​attributes_table.rb Implements row keys and empty-value predicates.
CHANGELOG.md Records the additions under Unreleased.

Review effort: Balanced

@senid231 senid231 changed the title Attributes table: row order, empty markers and tables in panels Attributes table, panel tables, and form input and submit checks Dec 3, 2026
@senid231 senid231 self-assigned this Dec 4, 2026
Comment thread lib/active_admin_page_objects/panel.rb Resolved
Comment thread CHANGELOG.md Resolved
Adds AttributesTable#row_keys and the empty-value checks (empty?,
has_empty_row?, has_no_empty_row?), plus Form#has_input? and
#has_submit?. The field check is named has_input? because a section's
has_field? is Capybara's own lookup by label. A table in a panel needs
no helper: the README shows it declared as a section inside the
panel's section.

Co-Authored-By: Clanker
@senid231
senid231 force-pushed the attributes-table-helpers branch from a49407c to 0aefab5 Compare December 4, 2026 09:02
@senid231 senid231 changed the title Attributes table, panel tables, and form input and submit checks Release 2.0.0.beta3: attributes table and form checks Dec 4, 2026
@senid231
senid231 merged commit d0586c3 into main Dec 4, 2026
5 checks passed
@senid231
senid231 deleted the attributes-table-helpers branch December 4, 2026 09:09
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