Skip to content

Add per-NPC event history and injection - #689

Merged
RANGROO merged 5 commits into
unstablefrom
codex/npc-history-event-injection
Aug 11, 2026
Merged

Add per-NPC event history and injection#689
RANGROO merged 5 commits into
unstablefrom
codex/npc-history-event-injection

Conversation

@RANGROO

@RANGROO RANGROO commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

What

  • adds exact-NPC recent event history to the PHP NPC editor
  • limits History to the PHP Adventure Log's default narrative event allow list, then applies saved Event Log hidden types
  • adds an NPC-scoped event-type filter and Event Log-style recent-events table capped at the latest 100 rows
  • places Background Life second-last and History last in the PHP NPC editor
  • lets users inject ordinary inputtext events for an NPC who is outside the current scene
  • supports optional additional NPC recipients and guarded event deletion
  • keeps the existing profile rollback viewer under the clearer Profile Versions label

Why

NPCs need to remember cross-scene handoffs, such as one NPC giving another a sweetroll, even when they are not currently together.

Maintainer Discussion

  • I discussed this PR with RANGROO or tyler.maister in Discord.

Related PRs

Companion PrismaUI PR: https://github.com/Dwemer-Dynamics/CHIM/pull/126

Notes

  • No schema migration or new event type. Injected rows use the existing inputtext event/context path.
  • Existing save-load eventlog cleanup rolls these rows back when an older save predates them.
  • History reads the Event Log hide-list but does not mutate it; the local type selector only narrows the edited NPC.
  • Internal/noisy rows such as infoloc are excluded from both History rows and its type selector.
  • ui/core/npc_master.php also overlaps draft PR Add persistent and repeatable NPC tasks #594, but this change is scoped to event history/injection rather than persistent NPC tasks.
  • Focused PHPUnit execution is currently blocked before assertions on current unstable: debug/db_updates.php calls sql::escapeLiteral(), which is absent from the active test database class.

Validation

  • php -l ui/api/chim_npc_manager.php
  • node --check ui/js/npc_event_history.js
  • git diff --check
  • copied allow list programmatically matched ui/adventurelog.php exactly
  • full local release deploy using the feature worktrees, followed by focused UI/API sync for this update
  • deployed server endpoint hash matched the feature worktree
  • live history API: 100 Dorthe events, only allowed event types, no infoloc in rows or filter options
  • live type filters: chat returned only chat; requesting infoloc returned zero rows
  • deployed two-recipient inputtext inject/read/delete round trip using Dorthe gave Alvor a sweetroll., with the temporary row removed from both histories
  • browser PHP editor: 100 rows, allowed type options only, and final tab order Background Life -> History

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