Skip to content

Gemini Chat Bot#50

Open
Pedram-Karimi wants to merge 15 commits intoYSTEMandChess:mainfrom
Pedram-Karimi:feature/geminiChatBot
Open

Gemini Chat Bot#50
Pedram-Karimi wants to merge 15 commits intoYSTEMandChess:mainfrom
Pedram-Karimi:feature/geminiChatBot

Conversation

@Pedram-Karimi
Copy link
Collaborator

No description provided.

Copy link

@khushita28 khushita28 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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!

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 lessonEndFEN is 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";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are duplicate imports and variables — probably leftover from edits.

  • The <input> is controlled but missing an onChange, which will throw a React warning.

@@ -1,8 +1,8 @@
import { environment } from '../../environments/environment';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor formatting improvements and callback indentation look good. No logic changes just cleaner structure.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants