VasaChiranjeevi / ai-customer-feedback-analysis

The objective of this project is to build an AI-powered system to collect and analyze customer reviews for multiple companies, generating summaries and extracting common keywords using existing free AI models. The reviews and their respective analysis will be stored in a database, and summaries will be updated
0 stars 0 forks source link

UI change #24

Closed ShashankC66 closed 1 month ago

ShashankC66 commented 1 month ago

Summary by Sourcery

Update the UI to display sentiment counts for reviews and refactor sentiment constants into separate variables for improved code organization.

New Features:

Enhancements:

sourcery-ai[bot] commented 1 month ago

Reviewer's Guide by Sourcery

This pull request implements UI changes to enhance the display of sentiment analysis results and improves the overall user experience. The changes include adding a new section to show sentiment counts, updating the review submission process, and refactoring some backend code to support these new features.

Sequence Diagram

sequenceDiagram
    participant User
    participant Frontend
    participant Backend
    User->>Frontend: Submit review
    Frontend->>Backend: POST /submit_review
    Backend->>Frontend: Response (success/error)
    Frontend->>User: Show alert
    Frontend->>Frontend: Clear form fields
    Frontend->>Backend: GET /get_reviews
    Backend->>Frontend: Updated reviews and counts
    Frontend->>User: Display updated data

File-Level Changes

Change Details Files
Add sentiment count display to the UI
  • Create new HTML structure for displaying sentiment counts
  • Add CSS styles for the new sentiment count display
  • Update JavaScript to populate sentiment counts
  • Modify backend view to include sentiment counts in the response
SentimentAnalysis/analysis/templates/index.html
SentimentAnalysis/analysis/views.py
Improve form handling after review submission
  • Clear form fields after successful submission
  • Reset company dropdown to the selected company
SentimentAnalysis/analysis/templates/index.html
Refactor sentiment constants
  • Replace REVIEW_SENTIMENTS tuple with individual constants
  • Update imports in models.py
SentimentAnalysis/SentimentAnalysis/constants.py
SentimentAnalysis/analysis/models.py
Enhance error handling in the frontend
  • Simplify error message display for failed review loading
SentimentAnalysis/analysis/templates/index.html

Tips and commands #### Interacting with Sourcery - **Trigger a new review:** Comment `@sourcery-ai review` on the pull request. - **Continue discussions:** Reply directly to Sourcery's review comments. - **Generate a GitHub issue from a review comment:** Ask Sourcery to create an issue from a review comment by replying to it. #### Customizing Your Experience Access your [dashboard](https://app.sourcery.ai) to: - Enable or disable review features such as the Sourcery-generated pull request summary, the reviewer's guide, and others. - Change the review language. - Add, remove or edit custom review instructions. - Adjust other review settings. #### Getting Help - [Contact our support team](mailto:support@sourcery.ai) for questions or feedback. - Visit our [documentation](https://docs.sourcery.ai) for detailed guides and information. - Keep in touch with the Sourcery team by following us on [X/Twitter](https://x.com/SourceryAI), [LinkedIn](https://www.linkedin.com/company/sourcery-ai/) or [GitHub](https://github.com/sourcery-ai).