Add chat session history with dropdown UI
Implement persistent chat history using a new ChatHistoryManager class. Sessions are saved on view close, restored on open, and selectable via a dropdown in the chat header. Includes delete and clear-all commands, with automatic title generation from the first user message.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { ChatView } from '../src/chat-view';
|
||||
import { PluginSettings, OllamaMessage, ChatMessage, OllamaTool, ToolCall } from '../src/types';
|
||||
import { ErrorHandler } from '../src/error-handler';
|
||||
import { ChatHistoryManager } from '../src/chat-history';
|
||||
|
||||
// Mock Obsidian types
|
||||
interface MockVault {
|
||||
@@ -114,7 +115,14 @@ describe('ChatView', () => {
|
||||
app: mockApp,
|
||||
};
|
||||
|
||||
view = new ChatView(mockLeaf as unknown as any, mockSettings);
|
||||
view = new ChatView(
|
||||
mockLeaf as unknown as any,
|
||||
mockSettings,
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
new ChatHistoryManager()
|
||||
);
|
||||
// Obsidian's contentEl has a createEl helper that standard DOM lacks
|
||||
// Unlike standard DOM, Obsidian elements can create nested elements with createEl
|
||||
const contentDiv = document.createElement('div') as any;
|
||||
|
||||
Reference in New Issue
Block a user