Contextual Overlay

Summoned in place, dismissed when done

Sidebar chat and modal assistants pull you off the page to re-describe work the model can already see. A contextual overlay summons the assist in place, anchored to your selection, and vanishes when the edit lands. Unlike a ghost-text completion at the cursor, it acts on what you selected and labels each suggestion with the action that produced it, so you accept or reject with one click.

Framing

The problem

Sidebar and modal assistants pull users off the page to re-describe work the model can already see.

The pattern

Summon an ephemeral surface anchored to the selection — not a completion at the cursor (Ghost Text), not a diff-reviewed transform (Select & Transform), but a labeled action menu that appears on demand and vanishes when the edit lands.

Why chat breaks here

A separate chat surface has no anchor to the selection, so every tiny edit becomes a copy-in, copy-out round trip the user has to splice back by hand.

Risks

Overlays that trigger on idle hover instead of a deliberate gesture feel interruptive — and an overlay that grows tabs and history has become the sidebar it replaced.

Avoid when

The edit needs cross-document context or diff-level review — then a persistent workspace or Select & Transform's reviewable scope beats a surface that disappears.

Use when

Unlike ghost text that just completes at the cursor, a contextual overlay acts on what you selected and shows what each suggestion did — so you stay in the document and decide with one click, not by reflex.

DOPE evaluation

Directability
Actions are named verbs on the selection ("Make it shorter", "More formal") — one click applies, one click dismisses, no prompt writing in between
Observability
The overlay appears anchored to the selection and the proposed rewrite renders in place, visually distinct from the authored text around it
Predictability
The surface is ephemeral by contract: summoned by a deliberate selection, gone when the edit lands — it never lingers as a second workspace
Explainability
Each proposed rewrite is labeled with the action that produced it, so what the AI did to your paragraph is stated, not guessed from the diff

In the wild

  • Notion AI overlay (Notion) — Press space on a new line for a prompt box; select text and choose Edit with AI for the in-place menu — built-in skills (Improve Writing, Proofread, Explain, Reformat) plus any skill your workspace adds. The rewrite lands in the document with accept, discard, or try again. Both surfaces vanish once the edit lands.
  • GitHub Copilot Inline Chat (GitHub) — Two surfaces in one editor. Cmd+I / Ctrl+I is a free-text prompt box at the cursor — ephemeral, but with no named verbs. The labeled half is Smart Actions: right-click a selection for Explain, Fix, Generate Docs, Generate Tests, Review, no prompt written. Both return an inline diff with Keep or Undo.
  • Apple Intelligence Writing Tools (Apple) — Select text, then Control-click and choose Show Writing Tools on macOS, or tap Writing Tools in the iOS selection bar. A floating panel offers Proofread, Rewrite, Friendly, Professional, Concise, Summary, Key Points, List and Table, then dismisses on Replace. Works in most third-party fields; read-only text gets the result without Replace.

FAQ

When should I use the Contextual Overlay pattern?

Unlike ghost text that just completes at the cursor, a contextual overlay acts on what you selected and shows what each suggestion did — so you stay in the document and decide with one click, not by reflex.

When should I avoid the Contextual Overlay pattern?

The edit needs cross-document context or diff-level review — then a persistent workspace or Select & Transform's reviewable scope beats a surface that disappears.

What problem does Contextual Overlay solve?

Sidebar and modal assistants pull users off the page to re-describe work the model can already see.

Why is chat the wrong fit for this?

A separate chat surface has no anchor to the selection, so every tiny edit becomes a copy-in, copy-out round trip the user has to splice back by hand.

Related patterns

  • Alternative to: Ghost Text Editor — Ephemeral overlay above the cursor vs always-on predictive ghost text.
  • Often paired with: Select & Transform — Both anchor to a selection; overlay surfaces the action menu.
  • Alternative to: Parallel Alternatives — One contextual suggestion at a time vs three side-by-side candidates.

Browse all patterns