-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
fix(frontend): Error when API key is not entered is not clear #4429
Conversation
@amanape is this good |
@amanape i have solved the issue but why isnt it merged |
I will give a proper review soon, sorry for the delay! In the meantime, I see that there are some linting issues on the frontend. Could you take care of it to pass the GitHub CI? |
Yes i think the prettier in my code editor is causing the problem will solve it. @amanape |
@amanape solved the lint issues perfect to merge |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The functionality does not work when pressing "Save". The flow should look something like this:
- User presses "Save"
- If there is no API key, show modal
- Otherwise, send the save settings action request (it currently only does this)
We are using Remix to handle form actions. Instead of keeping LLM_API_KEY
changes in the hasEnteredKey
state, we can access this setting from the formRef
:
const formData = new FormData(formRef.current); // assuming formRef.current is not undefined
const apiKey = formData.get("api-key");
You should prefer using Remix / React Router (latest version) API to handle form data and navigation states. I recommend reading their documentation for more information!
@amanape ok i will implement the changes and come back |
Hi @amanape corrected the flow and other eslint issues (removed all the console log statements). |
@amanape all checks are done can we merge it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There seems to be just one bug:
- Set API key and save
- Open settings again
- Clear API key input and press "Save"
- Confirm warning modal
In this case, the API key is not actually removed, and still there.
@amanape solved the bug, ready to merge |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes! Bonus points for handling the zIndex, too.
Give a summary of what the PR does, explaining any non-trivial design decisions
Added a modal for prompting the user to input an API Key in settings during startup and in session.
Link of any specific issues this addresses
Resolves #4236