Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Settings Modal #342

Merged
merged 48 commits into from
Jun 2, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
af28fe8
Improve UI with style changes and add Settings button
techwithanirudh May 20, 2023
0706283
Revert not needed changes
techwithanirudh May 20, 2023
52a8a98
Updated style.css to only work for select
techwithanirudh May 20, 2023
eff8387
feat: Remove Dark Mode component and add theme selection feature
techwithanirudh May 20, 2023
2797887
Add auto theme setting to Settings component.
techwithanirudh May 20, 2023
e8d6ffb
Improve user experience by allowing customized themes
techwithanirudh May 20, 2023
489b48e
feat(Nav): Add SVG icon to settings gear
techwithanirudh May 20, 2023
eb1a85c
Merge branch 'main' into settings
techwithanirudh May 21, 2023
7ef00b4
Merge branch 'settings' of https://github.com/techwithanirudh/chatgpt…
techwithanirudh May 21, 2023
fd1f0d0
refactor(ui): Update overlay background color
techwithanirudh May 21, 2023
6b63fdf
Refactor ThemeContext to include system theme and fix bug in Settings
techwithanirudh May 21, 2023
8f83249
Refactor DialogTemplate styles and color scheme
techwithanirudh May 21, 2023
425f33d
Refactor: Change button logic to require confirmation before clearing…
techwithanirudh May 22, 2023
234fe41
Merge branch 'main' into settings
techwithanirudh May 22, 2023
0a6e314
Merge branch 'settings' of https://github.com/techwithanirudh/chatgpt…
techwithanirudh May 22, 2023
c72ff50
Refactor component name to reflect functionality change.
techwithanirudh May 22, 2023
8919a3a
Refactor conversation clearing functionality in `Settings.jsx`
techwithanirudh May 22, 2023
5575df1
Refactor Input component UI styles
techwithanirudh May 22, 2023
0156b9f
feat: Add e2e test for Settings modal
techwithanirudh May 22, 2023
753a02f
test: Add Navigation and Settings tests
techwithanirudh May 22, 2023
00d9d3c
Quick fix
techwithanirudh May 22, 2023
cbdeec4
feat(navbar): Add confirmation before clearing conversations
techwithanirudh May 22, 2023
f98a556
Add click functionality to the navigation bar and improve UI design
techwithanirudh May 22, 2023
f0890ad
test: Add test for dark mode theme change
techwithanirudh May 22, 2023
c1101bd
Improve navigation test clarity
techwithanirudh May 22, 2023
b786356
Improve navigation test clarity
techwithanirudh May 22, 2023
fb83608
Hotfix
techwithanirudh May 22, 2023
0073ac6
Removed repetation
techwithanirudh May 22, 2023
7413e2e
Merge branch 'main' into settings
techwithanirudh May 23, 2023
ad2dc3c
Refactor: Change text-gray-400 to text-white/50 to make tailwind more…
techwithanirudh May 23, 2023
8bef8f5
style: Update CSS classes to improve the conversation UI
techwithanirudh May 23, 2023
45f2884
Merge branch 'main' into settings
techwithanirudh May 23, 2023
2988fe7
Merge branch 'main' into settings
techwithanirudh May 24, 2023
acbaa6d
Refactor EndpointItem, EndpointItems, and NewConversationMenu for bet…
techwithanirudh May 24, 2023
853a1bf
Merge branch 'settings' of https://github.com/techwithanirudh/chatgpt…
techwithanirudh May 24, 2023
a48d556
Added error messages
techwithanirudh May 25, 2023
e47040b
refactor: Improve endpoint menu highlighting and error handling
techwithanirudh May 25, 2023
f70e4b7
test: Add Conversation and Change Path of Auth JSON
techwithanirudh May 26, 2023
dca7486
Merge branch 'main' into settings
techwithanirudh May 26, 2023
a2d5137
Merge branch 'main' into settings
techwithanirudh May 27, 2023
6e20a9e
Merge branch 'main' into settings
techwithanirudh May 27, 2023
0a14074
Fixed logo issues
techwithanirudh May 28, 2023
4a4c93a
Make everything not rounded
techwithanirudh May 28, 2023
b7f85b0
Merge branch 'danny-avila:main' into settings
techwithanirudh May 29, 2023
8ff999a
Merge branch 'main' into settings
techwithanirudh May 30, 2023
80c2567
Merge branch 'main' into settings
techwithanirudh May 31, 2023
c1ceef6
Added time
techwithanirudh Jun 1, 2023
d8b38a5
Merge branch 'main' into settings
danny-avila Jun 2, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Refactor EndpointItem, EndpointItems, and NewConversationMenu for bet…
…ter user experience

