ngx-prompt-kit

Conversation List

ngx-prompt-kit original — not part of ibelick/prompt-kit

Sidebar of past conversations. Optional date grouping (Today / Yesterday / Last 7 Days / Older), inline rename (an hlmInput), and a hover-revealed spartan dropdown menu.

Examples

Grouped by date

Default mode. Empty buckets are not rendered. Hover or focus a row to reveal the actions menu.

Today

Yesterday

Previous 7 days

Older

Flat list

Set [groupBy]='none' to render conversations in their original order without date headers.

Installation

Add the conversation-list component (and the cn() utility) to your project.

ng generate ngx-prompt-kit:conversation-list

It is built on spartan/ui, so add these helm components too: button, dropdown-menu, input.

ng g @spartan-ng/cli:ui button dropdown-menu input

Component API

PkConversationList

PropTypeDefaultDescription
conversationsreadonly Conversation[] — The conversations to render (required).
groupBy"date" | "none" "date" Bucket items by Today / Yesterday / Last 7 Days / Older, or render flat.
activeIdstring | null null The id of the currently selected conversation.
classstring — Extra classes for the host.

PkConversationItem

PropTypeDefaultDescription
conversationConversation — The conversation to render (required).
isActiveboolean false Highlight as the active row.
classstring — Extra classes for the row.

Outputs (both)

PropTypeDefaultDescription
selected(id: string) => void — Fires when a row is clicked.
renamed({ id, title }) => void — Fires after the inline rename input commits a non-empty, changed value.
deleted(id: string) => void — Fires when the Delete action is chosen.