From ca00f528d6bd5b916f9b99bf6100ece80113f05f Mon Sep 17 00:00:00 2001 From: Jon Kazama Date: Sat, 30 May 2026 18:55:26 +0200 Subject: [PATCH] feat(config): drop dead SidebarTabView and migrate false to top tabs (schema v23) --- HellionChat/Configuration.cs | 7 ++++++- HellionChat/Plugin.cs | 14 ++++++++++++-- ...ionV22Step.cs => ConfigMigrationV23Step.cs} | 18 ++++++++++-------- .../Ui/Components/Settings/Tabs/ChannelsTab.cs | 5 ----- 4 files changed, 28 insertions(+), 16 deletions(-) rename HellionChat/SelfTests/{ConfigMigrationV22Step.cs => ConfigMigrationV23Step.cs} (73%) diff --git a/HellionChat/Configuration.cs b/HellionChat/Configuration.cs index 18c2787..80eae80 100755 --- a/HellionChat/Configuration.cs +++ b/HellionChat/Configuration.cs @@ -35,7 +35,7 @@ public class ConfigKeyBind [Serializable] public class Configuration : IPluginConfiguration { - internal const int LatestVersion = 22; + internal const int LatestVersion = 23; public int Version { get; set; } = LatestVersion; @@ -177,6 +177,11 @@ public class Configuration : IPluginConfiguration public bool MoreCompactPretty; public bool HideSameTimestamps = true; public bool ShowNoviceNetwork; + + // Migration-only since v23: the 1.5.6 sidebar↔top-tabs switch, superseded by + // MainWindowLayoutMode in the v1.6.0 rewrite. No UI control anymore; read by + // the v23 migration in Plugin.cs and kept deserializable so a 1.5.6 user's + // false value survives one load. Remove in a later schema bump. public bool SidebarTabView = true; public bool PrintChangelog = true; public bool OnlyPreviewIf; diff --git a/HellionChat/Plugin.cs b/HellionChat/Plugin.cs index 865b3dd..d942de0 100755 --- a/HellionChat/Plugin.cs +++ b/HellionChat/Plugin.cs @@ -223,7 +223,17 @@ public sealed class Plugin : IAsyncDalamudPlugin + "Please install v1.4.2 first to migrate the configuration, then upgrade to v1.4.10." ); } - Config.Version = 22; + // v23 migration: SidebarTabView was the 1.5.6 sidebar↔top-tabs switch, + // superseded by MainWindowLayoutMode in the v1.6.0 rewrite. A user who + // set it false (only effective in 1.5.6) wanted top tabs — carry that + // intent forward. Runs only for pre-v23 configs; fresh configs load at + // LatestVersion and skip it. Additive v20/v22 fields keep their + // initializer defaults as before. + if (Config.Version < 23 && !Config.SidebarTabView) + { + Config.MainWindowLayoutMode = MainWindowLayoutMode.TopTabs; + } + Config.Version = 23; // Unpinned TempTabs are session-only and dropped on every load. Pinned // TempTabs survive reload — Jin's tester feedback (v1.4.7). @@ -369,7 +379,7 @@ public sealed class Plugin : IAsyncDalamudPlugin new SelfTests.SettingsWindowOpenStep(this), new SelfTests.OnOpenMainUiRoutesMainWindowStep(this), new SelfTests.TypingIpcStateStep(this), - new SelfTests.ConfigMigrationV22Step(this), + new SelfTests.ConfigMigrationV23Step(this), new SelfTests.HoverSheenAllocStep(this), new SelfTests.HonorificHeaderRenderStep(this), new SelfTests.PerformanceBaselineStep(this), diff --git a/HellionChat/SelfTests/ConfigMigrationV22Step.cs b/HellionChat/SelfTests/ConfigMigrationV23Step.cs similarity index 73% rename from HellionChat/SelfTests/ConfigMigrationV22Step.cs rename to HellionChat/SelfTests/ConfigMigrationV23Step.cs index e307176..48a0f62 100644 --- a/HellionChat/SelfTests/ConfigMigrationV22Step.cs +++ b/HellionChat/SelfTests/ConfigMigrationV23Step.cs @@ -3,23 +3,25 @@ using Dalamud.Plugin.SelfTest; namespace HellionChat.SelfTests; -// Pins the post-migration shape of the v22 config. By /xlperf time the schema -// gate has already stamped Config.Version = 22, so the v21 fields plus the new -// MainWindowLayoutMode must carry valid values here; this probe never rewrites config. -internal sealed class ConfigMigrationV22Step : ISelfTestStep +// Pins the post-migration shape of the v23 config. By /xlperf time the schema +// gate has already stamped Config.Version = 23 and run the SidebarTabView→ +// TopTabs migration, so MainWindowLayoutMode must carry a valid value here. +// This probe never rewrites config; the actual migration (false → TopTabs) is +// load-time and verified by the prepared-config smoke in the plan. +internal sealed class ConfigMigrationV23Step : ISelfTestStep { - public ConfigMigrationV22Step(Plugin plugin) + public ConfigMigrationV23Step(Plugin plugin) { _ = plugin; } - public string Name => "Hellion Chat - Config v22 migration"; + public string Name => "Hellion Chat - Config v23 migration"; public SelfTestStepResult RunStep() { - if (Plugin.Config.Version != 22) + if (Plugin.Config.Version != 23) { - ImGui.Text($"Config.Version is {Plugin.Config.Version}, expected 22"); + ImGui.Text($"Config.Version is {Plugin.Config.Version}, expected 23"); return SelfTestStepResult.Fail; } diff --git a/HellionChat/Ui/Components/Settings/Tabs/ChannelsTab.cs b/HellionChat/Ui/Components/Settings/Tabs/ChannelsTab.cs index 6e036b8..328c06e 100644 --- a/HellionChat/Ui/Components/Settings/Tabs/ChannelsTab.cs +++ b/HellionChat/Ui/Components/Settings/Tabs/ChannelsTab.cs @@ -55,11 +55,6 @@ internal sealed class ChannelsTab if (ImGui.CollapsingHeader("Sidebar")) { - DrawToggle( - "Show sidebar tabs", - () => Plugin.Config.SidebarTabView, - v => Plugin.Config.SidebarTabView = v - ); // Range matches Sidebar.MinSidebarWidth/MaxSidebarWidth (40-300). The // lower bound sits just above the 38px icon-only threshold; the // on-disk default (44) and the 150px expanded reference both fit.