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

feat: knowledge tab add button #1277

Merged
merged 9 commits into from
Sep 28, 2023
Merged

feat: knowledge tab add button #1277

merged 9 commits into from
Sep 28, 2023

Conversation

gozineb
Copy link
Contributor

@gozineb gozineb commented Sep 28, 2023

Description

https://www.loom.com/share/f442db368dda43b7ac38a5abc5aa6044

Checklist before requesting a review

Please delete options that are not relevant.

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented hard-to-understand areas
  • I have ideally added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged

Screenshots (if appropriate):

@gozineb gozineb temporarily deployed to preview September 28, 2023 07:57 — with GitHub Actions Inactive
@vercel
Copy link

vercel bot commented Sep 28, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 28, 2023 1:22pm
quivr-strapi ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 28, 2023 1:22pm
quivrapp ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 28, 2023 1:22pm

@dosubot dosubot bot added the area: frontend Related to frontend functionality or under the /frontend directory label Sep 28, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Sep 28, 2023

Risk Level 2 - /home/runner/work/quivr/quivr/frontend/app/brains-management/[brainId]/components/BrainManagementTabs/components/KnowledgeTab/hooks/useFeedBrain.ts

The code seems to be well written and follows the SOLID principles. However, there is a TODO comment indicating a need to modify the backend architecture. This should be addressed to avoid potential future issues. The code does not contain any API keys or secrets in plain text.


Risk Level 2 - /home/runner/work/quivr/quivr/frontend/lib/context/KnowledgeToFeedProvider/hooks/useKnowledgeToFeedContext.tsx

The changes in this file are low to medium risk. The developer has created a new hook useKnowledgeToFeedContext which uses the useContext hook to access the KnowledgeToFeedContext. This hook provides two functions addKnowledgeToFeed and removeKnowledgeToFeed to manipulate the context state. There is a potential bug if the context is undefined, an error is thrown. This could be handled more gracefully. The code is readable and follows the SOLID principles.

Suggested change:

if (!context) {
  console.error(\"useKnowledge must be used inside KnowledgeToFeedProvider\");
  return;
}

This will log an error message and exit the function if the context is not defined, preventing the rest of the code from executing and potentially causing further errors.


Risk Level 3 - /home/runner/work/quivr/quivr/frontend/lib/hooks/useDropzone.ts

The changes in this file are medium risk. The developer has modified the useCustomDropzone hook to use the useKnowledgeToFeedContext hook and add or reject files based on certain conditions. There is a potential bug if the track function or addKnowledgeToFeed function are not defined or do not behave as expected. The code is readable and follows the SOLID principles.

Suggested change:

if (track) {
  track(\"FILE_UPLOADED\");
}
if (addKnowledgeToFeed) {
  addKnowledgeToFeed({
    source: \"upload\",
    file: file,
  });
}

This will check if the functions are defined before calling them, preventing potential errors.


📝🐛🔧


Powered by Code Review GPT

@gozineb gozineb merged commit b64fc04 into main Sep 28, 2023
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: frontend Related to frontend functionality or under the /frontend directory
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants