<!-- GENERATED by scripts/build-llms.mjs from llms/conversation.md — do not edit this file. -->

# `lr-prompt-queue`

- **Import** `import '@aceshooting/lyra-ui/components/lr-prompt-queue.js';` (stable tag alias; registers the tag)
- **Class** `LyraPromptQueue`, also available unregistered from `@aceshooting/lyra-ui/components/conversation/prompt-queue/prompt-queue.class.js`
- **Family** `components/conversation/` — see `llms/index.md` for its siblings
- **Status** `stable` since `7.0.0` — see the maturity and deprecation policy in `llms/shared.md`
- **Release history** [CHANGELOG.md](../../CHANGELOG.md); family-wide breaking-change summaries: [llms-full.txt](../../llms-full.txt)
- **Deprecations** none
- **Optional peers** none
- **Themeable via** 11 parts, 0 custom properties — see this component's own `@csspart`/`@cssprop` list below
- **Library-wide behavior** (events, form association, `locale`/`strings`, tokens, TS types): `llms/shared.md`

---

## `lr-prompt-queue`

Controlled editable queue of follow-up turns. Reordering, editing, and removal emit a complete
proposed queue; send-now emits the complete selected item.

When a focused row action requests removal and the host applies the proposed queue, focus moves to
the equivalent action on the nearest surviving row. If the queue becomes empty, its stable region
receives focus. Removing an unfocused row does not move focus.

**Properties:** `items: readonly PromptQueueItem[] = []` (attribute: false); `editable: boolean = true`
(reflected, string-aware true-default converter); `disabled: boolean = false` (reflected);
`label: string = ''`; `accessibleLabel: string | null = null` (attribute `aria-label`).
`PromptQueueItem = { id: string; value: string; attachments?: readonly DocumentRef[]; createdAt?: number;
metadata?: Record<string, unknown> }`.

Item ids are occurrence identities. Empty ids and later duplicates are ignored before rendering or
proposing a mutation, preserving one unambiguous `itemId`. Attachment names render visibly for both
editable and read-only rows; the host `label` is also the visible queue heading.

Supported item and attachment fields are read once when `items` is assigned; create and reassign a
new collection after changes, because changing an assigned record or reassigning the same mutated
array does not update the view. Rows or attachments without valid direct data are ignored. Duplicate IDs are resolved
after validation, so the first valid item wins. `metadata` is opaque and retains identity in
proposed queue/send-now payloads, while emitted items are new frozen snapshots.

**Events:** `lr-queue-change` (`PromptQueueChangeDetail = { items, reason, itemId }`, with
`reason: 'edit' | 'remove' | 'reorder'`), `lr-send-now` (`{ item }`). The queue is controlled:
these events propose complete next values without mutating `items`.

**CSS parts:** `base`, `heading`, `list`, `item`, `value`, `editor`, `attachments`, `attachment`,
`actions`, `action`, `empty`.

**Slots:** none. **Optional peer deps:** none.

```ts
import "@aceshooting/lyra-ui/components/conversation/prompt-queue/prompt-queue.js";
```
