Diff
Backstory
The idea of message editing had long tickled my fancy – maybe since – and throughout I'd been keen on having the entire history of changes come with each edited message itself. To make this happen I'd been determined that this history be represented not as the whole message repeated over and over again, but more concisely in terms of "what changed". It was then reading @CiaraNi@mastodon.green's love letter () to notifications of people making edits to (relatively) ancient posts, and realising that some Mastodon clients provide the "track changes" style inherent to the scheme I'd been mulling over, which the browser version I use does not, that spurred me on to give this a go.
Privacy note: Nothing actually gets sent back to the server, it all happens locally, so feel free to play with it to your heart's content.
Compose
Instant Notification
On-Focus Notification
Possibilities
- Understanding the idea of a longest common subsequence and writing my own solution, to lift the dependency on jsdiff.
- Animating length:
- Documents too long to fit in view in their entirety.
- Long chains of edits, whose replaying would naturally take more time to animate than our target 800ms (400ms fast-forwarding all except the final stage, plus 400ms for the final one itself).
- Respecting prefers-reduced-motion, especially if scrolling / scaling long documents.
- Parsing:
- Line breaks. (After working through this manually, it turned out that setting .innerText gave me what .textContent did not.) [9thβ10th April 2025]
- Hyperlinks. [10th April 2025]
- Fediverse handles.
- Styling, e.g. bold, italics, colours, sizing.
- Formatting, e.g. lists, tables.
- Inline media, e.g:
- audio player.
- image (incl. alt text edits).
- video.
- Applying it to something (hopefully) usable, e.g:
- This website.
- The first step of my long-dreamt-of "decontextualisation-unfriendly communication system".
Dependencies
- jsdiff for the diff'ing code.