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 an empty line → AI command menu overlay. Or select text → in-place AI overlay. Both ephemeral, both anchored to context.
  • GitHub Copilot Inline Chat (GitHub) — Cmd+I / Ctrl+I opens an ephemeral chat prompt directly in the editor at the cursor. Distinct from Tab completion — a different UX move in the same product.
  • Apple Intelligence Writing Tools (Apple) — Selection-triggered floating menu that appears in any text field across macOS / iOS and disappears after action. Strongest OS-level example.

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