Conversation
Limits chat context to 6 user-model message pairs
Feature/gemini chat bot
khushita28
left a comment
There was a problem hiding this comment.
Overall, the codebase looks solid and well-structured. Recent changes improved formatting consistency, removed redundant imports, and added useful UI components like the Gemini chatbot. A few minor style issues remain (e.g., duplicate useCookies imports, inconsistent comment styles), but nothing critical. Great job keeping things readable and organized!
There was a problem hiding this comment.
Nice use of CSS variables here — defining them under :root makes it easy to manage and update theme colors consistently across the app. Also noticing you’ve commented out the overflow styles — was that for debugging or design flexibility? Just checking if that’s intentional.
There was a problem hiding this comment.
I had commented out the overflow styles for debugging and forgot to change them back 😅
| @@ -3,7 +3,10 @@ let information; | |||
|
|
|||
| type SetPermissionLevelType<T> = (a: any, b?: any) => Promise<T>; | |||
|
|
|||
There was a problem hiding this comment.
This looks good overall and the structure is clear. One thing — we're using any in a few places, which kind of defeats the purpose of TypeScript. Might be worth tightening up the types for cookies, removeCookie, and the return value. Also, removeCookie is marked as optional in the type but seems required and maybe good to align that too.
| @@ -0,0 +1,161 @@ | |||
| import React, { useState, FormEvent, useRef, useEffect } from "react"; | |||
There was a problem hiding this comment.
we’re calling setChatHistory() before trimming the history, so it stores the full list even if it exceeds MAX_HISTORY_LENGTH. Should we apply the trim before saving to localStorage?
There was a problem hiding this comment.
The idea behind this was to give the user the illusion that nothing is being trimmed, and to rely on Gemini to maintain coherence with the limited context. We can change it if it doesn’t work well. I’d love to hear your thoughts on this.
There was a problem hiding this comment.
A few things to clean up:
- There are a bunch of duplicate imports and repeated logic blocks (maybe leftover from merging or refactoring?). Trimming those down will help with readability.
- Looks like
lessonEndFENis declared but never assigned — might want to double-check if it's used as intended. - Also noticed multiple blocks for the same popups (like success/fail/loading) — could be nice to refactor those into separate components later.
Otherwise, really solid logic overall.
| @@ -1,32 +1,32 @@ | |||
| import React, {useState} from "react"; | |||
There was a problem hiding this comment.
There are duplicate imports and variables — probably leftover from edits.
- The
<input>is controlled but missing anonChange, which will throw a React warning.
| @@ -1,8 +1,8 @@ | |||
| import { environment } from '../../environments/environment'; | |||
There was a problem hiding this comment.
Minor formatting improvements and callback indentation look good. No logic changes just cleaner structure.
There was a problem hiding this comment.
This refactor improves formatting consistency and readability throughout the component. Line spacing, indentation, and quote usage are now standardized. Also nice to see minor bugs removed and tab content more clearly structured. No functional changes — looks clean overall.
No description provided.