From 897e262eda2eb633baa8d066be0c1bbb1cfc246c Mon Sep 17 00:00:00 2001 From: Erik Date: Mon, 7 Sep 2026 11:53:01 +0200 Subject: [PATCH] =?UTF-8?q?refactor(vtank):=20slice=207=20fix=20round=20B?= =?UTF-8?q?=20item=2013=20=E2=80=94=20glob=20mosstank*.xml=20everywhere=20?= =?UTF-8?q?it's=20named?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reordered ahead of items 5-12 on purpose: item 5 adds a fourth popup (mosstank-metaeditor.xml) and would otherwise need the same three-file manual edit this item retires. Every place a mosstank-*.xml file used to be named one at a time now globs mosstank*.xml instead, so adding a new popup panel needs exactly one new file, not four matching edits: - AcDream.Plugins.MossTank.csproj: replaces four separate entries. - AcDream.Plugins.MossTank.Tests.csproj: one globbed with Link="%(Filename)%(Extension)" replaces four separate Include/Link pairs. - AcDream.App.csproj: a new _MossTankPluginMarkup item (Include="…/mosstank*.xml") replaces the literal four-file semicolon list in both CopyMossTankPluginToBuildOutput and …ToPublishOutput's Copy SourceFiles. - MossTankMarkupContractTests: AuthoredControlsInTheSameContainerNeverOverlapASibling (item 2's new pin) and NoButtonAnywhereUsesTheUnrenderableArrowGlyphs now iterate Directory.GetFiles(AppContext.BaseDirectory, "mosstank*.xml") instead of a hardcoded 4-file array/Theory. Left SecondaryPopupPanelsFitTheirOwnBoundsAndEveryBindingResolves alone — it pairs each file with its OWN expected w/h, which a glob can't supply. - LinuxPlatformBoundaryTests.ShippedPluginCopiesUseResolvedTargetPathsForBuildAndPublish now asserts on the glob pattern instead of the literal mosstank.xml substring the old Copy SourceFiles list contained. A missed file in any of these four places used to silently drop a panel at mount (fix round A's own #missing-popup-files near-miss) instead of failing the build; the glob makes that failure mode structurally impossible. tests/AcDream.Plugins.MossTank.Tests: 662/662 (665 -> 662: the 4-case Theory collapsed into 1 Fact with an internal loop — same coverage, 3 fewer reported xunit tests). tests/AcDream.App.Tests --filter Markup|Plugin|UiMenu|Slider: 276/3 skipped/279 (unchanged). Verified the glob actually copies all four files: `ls src/AcDream.App/bin/Release/net10.0/plugins/AcDream.Plugins.MossTank/*.xml` lists all four post-build. Co-Authored-By: Claude Fable 5.1 --- src/AcDream.App/AcDream.App.csproj | 21 ++++++----- .../AcDream.Plugins.MossTank.csproj | 17 ++++----- .../Rendering/LinuxPlatformBoundaryTests.cs | 4 ++- .../AcDream.Plugins.MossTank.Tests.csproj | 18 ++++------ .../MossTankMarkupContractTests.cs | 35 +++++++++---------- 5 files changed, 47 insertions(+), 48 deletions(-) diff --git a/src/AcDream.App/AcDream.App.csproj b/src/AcDream.App/AcDream.App.csproj index 529a86b74..5ec6e149b 100644 --- a/src/AcDream.App/AcDream.App.csproj +++ b/src/AcDream.App/AcDream.App.csproj @@ -101,18 +101,23 @@ LogicalName="AcDream.App.Rendering.Icons.acdream-client-256.png" /> + MossTankPlugin resolves mosstank.xml and every mosstank-*.xml popup + panel relative to its own assembly, so all of them must land in the + same plugin directory. Fix round B item 13: globbed (mosstank*.xml) + instead of named one by one — a new popup used to need a matching + manual edit in both Copy targets below, the plugin csproj's own + CopyToOutputDirectory list, and the test project's Link list; a + missed one silently dropped a panel at mount instead of failing the + build. --> false true + + <_MossTankPluginMarkup Include="$(MSBuildProjectDirectory)/../AcDream.Plugins.MossTank/mosstank*.xml" /> + - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - + + PreserveNewest diff --git a/tests/AcDream.App.Tests/Rendering/LinuxPlatformBoundaryTests.cs b/tests/AcDream.App.Tests/Rendering/LinuxPlatformBoundaryTests.cs index 1fa4218a2..f380ae983 100644 --- a/tests/AcDream.App.Tests/Rendering/LinuxPlatformBoundaryTests.cs +++ b/tests/AcDream.App.Tests/Rendering/LinuxPlatformBoundaryTests.cs @@ -123,8 +123,10 @@ public sealed class LinuxPlatformBoundaryTests 2, project.Split("Targets=\"GetTargetPath\"", StringSplitOptions.None) .Length - 1); + // Fix round B item 13: globbed (mosstank*.xml) rather than named + // one file at a time — see AcDream.App.csproj's own comment. Assert.Contains( - "../AcDream.Plugins.MossTank/mosstank.xml", + "../AcDream.Plugins.MossTank/mosstank*.xml", project, StringComparison.Ordinal); Assert.DoesNotContain( diff --git a/tests/AcDream.Plugins.MossTank.Tests/AcDream.Plugins.MossTank.Tests.csproj b/tests/AcDream.Plugins.MossTank.Tests/AcDream.Plugins.MossTank.Tests.csproj index 6e692bd87..cf41fd256 100644 --- a/tests/AcDream.Plugins.MossTank.Tests/AcDream.Plugins.MossTank.Tests.csproj +++ b/tests/AcDream.Plugins.MossTank.Tests/AcDream.Plugins.MossTank.Tests.csproj @@ -20,17 +20,13 @@ - - - - + diff --git a/tests/AcDream.Plugins.MossTank.Tests/MossTankMarkupContractTests.cs b/tests/AcDream.Plugins.MossTank.Tests/MossTankMarkupContractTests.cs index c69f8a38a..620c8ae8d 100644 --- a/tests/AcDream.Plugins.MossTank.Tests/MossTankMarkupContractTests.cs +++ b/tests/AcDream.Plugins.MossTank.Tests/MossTankMarkupContractTests.cs @@ -323,19 +323,19 @@ public sealed class MossTankMarkupContractTests /// <column> (Campaign VT slice 1's <list><column> /// children have no x/y grammar at all — see /// docs/plugin-ui-markup.md's "Columns" — so every column reads as - /// (0,0) and would trivially "overlap" every other column). + /// (0,0) and would trivially "overlap" every other column). Fix round B + /// item 13: the file list is discovered (Directory.GetFiles) rather than + /// named one by one, so a new mosstank-*.xml popup is covered for free. /// - [Theory] - [InlineData("mosstank.xml")] - [InlineData("mosstank-advanced.xml")] - [InlineData("mosstank-loot-editor.xml")] - [InlineData("mosstank-buffpicker.xml")] - public void AuthoredControlsInTheSameContainerNeverOverlapASibling(string fileName) + [Fact] + public void AuthoredControlsInTheSameContainerNeverOverlapASibling() { - XDocument document = XDocument.Load( - Path.Combine(AppContext.BaseDirectory, fileName)); - XElement root = Assert.IsType(document.Root); - AssertNoSiblingOverlap(root); + foreach (string path in Directory.GetFiles(AppContext.BaseDirectory, "mosstank*.xml")) + { + XDocument document = XDocument.Load(path); + XElement root = Assert.IsType(document.Root); + AssertNoSiblingOverlap(root); + } } /// Direct pin on the overlap PREDICATE itself (independent of @@ -464,14 +464,13 @@ public sealed class MossTankMarkupContractTests [Fact] public void NoButtonAnywhereUsesTheUnrenderableArrowGlyphs() { - foreach (string fileName in new[] - { - "mosstank.xml", "mosstank-advanced.xml", - "mosstank-loot-editor.xml", "mosstank-buffpicker.xml", - }) + // Fix round B item 13: discovered file list (Directory.GetFiles) + // instead of a named-one-by-one array, so a new mosstank-*.xml + // popup is covered for free. + foreach (string path in Directory.GetFiles(AppContext.BaseDirectory, "mosstank*.xml")) { - XDocument document = XDocument.Load( - Path.Combine(AppContext.BaseDirectory, fileName)); + string fileName = Path.GetFileName(path); + XDocument document = XDocument.Load(path); XElement root = Assert.IsType(document.Root); foreach (XElement button in root.Descendants("button")) {