logancyang_obsidian-copilot/src/components/NoteTitleModal.tsx
Logan Yang e0af6d9fbf
Introduce Copilot Plus Alpha to testers (#835)
- Implement Copilot Plus mode
- Use broca endpoint and add license key setting
- Implement context menu for Plus mode
- Implement url mention
- Implement cmd shift enter for vault search
- Handle embedding model change at note reindex
- Implement image support in chat
- Fix vault qa and remove relevance threshold score
- Implement brevilabs client, reranker when max score from orama is low
- Implement chat history to plus mode
- Pass only original user message for intent analysis and processing
- Implement pdf in chat context
- Implement web search
- Implement youtube tool
- Enable index on mode switch for copilot plus mode
2024-11-21 17:36:52 -08:00

27 lines
841 B
TypeScript

import { App } from "obsidian";
import { BaseNoteModal } from "./BaseNoteModal";
export class NoteTitleModal extends BaseNoteModal<string> {
private onChooseNoteTitle: (noteTitle: string) => void;
constructor(app: App, noteTitles: string[], onChooseNoteTitle: (noteTitle: string) => void) {
super(app);
this.onChooseNoteTitle = onChooseNoteTitle;
this.availableNotes = this.getOrderedNotes()
.filter((file) => file.extension === "md")
.map((file) => file.basename);
}
getItems(): string[] {
return this.availableNotes;
}
getItemText(noteTitle: string): string {
const isActive = noteTitle === this.activeNote?.basename;
return this.formatNoteTitle(noteTitle, isActive);
}
onChooseItem(noteTitle: string, evt: MouseEvent | KeyboardEvent) {
this.onChooseNoteTitle(noteTitle);
}
}