From b01011cad20275b713e8b48db65efd4ca2dfbac1 Mon Sep 17 00:00:00 2001 From: Taichi Maeda Date: Sun, 28 Apr 2024 21:37:59 +0900 Subject: [PATCH] Add TODO comments --- src/api/providers/costs.ts | 2 ++ src/chat/App.tsx | 2 ++ src/editor/listener.ts | 3 +++ src/settings/index.ts | 3 +++ 4 files changed, 10 insertions(+) diff --git a/src/api/providers/costs.ts b/src/api/providers/costs.ts index 4e6dadb..a9b6f92 100644 --- a/src/api/providers/costs.ts +++ b/src/api/providers/costs.ts @@ -39,6 +39,8 @@ export class CostsTracker { settings.usage.dailyCosts[today] += cost; settings.usage.monthlyCosts[thisMonth] += cost; + // TODO: + // Only save settings before unload. await this.plugin.saveSettings(); } } diff --git a/src/chat/App.tsx b/src/chat/App.tsx index 1fac1f3..b6edf81 100644 --- a/src/chat/App.tsx +++ b/src/chat/App.tsx @@ -54,6 +54,8 @@ export function App({ // There may be a better way to store chat history, but this works for now. useEffect(() => { settings.chat.history = history; + // TODO: + // Only save settings before unload. plugin.saveSettings(); }, [history]); diff --git a/src/editor/listener.ts b/src/editor/listener.ts index 34f6484..46d1f72 100644 --- a/src/editor/listener.ts +++ b/src/editor/listener.ts @@ -11,6 +11,9 @@ function showCompletions(fetcher: CompletionsFetcher) { return async (update: ViewUpdate) => { const { state, view } = update; + // TODO: + // Stop re-fetching the completions when the suggestions match the typed text. + // If the document has not changed and the head has not moved, keep the completions. const previousHead = lastHead; const currentHead = state.selection.main.head; diff --git a/src/settings/index.ts b/src/settings/index.ts index 725588b..617dfe7 100644 --- a/src/settings/index.ts +++ b/src/settings/index.ts @@ -604,6 +604,9 @@ export class MarkpilotSettingTab extends PluginSettingTab { data[index].cost = cost; } } + // TODO: + // Replace with "Text Colors": + // https://docs.obsidian.md/Reference/CSS+variables/Foundations/Colors#Text+colors // Get the accent color from the theme // using CSS variables provided by Obsidian: // https://docs.obsidian.md/Reference/CSS+variables/Foundations/Colors#Accent+color