Skip to content

feat: add prompt input mentions and slash commands#448

Open
Rana-Faraz wants to merge 1 commit into
vercel:mainfrom
Rana-Faraz:agent/prompt-input-suggestions
Open

feat: add prompt input mentions and slash commands#448
Rana-Faraz wants to merge 1 commit into
vercel:mainfrom
Rana-Faraz:agent/prompt-input-suggestions

Conversation

@Rana-Faraz

Copy link
Copy Markdown

Summary

Adds a composable, dependency-free suggestion layer to PromptInput for @ mentions and / commands while preserving its textarea and plain-text submission behavior.

Demo

Prompt input showing file mention suggestions after typing @ Prompt input showing slash command suggestions after typing /
@ file mentions / slash commands

What changed

  • Adds PromptInputSuggestions, PromptInputSuggestionContent, PromptInputSuggestionItem, and PromptInputSuggestionEmpty as opt-in composition primitives.
  • Exposes usePromptInputSuggestions plus trigger-boundary controls through allowedPrefixes, line position, spaces, and query length.
  • Supports controlled and uncontrolled inputs, provider-backed forms, IME composition, mid-string replacement, custom insertion, and action-only items.
  • Implements combobox/listbox semantics and keyboard navigation with Arrow Up/Down, Enter, Tab, and Escape.
  • Documents the API with live mention and command examples, focused tests, and regenerated AI Elements skill artifacts.
  • Adds a patch changeset for the new public API.

Why this approach

This addresses the suggestion discovery and plain-text insertion portion of #179 without adding a rich-editor dependency or changing the existing copy/paste and submission contract. It is complementary to the richer editor direction in #403: consumers can opt into suggestions today while keeping values as plain text.

Validation

  • pnpm build --filter ai-elements --filter docs — passed; 194 static pages generated.
  • pnpm test — passed; 46 files and 966 tests.
  • pnpm generate-skills — passed; 48 references and 80 examples generated.
  • Live docs verified in Chromium for both triggers, keyboard selection, and rendering.
  • Changed TSX files pass Oxlint; git diff origin/main...HEAD --check passes.

Notes

@vercel

vercel Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

@Rana-Faraz is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant