chore(polish): cycle-end sweep — drop dead fields, dep-cycle, comments

Accumulated polish across the v1.7.1 R-Block reviewer findings. Single
sweep before Phase-3 Smoke-Gate.

Dep-cycle cleanup (Block H + #30):
- CommandHelpWindow drops the dead _inputBar ctor-param + discard that
  was J's speculative prep; this eliminates the InputBar <-> CommandHelpWindow
  ctor cycle at its root
- InputBar replaces Lazy<CommandHelpWindow> wrapper with direct
  CommandHelpWindow ctor-param now that the cycle is broken
- PluginHostFactory InputBar + CommandHelpWindow DI-regs simplified

Dead-field removals:
- MessageList drops _themes + _resolver (no reads after H's render-path
  swap to _chunkRenderer.DrawChunks)
- InputBar drops FocusedPreview (no consumer wiring in the new architecture)
- InputPreview drops SelectedCursorPos (v1.5.6 letter-by-letter renderer
  artifact, no callers in R1)
- InputPreview drops WhitespaceRegex + partial keyword on class (dead
  GeneratedRegex with no callers)

Visibility fixes:
- InputPreview + CommandHelpWindow + DebuggerWindow ctors flip
  public -> internal for consistency with internal sealed class declarations

DI helper extraction:
- PluginHostFactory MakePayloadHandler private static helper DRYs the
  7-arg list shared between PayloadHandler-singleton and Lender<T> factory

ImGui-rendering fix:
- MessageList.DrawCompactRow uses SameLine(0f, 0f) — eliminates visible
  ItemSpacing.X gap between sender-prefix and chunk content

Bug fixes:
- PayloadHandler.LeftClickPayload drops spurious unsafe keyword (no
  pointer ops in the method body; v1.5.6 had no unsafe here)
- PayloadHandler.StringifyMessage Aggregate seeded with string.Empty to
  fix empty-sequence crash for pure-icon messages
- PayloadHandler.MoveTooltip args==null LogWarning template simplified
  (?.GetType().Name was always null after the null-check — misleading)
- InputBar.SlashCommandCallback drops redundant BufTextLen==0 guard
  (BufTextSpan handles empty correctly)

Comment improvements (WHY-not-WHAT):
- ImGuiUtil.cs payload-state cluster comment moved below Buttons array
- PayloadHandler: §6.9 trimmed to 1 line, FindCharacterForPayload
  documented, hq symbol marker restored, MoveTooltip guard documented
  as defensive v1.7.1 addition, NativeItemTooltips branch explained,
  §4.2 theme colour swap explained
- DebuggerWindow class comment mentions PayloadHandler counters section
- InitHostedServices StopAsync explains params-overload semantics
- InputBar AppendPending null policy vs SetPendingMessage documented,
  CommandManager leading-slash assumption noted
- PluginHostFactory block comment explains singleton+Lender split

Build: 0 warnings, 0 errors. csharpier: clean. Version unchanged.
This commit is contained in:
2026-05-27 23:42:28 +02:00
parent d1bfddd9b8
commit f6749d206b
9 changed files with 47 additions and 76 deletions
+3 -9
View File
@@ -1,6 +1,5 @@
using System.Numerics;
using System.Text;
using System.Text.RegularExpressions;
using Dalamud.Bindings.ImGui;
using Dalamud.Game.Text;
using Dalamud.Game.Text.SeStringHandling;
@@ -13,7 +12,7 @@ using Microsoft.Extensions.Logging;
namespace HellionChat.Ui;
internal sealed partial class InputPreview : Window
internal sealed class InputPreview : Window
{
private readonly Components.ChunkRenderer _chunkRenderer;
private readonly Lender<PayloadHandler> _handlerLender;
@@ -28,9 +27,7 @@ internal sealed partial class InputPreview : Window
private int _lastLength;
private Message? _previewMessage;
internal int SelectedCursorPos = -1;
public InputPreview(
internal InputPreview(
Components.ChunkRenderer chunkRenderer,
Lender<PayloadHandler> handlerLender,
Windows.MainWindow mainWindow,
@@ -57,7 +54,7 @@ internal sealed partial class InputPreview : Window
DisableWindowSounds = true;
IsOpen = true;
// Logger injected for future diagnostic hooks (no call-sites yet in R1).
// TODO Polish-Sweep: remove discard once logging call-sites exist
_ = _logger;
}
@@ -187,7 +184,4 @@ internal sealed partial class InputPreview : Window
handler.Draw();
}
}
[GeneratedRegex(@"(\s)")]
private static partial Regex WhitespaceRegex();
}