Skip to content

Release 2.0.0 - #57

Merged
senid231 merged 1 commit into
masterfrom
release/2.0.0
Oct 1, 2026
Merged

senid231 merged 1 commit into
masterfrom
release/2.0.0

Conversation

@Fivell

@Fivell Fivell commented Oct 1, 2026

Copy link
Copy Markdown
Member

Merge this last. #55 and #56 both add entries under ## [Unreleased]; once they land I move those entries under the ## [2.0.0] heading here and rebase. Merging this first would date a release that does not yet contain them.

Why major

The selectors build a different string than 1.0.0 did for the same input, so a suite that passed on 1.0.0 can fail on this version without a line changing:

input 1.0.0 2.0.0
'E-mail' col-email col-e-mail
:full_name col-fullname col-full_name
"Customer's Name" col-customers_name col-customer_s_name
'Billing::Employee' billing::employee (raises) billing_employee

That is a breaking change by SemVer, and the gem's README commits to SemVer. 1.0.0 → 2.0.0.

The sharpest case is a consumer who worked around the old behaviour: a helper that pre-normalized labels before calling these selectors passed on 1.0.0 and breaks here, because normalizing twice strips the separator the first pass inserted. That is called out in the migration notes and in the new README section.

What is in this PR

  • version.rb 1.0.0 → 2.0.0
  • CHANGELOG.md: a dated ## [2.0.0] heading
  • README.md: a new How labels become selectors section

The README section

The README had no reference for any of this — spec/support and test_helpers.rb were the only pointers, and neither explains how a label turns into a selector. Three things cost a downstream suite a day today, and all three were invisible from the docs:

  1. Do not normalize the label yourself. The gem makes the same parameterize(separator: '_') call ActiveAdmin makes; doing it first corrupts the result.
  2. row :salary, class: 'money' makes ActiveAdmin emit no row-* class at all (if options[:class] … elsif title.present?), so no label can address that row. Match on text.
  3. have_attributes_table(model:) follows the model class, have_table(resource_name:) follows the registered resource name. register Billing::Employee, as: 'Business Employee' splits the two, and passing the class to the second one silently builds index_table_billing_employees for a table rendered as index_table_business_employees.

Plus the label→class table, and the two cases where there is no class to match (own class:, and a label parameterize cannot transliterate).

Verification

Every selector in the new table was produced by running the gem, not written from memory:

"Full Name"          -> col-full_name
:full_name           -> col-full_name
"VAT / TAX Number"   -> col-vat_tax_number
"E-mail"             -> col-e-mail
"Customer's Name"    -> col-customer_s_name
"# of DIDs"          -> col-of_dids

The two model-name examples were read off real rendered pages earlier today: the dummy renders <div class="attributes_table billing_employee"> and <table id="index_table_business_employees">.

Suite: 34 examples, 0 failures on this branch (42 once #55 and #56 are in).

Major, not minor: the selectors build a different string than 1.0.0 did
for the same input, so a suite that passed on 1.0.0 can fail on this
version without changing a line. `col-email` becomes `col-e-mail`,
`col-fullname` becomes `col-full_name`, `col-customers_name` becomes
`col-customer_s_name`.

Also documents how labels and model names become selectors, which the
README never covered. Three things bit a downstream suite today and all
three were invisible from the docs:

  * normalizing a label yourself before handing it over now corrupts it,
    because the gem makes the same `parameterize` call ActiveAdmin does
  * `row :salary, class: 'money'` makes ActiveAdmin emit no `row-*`
    class at all, so no label can address it
  * `have_table(resource_name:)` follows the name a resource was
    registered under, while `have_attributes_table(model:)` follows the
    model class — `register Model, as: 'Other'` splits the two

Every selector in the new table was computed by running the gem, not
written from memory.
@Fivell
Fivell requested a review from senid231 October 1, 2026 13:51
@senid231 senid231 self-assigned this Oct 1, 2026
@senid231
senid231 merged commit f4a397e into master Oct 1, 2026
49 of 50 checks passed
@senid231
senid231 deleted the release/2.0.0 branch October 1, 2026 13:53
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