RynthChat: a new tab never lands in a hidden server tab

"New tab: Network" on a server where the DreamWeave Network tab is
hidden returned that hidden tab, so the player's new rule filled the
server's tab. ChatServerTabs.ResolveNewTab now keeps "returns the
existing one" for a visible tab only; a hidden match gets a free
numbered name ("Network 2"). An unreadable settings file is logged
once per run instead of on every 2 s retry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Daniel Wallace 2026-11-15 09:05:29 -08:00
commit 0eec23f6fd
3 changed files with 43 additions and 11 deletions

View file

@ -1449,6 +1449,16 @@ internal static class Program
Check(!offRoute.ShowsIn("Network", "Chat") && offRoute.ShowsIn("Every", "Chat"), "another server: only the every-server rule runs");
Check(!none.ShowsIn("Network", "Chat") && none.ShowsIn("Every", "Chat"), "no servers known: only the every-server rule runs");
Case("ResolveNewTab_HiddenServerTabIsAClash");
// "New tab: Network" on another server, where the DreamWeave Network tab is hidden.
string[] visible = { "All", "Chat", "Mine" };
string[] everyTab = { "All", "Chat", "Mine", "Network", "Network 2" };
Check(ChatServerTabs.ResolveNewTab("mine", visible, everyTab) == ("Mine", true), "a visible tab of that name is that tab (its own case)");
Check(ChatServerTabs.ResolveNewTab("chat", visible, everyTab) == ("Chat", true), "a base tab too");
Check(ChatServerTabs.ResolveNewTab("Network", visible, everyTab) == ("Network 3", false), "a hidden server tab: a free numbered name, not the server's tab");
Check(ChatServerTabs.ResolveNewTab("Network", visible, new[] { "All", "Network" }) == ("Network 2", false), "the first free number");
Check(ChatServerTabs.ResolveNewTab("Fresh", visible, everyTab) == ("Fresh", false), "no match: the name itself, new");
Case("Apply rules compile");
foreach (RynthChatFilterDto r in new TabSim { Room = "LFG" }.Apply(d).Inserts)
{