Skip to content

feat: add distribution-owned response feedback UI - #214

Merged
comp615 merged 4 commits into
mainfrom
ccroom/response-feedback-ui
Aug 28, 2026
Merged

feat: add distribution-owned response feedback UI#214
comp615 merged 4 commits into
mainfrom
ccroom/response-feedback-ui

Conversation

@comp615

@comp615 comp615 commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

This PR description was generated by AMP.

Summary

Berd distributions need a generic way to collect turn-level response ratings without putting a company-specific telemetry endpoint or schema in the public app.

This adds opt-in thumbs-up/down controls tied to the canonical assistant response, session ID, and message ID. Stock Berd uses a typed no-op transport and ordering seam; distributions can supply their own sink and enable the UI through the transport-neutral feedbackSurveys build capability plus runtime config. Mounting, hovering, focusing, or revealing controls emits nothing; only explicit good, bad, and cleared transitions reach the sink.

Response feedback controls

Related issue

N/A — no duplicate issue or PR found.

Testing

bin/just check
bin/pnpm vitest run src/features/chat/response-feedback src/shared/runtime-config/schema.test.ts
bin/just _tauri-cargo-unix check --features block-feedback
AI tool validation prompt

Copy and paste into your AI tool:

Review block/berd branch ccroom/response-feedback-ui and verify:
1. Run the focused response-feedback and runtime-config tests.
2. Confirm stock Berd sends no feedback events, while the typed sink receives session ID, message ID, appearance ID, and response only when the user changes a rating; confirm the distribution sink owns delivery ordering.
3. Confirm only the canonical terminal assistant response receives controls in classic and virtual transcripts.

@comp615
comp615 marked this pull request as ready for review August 26, 2026 00:41
@comp615
comp615 requested a review from a team August 26, 2026 00:41

@kalvinnchau kalvinnchau left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤖 Reviewed in the context of the stacked session-survey work and a distribution-owned transport. These comments are limited to unresolved contracts owned by this PR; later-stack concerns are left on the PR that owns them.

Comment thread src/features/chat/ui/MessageBubble.tsx Outdated
Comment thread src/features/chat/response-feedback/feedbackSurveyEvents.ts Outdated
Comment thread src-tauri/src/commands/runtime_config.rs
@comp615
comp615 force-pushed the ccroom/response-feedback-ui branch from bfe7788 to ccf75fd Compare August 27, 2026 16:58
@kalvinnchau kalvinnchau changed the title Add distribution-owned response feedback UI feat: add distribution-owned response feedback UI Aug 27, 2026
@comp615
comp615 merged commit 0aae368 into main Aug 28, 2026
8 checks passed
@comp615
comp615 deleted the ccroom/response-feedback-ui branch August 28, 2026 01:41
comp615 added a commit that referenced this pull request Aug 28, 2026
_This PR description was generated by AMP._

## Summary

This builds the generic sampled session survey on top of the
response-feedback seam. It is stacked on the response-feedback PR and
should merge after it.

After five visible user turns and ten minutes, each eligible completed
response gets a distribution-owned basis-point sampling opportunity,
matching Claude and Amp. A selected prompt starts a persisted 27–29 hour
cooldown, with arbitration serialized within the app process; this
best-effort feedback path intentionally does not coordinate independent
app processes. Dismiss is the default focus, Escape dismisses only while
the visible survey owns focus, and focus returns to its prior target.
Stock Berd still sends nothing; distributions own transport and rollout
values.

Virtualized transcripts include the survey in offscreen height
measurements without letting the hidden measurement copy focus or emit
feedback.

![Session feedback
survey](https://d24qwcpro867f5.cloudfront.net/repos/berd-internal/prs/85/session-feedback-survey.png)

### Related issue

N/A — no duplicate issue or PR found. Depends on [response-feedback PR
#214](#214).

### Testing

```bash
bin/just check
bin/pnpm vitest run src/features/chat/response-feedback src/shared/runtime-config/schema.test.ts
bin/just _tauri-cargo-unix test --lib feedback_survey
bin/just tauri-check
```

<details>
<summary>AI tool validation prompt</summary>

Copy and paste into your AI tool:

```
Review block/berd branch ccroom/session-feedback-survey and verify:
1. Run the focused survey, runtime-config, and native cooldown tests.
2. Confirm sessions shorter than five visible user turns or ten minutes never claim a survey.
3. Confirm a visible prompt defaults focus to Dismiss, Escape dismisses only while it owns focus, and a session is never prompted again after an appearance.
4. Confirm cooldown state persists across restart, claims are serialized within one app process, and the delay is randomized from 27 through 29 hours.
```

</details>

---------

Co-authored-by: Amp <amp@ampcode.com>
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.

2 participants