[PR #8815] [MERGED] Show Professor Mari's edits as whole runs, old then new #8821

Closed
opened 2026-11-07 17:39:58 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/8815
Author: @kolacheee
Created: 11/4/2026
Status: ✅ Merged
Merged: 11/4/2026
Merged by: @kolacheee

Base: staging ← Head: claude/project-thread-e339o4


📝 Commits (7)

  • 6048133 Show Professor Mari's edits as whole runs, old then new
  • decfed0 Fold a single kept word between two edits into the run
  • 3dca375 Never strike a kept word between pure insertions or deletions
  • 6611bd6 Judge each run on its own segments, not flags left by an earlier run
  • 8345587 Merge remote-tracking branch 'origin/staging' into claude/project-thread-e339o4
  • 176d977 Merge remote-tracking branch 'origin/staging' into claude/project-thread-e339o4
  • 3e1cd85 Merge remote-tracking branch 'origin/staging' into claude/project-thread-e339o4

📊 Changes

5 files changed (+190 additions, -10 deletions)

View changed files

📝 packages/client/src/components/chat/MariChangeReceipt.tsx (+2 -2)
📝 packages/client/src/lib/mari-edit-diff.ts (+5 -5)
📝 packages/client/src/lib/word-diff.ts (+100 -2)
📝 packages/client/src/styles/mari.css (+12 -0)
📝 scripts/regressions/mari/word-diff-lines.regression.ts (+71 -1)

📄 Description

Linked issue

Closes #8814

Why this change

A rewritten phrase in Mari's edit diff alternated old and new word by word, each struck word glued to its replacement, which is hard to read.

What changed

  • groupChangeRuns / diffWordRuns in lib/word-diff.ts: each run of changed words becomes the whole old run struck, then the whole new run. Kept stretches between two edits join the run when they are a single word (any length) or up to two words of four letters or fewer ("of the"); a line break never does. A run that only inserts or only deletes keeps its kept words unstruck. Kept+removed still spells the old text and kept+added the new.
  • Used by the change receipt and in-place field review (TextBody), the Easy Viewer (trackProseChange, after its rewrite check on the raw diff), and paired lines in the unified diff (after its similarity check).
  • CSS: a small margin-inline-end on struck text directly followed by new text (del:has(+ ins)), so the two runs don't touch. Browsers without :has() just show them adjacent, as before.
  • Regression cases in scripts/regressions/mari/word-diff-lines.regression.ts (the issue example, single kept words, pure insertion/deletion, line breaks).

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

Ran the mari regressions (node ./scripts/run-regressions.mjs --filter mari, 87/87) and the command-center regression, client tsc --noEmit, client lint (no errors), and Prettier on changed files. Rendered the diff output with the receipt styles in Chromium to compare before and after; not clicked through in the running app.

Before: A brilliant researcher ~~and respected~~whose ~~authority~~outward ~~in~~professionalism ~~her~~has ~~field,~~become a ~~professional~~ shield ~~to~~against ~~a~~growing ~~fault.~~exhaustion.
After: A brilliant researcher ~~and respected authority in her field, a professional shield to against a growing fault. With~~ whose outward professionalism has become a shield against growing exhaustion. While …

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

🔄 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/8815 **Author:** [@kolacheee](https://github.com/kolacheee) **Created:** 11/4/2026 **Status:** ✅ Merged **Merged:** 11/4/2026 **Merged by:** [@kolacheee](https://github.com/kolacheee) **Base:** `staging` ← **Head:** `claude/project-thread-e339o4` --- ### 📝 Commits (7) - [`6048133`](https://github.com/Pasta-Devs/Marinara-Engine/commit/604813344302ff073ccd8a4e86710359d253b43d) Show Professor Mari's edits as whole runs, old then new - [`decfed0`](https://github.com/Pasta-Devs/Marinara-Engine/commit/decfed06ae2dabd169d582e2aa9b03bf7c7c6ece) Fold a single kept word between two edits into the run - [`3dca375`](https://github.com/Pasta-Devs/Marinara-Engine/commit/3dca375a8804e48e9835d57812db4e0dc2e2de2c) Never strike a kept word between pure insertions or deletions - [`6611bd6`](https://github.com/Pasta-Devs/Marinara-Engine/commit/6611bd6ec100c9985d7b2cb1b44aea675ad51210) Judge each run on its own segments, not flags left by an earlier run - [`8345587`](https://github.com/Pasta-Devs/Marinara-Engine/commit/83455875a09168b488513cb383719e04f2ca875a) Merge remote-tracking branch 'origin/staging' into claude/project-thread-e339o4 - [`176d977`](https://github.com/Pasta-Devs/Marinara-Engine/commit/176d97717c3c9b954a7b2e5ed19c1edfdbe36e52) Merge remote-tracking branch 'origin/staging' into claude/project-thread-e339o4 - [`3e1cd85`](https://github.com/Pasta-Devs/Marinara-Engine/commit/3e1cd85529066afa5a4b95ac2daffd2f43379945) Merge remote-tracking branch 'origin/staging' into claude/project-thread-e339o4 ### 📊 Changes **5 files changed** (+190 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/chat/MariChangeReceipt.tsx` (+2 -2) 📝 `packages/client/src/lib/mari-edit-diff.ts` (+5 -5) 📝 `packages/client/src/lib/word-diff.ts` (+100 -2) 📝 `packages/client/src/styles/mari.css` (+12 -0) 📝 `scripts/regressions/mari/word-diff-lines.regression.ts` (+71 -1) </details> ### 📄 Description ## Linked issue Closes #8814 ## Why this change A rewritten phrase in Mari's edit diff alternated old and new word by word, each struck word glued to its replacement, which is hard to read. ## What changed - `groupChangeRuns` / `diffWordRuns` in `lib/word-diff.ts`: each run of changed words becomes the whole old run struck, then the whole new run. Kept stretches between two edits join the run when they are a single word (any length) or up to two words of four letters or fewer ("of the"); a line break never does. A run that only inserts or only deletes keeps its kept words unstruck. Kept+removed still spells the old text and kept+added the new. - Used by the change receipt and in-place field review (`TextBody`), the Easy Viewer (`trackProseChange`, after its rewrite check on the raw diff), and paired lines in the unified diff (after its similarity check). - CSS: a small `margin-inline-end` on struck text directly followed by new text (`del:has(+ ins)`), so the two runs don't touch. Browsers without `:has()` just show them adjacent, as before. - Regression cases in `scripts/regressions/mari/word-diff-lines.regression.ts` (the issue example, single kept words, pure insertion/deletion, line breaks). ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes Ran the mari regressions (`node ./scripts/run-regressions.mjs --filter mari`, 87/87) and the command-center regression, client `tsc --noEmit`, client lint (no errors), and Prettier on changed files. Rendered the diff output with the receipt styles in Chromium to compare before and after; not clicked through in the running app. Before: `A brilliant researcher ~~and respected~~whose ~~authority~~outward ~~in~~professionalism ~~her~~has ~~field,~~become a ~~professional~~ shield ~~to~~against ~~a~~growing ~~fault.~~exhaustion.` After: `A brilliant researcher ~~and respected authority in her field, a professional shield to against a growing fault. With~~ whose outward professionalism has become a shield against growing exhaustion. While …` ## Docs and release impact - [x] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 17:39:58 +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#8821
No description provided.