Skip to content

Thread view: render replies WhatsApp-style — show only the new text, with the replied-to message as a quoted preview #43

Description

@Aravinda-HWK

Problem

In a conversation thread, a reply currently renders as one big bubble that can include the quoted original underneath the new text (email clients append the quoted chain on send, and rich-HTML replies render their full body including the quote). This buries the actual new content and reads like classic email, not chat.

Plain-text replies are already partially handled — stripQuotedText hides the quoted tail in the chat view — but there is no visual link back to the message being replied to, and rich-HTML replies still show the whole quoted chain.

Proposed behaviour (WhatsApp-style)

When a message in the thread is a reply to an earlier message:

  1. Show only the new content in the bubble — for plain text and for rich HTML replies (strip/hide the quoted chain in both).
  2. Attach a compact quoted preview at the top of the bubble, WhatsApp-style:
    • small colored accent bar + original sender's name + a 1–2 line snippet of the original message
    • visually distinct (tinted background inside the bubble)
  3. Tap/click the quoted preview scrolls to the original message in the thread (with a brief highlight), when the original is present in the conversation.
  4. If the original message isn't in the loaded conversation (e.g. it was permanently deleted), show the preview without the jump affordance.

Implementation pointers

  • src/nonview/email/quotedText.ts — existing plain-text quote stripping (extend/reuse; needs an HTML equivalent, e.g. stripping blockquote/gmail_quote containers)
  • src/nonview/core/replyContext.ts — builds the outgoing quote; outgoing replies already carry In-Reply-To/References headers
  • Linking reply → original: match in_reply_to against the thread messages' message_id (both already exist in the Message DTO; ThreadMessage would need to carry them)
  • src/view/moles/MessageBubble.tsx — render the quoted-preview block and the scroll-to-original behaviour

Edge cases

  • Replies composed in other clients (Gmail/Outlook) with different quoting formats — the quote parser should degrade gracefully (worst case: current behaviour)
  • Forwarded messages should keep their quoted content visible (a forward's content is the quote)
  • Nested replies: only preview the immediate parent, not the whole chain

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions