Commit Graph

805 Commits

Author SHA1 Message Date
JonKazama-Hellion 62621ba855 presets: add five built-in chat colour presets 2026-05-03 12:25:22 +02:00
JonKazama-Hellion 497c259031 config: add v10 to v11 migration with diagnostic log 2026-05-03 12:10:11 +02:00
JonKazama-Hellion 9ad9d2acd2 config: add PopOutInputEnabled and SeenPopOutInputHint, bump LatestVersion to 11 2026-05-03 12:09:51 +02:00
JonKazama-Hellion 1b7f2c40e6 fix(security): rebuild WrapText on span and int offsets
The pointer-arithmetic CodeQL alert kept re-firing on each shape of
the previous shallow fix because Encoding.GetBytes is virtual and
every length value derived from its return inherited the taint.
Refactor the routine to thread int offsets through index-based
control flow and only compute pointers inside two small helpers
(CalcWordWrap and DrawText) that take an already-pinned base pointer
plus offsets sourced from local logic, not from any virtual return.

Buffer is now allocated against Encoding.UTF8.GetMaxByteCount via
ArrayPool with a real 16 KiB upper bound, and the encoded length
returned by GetBytes is validated against that ceiling before
anything touches the pointer. Behaviour is byte-identical to v0.5.3,
verified locally with the same input shapes the previous code path
handled.

Slim changelog: trimmed the per-version blocks down to v0.5.1-v0.5.4
plus a link to GitHub releases for older history. The previous block
ran ~9000 characters and was dragging the manifest payload down for
no benefit; users see the latest release block first anyway.
2026-05-02 23:57:26 +02:00
JonKazama-Hellion 93d52ae819 chore(release): bump version to 0.5.3
Single-fix patch to close the CodeQL pointer-arithmetic alert that
v0.5.2 left open. v0.5.2 already shipped, so we tag forward instead
of moving the published tag.
2026-05-02 23:46:26 +02:00
JonKazama-Hellion 48b3d5c6b1 fix(security): validate UTF8 byte buffer length before pointer arithmetic
CodeQL re-opened the unvalidated-pointer-arithmetic alert at the new
textEnd line because Encoding.GetBytes is a virtual method on
Encoding and the returned array's Length is therefore tracked as
untrusted input for pointer arithmetic.

Compute the expected byte count from the same encoder via
GetByteCount and bail out if the actual buffer length does not match.
That is a real consistency check that would catch a maliciously
swapped Encoding.UTF8 instance, not a dead defensive guard. The
empty-split early-out from the previous fix is folded into the same
condition.
2026-05-02 23:42:59 +02:00
JonKazama-Hellion a155a57f33 fix(packaging): icon and image urls now reach the built manifest
Three packaging defects rolled into one fix:

- The custom DalamudPackager.targets override forced HandleImages and
  ImagesPath through the legacy code path. SDK 15 handles images by
  default and the override produced an output manifest with neither
  IconUrl nor ImageUrls populated. Removed.
- The csproj only included images/icon.png explicitly via
  <None Include>, so chatWindow.png and withSimpleTweaks.png never
  reached the build output and never made it into the release ZIP
  either. Switched to a glob include.
- HellionChat.yaml carried no icon_url / image_urls, so even after
  the SDK started writing the manifest correctly, both fields stayed
  unset. Added them pointing at the public raw.githubusercontent
  URLs that already work for the repo.json IconUrl.

Net effect on a fresh release: Dalamud picks up the icon next to the
DLL on dev installs, the plugin-installer card shows the proper
HellionChat logo for users coming through the custom repo, and the
two screenshot images are listed alongside the description so the
plugin installer carousel works the way other Dalamud plugins look.
2026-05-02 23:33:15 +02:00
JonKazama-Hellion 90b83a0690 chore(release): bump version to 0.5.2
Patch release. History-order fix for Auto-Tell-Tabs, three default-
config alignments and two CodeQL security findings closed.
2026-05-02 23:28:35 +02:00
JonKazama-Hellion f10301c3e4 merge: codeql findings #1 and #2 2026-05-02 23:27:12 +02:00
JonKazama-Hellion 8571a936a4 merge: align config defaults with maintainer's live config 2026-05-02 23:27:12 +02:00
JonKazama-Hellion 53c432a635 fix(security): close codeql findings #1 and #2
Two CodeQL alerts opened against the codeql-manual-build workflow's
first scan. Both real, both small fixes.

