feat(config): drop dead SidebarTabView and migrate false to top tabs (schema v23)
This commit is contained in:
@@ -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;
|
||||
|
||||
+12
-2
@@ -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),
|
||||
|
||||
+10
-8
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user