Skip to content

Commit 247080f

Browse files
authored
fix: node header DOM hierarchy (#5961)
## Summary Fix: node header DOM hierarchy to position tooltip over text and constrain LOD fallback to text instead of full width. Keep node header full width to accommodate for colored background. ## Screenshots (if applicable) <img width="1418" height="933" alt="image" src="https://github.com/user-attachments/assets/804116d1-2444-4891-a04f-a2dfe8d586ff" /> <img width="1420" height="930" alt="image" src="https://github.com/user-attachments/assets/a884edd0-055b-4dc7-b44c-a88b8376e018" /> ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-5961-fix-node-header-DOM-hierarchy-2856d73d3650814eae04ef96fae062fe) by [Unito](https://www.unito.io)
1 parent 61d0a12 commit 247080f

File tree

1 file changed

+41
-38
lines changed

1 file changed

+41
-38
lines changed

src/renderer/extensions/vueNodes/components/NodeHeader.vue

Lines changed: 41 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -14,47 +14,51 @@
1414
:data-testid="`node-header-${nodeData?.id || ''}`"
1515
@dblclick="handleDoubleClick"
1616
>
17-
<div class="flex items-center justify-between gap-2.5 relative">
17+
<div class="flex items-center justify-between gap-2.5">
1818
<!-- Collapse/Expand Button -->
19-
<div class="flex items-center lod-toggle shrink-0 px-0.5">
20-
<IconButton
21-
size="fit-content"
22-
type="transparent"
23-
data-testid="node-collapse-button"
24-
@click.stop="handleCollapse"
25-
@dblclick.stop
19+
<div class="relative flex items-center gap-2.5">
20+
<div class="flex items-center lod-toggle shrink-0 px-0.5">
21+
<IconButton
22+
size="fit-content"
23+
type="transparent"
24+
data-testid="node-collapse-button"
25+
@click.stop="handleCollapse"
26+
@dblclick.stop
27+
>
28+
<i
29+
:class="
30+
cn(
31+
'icon-[lucide--chevron-down] size-5 transition-transform',
32+
collapsed && '-rotate-90'
33+
)
34+
"
35+
class="text-xs leading-none relative top-px text-node-component-header-icon"
36+
></i>
37+
</IconButton>
38+
</div>
39+
40+
<!-- Node Title -->
41+
<div
42+
v-tooltip.top="tooltipConfig"
43+
class="text-sm font-bold truncate flex-1 lod-toggle flex items-center gap-2"
44+
data-testid="node-title"
2645
>
27-
<i
28-
:class="
29-
cn(
30-
'icon-[lucide--chevron-down] size-5 transition-transform',
31-
collapsed && '-rotate-90'
32-
)
33-
"
34-
class="text-xs leading-none relative top-px text-node-component-header-icon"
35-
></i>
36-
</IconButton>
46+
<EditableText
47+
:model-value="displayTitle"
48+
:is-editing="isEditing"
49+
:input-attrs="{ 'data-testid': 'node-title-input' }"
50+
@edit="handleTitleEdit"
51+
@cancel="handleTitleCancel"
52+
/>
53+
<i-lucide:pin
54+
v-if="isPinned"
55+
class="size-5 text-node-component-header-icon"
56+
data-testid="node-pin-indicator"
57+
/>
58+
</div>
59+
<LODFallback />
3760
</div>
3861

39-
<!-- Node Title -->
40-
<div
41-
v-tooltip.top="tooltipConfig"
42-
class="text-sm font-bold truncate flex-1 lod-toggle flex items-center gap-2"
43-
data-testid="node-title"
44-
>
45-
<EditableText
46-
:model-value="displayTitle"
47-
:is-editing="isEditing"
48-
:input-attrs="{ 'data-testid': 'node-title-input' }"
49-
@edit="handleTitleEdit"
50-
@cancel="handleTitleCancel"
51-
/>
52-
<i-lucide:pin
53-
v-if="isPinned"
54-
class="size-5 text-node-component-header-icon"
55-
data-testid="node-pin-indicator"
56-
/>
57-
</div>
5862
<div class="flex items-center lod-toggle shrink-0">
5963
<IconButton
6064
v-if="isSubgraphNode"
@@ -70,7 +74,6 @@
7074
></i>
7175
</IconButton>
7276
</div>
73-
<LODFallback />
7477
</div>
7578
</div>
7679
</template>

0 commit comments

Comments
 (0)