fix(vtank): slice 7 fix round B item 7 — Consumables left-list click removes, not selects

Retail ground truth (PluginCore.cs:7683-7700): a click on the Consumables
tab's left list removes that row directly — there is no select-then-press-
Remove step for that list, unlike our previous SelectConsumableRow which
only updated the selection index. SelectConsumableRow now sets the index
AND immediately calls RemoveSelectedConsumableCore, matching the "click
removes" convention the right-hand Excluded Scarab Types list already
uses; the "Remove" button (RemoveSelectedConsumable) stays as a second
path, same as Items/Buffs/Route. Retitled the list's tooltip to match
("Click a row to remove it.").

New test: ConsumablesLeftListRowClickRemovesTheRowDirectly. Mutation
check: commenting out the RemoveSelectedConsumableCore() call turned it
red ("The collection contained 2 items" instead of Assert.Single); restoring
it turns it green.

tests/AcDream.Plugins.MossTank.Tests: 666/666 (was 665/665, +1).
tests/AcDream.App.Tests --filter Markup|Plugin|UiMenu|Slider: 276/3 skipped/279 (unchanged).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Erik 2026-09-07 12:11:56 +02:00
parent ce5652f524
commit e7ed603e6e
3 changed files with 41 additions and 1 deletions

View file

@ -942,6 +942,35 @@ public sealed class MossTankPanelTests
Assert.Equal(["Ice Wand"], panel.ItemNameColumn);
}
[Fact]
public void ConsumablesLeftListRowClickRemovesTheRowDirectly()
{
// Fix round B item 7: VTank's own Consumables left list removes the
// clicked row directly (PluginCore.cs:7683-7700) — no separate
// select-then-press-Remove step, unlike the earlier
// ItemsAndConsumablesTabsAddTheSelectedOwnedItemToRealProfiles test
// which still exercises the "Remove" button path.
var automation = new FakeAutomation
{
ItemEntries =
[
Item(20, "Iron Phial of Imperil", 0x100),
Item(21, "Black Marrow Pea", 0x20),
],
};
var host = new FakeHost(automation);
var panel = new MossTankPanel(host);
host.Selection.Select(20);
panel.AddSelectedConsumable();
host.Selection.Select(21);
panel.AddSelectedConsumable();
Assert.Equal(2, panel.ConsumableRows.Count);
panel.SelectConsumableRow(0);
Assert.Single(panel.ConsumableRows);
}
[Fact]
public void ExcludedComponentsGridAddsBySelectionAndDeletesByAnyCellClick()
{