QuoteReply

Select a phrase and a contextual edit bar attaches beneath it — describe an edit, or pick one, and watch the rewrite arrive in place.

Install it:

npx shadcn add @ambientui/quote-reply

Live

Select any phrase below

The regression happens because the converter drops parts with no text, so an empty assistant turn never reaches the thread.

Behavior

  • ·ANCHORED TO THE SELECTION: the bar measures the selected range and attaches beneath its last line, centred on the whole selection — a wrapped selection still reads as one object with its bar. It pops in on the control role and repositions through requestAnimationFrame.
  • ·A STATE MACHINE, not a toolbar: idle (a Describe-edits prompt plus Explain / Improve, with Shorten / Tone / Grammar unfolding inside the pill) → thinking (spinner + shimmer with the real elapsed count) → streaming (the rewrite arrives INTO the selection through StreamingText) → result (Keep / Discard / Retry).
  • ·Rewriting in place requires owning the prose: pass `text` and a `rewrite` seam. Without the seam, actions only report (onAction) — which is all a surface that cannot mutate its content should get.
  • ·Typing in the prompt collapses the presets to a send control; the instruction IS the action.
  • ·Appears on selection and nowhere else, and only for selections inside its own content.
  • ·The selection stays the SUBJECT: Keep applies the replacement to the text, Discard restores it, Retry runs the same action again.

When to use

  • ·Around long assistant answers, especially ones mixing prose and code.

When not to

  • ·Around user messages — quoting yourself back to the assistant is what the composer is for.
  • ·Where text is short enough to reference whole; a toolbar over one sentence is friction.