WORK-724
ID:WORK-724Status:ready

Behaviours write state as data-state, not as classes on rune-owned elements

SPEC-196 D6. Four behaviours write classes onto elements a rune owns. Under a theme that chooses classes: "none", that would put classes back on the page, and under a mapping table it produces junk:

Priority:mediumComplexity:simpleMilestone:v0.50.0Source:SPEC-196
claude/composition-usage-rune-pages-c87ar6 View source

Criteria completion

Criteria completion: 0 of 7 (0%) checked; tracking started on Nov 9, no incremental history yet0%25%50%75%100%Nov 9Nov 22

Tracking started Nov 9 — check back for trends.

Branches 2
claude/composition-usage-rune-pages-c87ar6 current ready
claude/rune-composition-layout-convention-hkqrzx donemain ready
History 1
  1. aea7072
    Created (ready)by bjornolofandersson

Acceptance Criteria

  • reveal sets data-state on each step and writes no class on it
  • tabs sets data-state on the active tab and panel, writes no class, and no longer reads a class from another element
  • The audio player sets data-state on the active track and writes no class on it
  • copy sets data-state for its copied state and writes no class on a rune-owned element
  • The Lumina rules for those states select [data-state="…"]
  • The behaviour tests for reveal, tabs and copy assert the attribute, and the audio player gains a test that does
  • A test fails when a behaviour calls classList.add, classList.toggle or assigns className on an element it did not create

Approach

  • Check each behaviour for an existing data-state (or aria-selected, aria-current) before adding one. Where ARIA already says the state, the CSS can select ARIA and no new attribute is needed.
  • State values follow what exists: active / inactive, visible / hidden, copied.
  • The last criterion's test can be narrow: it flags class writes on elements reached through a query, not on elements made with createElement in the same function. Behaviour-built UI is WORK-725.

References

  • SPEC-196 D6.
  • ADR-048: implementation order, step 1.