#1 Medium / Workflow does not contain permissions
   build.yml runs read-only against the repo (no push, no release
   creation, no API mutations) but never declared a permissions
   block, so the default GITHUB_TOKEN scope applied. Pin to
   contents: read at workflow level. Release and CodeQL workflows
   already have their explicit minimal scopes.

#2 Critical / Unvalidated local pointer arithmetic
   ImGuiUtil.WrappedTextWithPos splits its input on newlines and
   passes each part through Encoding.UTF8.GetBytes inside a fixed
   block. Empty splits (consecutive newlines, blank lines) produced
   a zero-length byte array, fixed gave us a valid pointer, and
   textEnd = text + bytes.Length collapsed onto text. The downstream
   ImGuiNative.CalcWordWrapPositionA calls received identical start
   and end pointers, which is undefined behaviour at the native
   boundary even if it happens to no-op on the current ImGui build.
   Bail before entering the fixed block when bytes.Length == 0 and
   render an empty line for the gap, which is what the original
   text == null guard was trying to do but could never reach inside
   a fixed block over a non-null array.
2026-05-02 23:25:41 +02:00
JonKazama-Hellion 340cadf3b9 chore(config): align defaults with maintainer's live config
Three real-world adjustments to the default config that ships with a
fresh install:

- HellionThemeWindowOpacity 0.92 -> 0.5 so a fresh install lands at
  the more glass-like default the maintainer uses daily
- Use24HourClock false -> true to match a German / European locale.
  Works correctly thanks to the v0.5.1 strict-format fix that uses
  CultureInfo.InvariantCulture instead of the host culture
- HellionParty preset Channel: InputChannel.Party -> null. Auto-
  routing /party into a tab that also collects /alliance and /pvpteam
  surprises the user when they wanted to type into the other ones;
  the tab stays as a read surface

LoadPreviousSession and FilterIncludePreviousSessions stay false to
keep the privacy-strict 'every session starts fresh' line. The
maintainer's personal settings flip them on, but that's an
opt-in choice, not a default we should ship to every fresh install.
RetentionEnabled also stays false for the same opt-in reason.
2026-05-02 23:24:22 +02:00
JonKazama-Hellion 8d6868aef6 chore(config): align defaults with maintainer's live config
Four defaults now match what a daily-driver Hellion install ends up at
anyway, so a fresh install does not feel like the wrong product:

- HellionThemeWindowOpacity 0.92 -> 0.5 (more glass-like)
- LoadPreviousSession + FilterIncludePreviousSessions false -> true
  (tabs pick up where they left off after a crash or restart). The
  privacy filter still gates what goes into the store; loading what
  is already in there is not an additional privacy cost.
- Use24HourClock false -> true (matches a German / European locale,
  works with the strict CultureInfo.InvariantCulture format from the
  v0.5.1 fix).

RetentionEnabled stays at false because that one is a documented
opt-in privacy line, not a UX default. The persistent retention sweep
should require an explicit user gesture even though my own install
has it on.
2026-05-02 23:21:20 +02:00
JonKazama-Hellion 2144eedd76 fix(autotell): exclude live tell from history preload
The live tell that triggers an Auto-Tell-Tab spawn is already in the
message store by the time MessageProcessed fires, because
MessageManager calls Store.UpsertMessage on line 266 before invoking
the event on line 277. PreloadHistory therefore picked up the live
tell as the youngest historic message and the separator landed below
it instead of above.

