fix(reaction): fix disabled-tooltip hover and post-AC dialog copy
Some checks failed
Deploy / deploy (build, debian, 22, /root/OJDeploy/data/clientnext) (push) Has been cancelled
Deploy / deploy (build:staging, school, 8822, /root/OJ/data/dist) (push) Has been cancelled

- SubmitCode.vue: AC dialog title still told students to '打星
  评分' after the reaction UI moved to emoji buttons. Rewritten to
  match the emoji-based interaction, with no star/rating language.
- ProblemReaction.vue: n-tooltip's hover trigger merges its
  mouseenter/mouseleave onto the single root element of the trigger
  slot. That root was an n-button, and disabled form controls never
  dispatch mouse events, so the two disabled-state tooltips ('完成本题后可以评价'
  and the max-selection message) never appeared. Wrap each button in
  a non-disabled <span> and make that the tooltip root so hover
  events fire regardless of the button's disabled state.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-06 04:12:55 -06:00
parent c91c923fd6
commit c4d55bb88e
2 changed files with 18 additions and 12 deletions

View File

@@ -3,6 +3,7 @@
<div v-else ref="container" class="reactions">
<n-tooltip v-for="item in REACTIONS" :key="item.key" trigger="hover">
<template #trigger>
<span class="reaction-trigger">
<n-button
size="small"
:disabled="isDisabled(item.key)"
@@ -14,6 +15,7 @@
<span v-if="showLabel" class="label">{{ item.label }}</span>
<span v-if="counts" class="count">{{ counts[item.key] }}</span>
</n-button>
</span>
</template>
{{ tooltipOf(item.key, item.label) }}
</n-tooltip>
@@ -106,6 +108,10 @@ onMounted(() => {
gap: 8px;
overflow-x: auto;
}
.reaction-trigger {
display: inline-flex;
flex-shrink: 0;
}
.label {
margin-left: 4px;
}

View File

@@ -259,7 +259,7 @@ watch(
<!-- 评价弹窗 -->
<n-modal
preset="card"
title="恭喜你成功提交,请对该题进行评价(一星差评,五星好评)"
title="恭喜你成功提交,说说你对这道题的感受吧"
:mask-closable="false"
:style="{ maxWidth: isDesktop && '50vw', maxHeight: '80vh' }"
v-model:show="commentPanel"