* webui: limit conversation name length in dialogs * webui: fix unreadable colors on links and table cell hover in user markdown * webui: keep table borders visible in user markdown * webui: updating unified exports * Update tools/server/webui/src/lib/components/app/chat/ChatAttachments/ChatAttachmentThumbnailFile.svelte Co-authored-by: Aleksander Grygier <aleksander.grygier@gmail.com> * chore: update webui build output * chore: update webui build output * chore: update webui build output --------- Co-authored-by: Aleksander Grygier <aleksander.grygier@gmail.com>
7 lines
295 B
TypeScript
7 lines
295 B
TypeScript
/**
|
|
* Returns a shortened preview of the provided content capped at the given length.
|
|
* Appends an ellipsis when the content exceeds the maximum.
|
|
*/
|
|
export function getPreviewText(content: string, max = 150): string {
|
|
return content.length > max ? content.slice(0, max) + '...' : content;
|
|
}
|