Repository navigation
Paint the Extract row from one place, so All cannot lie - #660
Merged
Merged
Conversation
Two stems selected, All lit, on every page load (#658). The Extract row has three controls describing one fact: the six stem chips, the All button beside them, and the Lead + Backing toggle that only means anything while Vocals is among them. Each was painted by whoever happened to change the selection, and the paths did not agree. All was synced from a closure inside wireAllButton, reachable only from a click. So both paths that set the selection without one left it stale. The restore on load arrives asynchronously, after the wiring has already synced once against the all-stems default, so the chips get the stored value and All keeps the default. Opening a track from the library set aria-pressed on each chip by hand and never touched All at all. The Lead + Backing toggle had the same gap on the same two paths, which is how it stayed on screen offering a choice about vocals nobody was extracting. So the painting moves to stemChoice.js and every path calls it. main.js imports catalog.js, so catalog.js cannot import back into main.js; a module outside both is what lets them agree without a cycle. All is now derived on every refresh from selectedStems.size === STEM_NAMES.length rather than kept in step by hand, which is the part that makes the next path added get it right for free. Reproduced first against a real import rather than the seeded fixture, which cannot reach applyStoredStemSelection: chose vocals and drums, split, watched All go correctly dark, reloaded, and found it lit again with the same two chips. Both of those paths are now covered by tests that fail without this change, along with the toggle's half and the All button's own behaviour. Verified: the full Playwright suite (187), pytest (1078), the JS unit tests, node --check over every module, i18n coverage clean, uv.lock untouched.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #658
Two stems selected, All lit, on every page load. Reported as part of #657.
What was wrong
The Extract row has three controls describing one fact, which stems will be extracted: the six chips, the All button, and the Lead + Backing toggle that only means anything while Vocals is among them. Each was painted by whoever happened to change the selection, and the paths did not agree.
All was synced from a closure inside
wireAllButton, reachable only from a click. Both paths that set the selection without one left it stale:stemSelectionReadyresolves after the wiring has already synced once against the all-stems default, so the chips get the stored value and All keeps the default.applyStoredStemSelectionsetaria-pressedon each chip by hand and never touched All.The Lead + Backing toggle had the same gap on the same two paths, which is how it stayed on screen offering a choice about vocals nobody was extracting.
What changed
The painting moves to
static/js/stemChoice.jsand every path calls it.main.jsimportscatalog.js, socatalog.jscannot import back intomain.js; a module outside both is what lets them agree without a cycle.All is now derived on every refresh from
selectedStems.size === STEM_NAMES.lengthrather than kept in step by hand. That is the part that makes the next path added get it right without knowing this bug existed.No behaviour changes beyond the fix: pressing All still fills and empties the row, and clicking a chip from the default state still switches to "only this stem".
How it was found
Against a real import rather than the seeded fixture, which cannot reach
applyStoredStemSelectionbecause it has noaudioStems. Chose vocals and drums, ran a split, watched All go correctly dark, reloaded, and found it lit again with the same two chips.Tests
Four in a new spec, seeding the store the way an earlier session would have left it. Two of them fail without this change: the All button's, and the toggle's. The other two pin the behaviour that was already right, so a future tidy-up of this row cannot quietly drop it.
Verified
The full Playwright suite (187 passing), pytest (1078 passing), the JS unit tests,
node --checkover every module, i18n coverage clean,uv.lockuntouched.Not in this PR
#659, the two different controls both labelled "All", which is the other half of what #657 reported. That one is a rename across ten language tables and a layout question, not a bug.