Skip to content

[Episode Chat] Rate answers with thumbs up or down - #6142

Merged
sztomek merged 10 commits into
mainfrom
feat/episode-chat-answer-rating
Oct 14, 2026
Merged

sztomek merged 10 commits into
mainfrom
feat/episode-chat-answer-rating

Conversation

@sztomek

@sztomek sztomek commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Description

Adds 👍/👎 under every answer in Ask about this episode, as in the P2 ("Users can leave feedback for each response by tapping the Thumbs up or down icon") and the Figma designs. This PR is based on #6127.

Behaviour

  • Thumbs show under every answer. An answer is the assistant's reply plus its quotes. "AI can make mistakes…" stays under the latest answer only.
  • 👍 shows "Thanks for the feedback".
  • 👎 opens the "What went wrong" form. Submitting it shows the same thanks.
  • Tapping the same thumb again clears the rating, and tapping the other one switches it.
  • Ratings are not saved yet, because we don't know whether they'll be stored through a server API or locally. They're kept while the chat is open and cleared by Clear Chat.

How it works

  • ChatViewModel.rateAnswer() keeps the ratings in ChatUiState.answerRatings, keyed by the uuid of the answer's first message.
  • The form opens on the chat's childFragmentManager with a new Trigger.ResponseRating. It sends back a fragment result on submit, so the thanks message shows inside the chat.
  • The thanks message is now a Compose snackbar inside the chat. The old View snackbar was hidden behind the chat sheet. The survey keeps using the old one.
  • After the 👎 form is sent from the chat, the end-of-session survey is skipped for that visit. It isn't marked as seen, so it can still show after a later chat, as product asked.
  • The icons are vectors exported from Figma. The selected one is filled, as in the Figma web frame "Transcripts web 35". The thumbs-up icon is the thumbs-down icon rotated, which is how Figma draws it too.
  • Analytics (episode_chat_response_rated) come in [Episode Chat] Send the missing chat analytics properties #6141, which will be rebased on top of this PR.

Open for design / product

  • The icons use the Figma colour (white at 20% on the player background). That is faint, and below the 3:1 contrast that WCAG asks for on icons.

Fixes POC-955 https://linear.app/a8c/issue/POC-955/add-thumbs-updown-reactions-for-answers

Testing Instructions

Use a debug build with "Episode Chat" on in Beta features.

  1. Open a transcript episode in the full-screen player, then ⋯ › Ask about this episode. Ask two questions. ✅ Thumbs show under both answers. The disclaimer shows only under the last one.
  2. Tap 👍 under the first answer. ✅ It fills in and "Thanks for the feedback" shows above the input.
  3. Tap 👍 again. ✅ It's cleared and nothing shows.
  4. Tap 👎 under the second answer. ✅ The "What went wrong" form opens above the chat. Logcat shows episode_chat_feedback_form_shown with trigger=response_rating.
  5. Pick a reason and submit. ✅ The form closes and "Thanks for the feedback" shows inside the chat.
  6. Tap 👍 under the second answer. ✅ The rating switches to 👍.
  7. ⋯ › Clear Chat, then ask again. ✅ The new answer has no rating.
  8. Tap 👎 under an answer, submit the form, and close the chat (with the survey reset in Developer settings). ✅ No survey. Open the chat, get an answer, and close it again. ✅ The survey shows.

Screenshots or Screencast

Thumbs under every answer 👍 thanks 👎 form After submitting
1-thumbs-under-every-answer 2-thumbs-up-thanks 3-thumbs-down-form 4-after-submit

Checklist

  • If this is a user-facing change, I have added an entry in CHANGELOG.md
  • Ensure the linter passes (./gradlew spotlessApply to automatically apply formatting/linting)
  • I have considered whether it makes sense to add tests for my changes
  • All strings that need to be localized are in modules/services/localization/src/main/res/values/strings.xml
  • Any jetpack compose components I added or changed are covered by compose previews
  • I have updated (or requested that someone edit) the Event Horizon schema to reflect any new or changed analytics.

I have tested any UI changes...

  • with different themes
  • with a landscape orientation
  • with the device set to have a large display and font size
  • for accessibility with TalkBack

@claude

claude Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @sztomek's task in 1m 2s —— View job


No blocking issues. Ratings are keyed by the persisted message uuid, so they stay stable as observeMessages re-emits, and Clear Chat resets them. Because the form is on childFragmentManager, its fragment result is delivered across rotation. The CONFLATED channel stops repeated taps from queueing snackbars.

Non-blocking

  • modules/features/chat/src/main/kotlin/au/com/shiftyjelly/pocketcasts/chat/ChatFragment.kt:137: if someone closes the 👎 form without submitting, the answer stays rated 👎 with no reason sent. Tapping 👎 again then clears the rating instead of reopening the form. Set the rating only when the form is submitted, or reopen the form in that case. [Episode Chat] Rate answers with thumbs up or down #6142 (comment)

@sztomek sztomek added this to the 8.23 milestone Oct 8, 2026
@sztomek
sztomek marked this pull request as ready for review October 8, 2026 17:47
@sztomek
sztomek requested a review from a team as a code owner October 8, 2026 17:47
@sztomek
sztomek requested review from geekygecko and removed request for a team October 8, 2026 17:47
@claude

claude Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @sztomek's task in 20s —— View job


No new commits since the last review, and nothing blocking. One non-blocking point is still open.

Non-blocking

@sztomek
sztomek force-pushed the feat/episode-chat-feedback-form branch from 595a7ea to 3f4f3eb Compare October 9, 2026 13:26
@sztomek
sztomek force-pushed the feat/episode-chat-answer-rating branch from 7fc7418 to 8e7d943 Compare October 9, 2026 13:29
@claude

