Commit Graph

1241 Commits

Author SHA1 Message Date
JonKazama-Hellion f6d3794d87 feat(di): scaffold Microsoft.Extensions.Hosting container (DI-1 + DI-1b)
Lays down the DI foundation that v1.5.x will run on top of, without
flipping the switch on Plugin.cs yet (that move follows in C3). The new
files compile alongside the existing bootstrap but no caller resolves
the host, so the live behaviour is byte-identical to v1.4.10.

What's new:

- PluginHostFactory.cs: HostBuilder.Build(plugin, dependencies)
  registers ~46 services across Block A (21 Dalamud singletons), Block
  B (14 HellionChat services plus FileDialogManager), Block C (8
  windows), plus Plugin and PluginLifecycle. Service-class bodies are
  untouched - Plugin-backref ctors go through factory lambdas.
- PluginLifecycle.cs: thin IAsyncDisposable wrapping the host's
  StartAsync/StopAsync, with idempotent dispose and framework-thread
  Host.Dispose. The Host is assigned via a property setter from
  Plugin.ctor; HellionChat deviates from Lightless' Func-delegate
  pattern because the schema gate must run before Build.
- Infrastructure/Logging/{DalamudLogger, DalamudLoggingProvider,
  DalamudLoggingProviderExtensions}.cs: ILogger<T> -> IPluginLog
  bridge, ported from Lightless without the mod-sync hasModifiedGameFiles
  flag and without the LightlessConfigService log-level coupling.
- Infrastructure/Hosting/InitHostedServices.cs: seven IHostedService
  adapters around the existing init methods (FontManager.BuildFonts,
  ThemeRegistry warmup+switch, IpcManager/TypingIpc/ExtraChat eager
  resolve, MessageManager.FilterAllTabsAsync, AutoTellTabsService
  .Initialize). Adapter style rather than inlining ": IHostedService"
  on the service classes per the DI-2a "service bodies untouched"
  constraint.

Plan drift noted for cycle closure: MessageStore stays inside
MessageManager.ctor (not a standalone container singleton) because
MessageManager.ctor allocates it directly today; promoting it would
double-construct the SQLite handle. AutoTellTabsService reads it via
MessageManager.Store inside its factory lambda.
2026-05-17 02:44:54 +02:00
JonKazama-Hellion 763f5a3f5d chore(deps): add Microsoft.Extensions.Hosting et al. for DI foundation
Prepares the v1.5.0 DI-container adoption (Lightless pattern) by adding
four MS.Extensions packages as direct closed-range references:

- Microsoft.Extensions.Hosting (IHost, HostBuilder)
- Microsoft.Extensions.DependencyInjection (IServiceCollection)
- Microsoft.Extensions.Logging (ILogger<T> for DI-4 logger migration)
- Microsoft.Extensions.Options (transitive used by Hosting + future config)

Closed-range [10.0.7, 11.0.0) matches the existing pinning style for
MessagePack/Pidgin/ImageSharp and locks the major version while letting
Renovate roll minor and patch updates. Lock file regenerated.
2026-05-17 02:29:41 +02:00
JonKazama-Hellion 8a18f7caaa fix(chat-input): replace input on slash-command insert
Cherry-pick from ChatTwo upstream ee7768ac (Infiziert90, 2026-05-16):
when args.AddIfNotPresent or args.Input starts with '/', replace the
chat input instead of appending. Fixes the Friend-List "/tell" path
where existing text like "test" would otherwise concatenate to
"test/tell user@world" before the receiver and channel resolve.

Variable drift versus upstream: HellionChat uses local 'Chat' where
ChatTwo uses InputHandler.ChatInput; logic is 1:1.
2026-05-17 02:26:03 +02:00
JonKazama-Hellion 5f7bfb5890 fix(preflight): avoid jq SIGPIPE race in verify-changelog-sync
Security / scan (push) Successful in 23s
Build / Build (Release) (push) Successful in 31s
The Block C check used `jq -r '.[0].Changelog' | grep -qE ...` to spot
the **vX.Y.Z** marker. With `set -o pipefail`, grep -q closing stdin on
the first match makes jq trip SIGPIPE on the rest of the multi-KB
Changelog string, which the script then surfaces as a false-positive
"Changelog missing **vX.Y.Z** subblock" failure. Interactive shells
sometimes raced through fast enough to hide the issue, but the pre-push
runner hit it reliably (saw it on the v1.4.10 release-cut push attempt).

Switched the pipe to a process substitution so jq writes into a FIFO
and SIGPIPE never enters the picture. Both directions of the marker
check now stay deterministic.
2026-05-16 14:08:19 +02:00
JonKazama-Hellion 3be4e73c27 Merge feature/v1.4.10 — Symbol-Picker and Tell-History Fix
Forge Announce / Post changelog to Hellion Forge (push) Successful in 7s
Release / Build and attach release ZIP (push) Successful in 37s
v1.4.10
2026-05-16 14:04:20 +02:00
JonKazama-Hellion 667950c98e docs: add v1.4.10 forge announcement post and apply csharpier reflow
Forge-Post is required in the tagged tree so forge-announce.yml can read
it during the release-pipeline run. Plus a csharpier reflow on two files
(SymbolPicker.cs, ChatLogWindow.cs) that preflight Block E flagged after
the cycle's comment-tightening sweep — purely whitespace, no behaviour
change.
2026-05-16 14:01:17 +02:00
JonKazama-Hellion 3e91177833 release: bump to v1.4.10 2026-05-16 13:25:53 +02:00
JonKazama-Hellion 51f18e46a0 chore(comments): tighten v1.4.10 inline commentary after self-review
Five trim spots from the cycle's earlier commits — none change behaviour,
just drop redundant phrasing and stale references per the HellionChat
comment-style convention (1-3 lines default, link "same as X" instead of
repeating, file:line refs only where they aid navigation).

SymbolPicker:
- BmpWhitelist header consolidated to source + filter ranges
- ImRaii.Popup pattern links the established ChatLogWindow popup idiom
  instead of citing three call-sites
- ToIconString comment drops the "discoverability" footnote that the
  code already telegraphs
