Repository navigation
fix: truncate long node names in workflow execution details #8299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,43 +24,47 @@ defineProps<{ | |
| <!-- 系统提示词 --> | ||
| <div class="mk-gray-card-sm"> | ||
| <h6 class="mb-2">{{ t('workflow.systemPrompt.label') }}</h6> | ||
| <div>{{ data.system || '-' }}</div> | ||
| <el-scrollbar max-height="500" class="-mr-3" view-class="pr-3"> | ||
| {{ data.system || '-' }} | ||
| </el-scrollbar> | ||
| </div> | ||
|
|
||
| <!-- 本次对话 --> | ||
| <div class="mk-gray-card-sm"> | ||
| <h6 class="mb-2">{{ t('execution.details.currentChat') }}</h6> | ||
| <div class="whitespace-pre-wrap space-y-2"> | ||
| <p class="mb-1 text-N600" v-if="data?.image_list?.length > 0">{{ t('upload.types.image') }}:</p> | ||
| <!-- 查看本次对话图片 --> | ||
| <div v-if="data?.image_list?.length > 0" class="flex flex-wrap gap-2"> | ||
| <template v-for="(imageItem, qIndex) in data?.image_list" :key="qIndex"> | ||
| <ImageUploadCard | ||
| :file="{ name: t('upload.types.image'), status: 'success' }" | ||
| :src="imageItem.url || imageItem" | ||
| :size="58" | ||
| :show-remove="false" | ||
| :preview-src-list="[imageItem.url || imageItem]" | ||
| /> | ||
| </template> | ||
| </div> | ||
| <p class="mb-1 text-N600" v-if="data?.video_list?.length > 0">{{ t('upload.types.video') }}:</p> | ||
| <!-- 查看本次对话视频 --> | ||
| <div v-if="data?.video_list?.length > 0" class="grid grid-cols-1 gap-2 sm:grid-cols-2"> | ||
| <template v-for="(videoItem, qIndex) in data?.video_list" :key="qIndex"> | ||
| <MkVideo :src="videoItem.url || videoItem" :name="videoItem.url" class="w-60 max-w-full"> | ||
| <el-card shadow="never" class="small cursor-pointer"> | ||
| <div class="flex-align-center gap-2"> | ||
| <img :src="getFileIconUrl('video.mp4')" alt="" width="24" class="shrink-0" /> | ||
| <span class="min-w-0 truncate">{{ videoItem.url || videoItem }}</span> | ||
| </div> | ||
| </el-card> | ||
| </MkVideo> | ||
| </template> | ||
| </div> | ||
| <el-scrollbar max-height="500" class="-mr-3" view-class="pr-3"> | ||
| <div class="whitespace-pre-wrap space-y-2"> | ||
| <p class="mb-1 text-N600" v-if="data?.image_list?.length > 0">{{ t('upload.types.image') }}:</p> | ||
| <!-- 查看本次对话图片 --> | ||
| <div v-if="data?.image_list?.length > 0" class="flex flex-wrap gap-2"> | ||
| <template v-for="(imageItem, qIndex) in data?.image_list" :key="qIndex"> | ||
| <ImageUploadCard | ||
| :file="{ name: t('upload.types.image'), status: 'success' }" | ||
| :src="imageItem.url || imageItem" | ||
| :size="58" | ||
| :show-remove="false" | ||
| :preview-src-list="[imageItem.url || imageItem]" | ||
| /> | ||
| </template> | ||
| </div> | ||
| <p class="mb-1 text-N600" v-if="data?.video_list?.length > 0">{{ t('upload.types.video') }}:</p> | ||
| <!-- 查看本次对话视频 --> | ||
| <div v-if="data?.video_list?.length > 0" class="grid grid-cols-1 gap-2 sm:grid-cols-2"> | ||
| <template v-for="(videoItem, qIndex) in data?.video_list" :key="qIndex"> | ||
| <MkVideo :src="videoItem.url || videoItem" :name="videoItem.url" class="w-60 max-w-full"> | ||
| <el-card shadow="never" class="small cursor-pointer"> | ||
| <div class="flex-align-center gap-2"> | ||
| <img :src="getFileIconUrl('video.mp4')" alt="" width="24" class="shrink-0" /> | ||
| <span class="min-w-0 truncate">{{ videoItem.url || videoItem }}</span> | ||
| </div> | ||
| </el-card> | ||
| </MkVideo> | ||
| </template> | ||
| </div> | ||
|
|
||
| <MdPreview v-if="data.question?.content" :model-value="data.question?.content" noImgZoomIn /> | ||
| </div> | ||
| <MdPreview v-if="data.question?.content" :model-value="data.question?.content" noImgZoomIn /> | ||
| </div> | ||
| </el-scrollbar> | ||
| </div> | ||
|
|
||
| <!-- 思考过程 --> | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Review of the DiffOverall the change is straightforward (wrapping two blocks in 1. Bugs / Potential Runtime Issuesa) <MkVideo :src="videoItem.url || videoItem" :name="videoItem.url" ... />
<span>{{ videoItem.url || videoItem }}</span>If :name="videoItem.url || videoItem"Same pattern should be extracted once instead of repeated three times (see §4). b) <el-scrollbar max-height="500px" ...>c) Fragile coupling of d) Long/unbroken content in the system prompt <el-scrollbar ...>
{{ data.system || '-' }}
</el-scrollbar>
<div class="whitespace-pre-wrap break-words">{{ data.system || '-' }}</div>(You also lose an explicit wrapper element elsewhere — text directly in the slot is fine, but a e) Nested scroll containers / scroll chaining
f) Keyboard accessibility 2. Minor Issues
3. Performance
4. Refactor SuggestionsNormalize media items once (types are clearly type MediaItem = string | { url: string }
const toSrc = (item: MediaItem) => (typeof item === 'string' ? item : item.url)
const images = computed(() => (data.image_list ?? []).map(toSrc))
const videos = computed(() => (data.video_list ?? []).map(toSrc))Then the template becomes Extract the repeated scroll shell: Or use a single scroll region for the whole "details" card and drop the per-section fixed heights — simpler layout, no nesting, and it adapts to the drawer height. Suggested corrected snippet (system prompt block)<div class="mk-gray-card-sm overflow-hidden">
<h6 class="mb-2">{{ t('workflow.systemPrompt.label') }}</h6>
<el-scrollbar max-height="500px" class="overscroll-contain" view-class="pr-3">
<div class="whitespace-pre-wrap break-words">{{ data.system || '-' }}</div>
</el-scrollbar>
</div>...and in the video loop: <MkVideo :src="toSrc(videoItem)" :name="toSrc(videoItem)" class="w-60 max-w-full">
...
<span class="min-w-0 truncate">{{ toSrc(videoItem) }}</span>
</MkVideo> |
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,26 +24,32 @@ function formatJson(value: unknown) { | |
| <!-- 系统提示词 --> | ||
| <div class="mk-gray-card-sm"> | ||
| <h6 class="mb-2">{{ t('workflow.systemPrompt.label') }}</h6> | ||
| <div>{{ data.system || '-' }}</div> | ||
| <el-scrollbar max-height="500" class="-mr-3" view-class="pr-3"> | ||
| {{ data.system || '-' }} | ||
| </el-scrollbar> | ||
| </div> | ||
| <!-- 用户提示词 --> | ||
| <div class="mk-gray-card-sm"> | ||
| <h6 class="mb-2">{{ t('workflow.userPrompt.label') }}</h6> | ||
| <div>{{ data.prompt || '-' }}</div> | ||
| <el-scrollbar max-height="500" class="-mr-3" view-class="pr-3"> | ||
| {{ data.prompt || '-' }} | ||
| </el-scrollbar> | ||
| </div> | ||
|
|
||
| <!-- 消息列表 --> | ||
| <!-- 上下文 --> | ||
| <div class="mk-gray-card-sm"> | ||
| <h6 class="mb-2">{{ t('workflow.llm.context.label') }}</h6> | ||
| <div class="space-y-2"> | ||
| <template v-if="data.message_list?.length > 0"> | ||
| <p v-for="(message, messageIndex) in data.message_list" :key="messageIndex" class="whitespace-pre-wrap"> | ||
| <span class="text-N600">{{ message.role }}:</span> | ||
| <span>{{ message.content }}</span> | ||
| </p> | ||
| </template> | ||
| <template v-else>-</template> | ||
| </div> | ||
| <el-scrollbar max-height="500" class="-mr-3" view-class="pr-3"> | ||
| <div class="space-y-2"> | ||
| <template v-if="data.message_list?.length > 0"> | ||
| <p v-for="(message, messageIndex) in data.message_list" :key="messageIndex" class="whitespace-pre-wrap"> | ||
| <span class="text-N600">{{ message.role }}:</span> | ||
| <span>{{ message.content }}</span> | ||
| </p> | ||
| </template> | ||
| <template v-else>-</template> | ||
| </div> | ||
| </el-scrollbar> | ||
| </div> | ||
| <!-- 结束原因 --> | ||
| <div class="mk-gray-card-sm"> | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Code Review1. Type-safety issue with
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No syntax/structural issues are obvious in the shown diff. Main points to review:
Potential issues
max-height="500"is implicitmax-height="500px"or:max-height="500"to avoid relying on Element Plus numeric-string parsing.Multiple independent
el-scrollbarregionsmax-height="500", which can create nested/awkward scrolling on one page. Consider a single outer scroll container or collapsible sections if content is long.Direct text inside
el-scrollbar<div>is clearer:whitespace-pre-wrapto preserve them.Negative margin + padding scrollbar trick
class="-mr-3"andview-class="pr-3"can cause horizontal overflow or clipping in some layouts, especially RTL or overlay-scrollbar environments. Verify visually; considerscrollbar-gutter: stableor onlypr-3.v-forkey uses index:key="historyIndex"/qIndexcan cause rendering/state issues if lists reorder or update. Prefer a stable ID if available.Inconsistent optional chaining
data.systemis not optional while other places usedata?.. Ifdatacan be undefined, this can throw. Usedata?.system.MkVideoname fallback is missing:src="videoItem.url || videoItem"handles string items, but:name="videoItem.url"does not. Use:Optimization suggestions
image_listandvideo_listinto computed arrays to avoid repeateditem.url || itemexpressions.ImageUploadCard :fileobject andgetFileIconUrl('video.mp4').length > 0checks to justdata.history_message?.lengthif only truthiness matters, though the current form is fine.