Skip to content
mentoor

Topic 1 of 5 · 4 min read

Editing AI output in place

Goal: Find where an edit flow discards user changes on regeneration and specify the fix.

AI output is a first draft, so the user must be able to change it where it sits, and the product must never throw those changes away.

Check yourself · 1 of 3

A user highlights one sentence in an AI draft and chooses "Make shorter". What should change?

Choose one answer

Why it matters

Nobody treats generated text as final. Research from Nielsen Norman Group on early generative-AI use found people expanding, trimming and picking pieces of a draft rather than accepting it whole. If the only way to change a draft is to type a new request and wait, the user loses time and often gets a different draft that is worse. The worst case is silent loss: the user fixes a name, clicks regenerate to improve the closing line, and the fix is gone.

How to do it

  1. Make the output a normal editable field. Text should be selectable and typeable in place. A read-only block with a "copy" button pushes people into another app.
  2. Offer select-to-refine. When the user highlights a sentence, show actions that apply only to that selection: shorter, more formal, rephrase, ask AI. Everything outside the selection stays byte for byte the same.
  3. Return partial edits as small changes. If the AI changes three words in a paragraph, show those three words, not a rewritten paragraph. Highlight what changed so the user can check it quickly.
  4. Track what the user touched. Keep a record of ranges the user typed into. When the AI regenerates, treat those ranges as locked, or ask before overwriting them.
  5. Let the user accept or reject each AI change. Per-change accept and reject beats an all-or-nothing replace.

Before and after

Before: A contract assistant drafts a clause. The user edits the party name to "Northwind Ltd". They click "Regenerate" to get a tighter payment term. The whole clause is replaced and the party name reads "the Supplier" again. No warning, no undo.

After: Regenerate on a selected sentence changes only that sentence. The edited party name is locked. The new payment term appears as a highlighted suggestion with Accept and Reject. If a regenerate would touch edited text, a short message says so and offers to keep the user's version.

What goes wrong

  • Whole-document regeneration. The control says "improve this" but rewrites everything, so one good paragraph costs three good ones.
  • Silent merge. The tool blends user text and new text and shows no diff, so the user cannot tell what the AI changed.
  • Lost selection scope. The user selects one line, but the request goes to the model with the full document, and the model edits more than asked.

For engineers, the rule is a data one: store user edits as ranges or patches separate from the generated base, and apply new output on top of them, never over them. Chat tools such as ChatGPT canvas, Claude artifacts and Copilot in Word all show versions of this idea: edit in place, point at a selection, change only that.

Examples

Locking a user fix on regenerate

A product page writer edits the AI headline to include the real model number, "KX-220". Later they regenerate only the bullet list.

Good behaviour: the headline is untouched because it was not selected and the user edited it. The bullets are replaced, shown as a diff against the old ones, with Keep old and Use new buttons.

Bad behaviour: the page regenerates as one block and the headline goes back to a generic phrase without "KX-220".

Specifying the fix in a ticket

A short, testable spec for engineers:

Given the user has edited paragraph 2
When they press Regenerate on paragraph 4
Then paragraph 2 is unchanged
And paragraph 4 shows a diff with Accept and Reject
And if the new text would overlap an edited range, show "Your edits are in this section. Keep them?"

Key points

  • AI output should be editable where it appears, not only through a new request.
  • Select-to-refine must change only the selected text and leave the rest untouched.
  • Show partial edits as small, highlighted changes the user can accept or reject one by one.
  • Track which ranges the user typed into and protect them when the AI regenerates.
  • Silently replacing user edits on regenerate is the most damaging failure in an edit flow.

Common mistakes

  • Offering only a "Regenerate" button with no way to edit the text directly.
  • Sending the whole document to the model when the user selected one sentence, then applying all of the result.
  • Showing the new version with no diff, so the user cannot see what the AI changed.
  • Treating user edits as temporary state that is dropped on the next generation.

Check yourself · 2 of 3

A user fixes a company name in an AI email draft, then clicks Regenerate. The new draft has the old wrong name. What is the core design fault?

Choose one answer

Check yourself · 3 of 3

An AI rewrites three words in a long paragraph. What is the best way to show the result?

Choose one answer

Practice items, not counted towards your mastery.

Start here