- Manually-wrapping comment drops the "same modern idiom" tail that
  duplicated the preceding sentence

MessageStore:
- Merge the stale pre-v1.4.10 sqlScanLimit comment with the new
  v1.4.10 commentary; the cap mention now describes the historical
  reason rather than a parameter that no longer exists
2026-05-16 12:49:01 +02:00
JonKazama-Hellion f66316161b fix(autotells): preload tell history fully up to the user-configured limit
PreloadHistory had a hardcoded 500-row SQL scan window that capped the
per-partner history pull regardless of the AutoTellTabsHistoryPreload
setting. For active users with many tell partners, the scan window
filled up with chatter from other partners and pushed less-frequent
partners' history off the back end — pinned tabs reloaded empty even
though the messages were still in the database.

Drops the hardcoded scan cap. The (Receiver, Date) index keeps SQL fast
on the now-unbounded read, and the client-side loop still breaks as
soon as the configured per-tab limit is hit, so decode cost stays
proportional to the depth at which `limit` matches accumulate (typically
shallow even for chatty users).
2026-05-16 12:16:08 +02:00
JonKazama-Hellion 679b8f0f5e feat(settings): toggle for the symbol-picker chat-input button
Adds a Configuration property, defaulted to enabled, and a checkbox in
the Chat settings tab's Behaviour section. Strings live in HellionStrings
so DE/EN stays in sync. Defaults aligned with our 'discoverable by
default, hidden by user choice' convention. Schema stays at v17 — the
new boolean is additive, the default constructor covers existing configs.
2026-05-16 10:05:37 +02:00
JonKazama-Hellion 0e470fcdce feat(ui): SymbolPicker BMP tab and session-only recents
Second tab exposes the server-verified BMP whitelist (round-tripped via
/echo and /say in the v1.4.10 preflight). Recent-used row at the top
floats the user's last sixteen picks across both tabs, move-to-front
on reuse. Recents stay session-only by design — no Configuration touch,
schema unchanged.
2026-05-16 09:27:58 +02:00
JonKazama-Hellion abbbf95002 feat(ui): add SymbolPicker popup with FFXIV icon tab
New popup attached to the chat input lets the user browse and insert
Dalamud SeIconChar glyphs (161 PUA codepoints, server-safe by design).
Search field filters by enum name. Multi-insert keeps the popup open
until the user clicks elsewhere. BMP tab follows in the next commit.
2026-05-16 01:11:12 +02:00
JonKazama-Hellion fbbbeebade refactor(commands): cache slash-command wrappers in private fields
TearDownCommands attached the same instance via re-Register with identical
args, which was functionally a no-op but masked a latent bug if Description
or ShowInHelp ever diverged between Setup and Teardown. Hold the wrapper
instances as nullable fields so Teardown can detach the live registration
directly. Mirrors the cached-wrapper pattern in ChatLogWindow.
2026-05-15 20:18:41 +02:00
JonKazama-Hellion 7c9b90c767 Merge feature/v1.4.9 — Plugin-Load Render Polish
Security / scan (push) Successful in 22s
Build / Build (Release) (push) Successful in 31s
Forge Announce / Post changelog to Hellion Forge (push) Successful in 7s
Release / Build and attach release ZIP (push) Successful in 36s
v1.4.9
2026-05-15 13:35:37 +02:00
JonKazama-Hellion b81894b859 docs: surface the ChatTwo IPC compatibility layer in v1.4.9 patch notes
Adds a "ChatTwo IPC compatibility layer" bullet across all six
release-note surfaces so the new behaviour from commits 8c4afaa and
655c903 is visible to users via the manifest installer, the Gitea
release page, the README project-status section, the changelog/roadmap
docs and the Forge-Discord announcement.

Files touched:
- HellionChat/HellionChat.yaml: bullet added inside the v1.4.9
  changelog block, preserved order so the regression-tripwire line
  still comes before the migration-stays line.
- repo.json: Changelog field kept synchronous (JSON-escaped newlines).
- README.md: project-status paragraph extended with a one-sentence
  recap of the IPC mirror and the conflict-detection caveat.
- docs/CHANGELOG.md: bullet inserted between the profiling-logs and
  migration-stays bullets, code-fenced gate names.
- docs/ROADMAP.md: v1.4.9-released section gets the same recap so the
  cycle history stays self-describing.
- .github/forge-posts/v1.4.9.md: German-only bullet for the Discord
  embed, slotted before the migration-v17 bullet. Char-cap holds —
  preflight Block C reports the embed total well under 5500 chars.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-15 13:04:18 +02:00
JonKazama-Hellion 655c903cb5 feat(ipc): mirror context-menu IPC gates under ChatTwo namespace (v1.4.9 R4 ext)
Extends commit 8c4afaa: the TypingIpc mirror covered only two of the six
ChatTwo IPC slots. Third-party plugins like Artisan and AllaganTools
subscribe to a different ChatTwo IPC surface — the context-menu
integration (ChatTwo.Register / Unregister / Available / Invoke) that
lets them push item-links into the chat. Smoke test against the
deployed v1.4.9 build showed Artisan logging "Chat2 is not available"
because those four gates were not yet mirrored.

This commit adds the missing four ChatTwo-prefixed provider gates in
IpcManager.cs:

- ChatTwo.Register  (Func<string>) — bound to the existing Register()
  backing method, so plugins that subscribe via either namespace land
  in the same Registered list.
- ChatTwo.Unregister (Action<string>) — bound to the existing
  Unregister() backing method, same shared-state rationale.
- ChatTwo.Available (Action<>) — SendMessage() fires from the ctor right
  after AvailableGate.SendMessage(), so any subscriber waiting on the
  "Chat 2 became available" signal sees both events.
- ChatTwo.Invoke (Action<string, PlayerPayload?, ulong, Payload?,
  SeString?, SeString?>) — Invoke() fans the context-menu event out to
  both InvokeGate and ChatTwoInvokeGate in lockstep. Subscribers compare
  on the registration ID they got back from Register, so the
  shared-backing approach keeps that contract intact regardless of which
  namespace they subscribed under.

Dispose() unregisters all four ChatTwo gates plus the four existing
HellionChat gates. The conflict-detection that prevents ChatTwo from
loading alongside HellionChat guarantees no slot collision at runtime.

