mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #4921] [MERGED] feat(client): Easy Viewer for Professor Mari's edit review cards #6542
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#6542
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/4921
Author: @kolacheee
Created: 8/11/2026
Status: ✅ Merged
Merged: 8/11/2026
Merged by: @kolacheee
Base:
staging← Head:feat/mari-edit-easy-viewer📝 Commits (4)
dd16b3efeat(client): add an Easy Viewer for Professor Mari's edit review cards (#4919)a75f58cfix(client): render all changed lorebook fields + unique preview-row keys (#4919)fb0db65feat(client): per-card Easy/Raw toggle + prominent deletes/disables in the Mari Easy Viewer (#4919)100b504fix(client): persist the Easy/Raw choice + show Disabled for all entry states (#4919)📊 Changes
9 files changed (+889 additions, -9 deletions)
View changed files
📝
CHANGELOG.md(+1 -0)📝
package.json(+2 -1)📝
packages/client/src/components/chat/HomeProfessorMariChat.tsx(+89 -8)➕
packages/client/src/components/chat/MariEditEasyViewer.tsx(+399 -0)➕
packages/client/src/lib/mari-edit-diff.ts(+174 -0)➕
packages/client/src/lib/word-diff.ts(+74 -0)📝
packages/client/src/localization/locales/en.json(+30 -0)📝
packages/client/src/stores/ui.store.ts(+7 -0)➕
scripts/regressions/mari-edit-diff.regression.ts(+113 -0)📄 Description
Linked issue
Closes #4919
Why this change
When Professor Mari edits something, her Keep/Restore review card showed the change as a raw
app_data … {JSON}command — a character rewrite, a lorebook entry edit, and a preset change all looked like the same opaque one-line blob. The card already renders created and deleted rows in a friendly way, but it had no rendering forupdate/replacerows, so every edit fell through to the raw command string.The before/after data is already on the card:
approval.diffPreviewcarries fullbefore/afterrow snapshots per change. So this is almost entirely a client-side rendering improvement.What changed (phases 1–3 of #4919)
update/replacerows now render as a per-field before/after diff with inline word-level highlighting (removed in red, added in green). New self-contained word-level diff util (word-diff.ts, no new dependency) and field-change extraction that recurses the nesteddata/JSON columns so you see "Personality changed", not "data changed" (mari-edit-diff.ts).lorebook_entrieschanges lay out like the entry editor (name, primary/secondary key chips with add/remove coloring, content diff, changed-toggle badges) via a dedicated read-only view.ui.storemariEditViewMode, default Easy). Raw keeps the JSON command and the existing insert/delete previews.Deferred to a phase-4 follow-up (agreed with the requester)
assemblePromptreads persisted rows by ID) andapply:falsereturns before/after row objects, not a rendered prompt, so a faithful Peek-Prompt view needs a new server endpoint. The field diff already makes these edits readable.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Automated, done by me:
pnpm checkpasses (TypeScript + ESLint + build, exit 0) andcheck-localespasses (26 new keys, sorted).mari-edit-diff.regression.ts(registered in the suite) passes: the word diff reconstructs both sides exactly, field extraction recurses nesteddataand skips noise/unchanged keys, and boolean-ish integer fields render as on/off.max-h-40 overflow-auto), and the added-green used a hardcodedemerald-300that was ~1.3:1 contrast on the built-in light theme (→ theme-aware tint +text-[var(--foreground)], matchingCharacterCardUpdateModal).Still needs a human — I could not run a dev server (it collides with the maintainer's live install ports), so please verify in a real browser (don't trust the boxes above):
Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)CHANGELOG.mdupdated. Nodocs/change (this is UI). New user-facing strings are in the canonicalen.json; community locales fall back to English per.instructions.md, so nodocs-i18nfollow-up. No version bump.UI evidence (if applicable)
Screenshots pending the manual browser pass (I can't run a dev server here). Happy to attach once verified.
Summary by CodeRabbit
New Features
Bug Fixes
Tests
Documentation
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.