Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion ui/src/views/knowledge-detail/termbase/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,12 @@ onMounted(() => {
<template>
<Teleport v-if="headerTarget" :to="headerTarget">
<div class="flex-between gap-4">
<h4>{{ title }}</h4>
<div class="flex-align-center gap-2">
<h4>{{ title }}</h4>
<MkTooltip placement="right" content="避免专业术语被拆分,提升全文检索的精准度与召回率">
<MkIcon name="icon_info_outlined" class="text-N600!" />
</MkTooltip>
</div>
<div class="flex-align-center gap-3">
<MkSearchInput v-model="searchText" class="w-60!" @change="handleSearchChange" />
<ButtonCreateTermbase v-if="!isWorkspaceSharedResource()" :knowledge-id="knowledgeId" @refresh="handleTermbasesCreated" />

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, the diff is syntactically fine and low-risk. Main concerns are i18n, accessibility, and flex layout robustness.

Potential issues / suggestions

  1. Hard-coded Chinese tooltip text

    • This will not be localized if the app supports multiple languages.
    • Use the project’s i18n helper instead of a literal string:
    <MkTooltip placement="right" :content="t('termbase.searchTooltip')">
    
  2. Accessibility of the info icon

    • The tooltip is triggered by an icon only. Hover-only tooltips are not keyboard- or touch-friendly.
    • Prefer a real focusable trigger, e.g. a button, and hide the decorative icon from screen readers:
    <MkTooltip placement="right" :content="t('termbase.searchTooltip')">
      <button type="button" class="inline-flex items-center" :aria-label="t('termbase.searchTooltip')">
        <MkIcon name="icon_info_outlined" class="text-N600!" aria-hidden="true" />
      </button>
    </MkTooltip>
    
    • If MkTooltip supports focus triggers, ensure it opens on keyboard focus as well as hover.
  3. Flex layout may become less robust

    • Wrapping the <h4> in a new flex div can change shrinking behavior. Long titles may squeeze or overflow the right-side controls.
    • Consider adding min-w-0 to the left wrapper and truncation to the heading if titles can be long:
    <div class="flex-align-center gap-2 min-w-0">
      <h4 class="truncate">{{ title }}</h4>
      ...
    </div>
    
    • If the right-side controls should not shrink, add shrink-0 to the right group.
  4. Avoid unnecessary !important unless required

    • text-N600! is valid if the project uses suffix-style important modifiers, but confirm it is needed. If MkIcon has a default color that must be overridden, this is acceptable.
  5. Tooltip placement

    • placement="right" is probably fine for a left-aligned header title, but verify it does not overflow on narrow screens. Most tooltip components handle auto-flipping; if not, test responsive behavior.
  6. No performance or reactivity concerns

    • The change adds only static template markup and does not introduce new reactive state or computed overhead.

Verdict

No blocking defects in the shown diff. Recommended changes: use i18n for the tooltip text, make the tooltip trigger keyboard-accessible, and add min-w-0/truncate if title can be long.

Expand Down
Loading