With this commit the full ChatTwo IPC surface (6 of 6 slots) is mirrored:
- ChatTwo.GetChatInputState     (TypingIpc, commit 8c4afaa)
- ChatTwo.ChatInputStateChanged (TypingIpc, commit 8c4afaa)
- ChatTwo.Register              (IpcManager, this commit)
- ChatTwo.Unregister            (IpcManager, this commit)
- ChatTwo.Available             (IpcManager, this commit)
- ChatTwo.Invoke                (IpcManager, this commit)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-15 13:01:12 +02:00
JonKazama-Hellion 8c4afaac17 feat(ipc): mirror TypingIpc provider slots under ChatTwo namespace (v1.4.9 R4)
HellionChat replaces ChatTwo (conflict detection prevents parallel loading)
but third-party plugins with a no-fork policy keep subscribing only to the
ChatTwo.*-prefixed IPC gates. Mirroring the two TypingIpc provider slots
under the ChatTwo namespace lets those plugins keep working without code
changes on their side.

Mirrored slots:
- ChatTwo.GetChatInputState  ←→ HellionChat.GetChatInputState
- ChatTwo.ChatInputStateChanged ←→ HellionChat.ChatInputStateChanged

Implementation:
- Two additional ICallGateProvider fields (ChatTwoStateQueryGate +
  ChatTwoStateChangedGate) with the identical ChatInputState tuple
  signature. The tuple's underlying types match ChatTwo's surface byte-
  for-byte (bool/bool/bool/bool/int/ushort — ChatType is `ushort` in both
  repos), so Dalamud's IPC marshalling matches across plugin boundaries
  even when the subscribing plugin defines its own copy of the ChatType
  enum.
- ctor registers the new provider gates and binds RegisterFunc(GetState)
  to ChatTwoStateQueryGate so query calls route to the same backing path.
- Update() pushes the state to both ChatTwoStateChangedGate and the
  existing StateChangedGate in lockstep.
- Dispose() unregisters both query gates.

Ipc/ExtraChat.cs is intentionally unchanged — it is a subscriber on
ExtraChat's own IPC, not a provider, so no compatibility mirror applies.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-15 12:47:06 +02:00
JonKazama-Hellion c6a3780753 docs: add v1.4.9 changelog and forge announcement post
Synchronises the v1.4.9 changelog across the manifest sources that the
Dalamud plugin installer, the gitea repo.json feed and the Forge auto-
announce workflow read at release-tag time.

Files touched:
- HellionChat/HellionChat.yaml: v1.4.9 block inserted at the top of the
  changelog: literal. v1.4.5 dropped to keep the slim-rule at 4 subblocks
  (preflight Block C enforces YAML_VERSIONS <= 4). Current set is
  v1.4.9/v1.4.8/v1.4.7/v1.4.6.
- repo.json: Changelog field kept synchronous with the yaml — v1.4.9
  block prepended, v1.4.5 substring removed, JSON-escaped newlines.
- .github/forge-posts/v1.4.9.md: new file with frontmatter (subtitle
  "Plugin-Load Render Polish", versionsnatur "Performance-Patch") and
  a German-only body. The English half of the eventual Discord embed
  is pulled automatically from the yaml changelog at tag-push time by
  .gitea/workflows/forge-announce.yml — same workflow as v1.4.4
  onwards, the post file does not carry an English block.

Char-cap pre-check passes (title 46 + description ~2700 + footer 33 =
~2800 chars, well under the 5500-char Discord embed total cap).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-15 11:51:25 +02:00
JonKazama-Hellion d9f6704316 chore: bump version to 1.4.9, sync manifest
Manifest version bump for the v1.4.9 release cut. Schema-required v16
stays unchanged (R1/R2/R3 are all config-neutral refactors).

Files touched:
- HellionChat/HellionChat.csproj: <Version> 1.4.8 -> 1.4.9
- HellionChat/Plugin.cs: schema-migration error string self-reference
  (v1.4.8 -> v1.4.9, required schema v16 stays)
- repo.json: AssemblyVersion, TestingAssemblyVersion, 3x DownloadLink*
  URLs all bumped to 1.4.9 / v1.4.9. Changelog field is still on v1.4.8;
  the v1.4.9 block plus v1.4.5 slim-drop land in the next commit.
- README.md: shield badge, version header in lead paragraph, project-
  status block rewritten for v1.4.9 (Plugin-Load Render Polish).
- docs/CHANGELOG.md: v1.4.9 block inserted above v1.4.8.
- docs/ROADMAP.md: v1.4.9 moved into the released-versions list,
  "Next Cycle" header now targets v1.4.10 (Render Clipper + Symbol
  Picker reserves carried over from the v1.4.9 plan).

yaml changelog block and repo.json Changelog field follow in the
docs commit so the slim-drop of v1.4.5 stays atomic with the v1.4.9
block insert.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-15 11:31:35 +02:00
JonKazama-Hellion 011490368b perf(draw): defer non-essential first-frame rendering (v1.4.9 R2)
Cut first-frame HITCH from ~127ms median down to ~76ms median (4-reload
sample, threshold lowered to 1ms for measurement) — comfortably under
Dalamud's 100ms warning threshold. ChatTwo upstream sits at ~63ms median
for comparison; the remaining ~13ms gap is the cost of HellionChat-only
features (Sidebar tab view, custom StatusBar, Honorific integration).

Mechanism: a single `_firstFrameDone` flag (flipped in Draw's finally
block) gates six sections that don't need to render on frame 0:

  - StatusBar.Draw (~12ms): the bottom status bar
  - DrawChannelName chunks (~17ms): SeString-Renderer layout, replaced
    with a plain-text fallback (activeTab.Name) for frame 0
  - PositionReset/BoundsCheck (~10ms): EnsureWindowOnScreen viewport
    iteration, only matters once the user notices a mispositioned window
  - DrawV061HintBannerIfNeeded (~3-5ms): v0.6.1 migration notice
  - DrawAutoComplete (~6ms): renders nothing until the user types a command
  - InputPreview.CalculatePreview (~3-5ms): triggers InputPreview first-
    frame lazy init, user-typing-driven anyway

