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: Add Message Feedback with Tag Options #5878

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

rubentalstra
Copy link
Collaborator

@rubentalstra rubentalstra commented Feb 14, 2025

Summary

Closes: #901

This pull request introduces a new feature for providing feedback on messages, along with various enhancements to the user interface and backend. The most important changes include adding a feedback route to the server, creating a new component for feedback tag options, and updating the UI to handle feedback submission.

Backend changes:

  • api/server/routes/messages.js: Added a new PUT route for updating message feedback, including handling thumbs down feedback with default tag choices.

Frontend changes:

New icons:

Hook updates:

Change Type

  • New feature (non-breaking change which adds functionality)
  • Translation update

Testing

Test Configuration:

  • Backend:

    • Tested the new /feedback API endpoint using Postman to ensure proper handling of feedback submissions, including defaulting tag choices for thumbs-down ratings.
  • Frontend:

    • Verified that clicking the thumbs up/down buttons triggers the correct feedback flow.
    • Confirmed that when a user submits a thumbs down rating, the FeedbackTagOptions component renders with predefined tags.
    • Ensured that after a tag is selected, a thank-you message appears for a few seconds.
    • Conducted local integration testing to verify UI updates and mutation flows.
  • General:

    • All local unit tests pass without errors.
    • No new warnings were introduced.

Checklist

  • My code adheres to this project's style guidelines.
  • I have performed a self-review of my own code.
  • I have commented on complex sections of the code.
  • I have updated relevant documentation.
  • My changes do not introduce new warnings.
  • Local unit tests pass with my changes.
  • Dependent changes have been merged and published in downstream modules.

TODO:
- needs some refactoring.
- needs some UI animations.
@rubentalstra rubentalstra changed the title feat: response feedback buttons positive and 'negative' feat: response feedback buttons positive and negative Feb 14, 2025
@rubentalstra rubentalstra changed the title feat: response feedback buttons positive and negative WIP feat: response feedback buttons positive and negative Feb 14, 2025
/>
) : showThankYou ? (
<div className="inline-flex rounded-lg border border-token-border-light p-4">
<div className="text-sm">Thanks for your feedback!</div>

Check failure

Code scanning / ESLint

disallow literal string Error

disallow literal string: Thanks for your feedback!
@rubentalstra rubentalstra changed the title WIP feat: response feedback buttons positive and negative WIP ✨ feat: Add Message Feedback with Tag Options Feb 15, 2025
@rubentalstra rubentalstra added the ✨ enhancement New feature or request label Feb 15, 2025
@rubentalstra
Copy link
Collaborator Author

rubentalstra commented Feb 15, 2025

Screenshot 2025-02-15 at 14 44 01
Screenshot 2025-02-15 at 14 44 24
Screenshot 2025-02-15 at 14 44 38
Screenshot 2025-02-15 at 14 44 43

@rubentalstra rubentalstra changed the title WIP ✨ feat: Add Message Feedback with Tag Options ✨ feat: Add Message Feedback with Tag Options Feb 15, 2025
<div className="min-h-[96px] w-full">
<div className="relative mt-2 flex w-full flex-col gap-3 rounded-lg border border-token-border-light p-4">
<div className="flex justify-between items-center">
<div className="text-sm text-token-text-secondary">Tell us more:</div>

Check failure

Code scanning / ESLint

disallow literal string Error

disallow literal string: Tell us more:
Comment on lines +91 to +93
<OGDialogTitle className="text-lg font-semibold leading-6 text-token-text-primary">
Provide additional feedback
</OGDialogTitle>

Check failure

Code scanning / ESLint

disallow literal string Error

disallow literal string:
Provide additional feedback
Comment on lines +112 to +114
<span className="absolute -top-1 -right-1 flex h-4 w-4 items-center justify-center rounded-full bg-blue-500 text-white text-xs">
</span>

Check failure

Code scanning / ESLint

disallow literal string Error

disallow literal string:

Comment on lines +139 to +141
>
Submit
</button>

Check failure

Code scanning / ESLint

disallow literal string Error

disallow literal string: <button
type="button"
onClick={handleSubmit}
className={cn('btn btn-primary', !selectedTag && 'opacity-50 cursor-not-allowed')}
disabled={!selectedTag}
>
Submit
@walbercardoso
Copy link
Contributor

Nice work. Is the feedback I send stored somewhere?

@rubentalstra
Copy link
Collaborator Author

rubentalstra commented Feb 17, 2025

@walbercardoso yes this is stored on the message object.

https://github.com/danny-avila/LibreChat/pull/5878/files#diff-baba50088a01ce3750bbb41c95be6f4a812f82b942ff283389ba4605f4d107b0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhancement: Chat rating button
3 participants