fix(vtank): slice 7 round D item 1 — Advanced Options category names

Owner live report 2026-09-07: "Some Hex numbers with green button to
the right. What is that?" — the Advanced Options popup's category
filter checklist showed raw bitmask hex ("0x1", "0x2", ...) instead of
VTank's real category names (Misc, Recharge, MeleeCombat, SpellCombat,
Ranges, Navigation, Buffing, Crafting, Looting).

This worktree has no refs/vtank/ checkout, so VTank's own name/enum
string literal for each bit isn't directly readable. Derived the
mapping instead from real data already in the embedded .usd: for each
category name, docs/research/vtank-kb/01-settings-and-profiles.md §2
was searched for a setting whose Category column names EXACTLY that
one category (no `|` combination) — e.g. row 45 RandomHelperBuffs is
pure "Misc", row 18 AttackDistance is pure "Ranges" — then that
setting's own recorded bitmask was read back from
VtankDefaultSettingsDatabase.SettingCategoryBitmasks (never a typed-in
hex literal), so the mapping tracks the shipped database instead of
silently drifting from it. All 9 of VtankOptionCatalog.CategoryBits
resolve to a real name this way (VtankOptionCatalog.
CategoryNamesByBit), in VTank's own ascending-bit order.

Mutation shown to fail: reverting AdvancedOptionCategoryNames to the
old `$"0x{bit:X}"` projection failed the new
AdvancedOptionCategoryNamesShowRealNamesNotHexBitmasks test with
["0x1", "0x2", ...] instead of ["Misc", "Recharge", ...]; restored and
confirmed green.

Verified: dotnet build AcDream.slnx -c Release green; MossTank suite
679/679 (678 -> 679); App markup/plugin filter 242/242 (unchanged).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Erik 2026-09-07 16:21:57 +02:00
parent 4ba0a557f6
commit ebe670adf5
3 changed files with 84 additions and 7 deletions

View file

@ -1280,6 +1280,30 @@ public sealed class MossTankPanelTests
Assert.False(panel.LootEditorVisible);
}
/// <summary>
/// Round D item 1 (owner live report 2026-09-07: "Some Hex numbers with
/// green button to the right. What is that?"): the category filter
/// checklist must show VTank's real category NAMES, never the raw
/// bitmask hex the popup showed before this fix. Order is
/// VtankOptionCatalog.CategoryBits' own ascending-bit order, which is
/// also VTank's cmbAdvOptFilterCategory order (Misc=1 through
/// Looting=256).
/// </summary>
[Fact]
public void AdvancedOptionCategoryNamesShowRealNamesNotHexBitmasks()
{
var panel = new MossTankPanel(new FakeHost(new FakeAutomation()));
Assert.Equal(
[
"Misc", "Recharge", "MeleeCombat", "SpellCombat", "Ranges",
"Navigation", "Buffing", "Crafting", "Looting",
],
panel.AdvancedOptionCategoryNames);
Assert.DoesNotContain(
panel.AdvancedOptionCategoryNames, name => name.StartsWith("0x", StringComparison.Ordinal));
}
[Fact]
public void AdvancedOptionCategoryFilterHidesNonMatchingSettings()
{