Calm motion: animations on this site only fade, with no movement
Chat history
Past chats in groups by age, with search, rename, and delete
Shows the past chats with an assistant, for a sidebar. The newest chat is at the top, and the chats are in groups: today, yesterday, the last 7 days, the last 30 days, and older. For a list of links of a site, use the sidebar navigation.
Basic
chatsis a list of chats. Each chat has anid, atitle, and thetimeof its last message.v-model:selectedis the id of the open chat. It has a bar at its start and bold words. A click on a chat sets it and emitsselect.- The search box filters the chats by title.
:search="false"hides it. - The rename button changes the title to a field. Enter or a click outside emits
renamewith the id and the new title, and Escape cancels. The delete button emitsremovewith the id. If these events come in, change your list. - The rename and delete buttons show on hover and on focus. On a touch screen, they show all the time.
- The server does not know the day of the reader, so the groups show after the page loads.
nowsets a fixed "now", for example in a test. - The list is a navigation landmark. Change the words with
labelsor a label pack:title,search,none,today,yesterday,week,month,older,rename, andremove.
Usage
ts
import { BlessChatHistory } from "blessing-ui";API
Props
| Name | Type | Default | Description |
|---|---|---|---|
chats* | BlessChat[] | — | |
search | boolean | true | show a search box over the list |
now | number | Date | — | a fixed "now" for the groups |
labels | Partial<{ title: string; search: string; none: string; today: string; yesterday: string; week: string; month: string; older: string; rename: string; remove: string; }> | — | |
selected | string | number | — | the id of the open chat |
Events
| Name | Payload | Description |
|---|---|---|
select | [id: string | number] | |
remove | [id: string | number] | |
update:selected | [value: string | number | undefined] | |
rename | [id: string | number, title: string] |