Skip to content

Show manifest stem names; describe stems via tooltip - #11

Merged
topkoa merged 3 commits into
mainfrom
feat/stem-display-name
Jul 19, 2026
Merged

topkoa merged 3 commits into
mainfrom
feat/stem-display-name

Conversation

@topkoa

@topkoa topkoa commented Jul 19, 2026 •

Copy link
Copy Markdown
Contributor

Part 3 of 3 for per-stem display metadata (feedpak 1.16.0, spec §5.3 name/description).
Depends on got-feedBack/feedBack#1013 (core passthrough) and
got-feedBack/feedBack-plugin-stems#41 (event/getState forwarding); fully backward-compatible
without them — rows render exactly as today.

What

  • Slider rows print the manifest name when reported, falling back to the built-in label
    (Guitar / Voice / …) and then the capitalized id — unchanged behavior for packs without
    the fields.
  • A stem with a description gets a ⓘ glyph next to its name; its native tooltip
    (title + aria-label) carries the text. No description → no glyph.
  • Metadata lives in a per-canonical-id map fed only by metadata-bearing sources (stems rows
    on the provider-ready event — preferred over stemIds — and getState() rows). Plain-id
    reports from an older stems plugin or the bridge heuristics never wipe it; it resets on song
    change.
  • Row-render cache key includes the metadata, so a name arriving after the id list rendered
    still rebuilds rows. Long names ellipsize inside the fixed label column.
  • Version 1.4.0.

Verification

  • node --check screen.js clean; node tests/state.test.js — 23 pass (new coverage:
    extractStemMeta canonicalization/dropping rules, stemDisplayName fallback chain incl.
    prototype-safety).
  • Visual check (name rendering, ⓘ tooltip, ellipsis) is on you in dev — needs a pack whose
    manifest carries the new fields, plus the two companion PRs.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Stem sliders now display descriptive names and tooltips based on available metadata.
    • Stem information remains consistent when availability updates are reordered or incomplete.
    • Improved compatibility with stem provider updates.
  • Bug Fixes

    • Stem metadata is reset correctly when switching songs, preventing outdated labels from carrying over.
  • Chores

    • Updated the plugin version to 1.4.0.