Frame 1 then renders all of them in ~40ms (still well under the warning
threshold), and frames 2+ stay at 0ms as before. User sees the deferred
sections ~17ms (60fps) later than before — invisible inside the ~2.5s
Atlas-Build window after every plugin reload.

Hypothesis triage from the R2-profiling pass:
  - (a) Atlas-Sync-Fallback: falsified. xllog shows the Atlas-Complete
    line always lands ~2.5s before the HITCH frame.
  - (b) Theme-Apply ABGR-Cache-Init: not dominant. PushGlobal is 5ms.
  - (c) Multiple-Window-Render: falsified in v1.4.9 Stage-2-Lazy-Init
    diagnose (deferred 4 windows, no measurable delta).
  - (d) DrawList-Setup-Cost per Window: actual root cause. Layout cost
    distributes evenly across ~10 ImGui sections inside ChatLogWindow
    (5-20ms each). No single hot-spot to optimise — the six selective
    skips above are the pragmatic fix.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-15 10:14:13 +02:00
JonKazama-Hellion 8ed10a536b refactor(plugin): centralise slash-command registration for lazy-window readiness (v1.4.9 R1 stage 1)
Pull the four user-triggered slash-commands (/hellion, /hellionView,
/hellionDebugger, /hellionSeString) plus the two Plugin-Manager
UiBuilder hooks (OpenConfigUi, OpenMainUi) out of their window
constructors and into a central Plugin.SetupCommands method so they
work before their target window has been opened the first time. A
matching TearDownCommands runs as the first CaptureFailure inside the
framework-thread teardown lambda. /hellion and /hellionSeString stay
under the same #if DEBUG guard SeStringDebugger had before. The four
window classes keep their public Dispose method signatures so the
existing Plugin.DisposeAsync method-group binding still resolves —
the bodies are now empty pointers to TearDownCommands. The pre-v1.4.9
`OpenMainUi` body that flipped SettingsWindow.IsOpen and the three
private Toggle(string, string) method-group wrappers are gone since
the central handlers call SettingsWindow.Toggle() / DbViewer.Toggle()
etc. directly.

The properties stay eager in stage 1 — the lazy-init switch lands in
stage 2 with the matching `_lazyWindowLock` guard around AddWindow
and RemoveAllWindows. Doing it in two commits keeps the slash-command
correctness verifiable on its own.

Smoke (release build): /hellion, /hellionView, /hellionDebugger,
/clearhellion plus Plugin-Manager Settings and Open buttons all
toggle their target window. /hellionSeString remains DEBUG-only as
before.
2026-05-15 00:28:18 +02:00
JonKazama-Hellion 6051e49307 chore(profiling): instrument plugin-load hot paths (v1.4.9 R3)
Bump AutoTranslate-warmup and FilterAllTabs log-level from Debug to
Information so the xllog tail surfaces them without a Debug filter.
Wrap MessageStore.Connect and MessageStore.Migrate in Stopwatches so
the SQLite open and migration-chain costs are visible too.

Sub-Task 3.4 Befund on v1.4.8-baseline (4 reloads, medians):
- MessageStore.Connect: 50.5 ms
- MessageStore.Migrate:    2 ms
- MessageManager.FilterAllTabs: 68.5 ms
- AutoTranslate warmup:  108 ms
- UiBuilder HITCH:       108.9 ms

Outcome D — none of the three dominates the 200 ms threshold. The
ChatTwo "300 ms" comment for AutoTranslate is falsified at ~108 ms;
SQLite is not the bottleneck (52.5 ms total); FilterAllTabs runs on
the worker thread and only competes for CPU slots. The HITCH is left
unexplained by these probes, which keeps Hypothesis c (multi-window
WindowSystem.Draw initial pass) as the main R2 suspect to be
validated by the R1 lazy-window refactor.

Logs stay in as belt-and-suspenders for future plugin-load
regressions.
2026-05-14 23:33:56 +02:00
JonKazama-Hellion 55120e6572 Merge branch 'feature/v1.4.8'
Security / scan (push) Successful in 23s
Build / Build (Release) (push) Successful in 29s
Forge Announce / Post changelog to Hellion Forge (push) Successful in 7s
Release / Build and attach release ZIP (push) Successful in 37s
v1.4.8
2026-05-14 12:12:06 +02:00
JonKazama-Hellion 7542d48983 perf(dbviewer): dispatch FTS filter to worker thread
FullTextSearch + LoadByGuids could stall the draw thread for 100-300 ms
on large databases with a popular search term. The two hot trigger sites
(FTS toggle, search input) now route via TriggerFilterRefresh, which
dispatches the FTS path to Task.Run; the in-memory page-filter path
stays inline because it is sub-ms on the loaded page array.

_ftsFilterSeq is bumped per trigger so a late worker recognises itself
as stale and drops its result instead of overwriting a newer one. The
date/channel and history workers already lived on Task.Run and are
untouched.

Surfaced during the v1.4.8 pre-tag review.
2026-05-14 11:48:40 +02:00
JonKazama-Hellion 7b36763359 docs: add v1.4.8 changelog and forge announcement post
- HellionChat.yaml: v1.4.8 changelog block above v1.4.7, v1.4.4
  dropped per slim-rule (verify-changelog-sync enforces max 4).
- repo.json: Changelog field synchronised with yaml, same slim-drop.
- .github/forge-posts/v1.4.8.md: bilingual announcement post (DE
  body, EN block resolved from yaml at workflow time). Frontmatter
  subtitle 32/60 chars, versionsnatur 12/40 chars, embed total
  ~2787/5500 chars.
2026-05-14 10:51:50 +02:00
JonKazama-Hellion eecedd9f97 chore: bump version to 1.4.8, sync manifest
- csproj <Version>, Plugin.cs schema-gate self-reference, repo.json
  (AssemblyVersion, TestingAssemblyVersion, 3x DownloadLink URLs).
- README.md shield badge, version header, Project Status body.
- docs/CHANGELOG.md gains a v1.4.8 section above v1.4.7.
- docs/ROADMAP.md flips Next Cycle to v1.4.9 (Plugin-Load Render
  Polish), v1.4.8 moves into the released history above v1.4.7.
