LibreChat
LibreChat copied to clipboard
Added Settings Modal
Pull Request Description: Adding a Settings Modal to the ChatGPT UI
This Pull Request introduces a significant enhancement to the ChatGPT clone by incorporating a new Settings Modal. The purpose of this update is to provide users with more control and customization options, ensuring a tailored conversational experience.
Key Changes:
-
Settings Modal Integration: I have added a fully functional Settings Modal to the ChatGPT UI, enabling users to personalize their interactions with the AI model. This modal acts as a central hub for various customizable options.
-
Playwright Testing: I have thoroughly tested the new feature using Playwright, an end-to-end testing framework. This approach ensures comprehensive testing of the feature's functionality, interactions, and visual components. Throughout the Playwright testing process, no issues or errors were encountered, indicating a stable and error-free implementation.
-
UI Consistency: To maintain visual coherence and align with the existing ChatGPT UI, I have replaced the constant background color values (e.g., bg-[#...]) with colors from the Tailwind CSS library. This change ensures a consistent and standardized color scheme throughout the application.
-
Selected Endpoint Styling: As part of this Pull Request, I have added a selected background color to indicate when an endpoint is selected. This visual cue enhances the usability of the UI and provides clear feedback to the user.
-
Endpoint Spacing: In order to improve readability and visual separation between endpoints, I have introduced spacing between them. This change helps users distinguish between different endpoints more easily.
These modifications enhance the ChatGPT clone's versatility and user-friendliness, empowering users to customize their conversations and adapt the AI model to their specific needs. By integrating the Settings Modal, we aim to provide a more immersive and personalized conversational experience.
I am confident that this Pull Request, with Playwright testing and other improvements, will positively impact the overall user satisfaction and make the ChatGPT clone an even more powerful tool for various applications.
@danny-avila I have added a description and I'm working on unit tests
You changed 17 files and I only see tests for 2 files.
Please make one for client/src/components/Conversations/Conversation.jsx client/src/components/Input/NewConversationMenu/ client/src/components/Messages/Message.jsx client/src/components/ui/DialogTemplate.jsx
You changed 17 files and I only see tests for 2 files.
Please make one for client/src/components/Conversations/Conversation.jsx client/src/components/Input/NewConversationMenu/ client/src/components/Messages/Message.jsx client/src/components/ui/DialogTemplate.jsx
Tests are not required for all of the files except NewConversationMenu which was done in the latest commit.
@danny-avila Any updates?
@danny-avila Any updates?
Sorry for the delay. I'm testing now
Some of your tests are failing.
Test timeout of 30000ms exceeded.
Error: locator.click: Target closed
=========================== logs ===========================
waiting for getByText('Settings')
============================================================
23 | await page.goto('http://localhost:3080/');
24 | await page.locator('[id="headlessui-menu-button-\\:r0\\:"]').click();
> 25 | await page.getByText('Settings').click();
| ^
26 |
27 | const modal = await page.getByRole('dialog', { name: 'Settings' }).isVisible();
28 | expect(modal).toBeTruthy();
at C:\Users\Daniela\Documents\data\chatgpt-clone\e2e\specs\nav.spec.js:25:38
Error: expect(received).toBeGreaterThan(expected)
Expected: > 14
Received: 14
48 | let afterAdding = (await getItems()).length;
49 |
> 50 | expect(afterAdding).toBeGreaterThan(beforeAdding);
| ^
51 | });
52 | });
53 |
at C:\Users\Daniela\Documents\data\chatgpt-clone\e2e\specs\landing.spec.js:50:25
Error: expect(received).toContain(expected) // indexOf
Expected substring: "active"
Received string: "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm font-medium outline-none focus:bg-slate-100 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-gray-900 group dark:font-semibold dark:text-gray-100 dark:hover:bg-gray-800"
20 | await page.getByRole('button', { name: 'New Topic' }).click();
21 | // Check if the active class is set on the selected endpoint
> 22 | expect(await endpointItem.getAttribute('class')).toContain('active');
| ^
23 | });
24 | });
25 |
at C:\Users\Daniela\Documents\data\chatgpt-clone\e2e\specs\popup.spec.js:22:54
Instead of using getByText use getByTestId, and you may need to add a test id to the react element
Thanks for writing tests!