claude Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @sztomek's task in 34s —— View job


This push is a rebase onto feat/episode-chat-feedback-form. The PR's own commits haven't changed since the last review, and nothing blocks. One non-blocking point from earlier is still open.

Non-blocking

  • modules/features/chat/src/main/kotlin/au/com/shiftyjelly/pocketcasts/chat/ChatFragment.kt:137: someone who closes the 👎 form without submitting still has the answer rated 👎 with no reason sent, and tapping 👎 again clears the rating instead of reopening the form. [Episode Chat] Rate answers with thumbs up or down #6142 (comment)

@sztomek
sztomek force-pushed the feat/episode-chat-feedback-form branch from 3f4f3eb to 6b18b41 Compare October 9, 2026 16:08
@sztomek
sztomek force-pushed the feat/episode-chat-answer-rating branch from 8e7d943 to 4c534b6 Compare October 9, 2026 16:08
@claude

claude Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @sztomek's task in 23s —— View job


The new commit (4c534b6) has nothing blocking. The survey is now skipped once someone sends the 👎 form from the chat, which settles the second open question in the description. Only the ResponseRating trigger sends SUBMITTED_RESULT_KEY, so submitting the survey itself can't set the flag. One non-blocking point from earlier is still open.

Non-blocking

  • modules/features/chat/src/main/kotlin/au/com/shiftyjelly/pocketcasts/chat/ChatFragment.kt:137: someone who closes the 👎 form without submitting still has the answer rated 👎 with no reason sent, and tapping 👎 again clears the rating instead of reopening the form. [Episode Chat] Rate answers with thumbs up or down #6142 (comment)

@wpmobilebot wpmobilebot modified the milestones: 8.23, 8.24 Oct 12, 2026
@wpmobilebot

Copy link
Copy Markdown
Collaborator

Version 8.23 has now entered code-freeze, so the milestone of this PR has been updated to 8.24.

@sztomek
sztomek force-pushed the feat/episode-chat-feedback-form branch from 6b18b41 to a1245f2 Compare October 12, 2026 10:05
@sztomek
sztomek force-pushed the feat/episode-chat-answer-rating branch from 4c534b6 to 1058010 Compare October 12, 2026 10:05
@claude

claude Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @sztomek's task in 23s —— View job


This push rebases the PR onto the new feat/episode-chat-feedback-form commit (a1245f2). The PR's five commits have the same messages as before, and its diff looks the same as at the last review. I couldn't run a commit-by-commit range-diff because the old head isn't in this checkout. Nothing blocks, and one non-blocking point from earlier is still open.

Non-blocking

@sztomek
sztomek force-pushed the feat/episode-chat-feedback-form branch from a1245f2 to 946e6eb Compare October 12, 2026 15:58
@sztomek
sztomek force-pushed the feat/episode-chat-answer-rating branch from 1058010 to 162e5b5 Compare October 12, 2026 15:58
@claude

claude Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @sztomek's task in 17s —— View job


This push is another rebase. The base feat/episode-chat-feedback-form is now a single commit (946e6eb). The PR's five commits keep the same messages, and the diff against the base is the same size (+430/−44 across the same 10 files). I couldn't run a range-diff against the previous head because it isn't in this checkout. Nothing blocks, and one non-blocking point from earlier is still open.

Non-blocking

Base automatically changed from feat/episode-chat-feedback-form to feat/episode-chat-survey October 13, 2026 13:13
@sztomek
sztomek force-pushed the feat/episode-chat-survey branch from 294ce3e to 77eb6db Compare October 13, 2026 13:32
@sztomek
sztomek force-pushed the feat/episode-chat-answer-rating branch from 162e5b5 to 128e302 Compare October 13, 2026 13:32
@claude

claude Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @sztomek's task in 22s —— View job


This push only rebases the PR onto feat/episode-chat-survey now that #6127 has merged into it. The PR's diff hasn't changed, and the only earlier point (the dismissed 👎 form) is settled as intended per the Figma spec, so nothing new and nothing open.

@sztomek
sztomek force-pushed the feat/episode-chat-answer-rating branch from 128e302 to 51ae9bb Compare October 13, 2026 14:50
@claude

claude Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @sztomek's task in 58s —— View job


The four new commits (f2bc073..51ae9bb) only change styling: icon size, tint and spacing, a top padding on the thumbs row, the disclaimer colour, and the thanks snackbar's text style. Nothing blocks and nothing earlier is still open. With minimum-size enforcement turned off, each thumb lays out at 20dp. Compose's near-hit expansion still accepts taps out to about 48dp, which is the same approach SegmentedTabBar and SearchBar already use.

Base automatically changed from feat/episode-chat-survey to main October 14, 2026 10:31
@dangermattic

Copy link
Copy Markdown
Collaborator
1 Warning
⚠️ This PR is larger than 500 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.

Generated by 🚫 Danger

@sztomek
sztomek force-pushed the feat/episode-chat-answer-rating branch from 0e73311 to 31c7a96 Compare October 14, 2026 11:49
@claude

claude Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @sztomek's task in 33s —— View job


The only new commit is 31c7a96, which merges #6141 into this branch. It adds the analytics properties, the episode_chat_response_rated event, and writes each exchange to the database in one batch, with timestamps in order. I found nothing blocking and nothing earlier is still open. The message_index that trackAnswerRated sends counts from 1, the same way as message_index on episode_chat_message_sent, so the two events can be joined. Leaving the earlier failed message out of the history (unsentMessageUuids) also means the server no longer gets a question with no answer.

@sztomek
sztomek merged commit 3ec5232 into main Oct 14, 2026
20 checks passed
@sztomek
sztomek deleted the feat/episode-chat-answer-rating branch October 14, 2026 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants