Skip to content

Preserve NPC profile list state after reloads - #718

Merged
RANGROO merged 1 commit into
unstablefrom
codex/preserve-npc-profile-list-state
Aug 22, 2026
Merged

Preserve NPC profile list state after reloads#718
RANGROO merged 1 commit into
unstablefrom
codex/preserve-npc-profile-list-state

Conversation

@RANGROO

@RANGROO RANGROO commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator

Problem

Navigating to a later CHIM NPC Profiles page updated only the rendered DOM. The URL retained no page or filter state, so any save-adjacent reload rebuilt page 1 and forced users to find the NPC again.

Change

  • expose the server-rendered, clamped page on the pagination toolbar
  • track the effective NPC list page and filters in the existing AJAX refresh flow
  • persist successful list state with history.replaceState
  • preserve page, search, letter, profile, checkbox filters, alpha order, and embedded mode
  • exclude transient list/modal parameters from the visible URL
  • keep the existing inline NPC Save/card update path unchanged with no extra list request

Compatibility

  • no schema or migration changes
  • no save payload, sort order, profile locking, or database behavior changes
  • HerikaServer only; analogous StobeServer and DialecticServer behavior was assessed but not ported because they are independent products and were not requested

Validation

  • php -l ui/core/npc_master.php
  • git diff --check
  • WSL PHP lint on the deployed file
  • source/deployment SHA-256 match: 67243AD96F49BB856A85AA3C3F8FAC49EAC08FACD724DC50E040780A490713D7
  • local HTTP 200 with no PHP warning/fatal markers
  • browser: page 5 persisted through reload with the same 12 NPCs
  • browser: search Dorthe persisted through reload
  • browser: page=999 clamped to page 11 and corrected the URL
  • browser: embed=1 page 5 persisted through reload
  • browser: editor modal open/close preserved page 5
  • browser console: no warnings or errors

Performance

No additional request is made during ordinary NPC Save. Pagination refresh retains the existing single bounded list request; the change only serializes the already-active list controls into the URL.

Review scope

One file, 64 additions and 30 deletions (94 changed lines). Draft PR because ui/core/npc_master.php also has unrelated active work in PRs #690 and #594.

Deployment

Deployed locally to /var/www/html/HerikaServer/ui/core/npc_master.php from commit b88c2875f4e2ff0d7966ce95fcac16fb42ed7b49 for user testing.

Limits

The live browser validation did not submit an NPC Save because that would alter local profile data. In-game behavior was not tested or changed. Config Hub tab reactivation and delete redirects remain outside this focused fix.

@RANGROO
RANGROO marked this pull request as ready for review August 22, 2026 05:40
@RANGROO
RANGROO merged commit 842f65a into unstable Aug 22, 2026
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