Skip to content

Commit d9fee52

Browse files
committed
refactor: Stories cleanup
1 parent fef2fe1 commit d9fee52

File tree

3 files changed

+11
-88
lines changed

3 files changed

+11
-88
lines changed

tools/server/webui/src/lib/types/database.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,4 @@ export interface DatabaseMessage {
4545
thinking: string;
4646
children: string[];
4747
extra?: DatabaseMessageExtra[];
48-
}
48+
}

tools/server/webui/src/stories/ConversationItem.stories.svelte renamed to tools/server/webui/src/stories/ChatSidebarConversationItem.stories.svelte

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,42 @@
11
<script module lang="ts">
22
import { defineMeta } from '@storybook/addon-svelte-csf';
3-
import { ChatConversationsItem } from '$lib/components';
4-
import type { Conversation } from '$lib/types/conversation';
3+
import { ChatSidebarConversationItem } from '$lib/components';
4+
import type { DatabaseConversation } from '$lib/types/database';
55
66
const { Story } = defineMeta({
7-
title: 'Components/ChatSidebar/ChatConversationItem',
8-
component: ChatConversationsItem,
7+
title: 'Components/ChatSidebar/ChatSidebarConversationItem',
8+
component: ChatSidebarConversationItem,
99
parameters: {
1010
layout: 'centered'
1111
}
1212
});
1313
14-
const sampleConversation: Conversation = {
14+
const sampleConversation: DatabaseConversation = {
1515
id: '1',
1616
name: 'Hello World Chat',
1717
lastModified: Date.now() - 1000 * 60 * 5, // 5 minutes ago
18-
messageCount: 12
18+
currNode: null,
1919
};
2020
21-
const longNameConversation: Conversation = {
21+
const longNameConversation: DatabaseConversation = {
2222
id: '2',
2323
name: 'This is a very long conversation name that should be truncated when displayed in the sidebar',
2424
lastModified: Date.now() - 1000 * 60 * 60 * 2, // 2 hours ago
25-
messageCount: 24
25+
currNode: null,
2626
};
2727
28-
const recentConversation: Conversation = {
28+
const recentConversation: DatabaseConversation = {
2929
id: '3',
3030
name: 'Recent Chat',
3131
lastModified: Date.now() - 1000 * 30, // 30 seconds ago
32-
messageCount: 3
32+
currNode: null,
3333
};
3434
</script>
3535

3636
<Story
3737
name="Default"
3838
args={{
3939
conversation: sampleConversation,
40-
class: 'w-80'
4140
}}
4241
/>
4342

@@ -46,31 +45,27 @@
4645
args={{
4746
conversation: sampleConversation,
4847
isActive: true,
49-
class: 'w-80'
5048
}}
5149
/>
5250

5351
<Story
5452
name="LongName"
5553
args={{
5654
conversation: longNameConversation,
57-
class: 'w-80'
5855
}}
5956
/>
6057

6158
<Story
6259
name="Recent"
6360
args={{
6461
conversation: recentConversation,
65-
class: 'w-80'
6662
}}
6763
/>
6864

6965
<Story
7066
name="WithActions"
7167
args={{
7268
conversation: sampleConversation,
73-
class: 'w-80',
7469
onSelect: (id: string) => console.log('Selected:', id),
7570
onEdit: (id: string) => console.log('Edit:', id),
7671
onDelete: (id: string) => console.log('Delete:', id)

tools/server/webui/src/stories/ConversationList.stories.svelte

Lines changed: 0 additions & 72 deletions
This file was deleted.

0 commit comments

Comments
 (0)