aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/formattedText/DailyJournal.tsx
diff options
context:
space:
mode:
authoraaravkumar <aarav.kumar1510@gmail.com>2025-06-02 10:26:18 -0400
committeraaravkumar <aarav.kumar1510@gmail.com>2025-06-02 10:26:18 -0400
commit025b55a5a8fe8e37a67713d3b0bbcfeea0899c5e (patch)
treeef13b0066f0b9459479c24cf707c6b38600d556b /src/client/views/nodes/formattedText/DailyJournal.tsx
parent0dc1d055d1b278cf174dd40591a343b0e478db44 (diff)
fixed toggling inline prompting so that /ask works even when inline prompting is disabled
Diffstat (limited to 'src/client/views/nodes/formattedText/DailyJournal.tsx')
-rw-r--r--src/client/views/nodes/formattedText/DailyJournal.tsx9
1 files changed, 6 insertions, 3 deletions
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<FieldViewProps>()
}
this.typingTimeout = setTimeout(() => {
- this.insertPredictiveQuestion();
+ if (this.inlinePromptsEnabled) {
+ this.insertPredictiveQuestion();
+ }
+
}, 3500);
};
@@ -184,7 +187,7 @@ export class DailyJournal extends ViewBoxAnnotatableComponent<FieldViewProps>()
*/
@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<FieldViewProps>()
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;