Skip to content
Merged
Show file tree
Hide file tree
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions src/composables/graph/useGraphNodeManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export interface SafeWidgetData {
name: string
type: string
value: WidgetValue
label?: string
options?: Record<string, unknown>
callback?: ((value: unknown) => void) | undefined
}
Expand Down Expand Up @@ -86,6 +87,7 @@ export function useGraphNodeManager(graph: LGraph): GraphNodeManager {
name: widget.name,
type: widget.type,
value: value,
label: widget.label,
options: widget.options ? { ...widget.options } : undefined,
callback: widget.callback
}
Expand Down
8 changes: 6 additions & 2 deletions src/renderer/extensions/vueNodes/components/NodeHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,10 @@ import IconButton from '@/components/button/IconButton.vue'
import EditableText from '@/components/common/EditableText.vue'
import type { VueNodeData } from '@/composables/graph/useGraphNodeManager'
import { useErrorHandling } from '@/composables/useErrorHandling'
import { st } from '@/i18n'
import { useNodeTooltips } from '@/renderer/extensions/vueNodes/composables/useNodeTooltips'
import { app } from '@/scripts/app'
import { normalizeI18nKey } from '@/utils/formatUtil'
import {
getLocatorIdFromNodeData,
getNodeByLocatorId
Expand Down Expand Up @@ -119,8 +121,10 @@ const tooltipConfig = computed(() => {
const resolveTitle = (info: VueNodeData | undefined) => {
const title = (info?.title ?? '').trim()
if (title.length > 0) return title
const type = (info?.type ?? '').trim()
return type.length > 0 ? type : 'Untitled'

const nodeType = (info?.type ?? '').trim() || 'Untitled'
const key = `nodeDefs.${normalizeI18nKey(nodeType)}.display_name`
return st(key, nodeType)
}

// Local state for title to provide immediate feedback
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ const processedWidgets = computed((): ProcessedWidget[] => {
name: widget.name,
type: widget.type,
value: widget.value,
label: widget.label,
options: widget.options,
callback: widget.callback
Comment on lines 135 to 140
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like it could just use the spread operator.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it's extracting safe properties, otherwise private fields would be included.

}
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/extensions/vueNodes/components/OutputSlot.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
v-if="!dotOnly"
class="whitespace-nowrap text-sm font-normal dark-theme:text-slate-200 text-stone-200 lod-toggle"
>
{{ slotData.name || `Output ${index}` }}
{{ slotData.localized_name || slotData.name || `Output ${index}` }}
</span>
<LODFallback />
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type { SimplifiedWidget } from '@/types/simplifiedWidget'
import LODFallback from '../../../components/LODFallback.vue'

defineProps<{
widget: Pick<SimplifiedWidget<string | number | undefined>, 'name'>
widget: Pick<SimplifiedWidget<string | number | undefined>, 'name' | 'label'>
}>()
</script>

Expand All @@ -19,7 +19,7 @@ defineProps<{
v-if="widget.name"
class="text-sm text-stone-200 dark-theme:text-slate-200 font-normal flex-1 truncate w-20 lod-toggle"
>
{{ widget.name }}
{{ widget.label || widget.name }}
</p>
<LODFallback />
</div>
Expand Down
3 changes: 3 additions & 0 deletions src/types/simplifiedWidget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ export interface SimplifiedWidget<
/** Current value of the widget */
value: T

/** Localized display label (falls back to name if not provided) */
label?: string

/** Widget options including filtered PrimeVue props */
options?: O

Expand Down