block / block/buzz

feat(desktop): reply to selected text in a message

Open
#5,827 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
32.7k
Forks
4.3k
Avg merge
1d 13h
Merged PRs (30d)
253

Description

## Summary

Add "reply to selected text" — select part of a message, get a **Reply** action, and have that excerpt drop into the composer as a quoted blockquote above your reply. Familiar behaviour from Slack, ChatGPT, Codex, and Claude Code.

Today you can reply to a *whole message*, but not to a specific line of a long one. In a channel where agents post long structured messages, that's most of them — a human replying to one table row in a 60-line agent report currently has to re-type or hand-quote the part they mean.

## Why this is a small addition

Most of the machinery already exists; this is mainly a bridge between two shipped features.

**Already present:**

| Piece | Location |
|---|---|
| Floating tray on text selection, with viewport clamping and above/below placement | `desktop/src/features/messages/ui/SelectionFormattingTray.tsx` |
| Reply callback on the message action bar | `desktop/src/features/messages/ui/MessageActionBar.tsx:395` |
| `replyTarget` prop, plumbed to the composer | `desktop/src/features/messages/ui/MessageComposer.types.ts:97` |
| "Replying to X" chip in the composer | `desktop/src/features/messages/ui/ComposerReplyEditBanner.tsx` |

**Missing:**

1. `SelectionFormattingTray` only works over *editor* content — `getSelectionRect` reads `editor.state.selection` and `editor.view.domAtPos`. It needs a variant that positions from a plain DOM `Range` so it can appear over rendered messages.
2. `replyTarget` carries `{author, body, id}` with no slot for a selected excerpt.
3. Nothing inserts the excerpt into the composer as a `>` blockquote.

## Open questions for maintainers

- Should the tray generalize, or should rendered messages get a sibling component? (1) means touching a shipped component, so this seems worth deciding before anyone writes it.
- Should the quote be plain composer text the user can edit, or structured data carried on the event?
- Any interaction with existing selection behaviour to avoid — e.g. the tray appearing during ordinary copy?

Filing to check appetite before anyone builds it.

Contributor guide

Open the contributing guide

Research direction

Start with desktop/src/features/messages/ui/SelectionFormattingTray.tsx and trace the reply callback at desktop/src/features/messages/ui/MessageActionBar.tsx:395, then inspect replyTarget in MessageComposer.types.ts:97 and ComposerReplyEditBanner.tsx. The work is done when selecting rendered message text offers Reply and the composer receives an editable quoted blockquote above the response, with the tray and reply data design resolved.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
desktop, frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.