Skip to content

[4/10] Update features, settings parsing, and sync delivery - #367

Merged
netniV merged 10 commits into
refactor/03-runtime-refactorfrom
refactor/04-features-settings-sync
Nov 14, 2026
Merged

netniV merged 10 commits into
refactor/03-runtime-refactorfrom
refactor/04-features-settings-sync

Conversation

@friendly-ripper

Copy link
Copy Markdown
Collaborator

Part 4 of 10 · base refactor/03-runtime-refactor · 10 commits

With features owning their state, three rough edges remain: settings parsing still touches files and live state, sync progress is kept in global caches that drop work, and a few feature hooks no longer match the current client. This PR makes parsing a pure step, gives sync a per-target record store, and brings those hooks up to date.

What changes

Settings and shortcuts:

  • Config::Parse only turns a TOML table into settings now. Writing the vars file, creating a missing file, and printing the first load move to the callers that own them. The logic tests parse the English example with the real reader and check that every documented key is read and no documented value is rejected.
  • Actions, defaults, tiers, and aliases come from one definition file instead of repeated tables. Bindings are built as a parsed value before publishing, so a bad chord cannot mutate live state.
  • Sync threads no longer hold references into settings that a reload replaces. They own an immutable snapshot, and workers for removed targets are released with their queues.

Sync:

  • Global sent caches and dropping queues become canonical records with an independent cursor per target. Payloads are shared and immutable, and requests are built outside the store lock.
  • Failed uploads retry with backoff, newer values coalesce, and stale session work is rejected. Journals keep 300 recent entries per session so they can replay after login.

Features:

  • Notification cues and native playback move into the feature file that uses them, with one sound API name across the settings reader, the toast hook, and the platform code. Toasts format typed parameters in one pass, so a substituted value is no longer read as a placeholder itself, and each cue generates only the requested sound instead of nine buffers.
  • Haven camera and history hooks move onto game bindings and feature descriptors; the last callers of the legacy helper layer go away, and the separate road depth cache header and its test are removed. Invalid zoom values fall back to the section default.
  • Pooled artifact widgets are tracked through their active lifecycle, so the tracker follows a widget while it is active instead of keeping a stale entry.
  • Mission HUD hooks follow the supported mission refresh path and read typed fields named after their TOML keys instead of a string map rebuilt per refresh.
  • Pinning ships rewrites only changed slots instead of clearing and re-adding the whole dock list, so the list keeps its count.

Behavior changes

  • The shop keeps its first popup per session and suppresses later ones before they open, not after.
  • The daily-goals button binding and its reader key are removed, because the current client no longer exposes that button.
  • Held and down results are cached in the frame snapshot. Disabling hotkeys cancels pending work, and a new screen request replaces the old one instead of overlapping it.

Testing

Built with xmake. Every commit was built on macOS arm64, and this PR's commits also built the test targets. Nothing was run in the game.

tashcan added 10 commits October 15, 2026 16:40
Notification cues and native playback move into the feature
file that uses them, with one sound API name across the
settings reader, the toast hook and the platform code.

Toasts format typed parameters in one pass over the template.
A value containing another placeholder is no longer read as a
placeholder itself, and each cue generates only the requested
sound instead of nine buffers.
Haven camera and history hooks move onto game bindings and
feature descriptors, and the last callers of the legacy helper
layer go away with them. The road depth code merges into the
Haven feature and its separate cache header and test are gone.

Invalid zoom values fall back to the section default, and
Haven settings stay together in the reader.
Pooled artifact widgets can leave and re-enter the live
instance set. The inventory activation lifecycle is bound so
the tracker follows the widget while it is active instead of
keeping a stale entry.

The shop keeps its first popup per session and suppresses
later ones before they open, not after.
The current client no longer exposes the daily-goals button,
so its binding and reader key are removed. The HUD hooks
follow the supported mission refresh path and read current
mission state.

Mission HUD preferences are typed fields named after their
TOML keys, read directly instead of through a string map
rebuilt per refresh.
Global sent caches and dropping queues become canonical
records with an independent cursor per target. Payloads are
shared and immutable, and requests are built outside the
store lock.

Failed uploads retry with backoff, newer values coalesce, and
stale session work is rejected. Journals keep 300 recent
entries per session so they can replay after login.
Parsing only turns a TOML table into settings now. Writing
the vars file, creating a missing file and printing the first
load move to the callers that own them.

The reader becomes testable: the logic tests parse the English
example with the real reader and check that every documented
key is read and no documented value is rejected.
Actions, defaults, tiers and aliases come from one definition
file instead of repeated tables. Bindings are built as a
parsed value before publishing, so a bad chord cannot mutate
live state.

Each modifier is described once and used for parsing, display
names and matching, keeping left and right aliases consistent
across all three.
Sync threads held references into settings that a reload
replaces. They now own an immutable snapshot, and workers for
removed targets are released with their queues.

Suppressed log levels no longer copy settings or build request
descriptions, and session checks compare a generation number
instead of copying credentials on every poll.
Overlapping timers become explicit ship swap, officer swap
and officer preset stages. A new screen request replaces the
old one, and disabling hotkeys cancels pending work.

Held and down results are cached in the frame snapshot,
including negative results, so repeated checks in one frame
agree. Asking for alliance help runs before its result is
combined, where short-circuiting previously skipped it.
Pinning cleared and re-added every ship in the dock list. It
now visits a snapshot in pinned and unpinned passes and sets
only changed slots, so the list keeps its count.

Instance snapshots are taken once per operation instead of
rescanning GC handle lists for each tracked object.
@netniV
netniV added this pull request to the merge queue Nov 14, 2026
Merged via the queue into dev with commit a901d25 Nov 14, 2026
6 checks passed
@netniV
netniV deleted the refactor/04-features-settings-sync branch November 14, 2026 00:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants