From 35033f3f4266d4d5d11a2ea102a90280de1ab075 Mon Sep 17 00:00:00 2001 From: Alina086 Date: Wed, 25 Jun 2025 15:43:14 -0400 Subject: [PATCH] logging any editor document change for keystroke level analysis --- frontend/src/editor/editor.tsx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/frontend/src/editor/editor.tsx b/frontend/src/editor/editor.tsx index 6933aa41..5150a0e0 100644 --- a/frontend/src/editor/editor.tsx +++ b/frontend/src/editor/editor.tsx @@ -17,6 +17,10 @@ import { HistoryPlugin } from '@lexical/react/LexicalHistoryPlugin'; import { OnChangePlugin } from '@lexical/react/LexicalOnChangePlugin'; import classes from './editor.module.css'; +import { log } from '@/api'; +import { overallModeAtom, pageNameAtom } from '@/contexts/pageContext'; +import { useAtomValue } from 'jotai'; +import { usernameAtom } from '@/contexts/userContext'; function $getDocContext(): DocContext { @@ -157,6 +161,10 @@ function LexicalEditor({ storageKey?: string; taskPrompt?: string; }) { + const mode = useAtomValue(overallModeAtom); + const page = useAtomValue(pageNameAtom); + const username = useAtomValue(usernameAtom); + return ( <>