Repository navigation
Show manifest stem names; describe stems via tooltip - #11
Conversation
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>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughStem 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. ChangesStem metadata flow
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
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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/descriptionmetadata 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.
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>
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>
There was a problem hiding this comment.
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 →
nextMetais empty),metaChangedbecomes true viamembershipChangedandstemMetais replaced with{}. That means a plain-id update that adds/removes stems will wipe previously captured manifestname/descriptionfor 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;
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
namewhen reported, falling back to the built-in label(
Guitar/Voice/ …) and then the capitalized id — unchanged behavior for packs withoutthe fields.
descriptiongets a ⓘ glyph next to its name; its native tooltip(
title+aria-label) carries the text. No description → no glyph.stemsrowson the provider-ready event — preferred over
stemIds— andgetState()rows). Plain-idreports from an older stems plugin or the bridge heuristics never wipe it; it resets on song
change.
still rebuilds rows. Long names ellipsize inside the fixed label column.
Verification
node --check screen.jsclean;node tests/state.test.js— 23 pass (new coverage:extractStemMetacanonicalization/dropping rules,stemDisplayNamefallback chain incl.prototype-safety).
manifest carries the new fields, plus the two companion PRs.
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Bug Fixes
Chores