- Config schema stays at v17, Migration v17 stays additive.

repo.json Changelog field and HellionChat.yaml changelog block plus
the new forge-posts/v1.4.8.md follow in a separate commit (slim-drop
of v1.4.4 happens there).
2026-05-14 10:28:51 +02:00
JonKazama-Hellion 1003a88cad fix(messagestore): match TEXT-stored UUID form in FTS bulk insert and LoadByGuids
messages.Id is declared BLOB but stored as TEXT because Microsoft.Data.Sqlite
binds Guid parameters as UUID strings (UpsertMessage uses AddWithValue with
a Guid). RebuildFtsIndex cast reader.GetValue(0) to byte[] and threw
InvalidCastException at the first row. LoadByGuids bound byte[] params
against the TEXT-stored Id and would have returned no rows once the index
had built.

- RebuildFtsIndex reads via GetGuid and stores ToString() in
  messages_fts.message_guid.
- LoadByGuids parses incoming UUID strings and binds them as Guid so
  Microsoft.Data.Sqlite re-serialises to TEXT, matching the messages.Id
  storage form.
- DbViewer caller variable renamed hexIds -> guidHits for clarity.
2026-05-14 09:58:58 +02:00
JonKazama-Hellion 299fd59cbb refactor(retention): use Framework.RunOnTick instead of synchronous .Wait()
Retention sweep no longer blocks for ~194ms on Framework.Run().Wait().
The clear+refilter pair is now scheduled on the next framework tick, so
it still runs on the framework thread (keeping the Tabs-list mutation
serialisation invariant -- Plugin.Config.Tabs is plain List<Tab> and
AutoTellTabsService can mutate it from background paths) but does not
block the sweep thread while the framework finishes the current frame.

A new _isDisposing volatile bool is set as the first statement in
DisposeAsync so a deferred tick that fires after teardown bails before
it touches MessageManager / Log / static fields the dispose path has
already cleared. The retention worker is IsBackground=true so plugin
unload can race against a still-pending tick.

The existing RetentionSweepLock / RetentionSweepRunning serialisation
covers the not-two-sweeps-at-once invariant; we don't add a CTS here
because RunOnTick is fire-and-forget and the framework service owns
the tick lifecycle.

v1.4.8 B3. Coverage via in-game smoke (frame-time trace during a
retention sweep run) in Task 9 -- no Build-Suite test because the
suite has no FakeFramework fixture and the change is a schedule-form
swap rather than new behaviour.
2026-05-14 00:00:53 +02:00
JonKazama-Hellion 74bcb91b65 feat(themes): auto-reload active custom theme on disk change
When the user edits their active custom theme JSON in an external editor
and saves, the change now propagates to HellionChat within ~1 second
without re-selecting the theme in the picker.

RefreshActiveIfStale runs from Plugin.Draw on every frame but the actual
File.GetLastWriteTimeUtc stat is 1Hz-throttled -- 60fps would otherwise
mean 3600 stats/min, more on Wine. Built-in themes short-circuit on the
IsBuiltIn check; custom themes without a captured source path (Switch
fell to default) short-circuit on the null check.

Switch() now captures the source path of custom themes via an out-param
on LoadCustomBySlug, which now reverse-looks-up against the existing
_customCache (no re-parse, no extra disk IO). Plugin.LoadAsync warms the
cache via AllCustom() once before the first Switch so a Config.Theme
pointing at a custom slug does not fall through to the built-in default
on a cold registry.

Switch's lookup order is now built-in-first to match Get(slug), so a
user-authored JSON that declares a built-in slug is consistently
ignored in both code paths.

Pure-helper ThemeStampDiff isolates the stamp-diff rules for the
Build-Suite (covers DateTime.MinValue hold-the-line semantics).

v1.4.8 B2.
2026-05-13 23:22:14 +02:00
JonKazama-Hellion 2c64aaa251 fix(statusbar): make height DPI-aware via GetTextLineHeightWithSpacing
Replace the fixed 22px const Height with a computed property that bakes
in the ImGui font line height plus a GlobalScale-rounded 2px spacer.
The constant clipped the bottom bar on Windows display-scaling >100%
because ImGui rendered the actual font taller than 22px; the bar then
got pushed off the window edge.

ChatLogWindow.cs:423 reservation drops the explicit +2 because the
spacer now lives inside Height. Same idiom as the v1.4.6 F7.2 underline
pill in ChatLogWindow.cs:1639-1653.

v1.4.8 B1. Coverage via in-game smoke on Windows (Jin) and Linux/Wayland
in Task 9 -- DrawList-coupled, no Build-Suite test.
2026-05-13 22:42:40 +02:00
JonKazama-Hellion 607d2c7241 feat(dbviewer): full-text-search toggle wired to FTS5 query API
New UseFullTextSearch transient UI bool flips DbViewer.Filter() between
the existing local page filter (default) and the FTS5 MATCH path across
the whole database. ImRaii.Disabled blocks the toggle while the bulk-insert
worker is still building the index; the HelpMarker swaps between two
hints, one for the indexing state and one for the phrase-match advisory
once the index is ready.

Three new HellionStrings entries cover EN + DE + the Designer accessor:
- DbViewer_FullTextToggle (label)
- DbViewer_FullTextToggle_Hint_Indexing (tooltip while indexing)
- DbViewer_FullTextToggle_Hint_PhraseMode (tooltip once ready, warns
  multi-word terms match as phrases and how to opt into raw MATCH syntax)

Filter() short-circuits to the local fallback if the toggle is on but
ftsReady has flipped back to false -- defensive against a mid-session
Dispose-and-reopen during indexing.

v1.4.8 H2 Sub-Task 4.4.
2026-05-13 22:08:32 +02:00
JonKazama-Hellion b2a0f3a77c feat(messagestore): add FullTextSearch + LoadByGuids with MATCH-syntax escape
Two new public query methods plus an internal EscapeFtsTerm helper:
- FullTextSearch(term, limit) runs MATCH against messages_fts and returns
  hex-encoded GUIDs sorted by FTS5 rank. Empty/whitespace short-circuits
  to an empty list so callers can fall back to the local page filter.
