Response feedback
Feedback on a reply: thumbs that fill, reason chips and a note after thumbs down, a short thank-you that folds away, and Try again when sending fails.
oxyn add response-feedbackTokens minted in the last second of a minute expire before verify runs. Add a 30 s leeway and freeze the clock in a regression test.
rsx! {
ResponseFeedback {
allow_comment: true,
on_rating: move |r: Option<String>| save(message_id, r),
}
}Rendered from Rust at build time · goes live when visible
When to use
- After the agent answers, the user does one of five things with a message: copy it, fix what they asked (edit and resend), ask again (retry, maybe with a different model or effort), compare attempts (version arrows), or grade it (thumbs with a reason).
- Every product we studied has this bar.
- Agent runs add states chat kits ignore: a message interrupted mid-tool, a partial answer after a model error, a message sent mid-run that the agent has not read yet, and edits that must stop the current run before they branch.
- This spec gives every one of those a defined look, action and label.
When not to use
- The empty state of an AI app: use Starter prompts instead.
- Markdown that renders correctly while it streams: use Streaming markdown instead.
- The thinking of a reply: use Reasoning block instead.
Installation
Response feedback is free and MIT. The oxyn CLI copies its code, and the components it needs, into src/oxyn/ of your Dioxus or GPUI project, so it is yours to change.
cargo install --git https://github.com/ismailqureshi72/Oxyn oxyn-cli
oxyn init
oxyn add response-feedbackuse crate::oxyn::{ResponseFeedback, MessageActions, STATUS_INDICATOR_CSS};Rather depend on the crate? cargo add oxyn-dioxus oxyn-core --git https://github.com/ismailqureshi72/Oxyn, then use oxyn_dioxus::{ResponseFeedback, MessageActions, STATUS_INDICATOR_CSS};
Usage
rsx! {
ResponseFeedback {
allow_comment: true,
on_rating: move |r: Option<String>| save(message_id, r),
}
}Examples
Idle
Thumbs only.
Tokens minted in the last second of a minute expire before verify runs. Add a 30 s leeway and freeze the clock in a regression test.
Code
rsx! {
ResponseFeedback {
allow_comment: true,
on_rating: move |r: Option<String>| save(message_id, r),
}
}Down
Thumbs down with reasons and a note.
Tokens minted in the last second of a minute expire before verify runs. Add a 30 s leeway and freeze the clock in a regression test.
Code
rsx! {
ResponseFeedback {
rating: "down",
allow_comment: true,
on_rating: move |r: Option<String>| save(message_id, r),
}
}Up
Thumbs up asks what was good.
Tokens minted in the last second of a minute expire before verify runs. Add a 30 s leeway and freeze the clock in a regression test.
Code
rsx! {
ResponseFeedback {
rating: "up",
allow_comment: true,
on_rating: move |r: Option<String>| save(message_id, r),
}
}Retry
A failed send becomes Try again (Oxyn plus).
Tokens minted in the last second of a minute expire before verify runs. Add a 30 s leeway and freeze the clock in a regression test.
Code
rsx! {
ResponseFeedback {
rating: "down",
allow_comment: true,
on_rating: move |r: Option<String>| save(message_id, r),
}
}API reference
ResponseFeedback
| Prop | Type | Default | Description |
|---|---|---|---|
negative | Vec<String> | NEGATIVE.iter().map(|s| s.to_string()).collect() | Reasons after thumbs down. |
positive | Vec<String> | POSITIVE.iter().map(|s| s.to_string()).collect() | Reasons after thumbs up ([] skips the row). |
allow_comment | bool | true | Note field after thumbs down. |
rating | Option<String> | Default::default() | Initial rating (`up` · `down`). |
privacy_note | String | "Shares this reply for review" | Privacy line next to Submit. |
fail_send | bool | Default::default() | Simulate a failed send. |
disabled | bool | Default::default() | Disabled (still streaming). |
leading | Element | VNode::empty() | Leading actions (copy, regenerate). |
on_rating | EventHandler<Option<String>> | — | Rating changed. |
MessageActions
| Prop | Type | Default | Description |
|---|---|---|---|
textrequired | String | — | Text to copy. |
regenerate | bool | true | Regenerate button. |
branch | bool | Default::default() | Branch button. |
persistent | bool | Default::default() | Always visible. |
meta | Option<String> | Default::default() | Trailing meta ("1.2k tokens · 4.1s"). |
on_regenerate | EventHandler<()> | — | Regenerate pressed. |
Read from the Rust signature and doc comments.
Keyboard interactions
| Key | Action |
|---|---|
| EnterorSpace | Press a thumb or chip |
| Escape | Close the panel, keep the rating |
| ⌘orCtrlEnter | Submit from the note |
Accessibility
- Thumbs are toggle buttons (Good / Bad response) with aria-expanded while the panel is open.
- Chips use aria-pressed and invert when selected.
- A polite region announces rating, sending, thanks and errors.
From the spec
- Each message:
role="article",aria-labelledbyheader ("You, 14:02" / "Agent, 14:02"), andaria-describedbythe status row when notComplete("Interrupted after 42 seconds"). - Action labels: "Copy message" → "Copied" (announced politely once); "Edit message"; "Retry response"; "Retry with a different model"; "Good response" / "Bad response" (
aria-pressed); "Previous version" / "Next version" and the switcheraria-label"Version 2 of 3"; "Branch from here"; "More actions". - Hover-revealed actions are always in the DOM / accessibility tree and appear on focus-within; they are never removed when hidden (opacity only), so keyboard users can reach them.
- Live region: copy result, "Feedback sent", "Version 2 of 3 shown", "Response stopped", "Response failed" (assertive), "Editing message" when the editor opens.
- Editor: labelled "Edit your message"; focus moves into it on open and back to the message's Edit button on cancel, to the new bubble on Save.
- Contrast: user bubble text ≥ 4.5:1 on its fill in both themes; unread 60 % state dims the fill only; muted thumbs ≥ 3:1; danger rows carry words.
- Reduced motion: §5 last row.
- Focus order inside a message: header (if interactive) → body links / code buttons / citations → status row actions (Continue / Retry) → footer actions (copy → retry → ▾ → 👍 → 👎 → ‹ › → ⋯).
Motion & interaction
- User bubble enter: receives the composer fly-up (≤ 260 ms, composer.md §4); for messages not typed here (sync, queue dispatch): scale 0.96 → 1 + y 6 → 0, 200 ms
spring.snap(Claude desktop user bubble enters from scale .92 + 6 px, note 08 — we use a smaller scale). - Actions reveal: after
dur.actions.revealhover intent (80 ms) the bar fades in 120 ms; hides 160 ms after a 300 ms leave delay; focus-within keeps it visible. Last agent turn: always visible. "copy blurs into a green check", note 11 — our timings). - Retry: ↻ rotates 360° once (400 ms
ease.in-out); keeps rotating at 1 turn / 1000 ms whileRegenerating(loaders.mdloop.base). - Thumb vote: scale 1 → 1.18 → 1 (
spring.soft, ~240 ms), fill swaps tocolor.feedback.on; the opposite thumb dims to 50 % (still ≥ 3:1). - Reason row: unfolds below the bar (
dur.collapse200 ms); chips stagger in (40 ms, cap 5); on Send the row crossfades to "Thanks" then folds after 1.2 s. - Version switch: number rolls (
dur.digit.roll280 ms); body crossfades 180 ms while height springs - Edit open: bubble fill fades to the editor surface (120 ms); width locks to the bubble's width then springs to editor width (200 ms); caret at end. Cancel: reverse. Save & send: editor text morphs into the new bubble (same fly as composer send, 260 ms).
- Interrupted / failed marker: "Interrupted" drops in from the status tab (owned by composer-status-strip.md, 220 ms
ease.firm); failed row tone fades 200 ms; no shake on text. - Regenerating: old body to 40 % opacity (160 ms); when the new first block lands, old collapses (200 ms) with the anchor rule (messages.md §4.2).
- Unread → Read: fill 60 → 100 % over 200 ms.
Timing
| Transition | Duration | Delay | Easing / spring | Stagger | Frame rate |
|---|---|---|---|---|---|
| User bubble enter (non-composer) | 200 ms | 0 | spring.snap | — | 60 Hz |
| Actions reveal / hide | 120 / 160 ms | 80 / 300 ms | ease.out / ease.in | — | 60 Hz |
| Copy → ✓ / hold / revert | 160 / 1500 / 160 ms | 0 | ease.out | — | 60 Hz |
| Retry spin (press / loop) | 400 ms / 1000 ms per turn | 0 | ease.in-out / linear | — | 60 Hz |
| Thumb pop | ~240 ms | 0 | spring.soft | — | 60 Hz |
| Reason row unfold / fold | 200 / 200 ms | 0 / 1200 ms after Thanks | ease.out / ease.in | chips 40 ms, cap 5 | 60 Hz |
| Version switch | 180 ms crossfade + height spring; digits 280 ms | 0 | ease.in-out + spring.snap | — | 60 Hz |
| Edit open / cancel | 120 ms fill + 200 ms width | 0 | ease.out / spring.snap | — | 60 Hz |
| Save & send fly | ≤ 260 ms | 0 | ease.in | — | 60 Hz |
| Regenerating dim / collapse | 160 / 200 ms | collapse on first new block | ease.out / spring.snap | — | 60 Hz |
| Unread → Read | 200 ms | 0 | ease.out | — | 30 Hz |
| Pending clock glyph | appears after 600 ms | 600 ms | fade 120 ms | — | — |
| Reduced motion | all transitions → 0–80 ms opacity crossfade; no pop, no spin (↻ shows a static "…" badge while regenerating), no width spring; copy ✓ still holds 1500 ms; version digits swap without rolling | — | linear | none | on change |
Responsive behaviour
- The privacy line hides below 400 px of container.
Edge cases (spec)
- Long text: user messages > 24 lines fold to 12 lines with "Show more" (coss ui long-message collapse, note 01); agent long output is handled by streaming-markdown (code collapse) — prose is never folded by default.
- Huge pastes / binary-looking text: > 20 000 chars renders as plain mono with no markdown parse (proposed).
- Overflow: long URLs / tokens break after 40 chars in prose (text-reveal rule); code never wraps unless the code block's wrap toggle is on.
- RTL: bubbles mirror (user on the left); grouped-corner radii mirror; ‹ › arrows mirror (‹ = previous in reading order); version numbers stay LTR in a bidi isolate; mixed-direction bubbles use the first strong character for alignment.
- Tiny sizes (16–20 px controls): action icons 16 px with 24 px hit areas in IDE; on < 280 px width everything goes into
⋯. - Dense IDE panels:
message/dense+message-actions/overflow; timestamps tooltip-only. - Touch: 44 px hit areas; long-press = actions sheet; no hover state; feedback chips wrap to two rows.
- Slow networks:
Pendingclock after 600 ms;SendFailedafter the adapter's timeout; feedback sends queue locally and retry silently (vote shown immediately). - Very fast agent: Reserved → Complete in one frame: no status row, actions fade in directly.
- Very slow agent: footer stays hidden until Done; partial text is copyable by selection at any time.
- Edit while the agent is mid-approval:
StopConfirmcopy changes to "This will cancel the pending approval and stop the run". - Many versions (> 9): arrows show "‹ 12 / 37 ›" with reserved width for the widest count (status-text §2.2
ReserveMagnitude). - Deleted / redacted message (app policy): row "Message deleted" with no actions except Undo for 5 s.
- Feedback on an old version: stored against that version id; switching versions shows that version's vote.
Notes for AI
- Import
ResponseFeedback,MessageActionsfromoxyn_dioxusand includeSTATUS_INDICATOR_CSSplus the token stylesheet once. - A GPUI version exists:
FeedbackElinoxyn_gpui. - Props to set first:
text. - Keep its states and timings as they ship; restyle it through the CSS variables rather than by hand.