Fix Insert-as-FX review findings: id rename, selection-count drift, refusal tooltip, success msg, master-only, reserve test

Renames the permanent action id out of the placement family, makes the button's
painted state and pressed outcome share one selection count, surfaces
panel-known refusals in the tooltip, reports the target track on success,
distinguishes a master-only selection, and pins the overflow-reserve test to the
real bar spec.
This commit is contained in:
2026-08-03 16:43:10 -04:00
parent fcd1ed022c
commit 51c7505dc0
8 changed files with 126 additions and 10 deletions
+18
View File
@@ -27,6 +27,18 @@ static void testEveryCombination() {
CHECK(insertFxRefusal(3, true) == InsertFxRefusal::MultiCapture);
}
// GetSelectedTrack ignores the master track, so "only the master is selected" is a
// distinct refusal from a plain empty selection -- both are !trackSelected, but the
// message differs so a master-only user isn't told "select a track" when they did.
static void testMasterOnlySelectedIsDistinctFromNoTrack() {
CHECK(insertFxRefusal(1, false, /*masterOnlySelected=*/true) ==
InsertFxRefusal::MasterOnlySelected);
CHECK(insertFxRefusal(1, false, /*masterOnlySelected=*/false) == InsertFxRefusal::NoTrack);
// The payload axis still runs first -- a bad capture count refuses on ITS reason
// even with the master selected.
CHECK(insertFxRefusal(0, false, /*masterOnlySelected=*/true) == InsertFxRefusal::NoCapture);
}
// Exactly one capture is the only count that can run; two is already too many.
static void testOnlyASingleCaptureRuns() {
CHECK(insertFxRefusal(2, true) == InsertFxRefusal::MultiCapture);
@@ -68,18 +80,24 @@ static void testEveryRefusalHasItsOwnSentence() {
const std::string noCap = insertFxRefusalMessage(InsertFxRefusal::NoCapture);
const std::string multi = insertFxRefusalMessage(InsertFxRefusal::MultiCapture);
const std::string noTrk = insertFxRefusalMessage(InsertFxRefusal::NoTrack);
const std::string masterOnly = insertFxRefusalMessage(InsertFxRefusal::MasterOnlySelected);
CHECK(none.empty());
CHECK(!noCap.empty());
CHECK(!multi.empty());
CHECK(!noTrk.empty());
CHECK(!masterOnly.empty());
CHECK(noCap != multi);
CHECK(noCap != noTrk);
CHECK(multi != noTrk);
CHECK(masterOnly != noTrk);
CHECK(masterOnly != noCap);
CHECK(masterOnly != multi);
}
int main() {
testEveryCombination();
testMasterOnlySelectedIsDistinctFromNoTrack();
testOnlyASingleCaptureRuns();
testNegativeCountRefuses();
testButtonBitIsThePayloadAxisOfTheFold();