- The `EndpointItem` component now accepts an `isSelected` prop instead of `onSelect` to better reflect its usage in `EndpointItems` and `NewConversationMenu`.
- `EndpointItems` component now has a `selectedEndpoint` prop to highlight the selected item in the list.
- `NewConversationMenu` now has a gap between the endpoint options to improve user experience.
  • Loading branch information
techwithanirudh committed May 24, 2023
commit acbaa6d015630d9f396e1a23b8fa03f83eaa10ba
13 changes: 10 additions & 3 deletions client/src/components/Input/NewConversationMenu/EndpointItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { useRecoilValue } from 'recoil';
import SetTokenDialog from '../SetTokenDialog';

import store from '../../../store';
import { cn } from '~/utils/index.jsx';
techwithanirudh marked this conversation as resolved.
Show resolved Hide resolved

const alternateName = {
openAI: 'OpenAI',
Expand All @@ -15,7 +16,7 @@ const alternateName = {
google: 'PaLM'
};

export default function ModelItem({ endpoint, value, onSelect }) {
export default function ModelItem({ endpoint, value, isSelected }) {
const [setTokenDialogOpen, setSetTokenDialogOpen] = useState(false);
const endpointsConfig = useRecoilValue(store.endpointsConfig);

Expand All @@ -33,15 +34,21 @@ export default function ModelItem({ endpoint, value, onSelect }) {
<>
<DropdownMenuRadioItem
value={value}
className="group dark:font-semibold dark:text-gray-100 dark:hover:bg-gray-800"
className={cn(
'group dark:font-semibold dark:text-gray-100 dark:hover:bg-gray-800',
isSelected && 'dark:bg-gray-900'
)}
>
{icon}
{alternateName[endpoint] || endpoint}
{!!['azureOpenAI', 'openAI'].find((e) => e === endpoint) && <sup>$</sup>}
<div className="flex w-4 flex-1" />
{isUserProvided ? (
<button
className="invisible m-0 mr-1 flex-initial rounded-md p-0 text-xs font-medium text-gray-400 hover:text-gray-700 group-hover:visible dark:font-normal dark:text-gray-400 dark:hover:text-gray-200"
className={cn(
'invisible m-0 mr-1 flex-initial rounded-md p-0 text-xs font-medium text-gray-400 hover:text-gray-700 group-hover:visible dark:font-normal dark:text-gray-400 dark:hover:text-gray-200',
isSelected && 'visible text-gray-700 dark:text-gray-200'
)}
onClick={(e) => {
e.preventDefault();
setSetTokenDialogOpen(true);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React from 'react';
import EndpointItem from './EndpointItem.jsx';

export default function EndpointItems({ endpoints, onSelect }) {
export default function EndpointItems({ endpoints, onSelect, selectedEndpoint }) {
return (
<>
{endpoints.map((endpoint) => (
<EndpointItem key={endpoint} value={endpoint} onSelect={onSelect} endpoint={endpoint} />
<EndpointItem isSelected={selectedEndpoint === endpoint} key={endpoint} value={endpoint} onSelect={onSelect} endpoint={endpoint} />
))}
</>
);
Expand Down
4 changes: 2 additions & 2 deletions client/src/components/Input/NewConversationMenu/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,11 @@ export default function NewConversationMenu() {
<DropdownMenuRadioGroup
value={endpoint}
onValueChange={onSelectEndpoint}
className="overflow-y-auto"
className="overflow-y-auto gap-1 flex flex-col"
>
{showEndpoints &&
(availableEndpoints.length ? (
<EndpointItems endpoints={availableEndpoints} onSelect={onSelectEndpoint} />
<EndpointItems selectedEndpoint={endpoint} endpoints={availableEndpoints} onSelect={onSelectEndpoint} />
) : (
<DropdownMenuLabel className="dark:text-gray-300">
No endpoint available.
Expand Down