fix: clear a reply's score and reason when its rating switches thumbs (#30075)

This commit is contained in:
G30 2026-09-19 16:42:15 -04:00 • committed by GitHub
parent 57063aaad8
commit a63ddb36d2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -464,6 +464,9 @@
annotation: {
...(message?.annotation ?? {}),
...(rating !== null ? { rating: rating } : {}),
...(rating !== null && rating !== message?.annotation?.rating
? { reason: null, details: null }
: {}),
...(details ? details : {})
}
};
@ -1610,15 +1613,17 @@
</div>
{#if message.done && showRateComment}
<RateComment
bind:message
bind:show={showRateComment}
on:save={async (e) => {
await feedbackHandler(null, {
...e.detail
});
}}
/>
{#key message?.annotation?.rating}
<RateComment
bind:message
bind:show={showRateComment}
on:save={async (e) => {
await feedbackHandler(null, {
...e.detail
});
}}
/>
{/key}
{/if}
{#if (isLastMessage || ($settings?.keepFollowUpPrompts ?? false)) && message.done && !readOnly && (message?.followUps ?? []).length > 0}