[PR #2195] [MERGED] Fix character version history ordering #5463

Closed
opened 2026-10-22 04:16:33 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/2195
Author: @cha1latte
Created: 6/4/2026
Status: ✅ Merged
Merged: 6/4/2026
Merged by: @cha1latte

Base: refactor ← Head: fix/issue-2129-character-version-order


📝 Commits (2)

  • 3a770d0 Fix character version history ordering
  • 95eb572 Cover character version query gating

📊 Changes

2 files changed (+115 additions, -1 deletions)

View changed files

➕ src/features/catalog/characters/hooks/use-characters.test.tsx (+109 -0)
📝 src/features/catalog/characters/hooks/use-characters.ts (+6 -1)

📄 Description

Linked issue

Closes #2129

Why this change

  • Character version history on refactor was requesting character-versions with only a characterId filter, so the generic storage list path kept its default ascending createdAt sort. That made older snapshots appear before newer snapshots, unlike legacy.

What changed

  • Updated useCharacterVersions to request orderBy: "createdAt" and descending: true.
  • Added a focused hook regression test that verifies the version-history query preserves the character filter while requesting newest-first ordering.

Refactor impact

Primary owner:

  • Catalog characters

Impact areas reviewed:

  • Catalog character editor version history hook
  • Shared storage API list options contract
  • Tauri generic storage list ordering behavior

Boundary notes:

  • The fix stays in the feature consumer. It does not change generic storage defaults or Rust storage behavior for other entities.

Pressure points touched:

  • None.

Validation

  • Matching validation command passes locally (for example pnpm typecheck, pnpm build, pnpm check:architecture, pnpm check:docs, or full pnpm check when warranted)
  • Full pnpm check passes before PR push/handoff
  • Human/manual validation completed by contributor or reviewer

Manual verification notes

  • Codex reproduced the issue with pnpm test src/features/catalog/characters/hooks/use-characters.test.tsx; the test failed before the fix because the hook called storageApi.list without orderBy or descending.
  • Codex reran pnpm test src/features/catalog/characters/hooks/use-characters.test.tsx after the fix; it passed.
  • Codex ran pnpm typecheck; it passed.
  • Codex ran pnpm check; it passed.
  • Codex ran node C:\Users\celia\.codex\tools\marinara-proof-gate.mjs scratch\issue-2129-bugfix-verification.json; it passed.

Feature Discoverability

Check exactly one:

  • Updated src/features/shell/discovery/ because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool.
  • NA because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find.

Reason:

  • Bugfix only; no new discoverable feature or workflow.

Docs and release impact

  • No docs changes needed
  • Updated README.md
  • Updated CONTRIBUTING.md
  • Updated docs/developer/
  • Updated repo skills or AGENTS.md
  • Confirmed this PR does not restore old staging/package-workspace/release claims

UI evidence

  • N/A. This is a non-UI ordering request fix in the character version-history hook; verification is the command output and full repo gate above.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/2195 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 6/4/2026 **Status:** ✅ Merged **Merged:** 6/4/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `refactor` ← **Head:** `fix/issue-2129-character-version-order` --- ### 📝 Commits (2) - [`3a770d0`](https://github.com/Pasta-Devs/Marinara-Engine/commit/3a770d0a66987cbcd57faf9677add2b62a0e0a36) Fix character version history ordering - [`95eb572`](https://github.com/Pasta-Devs/Marinara-Engine/commit/95eb572db761da46cefd51c84d6d9d1977b4ee6b) Cover character version query gating ### 📊 Changes **2 files changed** (+115 additions, -1 deletions) <details> <summary>View changed files</summary> ➕ `src/features/catalog/characters/hooks/use-characters.test.tsx` (+109 -0) 📝 `src/features/catalog/characters/hooks/use-characters.ts` (+6 -1) </details> ### 📄 Description <!-- Target branch: `refactor`. Change the base to `refactor` before submitting unless a maintainer explicitly asked for another base. --> <!-- Keep all checkboxes unchecked until a human has actually verified them. --> ## Linked issue Closes #2129 ## Why this change - Character version history on refactor was requesting `character-versions` with only a `characterId` filter, so the generic storage list path kept its default ascending `createdAt` sort. That made older snapshots appear before newer snapshots, unlike legacy. ## What changed - Updated `useCharacterVersions` to request `orderBy: "createdAt"` and `descending: true`. - Added a focused hook regression test that verifies the version-history query preserves the character filter while requesting newest-first ordering. ## Refactor impact Primary owner: - Catalog characters Impact areas reviewed: - Catalog character editor version history hook - Shared storage API list options contract - Tauri generic storage list ordering behavior Boundary notes: - The fix stays in the feature consumer. It does not change generic storage defaults or Rust storage behavior for other entities. Pressure points touched: - None. ## Validation <!-- Check only what you personally ran or manually verified. Treat unchecked items as explicit TODOs. --> <!-- Do not submit *.test.ts or *.test.tsx files as PR proof; cite existing checks, command output, app/browser/Tauri verification, or manual notes instead. --> - [ ] Matching validation command passes locally (for example `pnpm typecheck`, `pnpm build`, `pnpm check:architecture`, `pnpm check:docs`, or full `pnpm check` when warranted) - [ ] Full `pnpm check` passes before PR push/handoff - [ ] Human/manual validation completed by contributor or reviewer ### Manual verification notes - Codex reproduced the issue with `pnpm test src/features/catalog/characters/hooks/use-characters.test.tsx`; the test failed before the fix because the hook called `storageApi.list` without `orderBy` or `descending`. - Codex reran `pnpm test src/features/catalog/characters/hooks/use-characters.test.tsx` after the fix; it passed. - Codex ran `pnpm typecheck`; it passed. - Codex ran `pnpm check`; it passed. - Codex ran `node C:\Users\celia\.codex\tools\marinara-proof-gate.mjs scratch\issue-2129-bugfix-verification.json`; it passed. ## Feature Discoverability Check exactly one: - [ ] Updated `src/features/shell/discovery/` because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool. - [x] NA because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find. Reason: - Bugfix only; no new discoverable feature or workflow. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [ ] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [ ] Confirmed this PR does not restore old staging/package-workspace/release claims ## UI evidence - N/A. This is a non-UI ordering request fix in the character version-history hook; verification is the command output and full repo gate above. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:16:33 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#5463
No description provided.