[Feature] RubyUI 2.0 — Phase 2.0b: the other 173 ERB fixtures

Closed
CI
22d ago
+2071-9

What

Stacked on #548. Every one of the 188 golden scenarios now has an ERB
fixture under gem/test/golden/views/, rendered through the harness
(ReActionView → Herb) and compared against the canonical and strict
snapshots Phase 2.0a froze from Phlex — with every component still Phlex,
through phlex-rails. Button's 15 were in #548; the other 173 are here, in
seven batches, each green before the next.

  • A coverage test, every scenario has a fixture, red from the first commit
    (173 missing) to the last (0). Its message was the inventory.

  • Every fixture is one line, plus a trailing newline. Decision 10 records why:
    measured through Herb 0.10.4, the end closing a <%= … do %> block
    ignores its own trim markers and the indentation before an output tag is
    emitted, so an indented one-render-per-line template is not
    whitespace-tight — and the strict lane would see every such character.
    The plan's Appendix A has each probe's source and output.

  • The shapes the catalog uses — a block parameter writing raw HTML,
    yield(self) with group.ToggleGroupItem, DataTableForm reaching for
    the view context, a block yielding nothing, a Ruby loop, a heredoc — were
    each measured strict-identical before the plan was written; the plan's
    evidence table has the list.

  • One harness fix the lane exposed (Task 7b). ActionView instruments every
    render, and the first instrumentation on a thread creates ActiveSupport's
    Instrumenter, whose id is SecureRandom.hex(10) — inside the harness pin,
    on the first ERB render of a process, that call took the counter's first
    value and shifted every generated id in that render by one, so
    tooltip/default, select/default or date_picker/generated_id failed
    their own determinism check when one of them ran first (about 3 runs in
    190). render_erb now creates the instrumenter before the pin; a test
    renders twice on a fresh thread and asserts identical output. This amended
    the plan's "harness does not change" boundary by a ruling taken during
    execution — please ratify or revert it explicitly in review.

No component changes, no snapshot changes. Nothing under gem/lib/, docs/
or mcp/ moves; the harness changes by that one line.

Why

Decision 7: with every fixture written before any component migrates, a
migration from 2.1 on changes only an implementation, never the ruler — "did I
write the fixture right" and "did I port the component right" stop being one
failure. Plan: design/plans/2026-09-20-phase-2-0b-fixtures-implementation.md.

Test steps

cd gem
bundle exec rake            # 776 runs, 0 failures, 0 skips; 423 files, no offenses
bundle exec rake golden     # 410 runs: 188 Phlex-lane + 188 ERB-lane + 7 coverage + 27 of the ruler's own

To see a fixture fail, add a space before <% end %> in
test/golden/views/shortcut_key/default.html.erb and re-run rake golden:
the canonical form passes, the strict form fails — whitespace only, exactly
what the strict lane exists for.

🤖 Generated with Claude Code


Summary by cubic

Adds the remaining 173 ERB fixtures so all 188 golden scenarios render through the harness and compare against the snapshots Phase 2.0a froze from Phlex. Components stay on Phlex this phase, so a later migration changes only an implementation, never the test baseline.

A coverage test enforces that every scenario has a fixture; it was red at 173 missing and is green now.

Harness fix

  • The first ERB render on a thread could shift every generated id by one: ActionView's first instrumentation creates an Instrumenter whose SecureRandom.hex(10) id landed inside the harness pin. render_erb now creates the instrumenter before the pin, with a regression test rendering twice on a fresh thread.

All fixtures are one line because measured Herb 0.10.4 trim behavior keeps the newline after a block-closing end and emits indentation before output tags; recorded as decision 10.