diff --git a/apps/web/src/features/ai/AISessionCards.svelte b/apps/web/src/features/ai/AISessionCards.svelte new file mode 100644 index 0000000..527524a --- /dev/null +++ b/apps/web/src/features/ai/AISessionCards.svelte @@ -0,0 +1,18 @@ + + +
+ {#each sessions as session} + + {/each} +
diff --git a/apps/web/src/features/inbox/InboxPanel.svelte b/apps/web/src/features/inbox/InboxPanel.svelte new file mode 100644 index 0000000..31dfd35 --- /dev/null +++ b/apps/web/src/features/inbox/InboxPanel.svelte @@ -0,0 +1,24 @@ + + +
+ + +
+ + +
+
diff --git a/apps/web/src/features/inbox/SuggestionList.svelte b/apps/web/src/features/inbox/SuggestionList.svelte new file mode 100644 index 0000000..b95f0db --- /dev/null +++ b/apps/web/src/features/inbox/SuggestionList.svelte @@ -0,0 +1,41 @@ + + +
+ {#each suggestions as suggestion, index} + + {/each} + +
diff --git a/apps/web/src/features/inbox/SuggestionList.test.ts b/apps/web/src/features/inbox/SuggestionList.test.ts new file mode 100644 index 0000000..d7ee65a --- /dev/null +++ b/apps/web/src/features/inbox/SuggestionList.test.ts @@ -0,0 +1,25 @@ +import '@testing-library/jest-dom/vitest'; +import { fireEvent, render, screen } from '@testing-library/svelte'; +import { describe, expect, it, vi } from 'vitest'; +import SuggestionList from './SuggestionList.svelte'; + +describe('SuggestionList', () => { + it('requires explicit selection before confirmation', async () => { + const onConfirm = vi.fn(); + render(SuggestionList, { + props: { + suggestions: [{ kind: 'task', title: '跟进报价', body: '联系客户' }], + onConfirm, + }, + }); + + await fireEvent.click(screen.getByText('创建选中项')); + expect(onConfirm).toHaveBeenCalledWith([]); + + await fireEvent.click(screen.getByLabelText('选择 跟进报价')); + await fireEvent.click(screen.getByText('创建选中项')); + expect(onConfirm).toHaveBeenLastCalledWith([ + { kind: 'task', title: '跟进报价', body: '联系客户' }, + ]); + }); +}); diff --git a/apps/web/src/features/notes/MarkdownEditor.svelte b/apps/web/src/features/notes/MarkdownEditor.svelte new file mode 100644 index 0000000..33e26c5 --- /dev/null +++ b/apps/web/src/features/notes/MarkdownEditor.svelte @@ -0,0 +1,12 @@ + + + diff --git a/apps/web/src/features/tasks/TaskList.svelte b/apps/web/src/features/tasks/TaskList.svelte new file mode 100644 index 0000000..9d18323 --- /dev/null +++ b/apps/web/src/features/tasks/TaskList.svelte @@ -0,0 +1,22 @@ + + +
+ {#each tasks as task} +
+ {task.title} + {task.status} + {#if task.assignee} + {task.assignee} + {/if} +
+ {/each} +