From 025b55a5a8fe8e37a67713d3b0bbcfeea0899c5e Mon Sep 17 00:00:00 2001 From: aaravkumar Date: Mon, 2 Jun 2025 10:26:18 -0400 Subject: fixed toggling inline prompting so that /ask works even when inline prompting is disabled --- src/client/views/nodes/formattedText/DailyJournal.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/client/views/nodes/formattedText/DailyJournal.tsx b/src/client/views/nodes/formattedText/DailyJournal.tsx index 269a609ef..fc7290988 100644 --- a/src/client/views/nodes/formattedText/DailyJournal.tsx +++ b/src/client/views/nodes/formattedText/DailyJournal.tsx @@ -175,7 +175,10 @@ export class DailyJournal extends ViewBoxAnnotatableComponent() } this.typingTimeout = setTimeout(() => { - this.insertPredictiveQuestion(); + if (this.inlinePromptsEnabled) { + this.insertPredictiveQuestion(); + } + }, 3500); }; @@ -184,7 +187,7 @@ export class DailyJournal extends ViewBoxAnnotatableComponent() */ @action insertPredictiveQuestion = async () => { - if (!this.inlinePromptsEnabled) return; + // if (!this.inlinePromptsEnabled) return; const editorView = this._ref.current?.EditorView; if (!editorView) return; @@ -224,7 +227,7 @@ export class DailyJournal extends ViewBoxAnnotatableComponent() this.predictiveText = ' ...'; // placeholder const fullTextUpToCursor = state.doc.textBetween(0, state.selection.to, '\n', '\n'); - const gptPrompt = `Given the following incomplete journal entry, generate a single 2-5 word question that continues the user's thought:\n\n"${fullTextUpToCursor}"`; + const gptPrompt = `Given the following incomplete journal entry, generate a single 2-5 word reflective question that continues the user's thought:\n\n"${fullTextUpToCursor}"`; const res = await gptAPICall(gptPrompt, GPTCallType.COMPLETION); if (!res) return; -- cgit v1.2.3-70-g09d2