feat(reply-quality): 👎 keeps a snapshot of the turn; admin 对话质量记录
A 👎 now saves, server side, the rated turn plus the context window the model read for it (reconstructed from the stored session with the same consultationHistoryWindow the consult route uses), model and run facts. 👍 is only counted. Switching to 👍 or clearing deletes the snapshot. Bodies are blanked after 90 days; the row cascades on session delete and on account deletion. - Optional 不满意原因 panel under the answer after a 👎 (five reasons, 200-char note, "会把这一轮对话发给我们排查"). - Admin 对话质量记录: 👍/👎 stats by day and model, list without text, audited snapshot open, 处理状态 + note (support.quality.read/write). - Privacy draft: what a 👎 keeps, why, 90 days, deletion. - Migration 20260930050000 is add-only; set_reply_rating() replaced with the same signature. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N4f2nya58RoRu4yEmJgRGE
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
c1b4868cd9
commit
12e315a9bb
@@ -721,6 +721,19 @@ page. Three parts now, in reading order:
|
||||
|
||||
The 👍 / 👎 under an answer (回复评价) is saved per conversation and message position with a 16-hex hash of the answer text, and restored when that conversation is opened again — but only onto the same text, so a regenerated answer starts unrated. Saving is fire-and-forget: a failed save never disturbs the conversation.
|
||||
|
||||
### 不满意原因 after 👎 (2026-09-30)
|
||||
|
||||
- **When:** only right after a 👎 in the current view (`MessageEntry` owns `reasonOpen`; no Home state). A 👎 restored from the database does not reopen it; switching to 👍 or clearing closes it.
|
||||
- **Where:** directly under that answer's action row, above the follow-up questions. Not a modal, not a toast.
|
||||
- **Shape:** one panel on the canvas (`--radius-md`, hairline `--color-border`, max 520px, caption type in secondary ink): a head row (「哪里不满意?可以不选」 + a 32px × close), five pill chips (`aria-pressed`; current = muted surface, primary ink, darker border — no accent colour), a single-line note input (200 characters), and a foot row with the disclosure 「会把这一轮对话发给我们排查」 and a small 提交 button on the muted surface. Chips wrap on phones.
|
||||
- **After submit:** the panel collapses to one status line 「已收到,谢谢。」 and closes after 1.2s. Nothing is required; closing keeps the 👎 and its snapshot.
|
||||
|
||||
### Admin 对话质量记录 (2026-09-30)
|
||||
|
||||
- Sidebar entry after 反馈与投诉 (`DislikeOutlined`). Top card 「回复评价统计」: 近 7 / 14 / 30 / 90 天 segment, 👍 / 👎 / 👎 占比 totals, then by-day and by-model tables side by side (stacked below `lg`).
|
||||
- The list below is the shared `ResourceTable`; its one filter slot carries a 处理状态, `原因:…`, or 近 7 / 30 天. The list shows no conversation text — 快照 reads 有 / 已过期.
|
||||
- 查看 opens an 880px modal that loads the snapshot on open (audited; the modal says so): 用户问题, 被点踩的回复, the reconstructed context (summary, dropped count, turns), run facts, then 处理状态 + 内部备注. Expired bodies show an info alert instead.
|
||||
|
||||
### Settings dialog
|
||||
|
||||
- **Placement:** the overlay and the onboarding paywall portal to `document.body`. `SidebarInset` stays `inert` while a dialog is open (the BUG-744~746 focus contract); the dialog itself must not sit inside that subtree (BUG-968). Closing still uses the existing overlay click, the header button, and the window-level Escape listener.
|
||||
|
||||
Reference in New Issue
Block a user