feat(moderation): add user-facing reasons for rejected or failed content
Prompt AI models to provide short explanations for rejected content Store reasons in database and broadcast via WebSocket Display moderation details in UI for authors and admins
This commit is contained in:
@@ -296,6 +296,15 @@ function notificationText(notification: NotificationItem) {
|
||||
return t('notifications.moderationFailed', { target });
|
||||
}
|
||||
|
||||
function notificationReasonVisible(notification: NotificationItem) {
|
||||
return (
|
||||
notification.type === 'moderation_result' &&
|
||||
(notification.moderationStatus === 'rejected' || notification.moderationStatus === 'failed') &&
|
||||
notification.moderationReason !== null &&
|
||||
notification.moderationReason.trim() !== ''
|
||||
);
|
||||
}
|
||||
|
||||
function notificationIcon(notification: NotificationItem) {
|
||||
if (notification.type === 'life_post_comment') {
|
||||
return iconComment;
|
||||
@@ -409,6 +418,9 @@ onBeforeUnmount(() => {
|
||||
</span>
|
||||
<span class="notification-item__copy">
|
||||
<strong>{{ notificationText(notification) }}</strong>
|
||||
<span v-if="notificationReasonVisible(notification)" class="notification-item__detail">
|
||||
{{ notification.moderationReason }}
|
||||
</span>
|
||||
<time :datetime="notification.createdAt">{{ formatDateTime(notification.createdAt) }}</time>
|
||||
</span>
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user