- LoadByGuids(hexIds) resolves the hex GUIDs back to Message rows via
  WHERE Id IN (...). Chunked at 500 to stay below SQLite's 999-parameter
  cap, and the BLOB-PK autoindex means the join is O(log n) per id.
- EscapeFtsTerm wraps user input in double-quotes so multi-word queries
  match as a phrase, not as per-word AND. Users opt into raw MATCH
  syntax by writing their own quotes.

Plus _readLock serialises every Connection-touching internal method
(UpsertMessage, MessageCount, all readers, retention writers, etc.).
The DbViewer filter worker now runs FullTextSearch on a Task.Run thread
while the PendingMessageThread keeps calling UpsertMessage; SqliteConnection
is not safe for concurrent use, so this single lock is the minimal
architecture change that closes the race. The Lazy-Enumerator methods
(StreamForExport, GetDateRange, GetPagedDateRange) hold the lock only
through command-setup + ExecuteReader; v1.4.8 doc-notes the caveat for
the v1.5.x DI cycle to address with a snapshot-to-list or connection pool.

RebuildFtsIndex stays outside the lock -- it owns its own SqliteConnection
via OpenSecondaryConnection.
2026-05-13 21:27:17 +02:00
JonKazama-Hellion d26c4701fa feat(messagestore): async background FTS5 bulk-insert with progress notification
Adds the worker that fills the messages_fts virtual table after Migrate4.
The bulk-insert runs off the framework thread on its own SqliteConnection
opened via OpenSecondaryConnection -- WAL lets the live UpsertMessage
path on the primary Connection keep flowing, and the worker's writer
lock yields every 500 rows with a 5ms breather so PendingMessageThread
does not hit "database is locked" after DefaultTimeout=5s.

InitFtsReadyCache runs in the ctor and short-circuits to ready=true when
the index is already populated or when the messages table is empty. The
DbViewer (Task 4.4) reads IsFtsIndexBuilt per frame as a single volatile
field read.

Plugin.cs LoadAsync kicks the worker after FilterAllTabsAsync, gated on
IsFtsIndexBuilt and a CancellationTokenSource that DisposeAsync cancels
before MessageManager tears down. Progress reports back via IActiveNotification,
marshalled onto the framework thread via Framework.RunOnTick. Success path
finishes the notification as Success with a 5s linger; cancellation
dismisses it; an error swaps the type to Error with a fallback hint.
2026-05-13 20:38:05 +02:00
JonKazama-Hellion 7f317a2b18 refactor(messagestore): extract BuildConnectionString and ApplyPragmas helpers
Pre-step for the v1.4.8 FTS5 bulk-insert worker. The worker opens its
own secondary SqliteConnection on the same db path so the WAL journal
lets parallel reads/writes through, and it has to apply the exact same
connection-string options and PRAGMAs as Connect() -- otherwise the
worker connection drifts the moment Connect grows a new pragma.

Splitting BuildConnectionString + ApplyPragmas out lets both Connect()
and the upcoming OpenSecondaryConnection() share the same source of
truth instead of duplicating the body. No behaviour change.
2026-05-13 20:31:43 +02:00
JonKazama-Hellion 38149059c3 feat(messagestore): add Migrate4 with standalone FTS5 virtual table
Lays down a messages_fts virtual table with message_guid (UNINDEXED, hex
TEXT of the BLOB primary key), sender_text and content_text columns
using the unicode61 tokenizer with diacritic folding. Standalone FTS5
without content='messages' linking, because messages.Id is BLOB and
FTS5's content_rowid contract requires an INTEGER rowid alias.

LoadByGuids (Task 4.3) will resolve the hex GUIDs back to messages rows
via WHERE Id IN (...) joins. Schema step only -- the bulk-insert worker
that fills the index lives in Task 4.2.

Internal Connection property exposure plus a HasMessagesFtsTable helper
let the Build-Suite verify Migrate4 without raw PRAGMA glue in each test.

v1.4.8 H2 Sub-Task 4.1.
2026-05-13 19:51:54 +02:00
JonKazama-Hellion 67175419a9 refactor(messagestore): extract ReadMessageRow as shared deserialiser
Pure deserialisation helper that pulls one row from the current reader
position into a Message. The MessageEnumerator load path delegates to
it, and the upcoming FTS-join LoadByGuids (Task 4.3) will share the
same code so both stay in lockstep when the column layout shifts.

Pre-step for v1.4.8 H2 FTS5 full-text search.
2026-05-13 19:20:55 +02:00
JonKazama-Hellion d3fdcdf43d Merge branch 'feature/v1.4.7'
Security / scan (push) Successful in 23s
Build / Build (Release) (push) Successful in 30s
Forge Announce / Post changelog to Hellion Forge (push) Successful in 7s
Release / Build and attach release ZIP (push) Successful in 39s
v1.4.7
2026-05-13 11:07:32 +02:00
JonKazama-Hellion f4ea460644 chore: bump version to 1.4.7, sync changelog and forge post
- csproj <Version> -> 1.4.7
- repo.json AssemblyVersion + TestingAssemblyVersion -> 1.4.7.0
- repo.json DownloadLink{Install,Update,Testing} URLs -> /v1.4.7/
- repo.json + HellionChat.yaml changelog: prepend v1.4.7 block, retire
  v1.4.3 (slim rule keeps the last 3-4 versions)
- docs/CHANGELOG.md + docs/ROADMAP.md: v1.4.7 section, next-cycle
  pointer flipped to v1.4.8 Hook-Layer-Cycle
- README.md release badge + version stamps + Project Status block
  rewritten for v1.4.7
- .github/forge-posts/v1.4.7.md (new): DE body with subtitle
  "Backlog Cleanup and Mid-Features" / versionsnatur "Mid-Feature-Patch"
- Pin diagnostic logs (RehydratePinnedTabs / TryPin / Unpin /
  PromoteToPermanent) downgraded from Info to Debug so non-debug
  console stays quiet on release builds
