Repository navigation
fix: truncate long node names in workflow execution details - #8298
Merged
Merged
Conversation
shaohuzhang1
commented
Dec 4, 2026
| <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> | ||
|
|
Contributor
Author
There was a problem hiding this comment.
Here's my review of the diff:
Observations
1. data.name — inconsistent optional chaining
- The template uses
{{ data.name }},:title="data.name", anddata?.run_time(with?.). Ifdatacan be undefined,data.namewill throw. Make it consistent: usedata?.name(and:title="data?.name"), or ensuredatais always defined via a prop validator/required: true.
2. Truncation requires both parent and element to shrink
- You correctly added
min-w-0on both containers andshrink-0on the icon/suffix — good. - However,
<h6 class="truncate">needsmin-w-0too (oroverflow: hidden) in some flex layouts. Tailwind'struncateincludesoverflow-hidden; text-overflow: ellipsis; white-space: nowrap, but ifh6is itself a flex item inside.flex-align-center, addingmin-w-0explicitly to it is safer.
3. Layout structure mismatch
- Outer container is
flex-between(presumablyjustify-content: space-between), and you addedgap-2. Withjustify-content: space-betweenthe gap has no effect when the two children fill the width, and truncation works because the left group shrinks. Consider usingjustify-between+min-w-0is fine, but double-check the.flex-betweenutility doesn't also setalign-itemsincorrectly for your icon alignment.
4. :size="24" vs class="shrink-0"
- Fine, but verify the
componentforwardsclassandsizeto its root element (Vue fallthrough). IfnodeIconComponentis a fragment or doesn'tinheritAttrs,shrink-0may 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 addaria-labelif the truncated text is critical.
6. Unchanged line — potential issue
<span v-if="!isRunning">{{ data?.run_time?.toFixed(2) || '0.00' }} s</span>—toFixedreturns a string like"0.00", which is truthy, so|| '0.00'only triggers whentoFixedis skipped (undefined/null run_time). That's fine, but0→"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 be0, both behave the same. Prefer?? 0for 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix: truncate long node names in workflow execution details