From e7ed603e6ed83398df6f9bd8cf26ff19ba08223a Mon Sep 17 00:00:00 2001 From: Erik Date: Mon, 7 Sep 2026 12:11:56 +0200 Subject: [PATCH] =?UTF-8?q?fix(vtank):=20slice=207=20fix=20round=20B=20ite?= =?UTF-8?q?m=207=20=E2=80=94=20Consumables=20left-list=20click=20removes,?= =?UTF-8?q?=20not=20selects?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/AcDream.Plugins.MossTank/MossTankPanel.cs | 8 +++++ src/AcDream.Plugins.MossTank/mosstank.xml | 5 +++- .../MossTankPanelTests.cs | 29 +++++++++++++++++++ 3 files changed, 41 insertions(+), 1 deletion(-) diff --git a/src/AcDream.Plugins.MossTank/MossTankPanel.cs b/src/AcDream.Plugins.MossTank/MossTankPanel.cs index 46a7aa3d..17419490 100644 --- a/src/AcDream.Plugins.MossTank/MossTankPanel.cs +++ b/src/AcDream.Plugins.MossTank/MossTankPanel.cs @@ -515,8 +515,16 @@ internal sealed partial class MossTankPanel public int SelectedConsumableRowIndex => _selectedConsumableRow; public Action SelectItemRow => index => _selectedItemRow = ClampRow(index, _itemRows.Count); + // Fix round B item 7: VTank's own Consumables left list removes the + // clicked row directly (PluginCore.cs:7683-7700 — any left-list click + // is a delete, not a select-then-press-Remove step); the "Remove" + // button (RemoveSelectedConsumable) stays for parity with the + // Items/Buffs/Route lists that also keep both paths. public Action SelectConsumableRow => index => + { _selectedConsumableRow = ClampRow(index, _consumableRows.Count); + RemoveSelectedConsumableCore(); + }; public Action RemoveSelectedItem => RemoveSelectedItemCore; public Action RemoveSelectedConsumable => RemoveSelectedConsumableCore; diff --git a/src/AcDream.Plugins.MossTank/mosstank.xml b/src/AcDream.Plugins.MossTank/mosstank.xml index 07e286ff..36f44e5c 100644 --- a/src/AcDream.Plugins.MossTank/mosstank.xml +++ b/src/AcDream.Plugins.MossTank/mosstank.xml @@ -457,9 +457,12 @@ text="Gems / Food / Kits / Potions / Charges / Grenades / Lockpicks" color="#FFE8DEC3" />