yoheinakajima / instagraph

Converts text input or URL into knowledge graph and displays
MIT License
3.27k stars 281 forks source link

Fixes multiple bugs, refactored code #47

Closed shepherd-06 closed 11 months ago

shepherd-06 commented 11 months ago

Bug Fixes:

HTML Template

Python

In Python, most of the bugs occurred due to mismatches in variables or missing variable names. I changed the graph query as the JSON payload changes. JSON Sanitization function is no longer needed, but it's still there.

In the HTML Template, the loading bar wasn't working due to missing CSS classes. There were multiple JS functions, all overwriting each other, I removed the unnecessary ones. I have also added a bunch of null/undefined checkers and added a default value for them. I have added a lot of comments in the JS area, as this file kept getting mishandled on merge.

You (we) would need to add state management in the front end to utilize other functionalities. :) Also, You/we would need a proper pull-request guideline as well, just saying. :)

Summary by CodeRabbit

Release Notes:

coderabbitai[bot] commented 11 months ago

Walkthrough

This pull request introduces enhancements to error handling, code readability, and configuration management across Python and JavaScript files. It also includes improvements in HTML/CSS structure and styling, along with the addition of dynamic error message display functionality.

Changes

File(s) Summary
.env.example Added a new configuration variable USER_PLAN.
main.py Improved exception handling, renamed function parameters for clarity, optimized JSON handling, and updated Cypher query usage.
templates/index.html Enhanced HTML structure and CSS styling, refactored JavaScript functions for better readability and error handling, and added dynamic error message display.

🐇 "In the land of code, where logic is king,

Changes are made, improvements they bring.

With each pull request, we hop and we sing,

Celebrating the joy that these updates will bring! 🎉"


Tips ### Chat with CodeRabbit Bot (`@coderabbitai`) - Mention `@coderabbitai` in any *review comment* for bot assistance. - Note: Review comments are made on code diffs or files, not on the PR overview. ### Pause Incremental Reviews - Insert `@coderabbitai: ignore` in the PR description to halt the bot's ongoing reviews. Remove the line to resume.
yoheinakajima commented 11 months ago

oh man, i was just starting to work on this but this looks much more complete - thank you!