Skip to content

Commit 0a411db

Browse files
committed
Remove badge element handling from vue compat canvas layout
1 parent 553a2b6 commit 0a411db

1 file changed

Lines changed: 8 additions & 15 deletions

File tree

js/node/resolution_master_node_lifecycle.js

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ export const nodeLifecycleMethods = {
4747
: minimumHeight;
4848
},
4949

50+
getVueCompatBottomBadgeClearance() {
51+
return this.isVueNodesMode() && this.collapsedSections?.extraControls ? 23 : 0;
52+
},
53+
5054
scheduleVueCompatHeightRedraw() {
5155
if (this._vueCompatHeightRedrawFrame != null) return;
5256

@@ -143,7 +147,10 @@ export const nodeLifecycleMethods = {
143147

144148
const minimumHeight = this.getVueCompatWidgetHeight();
145149
const hostHeight = Math.floor(Number(canvasHost.clientHeight) || 0);
146-
const targetHeight = Math.max(minimumHeight, hostHeight);
150+
const targetHeight = Math.max(
151+
minimumHeight,
152+
hostHeight - this.getVueCompatBottomBadgeClearance()
153+
);
147154
const currentHeight = Number(height) || minimumHeight;
148155
if (!Number.isFinite(targetHeight) || Math.abs(targetHeight - currentHeight) <= 1) {
149156
return { ctx, height: currentHeight };
@@ -197,18 +204,11 @@ export const nodeLifecycleMethods = {
197204
if (this._vueCompatLayout?.widgetsGrid !== widgetsGrid) {
198205
this.teardownVueCompatCanvasLayout();
199206
const canvasHost = canvasElement.parentElement;
200-
const badgeElement = Array.from(bodyElement.children).find(element =>
201-
element !== slotsElement
202-
&& element !== widgetsGrid
203-
&& element.classList?.contains('h-5')
204-
&& element.classList?.contains('text-muted-foreground')
205-
) || null;
206207
this._vueCompatLayout = {
207208
bodyElement,
208209
widgetsGrid,
209210
slotsElement,
210211
canvasHost,
211-
badgeElement,
212212
bodyPosition: bodyElement.style.position,
213213
canvasHostMinHeight: canvasHost?.style.minHeight ?? '',
214214
gridMarginTop: widgetsGrid.style.marginTop,
@@ -221,7 +221,6 @@ export const nodeLifecycleMethods = {
221221
slotsWidth: slotsElement.style.width,
222222
slotsZIndex: slotsElement.style.zIndex,
223223
slotsPointerEvents: slotsElement.style.pointerEvents,
224-
badgeDisplay: badgeElement?.style.display ?? '',
225224
slotDotPointerEvents: new Map()
226225
};
227226
}
@@ -238,9 +237,6 @@ export const nodeLifecycleMethods = {
238237
slotsElement.style.width = "100%";
239238
slotsElement.style.zIndex = "2";
240239
slotsElement.style.pointerEvents = "none";
241-
if (this._vueCompatLayout.badgeElement) {
242-
this._vueCompatLayout.badgeElement.style.display = "none";
243-
}
244240
for (const slotDot of slotsElement.querySelectorAll?.('[data-testid="slot-connection-dot"]') || []) {
245241
if (!this._vueCompatLayout.slotDotPointerEvents.has(slotDot)) {
246242
this._vueCompatLayout.slotDotPointerEvents.set(slotDot, slotDot.style.pointerEvents);
@@ -394,9 +390,6 @@ export const nodeLifecycleMethods = {
394390
layout.slotsElement.style.width = layout.slotsWidth ?? "";
395391
layout.slotsElement.style.zIndex = layout.slotsZIndex;
396392
layout.slotsElement.style.pointerEvents = layout.slotsPointerEvents;
397-
if (layout.badgeElement) {
398-
layout.badgeElement.style.display = layout.badgeDisplay;
399-
}
400393
for (const [slotDot, pointerEvents] of layout.slotDotPointerEvents) {
401394
slotDot.style.pointerEvents = pointerEvents;
402395
}

0 commit comments

Comments
 (0)