Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { computed, ref } from 'vue'
import { useI18n } from 'vue-i18n'
import type { ChatContent, Dict } from '@/api/types'
import ConversationLoading from '@/conversation-panel/components/loading/index.vue'

const { t } = useI18n({ useScope: 'global' })

Expand Down Expand Up @@ -67,7 +68,7 @@ const formattedResult = computed(() => tryFormatJson(props.toolItem.content))
/>
</template>
<template #label>
<span v-if="loading" class="mk-conversation-loading" />
<ConversationLoading v-if="loading" class="shrink-0" :size="16" />
<MkIcon name="icon_busy_outlined" />
<span class="min-w-0 max-w-[300px] truncate" :title="toolTitle">{{ toolTitle }}</span>
<el-tag v-if="isFailed" size="small" :type="statusType">{{ statusText }}</el-tag>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { computed, ref } from 'vue'
import { useI18n } from 'vue-i18n'
import type { ChatContent, Dict } from '@/api/types'
import type { Component } from 'vue'
import ConversationLoading from '@/conversation-panel/components/loading/index.vue'
import CreateFile from '../tool/CreateFile.vue'
import DownloadSkills from '../tool/DownloadSkills.vue'
import Glob from '../tool/Glob.vue'
Expand Down Expand Up @@ -86,7 +87,7 @@ const isExpanded = ref(false)
/>
</template>
<template #label>
<span v-if="groupStatus === 'running'" class="mk-conversation-loading" />
<ConversationLoading v-if="groupStatus === 'running'" class="shrink-0" :size="16" />
<span>{{ t('chat.message.toolsCalled', { count: toolItems.length }, toolItems.length) }}</span>
<span v-if="failedToolCount">
(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { computed, ref, useTemplateRef } from 'vue'
import { useI18n } from 'vue-i18n'
import type { ChatContent } from '@/api/types'
import ContentList from '@/conversation-panel/components/content-list/index.vue'
import ConversationLoading from '@/conversation-panel/components/loading/index.vue'
import { useBottomFollow } from '@/conversation-panel/core/bottom-follow'

/**
Expand Down Expand Up @@ -80,7 +81,7 @@ useBottomFollow(useTemplateRef<HTMLElement>('groupScrollRef'))
/>
</template>
<template #label>
<span v-if="content.status === 'RUNNING'" class="mk-conversation-loading" />
<ConversationLoading v-if="content.status === 'RUNNING'" class="shrink-0" :size="16" />
<span class="min-w-0 max-w-[300px] truncate" :title="content.name">{{ content.name }}</span>
<!-- <span v-if="!isExpanded && currentActivity" class="min-w-0 truncate" :title="currentActivity">{{ currentActivity }}</span> -->
<el-tag v-if="isFailed" size="small" :type="statusType">{{ statusText }}</el-tag>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { computed } from 'vue'
import type { PatchFileInfo } from './patch/patchTypes'
import type { ChatContent } from '@/api/types'
import ConversationLoading from '@/conversation-panel/components/loading/index.vue'
import ScrollDiff from './components/ScrollDiff.vue'
import { extractPartialJsonField } from './extract-partial-json'

Expand Down Expand Up @@ -54,7 +55,7 @@ const fileInfo = computed<PatchFileInfo | null>(() => {
/>
</template>
<template #label>
<span v-if="loading" class="mk-conversation-loading" />
<ConversationLoading v-if="loading" class="shrink-0" :size="16" />
<MkIcon name="icon_file-add_outlined" />
<span class="min-w-0 max-w-[300px] truncate" :title="title">{{ title }}</span>
<span v-if="fileInfo" class="shrink-0 font-mono" style="color: var(--el-color-success-dark-2)">+{{ fileInfo.additions }}</span>
Expand All @@ -63,7 +64,7 @@ const fileInfo = computed<PatchFileInfo | null>(() => {
<div>
<ScrollDiff v-if="fileInfo" :file="fileInfo" />
<div v-else-if="loading">
<span class="mk-conversation-loading" />
<ConversationLoading class="shrink-0" :size="16" />
</div>
</div>
</MkCollapse>

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.

Review of the diff

  1. Inconsistent :size usage — biggest concern

    • Header spinner: :size="16" matches the icon
    • Body spinner: :size="16" but previous was a bare <span class="mk-conversation-loading" /> with no sizing; visually this may now render too small inside an empty body area. Consider a larger size (e.g., 20/24) or no size for the body placeholder to preserve prior look.
  2. shrink-0 on body spinner is likely meaningless

    • The body wrapper is <div v-else-if="loading">, not a flex container, so shrink-0 does nothing there. Only meaningful in the header flex row. Remove it from the body instance to avoid confusion.
  3. Possible layout regression in header

    • Previously <span class="mk-conversation-loading" /> relied on CSS (mk-conversation-loading class) for styling/alignment. Replacing with <ConversationLoading> means the old CSS class is no longer applied. If that class contained margin/size/color adjustments besides sizing, those are lost. Double-check .mk-conversation-loading usage elsewhere — if unused after this change, remove the stale CSS.
  4. Accessibility / semantics

    • Loading indicators should ideally expose role="status" / aria-label. Check whether ConversationLoading handles that internally; if not, add aria-label="Loading" at call sites.
  5. Import path depth

    • @/conversation-panel/components/loading/index.vue reaches across feature boundaries. Fine, but if this component is used in multiple features, consider promoting it to a shared location to avoid coupling the patch panel to the conversation panel module.
  6. No lazy loading

    • ConversationLoading is a small component, but if it pulls additional deps, defineAsyncComponent could keep the patch diff chunk lean while loading only when needed. Optional.
  7. Test coverage

    • Snapshot/DOM tests asserting .mk-conversation-loading will break. Search for that selector in tests and update.
  8. Styling consistency

    • Consider replacing inline :size="16" with a shared constant/prop default so all spinners in this file stay consistent if sizes change later.

Summary: Functionally fine, but verify (a) body spinner size/appearance vs. before, (b) leftover .mk-conversation-loading CSS and test selectors, (c) drop the redundant shrink-0 on the non-flex body case.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script setup lang="ts">
import { computed } from 'vue'
import type { ChatContent } from '@/api/types'
import ConversationLoading from '@/conversation-panel/components/loading/index.vue'
import { extractPartialJsonField } from './extract-partial-json'

defineOptions({ name: 'ConversationDownloadSkillsContent' })
Expand Down Expand Up @@ -28,7 +29,7 @@ const summary = computed(() => props.content.summary || '')
/>
</template>
<template #label>
<span v-if="loading" class="mk-conversation-loading" />
<ConversationLoading v-if="loading" class="shrink-0" :size="16" />
<svg class="shrink-0" viewBox="0 0 16 16" width="16" height="16" fill="none">
<path d="M8 2v8M4 7l4 4 4-4" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round" />
<path d="M2 13h12" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script setup lang="ts">
import { computed } from 'vue'
import type { ChatContent } from '@/api/types'
import ConversationLoading from '@/conversation-panel/components/loading/index.vue'
import { extractPartialJsonFields } from './extract-partial-json'

defineOptions({ name: 'ConversationGlobContent' })
Expand Down Expand Up @@ -37,7 +38,7 @@ const summary = computed(() => props.content.summary || '')
/>
</template>
<template #label>
<span v-if="loading" class="mk-conversation-loading" />
<ConversationLoading v-if="loading" class="shrink-0" :size="16" />
<svg class="shrink-0" viewBox="0 0 16 16" width="16" height="16" fill="none">
<circle cx="7" cy="7" r="4.5" stroke="currentColor" stroke-width="1.3" />
<path d="M10.5 10.5L14 14" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script setup lang="ts">
import { computed } from 'vue'
import type { ChatContent } from '@/api/types'
import ConversationLoading from '@/conversation-panel/components/loading/index.vue'
import { extractPartialJsonField } from './extract-partial-json'

defineOptions({ name: 'ConversationGrepContent' })
Expand Down Expand Up @@ -28,7 +29,7 @@ const summary = computed(() => props.content.summary || '')
/>
</template>
<template #label>
<span v-if="loading" class="mk-conversation-loading" />
<ConversationLoading v-if="loading" class="shrink-0" :size="16" />
<svg class="shrink-0" viewBox="0 0 16 16" width="16" height="16" fill="none">
<circle cx="7" cy="7" r="4.5" stroke="currentColor" stroke-width="1.3" />
<path d="M10.5 10.5L14 14" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script setup lang="ts">
import { computed } from 'vue'
import type { ChatContent } from '@/api/types'
import ConversationLoading from '@/conversation-panel/components/loading/index.vue'
import { extractPartialJsonField } from './extract-partial-json'

defineOptions({ name: 'ConversationListDirContent' })
Expand Down Expand Up @@ -28,7 +29,7 @@ const summary = computed(() => props.content.summary || '')
/>
</template>
<template #label>
<span v-if="loading" class="mk-conversation-loading" />
<ConversationLoading v-if="loading" class="shrink-0" :size="16" />
<svg class="shrink-0" viewBox="0 0 16 16" width="16" height="16" fill="none">
<path
d="M2 4.5A1.5 1.5 0 0 1 3.5 3h2.086a1.5 1.5 0 0 1 1.06.44l.354.354a.5.5 0 0 0 .354.146H12.5A1.5 1.5 0 0 1 14 5.44V11.5a1.5 1.5 0 0 1-1.5 1.5h-9A1.5 1.5 0 0 1 2 11.5v-7Z"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script setup lang="ts">
import { computed } from 'vue'
import type { ChatContent } from '@/api/types'
import ConversationLoading from '@/conversation-panel/components/loading/index.vue'

defineOptions({ name: 'ConversationListSkillsContent' })

Expand All @@ -22,7 +23,7 @@ const summary = computed(() => props.content.summary || '')
/>
</template>
<template #label>
<span v-if="loading" class="mk-conversation-loading" />
<ConversationLoading v-if="loading" class="shrink-0" :size="16" />
<svg class="shrink-0" viewBox="0 0 16 16" width="16" height="16" fill="none">
<path d="M8 2v12M2 8h12" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" />
</svg>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { computed, nextTick, onBeforeUnmount, onMounted, reactive, ref, watch } from 'vue'
import type { PatchFileStatus } from './patch/patchTypes'
import type { ChatContent } from '@/api/types'
import ConversationLoading from '@/conversation-panel/components/loading/index.vue'
import { Scroll } from '@/conversation-panel/core/scroll'
import ScrollDiff from './components/ScrollDiff.vue'
import { extractPartialJsonField } from './extract-partial-json'
Expand Down Expand Up @@ -107,7 +108,7 @@ function verb(status: PatchFileStatus) {
/>
</template>
<template #label>
<span v-if="loading" class="mk-conversation-loading" />
<ConversationLoading v-if="loading" class="shrink-0" :size="16" />
<svg class="shrink-0" viewBox="0 0 16 16" width="16" height="16" fill="none">
<path d="M2 3.5h12M2 8h12M2 12.5h8" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" />
</svg>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { computed } from 'vue'
import { useI18n } from 'vue-i18n'
import type { ChatContent } from '@/api/types'
import ConversationLoading from '@/conversation-panel/components/loading/index.vue'
import { extractPartialJsonField } from './extract-partial-json'

defineOptions({ name: 'ConversationReadFileContent' })
Expand Down Expand Up @@ -43,7 +44,7 @@ const lineCount = computed(() => parsedLines.value.length)
/>
</template>
<template #label>
<span v-if="loading" class="mk-conversation-loading" />
<ConversationLoading v-if="loading" class="shrink-0" :size="16" />
<svg class="shrink-0" viewBox="0 0 16 16" width="16" height="16" fill="none">
<path d="M4 2h8l2 2v10a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1Z" stroke="currentColor" stroke-width="1.3" stroke-linejoin="round" />
<path d="M6 8h4M6 10.5h4M6 5.5h2" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script setup lang="ts">
import { computed } from 'vue'
import type { ChatContent } from '@/api/types'
import ConversationLoading from '@/conversation-panel/components/loading/index.vue'

defineOptions({ name: 'ConversationRunSkillContent' })

Expand Down Expand Up @@ -40,7 +41,7 @@ const commandText = computed(() => args.value.command || '')
/>
</template>
<template #label>
<span v-if="loading" class="mk-conversation-loading" />
<ConversationLoading v-if="loading" class="shrink-0" :size="16" />
<svg class="shrink-0" viewBox="0 0 16 16" width="16" height="16" fill="none">
<path d="M7 8l4 4-4 4" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round" />
<path d="M2 12h5" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/>
</template>
<template #label>
<span v-if="loading" class="mk-conversation-loading" />
<ConversationLoading v-if="loading" class="shrink-0" :size="16" />
<MkIcon name="icon_command_outlined"></MkIcon>
<span :title="commandText || 'terminal'" class="min-w-0 max-w-[300px] truncate">{{ commandText || 'terminal' }}</span>
</template>
Expand All @@ -26,6 +26,7 @@
<script setup lang="ts">
import { computed, ref, watch } from 'vue'
import type { ChatContent } from '@/api/types'
import ConversationLoading from '@/conversation-panel/components/loading/index.vue'
import { extractPartialJsonField } from './extract-partial-json'

defineOptions({ name: 'ConversationTerminalContent' })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { computed, ref } from 'vue'
import { useI18n } from 'vue-i18n'
import type { ChatContent, Dict } from '@/api/types'
import ConversationLoading from '@/conversation-panel/components/loading/index.vue'

const { t } = useI18n({ useScope: 'global' })

Expand Down Expand Up @@ -70,7 +71,7 @@ const formattedResult = computed(() => tryFormatJson(props.content.content))
/>
</template>
<template #label>
<span v-if="loading" class="mk-conversation-loading" />
<ConversationLoading v-if="loading" class="shrink-0" :size="16" />
<MkIcon name="icon_busy_outlined" />
<span class="min-w-0 max-w-[300px] truncate" :title="toolTitle">{{ toolTitle }}</span>
<el-tag v-if="isFailed" size="small" :type="statusType">{{ statusText }}</el-tag>
Expand Down
Loading
Loading