Repository navigation
fix: application card chat tip - #7782
Conversation
| </MkTooltip> | ||
| <el-divider direction="vertical" /> | ||
| <component :is="ActionDropdown"> | ||
| <slot name="action-dropdown" /> |
There was a problem hiding this comment.
Here's my review of this diff:
Observations
-
Chinese comment/string in an English codebase: The comment
<!-- 去对话 -->and the tooltip content"去对话"are in Chinese. If the project's convention is i18n, hardcoded Chinese strings are a problem — it should use a translation key (e.g.$t('chat.goToConversation')) so it isn't untranslated for other locales. -
JSON diff line corruption (if this is a git patch): The
@@ -59,9 +59,12 @@ function handleOpen() {hunk header followed by a stray, Answer me in English,,— wait, that's your prompt text. Ignoring that, the hunk header looks fine (-59,9 +59,12= 3 lines added), but verify the actual patch applies cleanly; the trailing,artifacts suggest copy/paste contamination. -
MkTooltipwrapping an interactive element: ConfirmMkTooltiprenders a wrapper element (often a<div>or<span>). Wrapping a button inside a block-level tooltip can (a) break flex/inline alignment inside the toolbar, and (b) introduce invalid nesting or extra DOM affecting styles. Many tooltip libs support being applied via directive orvirtual-refto avoid a wrapper. Check whetherMkTooltipsupports atrigger/slot-based API to avoid the extra node. -
Accessibility: A tooltip on an icon-only button improves discoverability, but ensure the button itself has an accessible name (
aria-label="去对话"/ i18n equivalent). A hover-only tooltip is not sufficient for screen readers or keyboard users; ifMkTooltipis hover-only, addaria-labelto theel-button. -
Consistency: Other toolbar items (the
el-divider, theActionDropdown) don't have tooltips. Adding a tooltip to only one item may look inconsistent — consider adding tooltips to all icon-only controls. -
placement="top": Fine, but in a top-anchored action bar the tooltip may be clipped by overflow or collide with sticky headers. Verify visually. -
No functional use of the removed/added lines: The
el-buttonandMkIconare unchanged aside from indentation — good, no behavioral change beyond the tooltip.
Suggested revision
<MkTooltip :content="$t('chat.goToConversation')" placement="top">
<el-button text :aria-label="$t('chat.goToConversation')">
<MkIcon name="icon_new-chat_outlined" />
</el-button>
</MkTooltip>Summary of actionable items
- Replace hardcoded Chinese with an i18n key.
- Add
aria-labelto the button for accessibility. - Verify
MkTooltipdoesn't introduce layout/wrapper issues; prefer directive/virtual-ref if available. - Apply tooltips consistently across icon-only toolbar buttons.
- Double-check the patch for stray characters before applying.
【【智能体】智能体列表卡片上的「去对话」按钮,缺失鼠标悬浮提示】
https://www.tapd.cn/tapd_fe/45245355/bug/detail/1145245355001079043