feat(edit-history): word-level diff view
The Edit History modal listed each version's full text with no indication of what changed. Add a word-level diff: each edit highlights the words added (green) and removed (struck-through red) relative to the previous version, so a one-word fix is obvious at a glance. - New pure, dependency-free diffWords (LCS over word/whitespace tokens) in utils/textDiff.ts, with 8 unit tests (insert/delete/replace, whitespace preserved, empty, no-mutation, word-not-char granularity). - EditHistoryModal renders each edit via a DiffText component using semantic <ins>/<del> (screen-reader-meaningful) styled with folds Success/Critical tokens. A "Highlight changes" header toggle (default on) switches back to full text, which keeps the rich formatted render; the Original row is always the plain baseline. - Diff is plain-text (body) only by design; formatted markup isn't diffed (the toggle restores the rich view), and media/no-body edits diff as empty strings gracefully. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -660,6 +660,7 @@ The indicator is hidden once the server confirms the event (when the internal st
|
||||
|
||||
- API: `GET /_matrix/client/v1/rooms/{roomId}/relations/{eventId}/m.replace`
|
||||
- E2EE fix: the "Original" entry uses `getClearContent()` to retrieve the decrypted content rather than the encrypted payload
|
||||
- **Word-level diff**: a "Highlight changes" toggle (on by default) renders each edit as a word diff against the previous version — added words highlighted (green), removed words struck-through (red) — using semantic `<ins>`/`<del>`. Toggle off to see full text (formatted messages render rich there; the diff is plain-text only). Diff logic is the pure, unit-tested `diffWords` (LCS) in `src/app/utils/textDiff.ts`.
|
||||
- Accessible from the message context menu
|
||||
|
||||
### Inline GIF Preview
|
||||
|
||||
Reference in New Issue
Block a user