2026-05-13 11:00:25 +02:00
JonKazama-Hellion d5735d8dcc fix(tabs): preserve runtime channel across Settings Save, deep-clone seeded CurrentChannel
Smoke-test round 4 surfaced a clean reproducer: a Party or Linkshell
tab with channel /p, then Settings → Save, popped the input back to
/tell <pinned-partner> on the next interaction. Two bugs combined:

1. Configuration.UpdateFrom captured only Messages+LastSendUnread from
   the live state during the persistent-tab merge. CurrentChannel was
   not preserved, so a Settings save overwrote the runtime channel
   state with the settings-time snapshot. If the user switched channel
   in-game between Settings-open and Settings-save, that switch was
   lost. Live CurrentChannel now joins Messages and LastSendUnread in
   the per-Identifier preservation tuple.

2. TabSwitched seeded a new tab's CurrentChannel from previousTab via
   reference copy (`newTab.CurrentChannel = previousTab.CurrentChannel`).
   That left both tabs sharing the same UsedChannel instance, so a
   later mutation on one bled into the other — exactly the path that
   carried a pinned tell-target onto Party. Switched to a deep clone
   (UsedChannel.Clone(), same Cherry-Pick-Patch-B pattern from v1.4.6)
   plus a Debug log so the next smoke can confirm at a glance which
   previous tab donated its channel state.

Pre-existing ChatTwo upstream pattern; v1.4.7 just made it visible
because pinned tabs are now the kind of long-lived tell-target that
sticks around for the seed path to grab.
2026-05-13 10:31:21 +02:00
JonKazama-Hellion 80b48ac3ad feat(sidebar): pinned section, dimmed pin glyph, configurable width
Smoke-test round 3 feedback from Jin:

