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
10 changes: 5 additions & 5 deletions ui/src/workflow-canvas/execution-details/BaseHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ const tokenCount = computed(() => (props.data?.message_tokens || 0) + (props.dat
</script>

<template>
<div class="flex-between w-full">
<div class="flex-align-center gap-2">
<component :is="nodeIconComponent" v-if="nodeIconComponent" :size="24" />
<h6>{{ data.name }}</h6>
<div class="flex-between min-w-0 w-full gap-2">
<div class="flex-align-center min-w-0 gap-2">
<component :is="nodeIconComponent" v-if="nodeIconComponent" class="shrink-0" :size="24" />
<h6 class="truncate" :title="data.name">{{ data.name }}</h6>
</div>
<div class="flex-align-center gap-3 text-N600">
<div class="flex-align-center shrink-0 gap-3 text-N600">
<span v-if="showTokens">{{ formatTokenNumber(tokenCount) }} tokens</span>
<span v-if="!isRunning">{{ data?.run_time?.toFixed(2) || '0.00' }} s</span>

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.

Here's my review of the diff:

Observations

1. data.name — inconsistent optional chaining

  • The template uses {{ data.name }}, :title="data.name", and data?.run_time (with ?.). If data can be undefined, data.name will throw. Make it consistent: use data?.name (and :title="data?.name"), or ensure data is always defined via a prop validator/required: true.

2. Truncation requires both parent and element to shrink

  • You correctly added min-w-0 on both containers and shrink-0 on the icon/suffix — good.
  • However, <h6 class="truncate"> needs min-w-0 too (or overflow: hidden) in some flex layouts. Tailwind's truncate includes overflow-hidden; text-overflow: ellipsis; white-space: nowrap, but if h6 is itself a flex item inside .flex-align-center, adding min-w-0 explicitly to it is safer.

3. Layout structure mismatch

  • Outer container is flex-between (presumably justify-content: space-between), and you added gap-2. With justify-content: space-between the gap has no effect when the two children fill the width, and truncation works because the left group shrinks. Consider using justify-between + min-w-0 is fine, but double-check the .flex-between utility doesn't also set align-items incorrectly for your icon alignment.

4. :size="24" vs class="shrink-0"

  • Fine, but verify the component forwards class and size to its root element (Vue fallthrough). If nodeIconComponent is a fragment or doesn't inheritAttrs, shrink-0 may be dropped silently.

5. Accessibility

  • :title="data.name" gives a native tooltip, which is acceptable, but consider a real tooltip component for keyboard/touch accessibility. Also add aria-label if the truncated text is critical.

6. Unchanged line — potential issue

  • <span v-if="!isRunning">{{ data?.run_time?.toFixed(2) || '0.00' }} s</span> — toFixed returns a string like "0.00", which is truthy, so || '0.00' only triggers when toFixed is skipped (undefined/null run_time). That's fine, but 0 → "0.00" is also truthy, so behavior is correct. No change needed, just confirming intent.

7. tokenCount (context)

  • (props.data?.message_tokens || 0) + ... — using || vs ?? is harmless for numbers here; but if a token value could legitimately be 0, both behave the same. Prefer ?? 0 for clarity/consistency.

Suggested refined snippet

<div class="flex-between min-w-0 w-full gap-2">
  <div class="flex-align-center min-w-0 gap-2">
    <component :is="nodeIconComponent" v-if="nodeIconComponent" class="shrink-0" :size="24" />
    <h6 class="min-w-0 truncate" :title="data?.name">{{ data?.name }}</h6>
  </div>
  <div class="flex-align-center shrink-0 gap-3 text-N600">
    ...

Summary

The changes are directionally correct for handling long names via truncation. Main fixes: (a) consistent optional chaining on data, (b) ensure min-w-0 on the <h6> itself, (c) verify class fallthrough on the dynamic component.

Expand Down
Loading