Lab

Assistant

Slant / Components

A chat with an assistant: its reasoning shimmers while it thinks, then folds away as the answer lands. Some answers ask to run a command or ask questions first, and `@` and `/` open menus as you type.

The theme follows the link: share a page with ?theme=moon.

Usage

  • A Thread of Messages over a PromptInput, whose toolbar holds PromptInput.Attach and a PromptInput.Models menu (Fast, Balanced, Deep).
  • Each answer opens with a Reasoning that thinks for about a second, then folds itself and says how long it took. Some answers carry a CodeBlock or a Sources list of Slant docs pages; each has copy, retry and rate under it.
  • While a reply is on its way, Send turns into Stop, which cancels it. Retry writes the latest answer again in place; stopping a retry keeps the answer it was replacing.
  • One answer asks to run a command through an AgentApproval inside its Message. Allow once runs it as an AgentTask whose nested subtasks finish after a moment; Allow always does the same and lets later commands run without asking; Reject leaves a Marker ("Command rejected").
  • Another asks two AgentQuestions, one choice recommended and an Other field for your own words. Sent, they turn into a summary, and the next answer is built from them: it asks to run the tests they describe.
  • The PromptInput has triggers: @ mentions a person or a file as a chip, which the answer names, and / at the start picks /review, /test or /explain, whose answers come out of turn.
  • An answer whose request you answered keeps it, so it has no Retry. Switching model leaves a Marker ("Switched to Deep"). Attached files are listed above the field and on the sent message, never uploaded.

Keyboard

Entersends the draft
Shift + Enteradds a line; the field grows to five lines, then scrolls
@ or /opens the mention or the command menu while the field keeps focus; `/` only at the start of the draft
↑ / ↓moves through the open mention or command menu, or between the models in the open model menu
Enter / Tabin an open mention or command menu, picks the active choice (Enter sends nothing then)
Escapein the field, closes an open mention or command menu, else stops a reply on its way
Enterin an approval card, anywhere but a button, allows the command once
Escapein an approval card, rejects the command
↑ / ↓ / ← / →moves between a question's choices
Enterin a question's Other field, sends the answers
Tabreaches the toggles, the copy, retry and rate buttons, the cards' buttons and choices, and the composer's controls
Enter / Spaceopens a toggle or presses a button

Accessibility

  • The thread is a polite log, so answers and markers are read as they arrive.
  • The reasoning and sources toggles are buttons with aria-expanded; when thinking ends, how long it took is announced.
  • Copy, Retry and the rate buttons are named icon buttons in a group named "Message actions"; the rate buttons are toggles with aria-pressed.
  • Send and Stop are one button, so focus stays on it as it changes; after Stop or Retry, focus goes to the field.
  • The approval card is a group named by its title, with the command in a scrollable "Request details" group. The decision replaces the buttons and is announced, and focus on a pressed button moves to the card.
  • The task reads its status after its title and announces when it is done; its subtasks are a nested list under a toggle that counts them.
  • Each question is a radio group named by the question; the Recommended badge is part of its choice's name. Missing answers show under their question, are announced, and the first one takes focus; once sent, focus moves to the summary and "Answers sent" is announced.
  • While a mention or command menu is open, the field points at it with aria-controls and aria-activedescendant; the number of matches and each chip added are announced.

Assistant in React and SwiftUI.

Source

The React tab is the component’s real source; the SwiftUI tab is its twin in TUTTNKit.