feat(feedback): thumbs up/down + missed-items widget across all tools

New api/feedback.php stores rating + correction text to tool_feedback
table in bnl_admin. renderFeedbackWidget() appended to all tool results
(timeline, redact, transcribe, ask, summarize, search). Thumbs reveal
a textarea for missed/wrong items on click; submit POSTs asynchronously.
Engine from last run is stored alongside the rating.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-15 01:13:42 +02:00
parent cdd0fb970b
commit d429e785e8
3 changed files with 215 additions and 1 deletions
+98
View File
@@ -1578,3 +1578,101 @@ p {
opacity: 0.55;
cursor: progress;
}
/* ── Feedback widget ──────────────────────────────────────────── */
.feedback-widget {
margin-top: 1.5rem;
padding: 1rem 1.25rem;
border-top: 1px solid var(--line);
}
.feedback-label {
font-size: 0.85rem;
color: var(--muted);
margin: 0 0 0.6rem;
}
.feedback-btns {
display: flex;
gap: 0.5rem;
margin-bottom: 0.75rem;
}
.feedback-thumb {
background: var(--bg);
border: 1px solid var(--line);
border-radius: 8px;
padding: 0.35rem 0.75rem;
font-size: 1.2rem;
cursor: pointer;
transition: background 0.12s, border-color 0.12s;
line-height: 1;
}
.feedback-thumb:hover { background: var(--soft-teal); border-color: var(--teal); }
.feedback-thumb.is-active { background: var(--soft-teal); border-color: var(--teal); }
.feedback-detail {
display: flex;
flex-direction: column;
gap: 0.5rem;
}
.feedback-detail-label {
font-size: 0.83rem;
color: var(--ink);
font-weight: 500;
}
.feedback-optional {
color: var(--muted);
font-weight: 400;
}
.feedback-textarea {
width: 100%;
border: 1px solid var(--line);
border-radius: 6px;
padding: 0.5rem 0.75rem;
font-size: 0.85rem;
resize: vertical;
font-family: inherit;
color: var(--ink);
background: var(--panel);
}
.feedback-textarea:focus { outline: 3px solid var(--teal); outline-offset: 1px; }
.feedback-detail-footer {
display: flex;
align-items: center;
gap: 1rem;
}
.feedback-submit-btn {
background: var(--teal);
color: #fff;
border: none;
border-radius: 6px;
padding: 0.4rem 1rem;
font-size: 0.83rem;
font-weight: 600;
cursor: pointer;
transition: background 0.12s;
}
.feedback-submit-btn:hover { background: var(--teal-dark); }
.feedback-submit-btn:disabled { opacity: 0.55; cursor: progress; }
.feedback-status {
font-size: 0.8rem;
color: var(--muted);
margin: 0;
}
.feedback-thanks {
font-size: 0.85rem;
color: var(--teal-dark);
font-weight: 500;
margin: 0;
}