Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified tools/server/public/index.html.gz
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script lang="ts">
import { RemoveButton } from '$lib/components/app';
import { formatFileSize, getFileTypeLabel, getPreviewText } from '$lib/utils/file-preview';
import { formatFileSize, getFileTypeLabel } from '$lib/utils/file-preview';
import { getPreviewText } from '$lib/utils/text';
import { FileTypeCategory, MimeTypeText } from '$lib/enums/files';

interface Props {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
deleteConversation,
updateConversationName
} from '$lib/stores/chat.svelte';
import { getPreviewText } from '$lib/utils/text';
import ChatSidebarActions from './ChatSidebarActions.svelte';

const sidebar = Sidebar.useSidebar();
Expand All @@ -23,6 +24,9 @@
let showEditDialog = $state(false);
let selectedConversation = $state<DatabaseConversation | null>(null);
let editedName = $state('');
let selectedConversationNamePreview = $derived.by(() =>
selectedConversation ? getPreviewText(selectedConversation.name) : ''
);

let filteredConversations = $derived.by(() => {
if (searchQuery.trim().length > 0) {
Expand Down Expand Up @@ -162,7 +166,7 @@
bind:open={showDeleteDialog}
title="Delete Conversation"
description={selectedConversation
? `Are you sure you want to delete "${selectedConversation.name}"? This action cannot be undone and will permanently remove all messages in this conversation.`
? `Are you sure you want to delete "${selectedConversationNamePreview}"? This action cannot be undone and will permanently remove all messages in this conversation.`
: ''}
confirmText="Delete"
cancelText="Cancel"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,14 @@
background: hsl(var(--muted) / 0.1);
}

/* User message markdown should keep table borders visible on light primary backgrounds */
div.markdown-user-content :global(table),
div.markdown-user-content :global(th),
div.markdown-user-content :global(td),
div.markdown-user-content :global(.table-wrapper) {
border-color: currentColor;
}

/* Horizontal rules */
div :global(hr) {
border: none;
Expand Down Expand Up @@ -639,6 +647,21 @@
background: var(--muted);
}

/* Disable hover effects when rendering user messages */
.markdown-user-content :global(a),
.markdown-user-content :global(a:hover) {
color: var(--primary-foreground);
}

.markdown-user-content :global(table:hover) {
box-shadow: none;
}

.markdown-user-content :global(th:hover),
.markdown-user-content :global(td:hover) {
background: inherit;
}

/* Enhanced blockquotes */
div :global(blockquote) {
transition: all 0.2s ease;
Expand Down
9 changes: 0 additions & 9 deletions tools/server/webui/src/lib/utils/file-preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,3 @@ export function formatFileSize(bytes: number): string {
export function getFileTypeLabel(fileType: string): string {
return fileType.split('/').pop()?.toUpperCase() || 'FILE';
}

/**
* Truncates text content for preview display
* @param content - The text content to truncate
* @returns Truncated content with ellipsis if needed
*/
export function getPreviewText(content: string): string {
return content.length > 150 ? content.substring(0, 150) + '...' : content;
}
7 changes: 7 additions & 0 deletions tools/server/webui/src/lib/utils/text.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* 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;
}