Agent handoff

A marker that work passed from one agent, or person, to another: "Research agent handed off to Writer". A row with both avatars, or a centred rule like a date divider.

Agent handoff

No script. The server renders who, why and when; a re-render changes the status. The summary of what was handed over is a native disclosure.

Use it

In a chat or a run, as a row:

<x-ds::agent-handoff
    :from="['name' => 'Research agent']"
    :to="['name' => 'Maya Patel', 'kind' => 'human', 'src' => $maya->avatar_url]"
    reason="A refund over £500 needs a person"
    :summary="$handoff->notes"
    :time="$handoff->created_at"
    timeFormat="relative"
    status="waiting"
>
    <x-slot:actions>
        <x-ds::button size="sm" wire:click="takeOver">Take over</x-ds::button>
    </x-slot:actions>
</x-ds::agent-handoff>

Between two stretches of a conversation, as a divider:

<x-ds::agent-handoff variant="divider" from="Research agent" to="Writer" time="10:02" />

Inside an agent timeline, as the body of a handoff row:

<x-ds::agent-timeline-item type="handoff" title="Handed over" :time="$step->at">
    <x-ds::agent-handoff from="Support agent" to="Billing agent" :reason="$step->reason" />
</x-ds::agent-timeline-item>

Props

PropTypeDefaultWhat it does
from, tostring or array—A name, or ['name', 'src', 'initials', 'kind' => 'agent' | 'human']. An agent is drawn square, a person round.
reasonstring—Why, in a line.
summarystring—What was passed along, folded under "What was handed over". A summary slot takes markup. The row only.
timedate, ISO 8601 string or words—As timeline item's.
datetimestring—For a time in words, the machine-readable moment.
timeFormatrelative or a PHP formatthe locale's
statusthe agent status set—waiting: for a person to take over. Left out, none is shown.
variantrow dividerrow
textstring:from handed off to :toThe sentence.
summaryLabelstringWhat was handed over
statusTextarray—[status => words], replacing any of the English.
SlotWhat it does
actionsAccept, Take over: your buttons, wired by you.
summaryThe summary as markup.

Accessibility

  • The sentence carries everything; the avatars and the arrow are a picture of it and are hidden from assistive technology.
  • The status is a mark and its word, never colour alone.
  • The divider is text between two lines, not a separator, so it is read.

Don't

  • Don't use a divider for a handoff someone must act on. A row has room for the reason and the actions.

From the package repo: edit this page on GitHub.

Was this page helpful?