- Sidebar now groups tabs into three sections rendered in this order:
  persistent → pinned TempTabs → unpinned TempTabs. Each TempTab
  section carries its own divider header ("Angepinnt (n)" / "Aktive
  Tells (n)"). Plugin.Config.Tabs order is untouched — only the
  display order changes, so tabI still mirrors the real index and
  LastTab/WantedTab stay consistent.

- The thumbtack glyph overlay on a pinned tab dropped from accent
  colour at full alpha to TextMuted at ~47% alpha. The section header
  is now the primary discoverability cue; the glyph is just a per-tab
  confirmation hint.

- Sidebar width is now a Config field (default 44, range 44-160).
  Slider lives in Theme & Layout under the existing Sidebar-Tab-View
  toggle. The icon button inside each row stretches with the width so
  a widened sidebar doesn't leave the icon floating in dead space.
2026-05-13 10:16:53 +02:00
JonKazama-Hellion cddd29a986 fix(tabs): pin indicator, history preload, drop Promote from temp menu
Smoke-test round 2 feedback from Jin:
- Promote-to-permanent label "Dauerhaft behalten" was indistinguishable
  from Pin in German, leading to misclicks that dropped the tell-target.
  Removed the menu entry from TempTabs entirely — Promote stays as a
  service method for future use, but the user-facing path is gone. Anyone
  who wants a regular tab can still create one via the existing
  "neuen Tab anlegen" flow.
- No visual confirmation that pin took effect. Added a FontAwesome
  thumbtack overlay top-left of the sidebar icon, accent-coloured, and
  appended a "Pinned — survives relog" line to the hover tooltip.
- Pinned tabs came back empty after a full disable/enable cycle because
  Tab.Messages is NonSerialized. RehydratePinnedTabs now also runs the
  same MessageStore-backed PreloadHistory the spawn path uses, so the
  recent conversation window reappears alongside the rehydrated
  TellTarget.

Diagnose-logging on TryPin/Unpin/Promote/Rehydrate stays in so the next
smoke can confirm at a glance which path fired from the Dalamud console.
2026-05-13 10:08:33 +02:00
JonKazama-Hellion 799fdb67cc fix(tabs): rehydrate pinned TempTab tell-targets after reload
Smoke-test (Jin's scenario) surfaced two coupled bugs in v1.4.7 pin
persistence:

1. The chat input couldn't send to the pinned partner after a reload.
   Tab.CurrentChannel is NonSerialized, so it came back as a fresh
   UsedChannel with TellTarget=null even though tab.TellTarget (the
   persisted twin) was intact. The game-side channel hook only repaints
   CurrentChannel on a /tell or channel switch, so the pinned tab sat
   there mute until the user manually re-bounced the channel.

2. An incoming tell from the pinned partner spawned a *second* TempTab
   instead of routing into the existing pinned one. The Name+World
   lookup in FindTempTab was vulnerable to any round-trip nuance on
   tab.TellTarget — the fallback path now matches by tab name, which
   FormatTabName pins at spawn time.

Fix:
- AutoTellTabsService.Initialize now calls RehydratePinnedTabs() after
  the Phase-2 wiring lands, seeding tab.CurrentChannel.TellTarget +
  Channel from the persisted tab.TellTarget. Channel is also defaulted
  to InputChannel.Tell on the tab record so the chat-input bar paints
  Tell mode immediately on first selection.
- FindTempTab gained a Name-based fallback for the case where the
  primary TellTarget lookup misses (e.g. a pinned tab whose TellTarget
  didn't round-trip cleanly through an old save).
- HandleTell self-heals: when the fallback matches a pinned tab with a
  missing TellTarget, the tab is repaired from the live partner data
  and persisted, so subsequent messages take the fast path.

Build-suite coverage was attempted (PinnedTabJsonRoundtripTests) but
Tab + TellTarget are both Dalamud-coupled — Newtonsoft's reflection
walk loads Dalamud.dll which isn't available in the xUnit AppDomain
(documented in feedback_dalamud_test_isolation). Verification stays on
the ingame smoke path.
2026-05-13 09:53:27 +02:00
JonKazama-Hellion 69fa0fecbd feat(honorific): render glow outline as opt-in (gradient deferred)
Honorific's TitleData carries Glow / Color3 / GradientColourSet /
GradientAnimationStyle beyond the Title + Color we parsed in Cycle 1.
The DTO now mirrors all four so the JSON roundtrip doesn't silently
drop fields.

Rendering for v1.4.7 covers Glow only: when Config.ShowHonorificGlow
is on and the title has a Glow colour, the chat header title gets an
8-direction ±1px draw-list outline pre-pass in the glow colour at 0.4
alpha, then the primary text on top.

Gradient (Color3 / GradientColourSet / GradientAnimationStyle) is parsed
and stashed for a later cycle — porting the full animation needs
Honorific's hardcoded Pride-palette list and GradientSystem.cs (or an
upstream IPC PR exposing the resolved frame colour). Tracked as
"Honorific Full Gradient Port" in the vault backlog.

ShowHonorificGlow defaults OFF — keeps v1.4.6 visuals untouched and
dodges per-frame DrawList overhead on low-end hardware. Tooltip flags
the gradient deferral so users aren't surprised by static rendering.
2026-05-13 09:34:43 +02:00
JonKazama-Hellion fd5f970a8b feat(tabs): add IsPinned with separate pool and 5-tab cap
Tester-Request from Jin (2026-05-03): TempTabs should be pinnable so a
key conversation partner survives a relog. Right-click a TempTab and
choose Pin Tab / Unpin Tab / Promote to permanent.

Pool semantics:
- AutoTellTabsLimit (15) still gates the auto-managed unpinned pool.
- Pinned TempTabs live in their own pool, hard-capped at 5.
- The 6th pin attempt fails with a notification; users can unpin first
  or promote to permanent.
- Unpinning into a full unpinned pool drops the oldest unpinned (no
  user friction).

Mechanics:
- Tab.IsPinned (default false); Tab.Clone() carries it.
- Migration v16 -> v17 (additive; existing tabs default to unpinned).
- Three strip-sites synchronised through TabLifecycleHelpers:
  Plugin.cs load-time, Plugin.SaveConfig, Configuration.UpdateFrom.
- AutoTellTabsService:
  * MaxPinnedTempTabs constant.
  * F2.1 _activeTempTabCount counter retired — ActiveTempTabCount is
    now Tabs.Count(predicate). Pin/Unpin/Promote transitions are
    cold-path and don't need lock-free reads.
  * DropOldestTempTab filters on IsInUnpinnedPool so pinned tabs are
    never drop candidates.
  * OnLogout strips only the unpinned pool; pinned popouts and the
    active-tab switch behave correspondingly.
  * TryPin / Unpin / PromoteToPermanent service methods.
- ChatLogWindow tab context menu: Pin / Unpin / Promote with disabled-
  state at-cap tooltip + Promote tooltip explaining the channel-filter
  side effect.
- HellionStrings (EN+DE) for menu labels, tooltips, the limit warning.
- AutoTellTabsLimit slider description now flags the separate pinned
  pool so users aren't surprised by 18 tabs when the limit reads 15.
2026-05-13 09:06:14 +02:00
JonKazama-Hellion fee2459e73 refactor(services): route logging through IPluginLogProxy
F12.2 step 5b — service cluster (~42 sites in 16 files):
MessageManager, GameFunctions/{Chat, GameFunctions, KeybindManager},
EmoteCache, PayloadHandler, AutoTellTabsService, FontManager, Commands,
Util/{WrapperUtil, AutoTranslate, MemoryUtil}, Message, Themes/ThemeRegistry,
Ipc/ExtraChat, Configuration.

The proxy interface gained Dalamud's params-overload signature
(messageTemplate + params object[]) to cover Configuration.cs:86 which
relies on Serilog-style placeholders.

Verified: zero remaining Plugin.Log.X(...) call-sites in HellionChat/,
build green, build-suite 690/690.
2026-05-13 08:38:40 +02:00
JonKazama-Hellion 63cad62c89 refactor(ui): route logging through IPluginLogProxy
F12.2 step 5a — UI cluster (~40 sites in 6 files):
ChatLogWindow, DbViewer, Popout, SettingsTabs/{DataManagement,
FontsAndColours, ThemeAndLayout}. Plugin.Log.X(...) → Plugin.LogProxy.X(...).
No behaviour change; the proxy delegates 1:1 to the original IPluginLog.
2026-05-13 08:22:12 +02:00
JonKazama-Hellion dca5de4085 refactor(messagestore): inject IPluginLogProxy for test isolation
MessageStore's Migrate0 (and the Migrate1/2/3 siblings) called
Plugin.Log.Information directly, which prevented an isolated xUnit
construction test from running — Dalamud.dll cannot load in the test
AppDomain. With IPluginLogProxy threaded through the ctor and the inner
MessageEnumerator, the whole MessageStore.cs file is now Dalamud-static
free and the Build-Suite covers it (Floor 688 -> 690).

This is the second half of F12.2; the remaining ~82 Plugin.Log call
sites in the rest of the plugin will be routed through the static
Plugin.LogProxy wrapper in a follow-up commit.
2026-05-13 08:15:20 +02:00
JonKazama-Hellion 8edc3c70d3 feat(util): add IPluginLogProxy interface and production wrapper
F12.2 closes the gap that F12.1 left open: MessageStore's ctor calls
Plugin.Log.Information inside Migrate0, which prevents an isolated xUnit
construction test (Dalamud.dll cannot load in the test AppDomain).

The proxy mirrors IPluginLog's full surface (Verbose/Debug/Information/
Info/Warning/Error/Fatal — both Info and Information as Dalamud exposes
them) with both single-string and Exception+string overloads, so the
~91 existing Plugin.Log.* call-sites become a drop-in rewrite to
Plugin.LogProxy.*.

A later DI-container adoption cycle (v1.5.x) may swap this for
Microsoft.Extensions.Logging's ILogger<T>; this commit is the
intermediate decorator step.
2026-05-13 08:11:34 +02:00
JonKazama-Hellion 3c33acf6d7 fix(util): pin operator precedence in DrawArrows IconButton id
`id + 1.ToString()` resolves as `id.ToString() + "1"`, producing "01"
instead of "1" for the ArrowRight button. The single live caller
(DbViewer page navigation) still produced unique IDs by accident, but
the semantics were wrong. Explicit parentheses fix it.
2026-05-13 08:08:52 +02:00
JonKazama-Hellion c8ba8c1cd0 docs: linting Docs
Security / scan (push) Successful in 22s
Build / Build (Release) (push) Successful in 29s
2026-05-12 22:41:54 +02:00