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

fix: revert hide ask ai button #1539

Merged
merged 1 commit into from
Apr 16, 2023
Merged

fix: revert hide ask ai button #1539

merged 1 commit into from
Apr 16, 2023

Conversation

boojack
Copy link
Collaborator

@boojack boojack commented Apr 16, 2023

🤖 Generated by Copilot at 0bc75a0

Summary

🔧🐛🌐

This pull request refactors the code to remove the OpenAI configuration from the system status and store it as a separate system setting. It also simplifies the UI and the global state, fixes a typo, and modifies a translation. The files affected are server/system.go, web/src/components/Header.tsx, web/src/components/Settings/SystemSection.tsx, web/src/store/module/global.ts, api/system.go, web/src/components/AskAIDialog.tsx, web/src/locales/zh-Hans.json, and web/src/store/reducer/global.ts.

We're hauling on the ropes, me hearties, on the count of three
We're cleaning up the code, me hearties, openAIConfig is free
We're making it more simple, me hearties, and more performant too
We're sailing with the wind, me hearties, Ask AI is our crew

Walkthrough

  • Remove OpenAI configuration from system status and store it as a separate system setting (link, link, link, link, link)
  • Refactor SystemSection component to use a separate state variable for OpenAI configuration and update the fetching, saving, and rendering logic accordingly (link, link, link, link, link, link, link, link)
  • Simplify Header component to always show the header-ask-ai button and remove unused dependencies and variables (link, link, link, link)
  • Fix a typo in the AskAIDialog component that caused a missing closing tag (link)
  • Use a consistent and recognizable name for the Ask AI feature across languages by changing the Chinese translation to "Ask AI" (link)

@github-actions
Copy link

github-actions bot commented Apr 16, 2023

Uffizzi Ephemeral Environment deployment-22381

☁️ https://app.uffizzi.com/github.com/usememos/memos/pull/1539

📄 View Application Logs etc.

What is Uffizzi? Learn more!

@boojack
Copy link
Collaborator Author

boojack commented Apr 16, 2023

FYI @joaonunomota Because OpenAI API key should be a secret field, so we shouldn't pass it in system status. You can hide it with additional CSS. e.g.

#header-ask-ai{display: none !important;}

image

@boojack boojack merged commit 73b8d1d into main Apr 16, 2023
@github-actions
Copy link

Uffizzi Preview deployment-22381 was deleted.

@boojack boojack deleted the fix/revert-hide-ask-ai branch April 16, 2023 02:58
This was referenced May 18, 2023
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.

1 participant