Skip to content

feat(internaldata): persist search comments and log changes to history - #34

Merged
nxships merged 1 commit into
mainfrom
feat/search-comment-capture
Aug 3, 2026
Merged

feat(internaldata): persist search comments and log changes to history#34
nxships merged 1 commit into
mainfrom
feat/search-comment-capture

Conversation

@nxships

@nxships nxships commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Consumes NexusKit's new IInspectSearchCommentWatcher: when the user
examines somebody, SearchCommentCaptureService persists their search
comment and logs a history row if it actually moved.

The value goes on observed_player as search_comment, but is exposed via
the lazily-loaded ObservedPlayerDetail rather than the hot ObservedPlayer
record - same reasoning as the notes. ObservedPlayer holds every observed
row in memory at once, and this is a per-character free-text field the
list never renders.

The diff lives in the capture service, not in
InternalDataHistoryService.OnObservationProcessed, because the search
comment never travels through the observation pipeline - the prev/current
pair in PlayerObservationEvent simply does not carry it. SetSearchCommentAsync
already reads the previous value in order to write, so it hands it back and
the caller records the change without a second query.

Notes:

  • PlayerHistoryKind.SearchCommentChange = 5. No migration: kind is INTEGER
    and the enum is byte-backed for exactly this reason. OldValue/NewValue
    carry raw text; either may be null, which is how "set for the first time"
    and "cleared" are expressed.
  • UpdatedAt is deliberately not bumped on write. It drives
    observation-freshness, and examining somebody is not a sighting of them.
  • Re-examining with an unchanged comment writes nothing and logs nothing.
  • nexus_filter_player gains a search_comment column so the plugin can offer
    user filters on it. The view is dropped and recreated on every startup,
    so no migration is involved.
  • NexusKit floors raised to [0.5.0,): NuGet resolves the LOWEST version
    satisfying a range, so leaving them at [0.4.0,) would keep CI building
    against a NexusKit without the watcher.

Consumes NexusKit's new IInspectSearchCommentWatcher: when the user
examines somebody, SearchCommentCaptureService persists their search
comment and logs a history row if it actually moved.

The value goes on observed_player as search_comment, but is exposed via
the lazily-loaded ObservedPlayerDetail rather than the hot ObservedPlayer
record - same reasoning as the notes. ObservedPlayer holds every observed
row in memory at once, and this is a per-character free-text field the
list never renders.

The diff lives in the capture service, not in
InternalDataHistoryService.OnObservationProcessed, because the search
comment never travels through the observation pipeline - the prev/current
pair in PlayerObservationEvent simply does not carry it. SetSearchCommentAsync
already reads the previous value in order to write, so it hands it back and
the caller records the change without a second query.

Notes:

- PlayerHistoryKind.SearchCommentChange = 5. No migration: kind is INTEGER
  and the enum is byte-backed for exactly this reason. OldValue/NewValue
  carry raw text; either may be null, which is how "set for the first time"
  and "cleared" are expressed.
- UpdatedAt is deliberately not bumped on write. It drives
  observation-freshness, and examining somebody is not a sighting of them.
- Re-examining with an unchanged comment writes nothing and logs nothing.
- nexus_filter_player gains a search_comment column so the plugin can offer
  user filters on it. The view is dropped and recreated on every startup,
  so no migration is involved.
- NexusKit floors raised to [0.5.0,): NuGet resolves the LOWEST version
  satisfying a range, so leaving them at [0.4.0,) would keep CI building
  against a NexusKit without the watcher.
@nxships
nxships merged commit f21e5af into main Aug 3, 2026
3 checks passed
@nxships
nxships deleted the feat/search-comment-capture branch August 3, 2026 19:52
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.

1 participant