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

inform Feedback type. Submit positive feedback #630

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion app/components/Feedback/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ const Feedback = ({
showText={!!labels}
actionType={ActionType.HELPFUL}
hint={upHint}
onClick={() => setShowFeedback(true)}
onClick={() => {
setShowFeedback(true)
onSubmit && onSubmit('', '')
Copy link
Collaborator

Choose a reason for hiding this comment

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

why not just send in a Thumbs up feedback or something as the option?

}}
/>
<Action
pageid={pageid}
Expand Down
2 changes: 1 addition & 1 deletion app/routes/chat.log.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export const action = async ({request}: ActionFunctionArgs) => {
formData.append('file', fileBlob, 'question_and_response.html')

const info = [
option?.length > 0 ? ['Feedback type', 'Thumbs down'] : ['Feedback type', 'Thumbs UP'],
['Type', type],
['Pageid', pageid && `[${pageid}](https://aisafety.info/questions/${pageid}/${question})`],
['Selected option', option],
Expand All @@ -42,7 +43,6 @@ export const action = async ({request}: ActionFunctionArgs) => {
.map(([item, val]) => `* ${item} - ${val}`)
.join('\n')
formData.append('payload_json', JSON.stringify({content: `Chat feedback:\n${info}`}))

const DISCORD_LOGGING_URL = `https://discord.com/api/webhooks/${DISCORD_LOGGING_CHANNEL_ID}/${DISCORD_LOGGING_TOKEN}`
const response = await fetch(`${DISCORD_LOGGING_URL}`, {method: 'POST', body: formData})
if (!response.ok) {
Expand Down
Loading