"(edited)" hover shows a word-level diff of the last edit #144

Closed
opened 2026-09-17 16:51:58 -04:00 by jared · 1 comment
Owner

Clicking "(edited)" opens the full history viewer (keep). Add a hover/focus tooltip on the "(edited)" label showing only the last edit as a word diff: removed words struck, added words bold. Pure diff helper (utils/wordDiff.ts, unit-tested, LCS on words, cap at ~400 words then fall back to "open history"). Plain-text bodies only (formatted edits fall back to the viewer). Mobile: long-press = same tooltip.

Clicking "(edited)" opens the full history viewer (keep). Add a hover/focus tooltip on the "(edited)" label showing only the **last** edit as a word diff: removed words struck, added words bold. Pure diff helper (`utils/wordDiff.ts`, unit-tested, LCS on words, cap at ~400 words then fall back to "open history"). Plain-text bodies only (formatted edits fall back to the viewer). Mobile: long-press = same tooltip.
jared added this to the Features 2026-Q4 milestone 2026-09-17 16:51:58 -04:00
jared added the enhancementpriority: lowuxarea: messaging labels 2026-09-17 16:51:58 -04:00
jared self-assigned this 2026-09-17 16:51:58 -04:00
Author
Owner

Done in 2bdb2eb4.

  • Hover/focus on (edited) → tooltip with only the last edit as a word diff (removed struck, added bold) and a +N · −N summary; click still opens the history viewer.
  • Touch: long-press on the label shows the same diff as a popout (dismissed by tapping elsewhere/scrolling/6 s); a plain tap opens the viewer; the message's own long-press action sheet is not triggered.
  • utils/wordDiff.ts: LCS over words, whitespace-only changes ignored, gives up past 400 words (7 unit tests). Plain-text bodies only; formatted edits show no tooltip and fall back to the viewer.

Headless: message edited twice (quick→brown, then 5→6 tonight); tooltip shows only the second change: del: ['5 '] ins: ['6 tonight ']. Pixel 7 emulation: long-press → popout visible, action sheet 0, viewer not opened; tap → viewer opened.

desktop
touch

Done in 2bdb2eb4. - Hover/focus on **(edited)** → tooltip with only the *last* edit as a word diff (removed struck, added bold) and a `+N · −N` summary; click still opens the history viewer. - Touch: long-press on the label shows the same diff as a popout (dismissed by tapping elsewhere/scrolling/6 s); a plain tap opens the viewer; the message's own long-press action sheet is not triggered. - `utils/wordDiff.ts`: LCS over words, whitespace-only changes ignored, gives up past 400 words (7 unit tests). Plain-text bodies only; formatted edits show no tooltip and fall back to the viewer. Headless: message edited twice (`quick→brown`, then `5→6 tonight`); tooltip shows only the second change: `del: ['5 '] ins: ['6 tonight ']`. Pixel 7 emulation: long-press → popout visible, action sheet 0, viewer not opened; tap → viewer opened. ![desktop](https://code.lotusguild.org/attachments/ab67f7ee-2870-41de-90f7-ee8bd4e1fd58) ![touch](https://code.lotusguild.org/attachments/fbe4d369-12a1-492f-896a-28da0ad1ce37)
jared closed this issue 2026-09-19 23:34:44 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: LotusGuild/cinny#144