Skip to content

Pins the popup class names against the doc - #185

Merged
johnnyt merged 1 commit into
mainfrom
sui-bgw-popup-class-names-test
Oct 11, 2026
Merged

johnnyt merged 1 commit into
mainfrom
sui-bgw-popup-class-names-test

Conversation

@johnnyt

@johnnyt johnnyt commented Oct 11, 2026

Copy link
Copy Markdown
Member

Refs: sui-bgw

What

The completion popup's DOM is built at runtime by the expression hook (assets/js/expression_input.js), so its class names appear in no HEEx template and no rendering test saw them; a rename in the hook would break a host's stylesheet silently.

A new test, test/statifier_ui/live/expression_popup_classes_test.exs, reads the popup's table in the "Styling and theming" section of docs/ops-embedding.md (the table after "Two of the surfaces a host styles are built by the hook at runtime") and the hook's source, and holds them together:

  • the classes the table's selectors name equal the classes the hook assigns through className = or classList.add, in both directions;
  • every attribute a documented selector names (data-kind) is one the hook sets with setAttribute;
  • the table parses to its selectors, the popup's own among them, so the first two tests cannot pass on an empty read.

The table and the hook agree today; neither changes.

Sabotage

Each mutation was applied to a copy-backed file, checked as applied, and restored byte-equal before the next:

  • renamed the option-kind class in the hook: the class-equality test failed on its assertion, the other two passed;
  • renamed the option-detail row in the doc's table: the class-equality test failed on its assertion, the other two passed;
  • set the option's kind through dataset instead of setAttribute: the attribute test failed on its assertion, the other two passed.

The notes sit above the tests.

Gate

Full mix quality green on this head, attested by mix quality.verify. No changelog fragment: a test-only change takes none under changelog.d/README.md.

Review

In-turn review of the diff. No record text in this PR.

The completion popup's DOM is built at runtime by the expression hook,
so its class names appear in no HEEx template and no rendering test
saw them. A new test reads the popup's table in the styling section of
docs/ops-embedding.md and the hook's source, and holds them to the same
class names in both directions; every attribute a documented selector
names must be one the hook sets. The table and the hook agree today.

Test only; no file under lib/ or assets/ changes.

Refs: sui-bgw
@johnnyt
johnnyt force-pushed the sui-bgw-popup-class-names-test branch from f68ab7a to e57d94f Compare October 11, 2026 14:51
@johnnyt
johnnyt merged commit 09ef626 into main Oct 11, 2026
1 check passed
@johnnyt
johnnyt deleted the sui-bgw-popup-class-names-test branch October 11, 2026 14:52
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