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

👍👎 for UI feedback #1004

Merged
merged 7 commits into from
Dec 19, 2024
Merged

👍👎 for UI feedback #1004

merged 7 commits into from
Dec 19, 2024

Conversation

SmittieC
Copy link
Collaborator

Resolves #927

Description

User Impact

All participants can give 👍👎 feedback in the UI

Demo

demo

Docs

@codecov-commenter
Copy link

codecov-commenter commented Dec 18, 2024

Codecov Report

Attention: Patch coverage is 41.93548% with 18 lines in your changes missing coverage. Please review.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
apps/annotations/models.py 10.00% 9 Missing ⚠️
apps/experiments/views/chat.py 44.44% 5 Missing ⚠️
apps/chat/models.py 33.33% 4 Missing ⚠️
Additional details and impacted files

📢 Thoughts on this report? Let us know!

Copy link
Contributor

@stephherbers stephherbers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great-- only blocking comment is the clarifying text for the icons

hx-swap="outerHTML"
hx-target="#rating-{{message.id}}"
class="text-sm p-1 rounded-md hover:bg-gray-50">
👍
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add in a title to indicate what the icon means-- in chatgpt they have "good response" which I think it pretty clear

Copy link
Collaborator Author

@SmittieC SmittieC Dec 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, I'll add. 85d5c5d

hx-target="#rating-{{message.id}}"
class="text-sm p-1 rounded-md hover:bg-gray-50">
👎
</button>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here but for "bad response"

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.



def rate_message(request, team_slug: str, message_id: int, rating: str):
if rating not in ["👍", "👎"]:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will we have any issues with these emojis being updated/modified?

Copy link
Collaborator Author

@SmittieC SmittieC Dec 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I doubt it. I haven't encountered any so far

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wondering if we should use the html encodings or not &#128077; &#128078;

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These emoji's are part of unicode, which should make it fine to include as-is? Or am I missing something?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main concern if are we sure that all of our users are on environments that support Unicode emojis? I know there are some older software so I wonder if we should error on the safe side

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can circle back on this in a future convo

is_system_tag=False,
category=TagCategories.RESPONSE_RATING,
)
self.add_tag(tag, team=self.chat.team, added_by=None)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like having the participant being anonymous, but then having the added_by=None feels not intuitive along with some of the filtering-- I'm curious if rather than a category if you considered going the route of a is_system_tag that would also open the possibly of more participant guided tags in the future (which I think was discussed vaguely but perhaps not)-- either approach works just bringing up the idea

Copy link
Collaborator Author

@SmittieC SmittieC Dec 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question. I did consider the system tag route, but I think we should keep it reserved for cases where the server created the tag and added it to a message, with no human intervention. I agree that we can and should improve the meaning of system tag vs user tag vs participant tag. I think let's keep things as-is for now until we have a clearer solution to this. A mini spec might do.

There are two fundamental questions to answer:

  1. Who created this tag?
  2. Who added this tag to this message?

For the most part question 2 is the most interesting one for users I'd imagine. As for determining this, we could do it either at the application layer or DB layer. In the latter case, we can have a flag or something on the CustomTaggedItem model to indicate which entity added this to the message i.e. user/system/participant.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@coderabbitai please create a ticket for this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SmittieC Thanks for confirming. It looks like your new ticket (#1006) has been created successfully. Let me know if there’s anything else!

🔗 Analysis chain

@SmittieC

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
gh issue create \
  --title "Clarify participant vs system vs user tags in chat messages" \
  --body $'We need to improve the meaning of system tag vs user tag vs participant tag, specifically regarding who created and who added the tag to a message.\n\nFollow-up conversation:\n1) Who created this tag?\n2) Who added this tag?\n\nPR: https://github.com/dimagi/open-chat-studio/pull/1004\nComment: https://github.com/dimagi/open-chat-studio/pull/1004#discussion_r1890334694\nRequested by: @SmittieC' \
  --assignee SmittieC

Length of output: 559

@SmittieC SmittieC merged commit 3794faf into main Dec 19, 2024
8 checks passed
@SmittieC SmittieC deleted the cs/ui_feedback branch December 19, 2024 14:21
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.

Feedback in chat UI
4 participants