Pass the live message id through SpawnTempTab into PreloadHistory and
filter it out of the result. Pull one extra row so a successful
exclude does not cost the user a preload-budget slot.
2026-05-02 23:11:20 +02:00
dependabot[bot] 4a9ad426e7 chore(deps): Bump Microsoft.Data.Sqlite from 9.0.0 to 10.0.7 (#5)
---
updated-dependencies:
- dependency-name: Microsoft.Data.Sqlite
  dependency-version: 10.0.7
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-02 23:03:53 +02:00
JonKazama-Hellion 4ba5004322 chore(release): bump version to 0.5.1
Hardening and polish patch. Eight backlog items from the v0.5.0
codebase review. No new features, no migration.
2026-05-02 21:27:10 +02:00
JonKazama-Hellion 3584c94523 docs(db): explain why pragma statements stay interpolated
Both PRAGMA call sites take values that SQLite does not accept as
bound parameters. ColumnExists takes a hardcoded table name, the
migration call takes a compile-time int from the version sequence.
Comments now state both facts so future readers don't try to wedge a
defensive whitelist into a path that cannot be reached from anywhere
user-controlled.
2026-05-02 21:25:40 +02:00
JonKazama-Hellion 303729f3d3 refactor(db): parameterise DeleteByRetentionPolicy SQL clauses
Per-channel WHERE tuples and the catch-all default-clause now bind
ChatType and cutoff via named parameters instead of being inlined as
literals. Combines BindIntList for the explicit-types exclusion with
explicit AddWithValue for each (type, cutoff) tuple. Behavioural diff
against v0.5.0: none — same retention windows, same cutoff math, just
parameterised.
2026-05-02 21:25:05 +02:00
JonKazama-Hellion 12085ff1e2 refactor(db): parameterise IN-clause SQL via BindIntList
Migrate CleanupRetainOnly, StreamForExport, CountDateRange, GetDateRange
and GetPagedDateRange from interpolated IN lists onto BindIntList.
Eliminates the string-interpolation pattern for SQL value lists in the
IN-clause sites. Behavioural diff against v0.5.0: none — same enum/byte
values, just bound under named parameters instead of inlined.
2026-05-02 21:24:36 +02:00
JonKazama-Hellion e4593a0fda refactor(db): add BindIntList helper for parameterised IN-clauses
Centralised builder for dynamic IN-clauses that binds each value as a
named parameter and returns the comma-joined placeholder string. Used
by the upcoming MessageStore migrations away from string-interpolated
SQL.
2026-05-02 21:23:17 +02:00
JonKazama-Hellion 3fc42963ae feat(autotell): dim selection background of greeted tabs
The text-disabled colour alone made greeted tabs visually weak in the
sidebar. Push dimmed Header and HeaderHovered values alongside the
existing Text push so the selected and hovered states match the
greeted state too. Idle state stays untouched because ImGui Selectable
has no idle background slot.
2026-05-02 21:22:36 +02:00
JonKazama-Hellion 7c52e890e6 feat(privacy): mark cleanup preview as stale when whitelist changes
The preview block caches the deletion estimate from the last refresh.
When the user toggles whitelist channels afterwards the cached number
no longer reflects the current selection. Snapshot the whitelist on
refresh and detect drift on every frame; on drift, grey out the counts
and surface a stale hint plus an emphasised refresh button. Sits
alongside the existing Cleanup_Help_SavedNote, which warns about a
different mismatch (mutable vs saved) and stays as-is.
2026-05-02 21:22:12 +02:00
JonKazama-Hellion 4d977d5118 fix(fonts): marshal font chooser results onto the framework thread
Three FontChooser ContinueWith handlers wrote Mutable.* directly from
the threadpool. Wrap the result-write in Plugin.Framework.Run so the
mutation lands on the same thread that owns the rest of the UI state.
Matches the marshalling pattern already used by Database.cs and
Privacy.cs background work.
2026-05-02 21:20:49 +02:00
JonKazama-Hellion ddd72a878e refactor(emotes): drop async void on LoadData
async void Task.Run() is a no-op for awaiting purposes since the void
returns immediately. Switch LoadData to async Task and have the two
callers fire-and-forget the task directly. Exceptions still go through
the existing try/catch inside LoadData.
2026-05-02 21:20:16 +02:00
JonKazama-Hellion 66450dd518 refactor(i18n): pull tabs and database tab names into hellionstrings
Both tab classes were the last two settings tabs still pulling their
display name from the upstream Language resource bundle. Move them
into HellionStrings so all eight settings tabs share one i18n source.
The unused Language.Options_*_Tab keys stay around for backwards
compat with cherry-picked upstream tabs.
2026-05-02 21:19:40 +02:00
JonKazama-Hellion 7de28ef9b2 refactor(settings): align performance section with helpmarker pattern
Drop the inline wall-of-text description in favour of the standard
HelpMarker tooltip used across the rest of the v0.5.0 settings UX.
Visual consistency for the General tab.
2026-05-02 21:18:30 +02:00
JonKazama-Hellion da3c1f6832 fix(emotes): mark required properties to silence CS8618
Mark Emote.Id, Top100.Id, Top100.Code and Top100.ImageType as required
so the JSON deserializer enforces the contract instead of relying on
default-null semantics. Removes the four CS8618 warnings the build has
been carrying since v0.4.0.
2026-05-02 21:17:57 +02:00
JonKazama-Hellion 281a1e172f feat(tabs): add dedicated System tab to default layout
Split the technical/notification streams (System, Error, Echo, Debug,
NPC announcements, login/logout, retainer sales, gathering system,
glamour notifications, sign messages, alarms, orchestrion, message
book, random number, progress) out of the General tab into their own
System tab. General now shows player conversation plus the active
gameplay events (loot rolls, crafting, gathering, NPC dialogue, party
finder pings) without burying chat under technical chatter.
2026-05-02 18:28:29 +02:00
JonKazama-Hellion 45a5035426 refactor(tabs): align General preset with maintainer's live config
Drop the channels that already live in dedicated themed tabs (Tells,
emotes, Novice Network, FC and PvP announcements, Sign and Glamour
notifications) so the General tab is the public-chat catch-all instead
of a duplicate of every themed tab. NpcDialogue moves in because the
maintainer reads it alongside system messages.
2026-05-02 18:25:59 +02:00
JonKazama-Hellion e1931fc7d2 feat(tabs): seed default tab layout on first run and v10 wipe
Spawn six themed tabs out of the box instead of one General catch-all:
General (everything), Free Company (FC chat plus FC announcements and
login/logout), Party (Party, CrossParty, Alliance, PvP team plus loot
rolls), Beginner (Novice Network only when ShowNoviceNetwork is on),
Linkshell (all eight regular and cross-world linkshells together) and
Tell Exclusive (TellIncoming/TellOutgoing as a safety-net catch-all in
case Auto-Tell-Tabs misses one).

Tab names live in HellionStrings (EN/DE). The Tabs settings tab gains a
help-text hint above the list recommending one tab per linkshell when
the user is in multiple, since a single combined Linkshell tab gets
noisy fast for active users.
2026-05-02 18:13:15 +02:00
JonKazama-Hellion 2201478a54 fix(v0.5.0): defaults and coupling issues from first walkthrough
- Configuration.cs: ShowTitleBar defaults to true so a fresh install
  shows the window header instead of leaving the user without a drag
  handle and hide button
- Configuration.cs: MaxLinesToRender default drops from 10000 to 5000
  to match the slider's intended ceiling and the previous user-tuned
  baseline
- ChatLogWindow.cs: 24h-clock checkbox now actually flips the format.
  The Bestand path passed null culture which on a German system
  locale always rendered 24h regardless of the toggle
- Appearance.cs + ChatLogWindow.cs + Popout.cs: when Hellion theme is
  enabled the global theme opacity drives the chat-window BgAlpha and
  the legacy WindowAlpha slider is disabled, so the two opacity
  controls no longer fight each other
- Appearance.cs: ticking UseHellionFont now flips FontsEnabled off so
  the two mutually-exclusive font stacks no longer appear active at
  the same time
2026-05-02 18:00:04 +02:00
JonKazama-Hellion 50963ccf1b fix(v0.5.0): pre-release polish from full-codebase review
- Plugin.cs: mark RetentionSweepRunning volatile so the ImGui thread
  reads the latest value without a stale register-cached copy
- EmoteCache.cs: reset State to Unloaded on exception so a later
  trigger can retry instead of being blocked by the early-out
- Settings.cs: switch the SaveAndClose / Discard buttons to Allman
  bracing for consistency with the rest of the file, and include the
  ItemSpacing in the Ko-fi-button right-edge calculation
- Privacy.cs: add a saved-policy hint above the manual retention
  Ctrl+Shift button so the existing Cleanup wording pattern is
  matched here too
- HellionStrings: drop seven unreferenced keys (Theme_Heading,
  Migration_Notification_*, Migration_Webinterface_Removed_*,
  AutoTellTabs_Migration_*) and their EN/DE values, add the new
  Retention_Help_SavedNote string
2026-05-02 17:50:32 +02:00
JonKazama-Hellion fde85e6d69 chore(release): bump version to 0.5.0
Settings UX polish release. Twelve organic settings tabs collapsed
into eight themed ones, theme/font controls moved to Appearance,
About and Changelog merged into Information. Configuration migrates
from v9 to v10 as a wipe with a backup file written next to the live
config; chat history and tabs survive.
2026-05-02 17:37:46 +02:00
JonKazama-Hellion c22b169b73 chore(settings): remove legacy settings tab files
The nine legacy tab implementations were superseded by the new eight
themed tabs. Removing them now that the consolidated structure is in
place keeps SettingsTabs/ aligned with what actually ships.
2026-05-02 17:36:31 +02:00
JonKazama-Hellion 6839ccaf34 feat(settings): build information tab from about and changelog
Three collapsible sections: version info (author, discord handle,
version, issue tracker), about HellionChat (maintainer, mission, build
lineage, license, SE notice, localisation, translator list), and the
changelog (auto-print toggle plus the manifest changelog renderer).
2026-05-02 17:36:07 +02:00
JonKazama-Hellion fa108c2271 refactor(settings): align tabs tab plugin reference to property style
Match the property-style reference used across the other settings tabs
so the field/property mix is gone.
2026-05-02 17:34:24 +02:00
JonKazama-Hellion 395a0d7c98 refactor(settings): polish database tab section structure
Drop the redundant inner Advanced TreeNode in the Maintenance section,
flatten the duplicated indent in the Overview section, and rename the
section headings so they reflect their content (Overview shows
metadata, Maintenance hosts the shift-gated tooling).
2026-05-02 17:33:51 +02:00
JonKazama-Hellion b76bfb3cfc refactor(settings-refactor): regroup Database tab into storage, viewer, stats tree nodes 2026-05-02 17:22:26 +02:00
JonKazama-Hellion 0512e4729c refactor(settings-refactor): remove theme settings from Privacy tab and tighten tree structure 2026-05-02 17:14:40 +02:00
JonKazama-Hellion 654f24c609 docs(settings-refactor): add Chat tab header explaining emote block migration 2026-05-02 17:09:50 +02:00
JonKazama-Hellion 0e2a14197c feat(settings-refactor): populate Chat tab with auto-tell-tabs, behaviour, preview, emotes 2026-05-02 17:04:25 +02:00
JonKazama-Hellion 52e163a472 fix(settings-refactor): show HelpMarker tooltip even when item is disabled 2026-05-02 17:00:25 +02:00
JonKazama-Hellion e086afe2a8 feat(settings-refactor): populate Window tab with hide, inactivity, frame, tooltips 2026-05-02 16:54:23 +02:00
JonKazama-Hellion c97ce7543b feat(settings-refactor): populate Appearance tab with theme, fonts, colours, timestamps 2026-05-02 16:44:50 +02:00
JonKazama-Hellion cca4571470 feat(settings-refactor): populate General tab with input, audio, performance, language sections 2026-05-02 16:36:52 +02:00
JonKazama-Hellion 444d7f8e2e style(settings-refactor): use property-style for Plugin reference in tab stubs 2026-05-02 16:31:42 +02:00
JonKazama-Hellion 71ae95d79c feat(settings-refactor): wire new 8-tab structure with stubs 2026-05-02 16:26:22 +02:00
JonKazama-Hellion c33e519bb9 fix(settings-refactor): use pluginConfigs root for backup path 2026-05-02 16:03:51 +02:00
JonKazama-Hellion 14e585ef63 feat(settings-refactor): bump configuration version to 10 with wipe migration 2026-05-02 15:54:35 +02:00
JonKazama-Hellion e9ec587e3b chore: bump to 0.4.0 with auto-tell-tabs changelog 2026-05-02 14:33:52 +02:00