feedpak 1.16.0 (spec §5.3) added optional presentational fields to a
stems[] entry — `name` (display label) and `description` (free text).
Core passes them through song_info (feedback#1013) and the stems plugin
forwards them on stems:state / getState() (feedback-plugin-stems#41).
Display them:

- slider rows print the manifest `name` when one was reported, falling
  back to the built-in label (Guitar/Voice/...) and then the
  capitalized id, exactly as before for packs without the fields
- a stem with a `description` gets a ⓘ glyph next to its name whose
  native tooltip (title + aria-label) carries the text; stems without
  one render no glyph
- metadata is kept per canonical id in a map populated only by sources
  that carry it (stems rows on the provider-ready event, getState rows);
  a plain-id report from an older stems plugin or the bridge heuristics
  never wipes it, and it resets with the song
- the row-render cache key now includes the metadata, so a name arriving
  after the id list was already rendered still rebuilds the rows

Long names ellipsize inside the fixed label column instead of wrapping
the row. 23/23 node tests pass, including new coverage for the metadata
extraction and the display-name fallback chain.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: topkoa <topkoa@gmail.com>
@coderabbitai

coderabbitai Bot commented Jul 19, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 829c0093-6cfb-4008-a991-ecbdba70f93e

📥 Commits

Reviewing files that changed from the base of the PR and between b491da7 and 944b6b6.

📒 Files selected for processing (3)
  • plugin.json
  • screen.js
  • tests/state.test.js

📝 Walkthrough

Walkthrough

Stem availability now preserves per-stem manifest metadata, renders names and descriptions in slider rows, accepts metadata-bearing provider events, resets metadata between songs, and exports new helpers. Tests cover extraction, equality, display-name fallback, and inherited-property handling. Plugin version updates to 1.4.0.

Changes

Stem metadata flow

Layer / File(s) Summary
Metadata extraction and state tracking
screen.js, tests/state.test.js
Stem reports are canonicalized into metadata, reorder-only updates are ignored, and metadata-less updates preserve existing metadata.
Metadata rendering and lifecycle integration
screen.js, tests/state.test.js
Slider labels and descriptions use metadata, render keys include metadata changes, provider-ready accepts d.stems, song changes clear metadata, and helpers are exported.
Plugin release version
plugin.json
Plugin version changes from 1.3.0 to 1.4.0.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Provider as Stems provider
  participant Screen as screen.js
  participant Slider as Stem slider UI
  Provider->>Screen: stems:state with d.stems
  Screen->>Screen: extract and retain stem metadata
  Screen->>Slider: render available stems
  Slider->>Slider: display names and descriptions
Loading

Possibly related PRs

Suggested reviewers: omikronapex

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: showing manifest stem names and descriptions in the UI.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/stem-display-name

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for displaying per-stem manifest metadata (feedpak §5.3 name/description) in the Stem Mixer UI: showing the manifest name as the row label when present, and surfacing description via an info glyph tooltip, while remaining backward-compatible with older stems sources.

Changes:

  • Track per-stem name/description metadata keyed by canonical stem id and incorporate it into row rendering/cache invalidation.
  • Render manifest-provided stem names (with fallback chain) and add an ⓘ tooltip when a stem has a description.
  • Add node-only unit tests for metadata extraction and display-name fallback behavior; bump plugin version to 1.4.0.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
screen.js Adds stem metadata extraction/storage, display-name logic, tooltip glyph rendering, and render-cache keying on metadata.
tests/state.test.js Adds tests for extractStemMeta canonicalization/dropping rules and stemDisplayName fallback/prototype-safety.
plugin.json Bumps plugin version to 1.4.0.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread screen.js Resolved
Comment thread screen.js Resolved
Two Copilot catches:

- extractStemMeta rejected whitespace-only values via trim() but stored
  the raw string, so padded manifest values would reach the label and
  tooltip. Store the trimmed string; test pins it.
- the ellipsis on the name label never engaged: a flex item won't shrink
  below its content without min-width:0 (plus flex:1 1 auto), so a long
  manifest name would overflow the 58px column instead of clipping.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: topkoa <topkoa@gmail.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

Comment thread screen.js Resolved
Comment thread screen.js Resolved
Two Copilot catches on the metadata plumbing:

- extractStemMeta claimed "only own values survive" but read
  id/name/description through normal property access, so a crafted
  prototype could smuggle values in. All three now go through
  hasOwnProperty, matching the file's prototype-safety pattern.
- metaChanged was gated on an order-sensitive list compare, so a
  plain-id source replaying the same stems in a different order counted
  as a "new list" and wiped metadata a richer source had provided.
  Membership change (sameStemSet, order-insensitive) now gates the
  wipe; reorder-only reports keep the metadata. availableStems itself
  still updates on reorder, so row order keeps following the report.

Tests pin both: inherited-key rejection and set-vs-order semantics.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: topkoa <topkoa@gmail.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

screen.js:300

  • When the stem list membership changes and the incoming report has no metadata (plain-id array → nextMeta is empty), metaChanged becomes true via membershipChanged and stemMeta is replaced with {}. That means a plain-id update that adds/removes stems will wipe previously captured manifest name/description for stems that are still present, contradicting the stated behavior that metadata-less sources should never wipe metadata.

Consider preserving existing stemMeta entries for stems that remain in next when membershipChanged is true but nextMeta is empty (and only dropping metadata for removed stems).

        const membershipChanged = listChanged && !sameStemSet(next, availableStems);
        const metaChanged = (membershipChanged || Object.keys(nextMeta).length > 0)
            && JSON.stringify(nextMeta) !== JSON.stringify(stemMeta);
        if (!listChanged && !metaChanged) return;
        if (listChanged) availableStems = next;

@topkoa
topkoa merged commit 88e0234 into main Jul 19, 2026
3 of 4 checks passed
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