refactor: Components
This commit is contained in:
parent
579c2892df
commit
033af9f648
|
|
@ -14,9 +14,9 @@
|
||||||
import {
|
import {
|
||||||
ChatSettingsFooter,
|
ChatSettingsFooter,
|
||||||
ChatSettingsImportExportTab,
|
ChatSettingsImportExportTab,
|
||||||
ChatSettingsFields
|
ChatSettingsFields,
|
||||||
|
McpLogo
|
||||||
} from '$lib/components/app';
|
} from '$lib/components/app';
|
||||||
import McpLogo from '$lib/components/app/mcp/McpLogo.svelte';
|
|
||||||
import { ScrollArea } from '$lib/components/ui/scroll-area';
|
import { ScrollArea } from '$lib/components/ui/scroll-area';
|
||||||
import { config, settingsStore } from '$lib/stores/settings.svelte';
|
import { config, settingsStore } from '$lib/stores/settings.svelte';
|
||||||
import { setMode } from 'mode-watcher';
|
import { setMode } from 'mode-watcher';
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,10 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Download, Upload, Trash2 } from '@lucide/svelte';
|
import { Download, Upload, Trash2 } from '@lucide/svelte';
|
||||||
import { Button } from '$lib/components/ui/button';
|
import { Button } from '$lib/components/ui/button';
|
||||||
import { DialogConversationSelection } from '$lib/components/app';
|
import { DialogConversationSelection, DialogConfirmation } from '$lib/components/app';
|
||||||
import { createMessageCountMap } from '$lib/utils';
|
import { createMessageCountMap } from '$lib/utils';
|
||||||
import { conversationsStore, conversations } from '$lib/stores/conversations.svelte';
|
import { conversationsStore, conversations } from '$lib/stores/conversations.svelte';
|
||||||
import { toast } from 'svelte-sonner';
|
import { toast } from 'svelte-sonner';
|
||||||
import DialogConfirmation from '$lib/components/app/dialogs/DialogConfirmation.svelte';
|
|
||||||
|
|
||||||
let exportedConversations = $state<DatabaseConversation[]>([]);
|
let exportedConversations = $state<DatabaseConversation[]>([]);
|
||||||
let importedConversations = $state<DatabaseConversation[]>([]);
|
let importedConversations = $state<DatabaseConversation[]>([]);
|
||||||
|
|
|
||||||
|
|
@ -459,6 +459,29 @@ export { default as ChatMessageMcpPromptContent } from './ChatMessages/ChatMessa
|
||||||
*/
|
*/
|
||||||
export { default as ChatMessageSystem } from './ChatMessages/ChatMessageSystem.svelte';
|
export { default as ChatMessageSystem } from './ChatMessages/ChatMessageSystem.svelte';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* User message display component. Renders user messages with right-aligned bubble styling.
|
||||||
|
* Shows message content, attachments via ChatAttachmentsList, and MCP prompts if present.
|
||||||
|
* Supports inline editing mode with ChatMessageEditForm integration.
|
||||||
|
*/
|
||||||
|
export { default as ChatMessageUser } from './ChatMessages/ChatMessageUser.svelte';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Assistant message display component. Renders assistant responses with left-aligned styling.
|
||||||
|
* Supports both plain markdown content (via MarkdownContent) and agentic content with tool calls
|
||||||
|
* (via ChatMessageAgenticContent). Shows model info badge, statistics, and action buttons.
|
||||||
|
* Handles streaming state with real-time content updates.
|
||||||
|
*/
|
||||||
|
export { default as ChatMessageAssistant } from './ChatMessages/ChatMessageAssistant.svelte';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Inline message editing form. Provides textarea for editing message content with
|
||||||
|
* attachment management. Shows save/cancel buttons and optional "Save only" button
|
||||||
|
* for editing without regenerating responses. Used within ChatMessage components
|
||||||
|
* when user enters edit mode.
|
||||||
|
*/
|
||||||
|
export { default as ChatMessageEditForm } from './ChatMessages/ChatMessageEditForm.svelte';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* SCREEN
|
* SCREEN
|
||||||
|
|
@ -524,6 +547,13 @@ export { default as ChatMessageSystem } from './ChatMessages/ChatMessageSystem.s
|
||||||
*/
|
*/
|
||||||
export { default as ChatScreen } from './ChatScreen/ChatScreen.svelte';
|
export { default as ChatScreen } from './ChatScreen/ChatScreen.svelte';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Visual overlay displayed when user drags files over the chat screen.
|
||||||
|
* Shows drop zone indicator to guide users where to release files.
|
||||||
|
* Integrated with ChatScreen's drag-drop file upload handling.
|
||||||
|
*/
|
||||||
|
export { default as ChatScreenDragOverlay } from './ChatScreen/ChatScreenDragOverlay.svelte';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Chat form wrapper within ChatScreen. Positions the ChatForm component at the
|
* Chat form wrapper within ChatScreen. Positions the ChatForm component at the
|
||||||
* bottom of the screen with proper padding and max-width constraints. Handles
|
* bottom of the screen with proper padding and max-width constraints. Handles
|
||||||
|
|
@ -699,6 +729,13 @@ export { default as ChatSettingsParameterSourceIndicator } from './ChatSettings/
|
||||||
*/
|
*/
|
||||||
export { default as ChatSidebar } from './ChatSidebar/ChatSidebar.svelte';
|
export { default as ChatSidebar } from './ChatSidebar/ChatSidebar.svelte';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Action buttons for sidebar header. Contains new chat button, settings button,
|
||||||
|
* and delete all conversations button. Manages dialog states for settings and
|
||||||
|
* delete confirmation.
|
||||||
|
*/
|
||||||
|
export { default as ChatSidebarActions } from './ChatSidebar/ChatSidebarActions.svelte';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Single conversation item in sidebar. Displays conversation title (truncated),
|
* Single conversation item in sidebar. Displays conversation title (truncated),
|
||||||
* last message preview, and timestamp. Shows context menu on right-click with
|
* last message preview, and timestamp. Shows context menu on right-click with
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { X } from '@lucide/svelte';
|
import { X } from '@lucide/svelte';
|
||||||
import { Button } from '$lib/components/ui/button';
|
import { Button } from '$lib/components/ui/button';
|
||||||
import McpServerForm from '$lib/components/app/mcp/McpServerForm.svelte';
|
import { McpServerForm } from '$lib/components/app/mcp';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
serverId: string;
|
serverId: string;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue