Skip to content

feat(core): the audio group model — element, membership, helpers - #3278

Open
vanceingalls wants to merge 1 commit into
wa-22b-character-presetsfrom
wa-23a-group-model
Open

feat(core): the audio group model — element, membership, helpers#3278
vanceingalls wants to merge 1 commit into
wa-22b-character-presetsfrom
wa-23a-group-model

Conversation

@vanceingalls

Copy link
Copy Markdown
Collaborator

Summary

  • Adds <hf-audio-group> + data-audio-group: a non-rendering group element and member-held membership attribute, parse-only foundation for B2–B7 (routing, UI, mute/solo, carve, bus strip) and C1 (timeline FX entry).
  • packages/core/src/audioGroups.ts: resolveAudioGroups(root) and audioGroupOf(el), pure DOM reads, no state. Groups don't nest (self-referential data-audio-group ignored); a group with members but no element still resolves (label = id); removing a member from the DOM drops it on next resolve.
  • New ./audio-groups package subpath (mirrors ./audio-carve).
  • New audio-groups canary at percentage: 0, sunsetAfter: 2027-01-15 — gates the future Studio UI only.
  • Studio attribute-write path (handleDomAttributeLiveCommit) verified to set/remove data-audio-group like any other data attribute (new test in useDomEditCommits.test.tsx).

Deviations from the step doc (verified, not guessed — see commit message)

  • The step's suggested display:none injection point (an existing runtime base stylesheet) doesn't exist in this codebase — grepped, confirmed absent. Skipped rather than inventing new infrastructure: an empty, childless custom element already renders as a zero-size inline box, and hyperframes lint against a fixture with the element confirms it produces no visible/lint findings.
  • No lint rule flags unknown elements or data-* attributes — confirmed by grep, added nothing per the step's own instruction.
  • Timeline's clip-collection selector already excludes the group element (no data-start/data-track-index/data-composition-id, not video/audio/img) — confirmed by reading timeline.ts, zero changes needed.

Depends on

Stacked on #3277 (P2) → #3276 (P1) → #3275 (A2) → #3274 (A1). Should merge after all four.

Test plan

  • bun run build clean
  • packages/core test: 2352/2352 (new audioGroups.test.ts: round-trip, group-absent, no-nesting, dangling-member, video-ignored)
  • packages/studio test: 4245/4245 (new attribute set/remove test)
  • hyperframes lint on a fixture containing <hf-audio-group> — 0 findings reference the element or its attributes
  • oxfmt/oxlint clean

Introduces <hf-audio-group> and data-audio-group as the group model B2–B7
and C1 build on: a non-rendering group element carries a label and (later)
an FX chain, membership lives on the member's own data-audio-group
attribute rather than DOM nesting, so a track removed from the document
simply drops out of the group on the next resolve — nothing dangles.
Groups do not nest: data-audio-group on the group element itself is
ignored. A group with members but no <hf-audio-group> element still
resolves, label falling back to the id, so hand-authored HTML degrades
gracefully. Audio only in v1 — video members are ignored.

Parse-only: nothing routes or sums audio yet (B3/B4). Adds the
audio-groups canary at percentage: 0 gating the future Studio UI; the
element and attribute parse and play regardless of enrollment.

Verified rather than assumed per this plan's standing rule: the timeline's
clip-collection selector ([data-start], [data-track-index],
[data-composition-id], video, audio, img) already excludes the group
element with zero changes, and no lint rule flags unknown elements or
data-* attributes, so neither needed touching — confirmed by grep and by
running `hyperframes lint` against a fixture containing the element (0
findings referencing it). The step doc's suggested display:none injection
point (an existing base stylesheet in the runtime) does not exist in this
codebase; skipped rather than inventing new infrastructure, since an empty,
childless custom element already renders as a zero-size inline box with no
visible output — the same reasoning the lint check above confirms
empirically.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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