Skip to content

Commit 0fbea61

Browse files
committed
cleanup: Parameters and searchbox padding
1 parent 6687af7 commit 0fbea61

File tree

3 files changed

+22
-30
lines changed

3 files changed

+22
-30
lines changed

src/components/rightSidePanel/RightSidePanel.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ watchEffect(() => {
9494
<template>
9595
<div class="flex size-full flex-col bg-interface-panel-surface">
9696
<!-- Panel Header -->
97-
<section class="border-b border-interface-stroke pt-1">
97+
<section class="pt-1">
9898
<div class="flex items-center justify-between pl-4 pr-3">
9999
<h3 class="my-3.5 text-sm font-semibold line-clamp-2">
100100
{{ panelTitle }}

src/components/rightSidePanel/layout/SidePanelSearch.vue

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,7 @@ const debouncedSearchQuery = refDebounced(searchQuery, 100, {
2222
watch(searchQuery, (value) => {
2323
isQuerying.value = value !== debouncedSearchQuery.value
2424
})
25-
const updateKey =
26-
typeof props.updateKey === 'function'
27-
? props.updateKey
28-
: toRef(props, 'updateKey')
25+
const updateKey = toRef(props, 'updateKey')
2926
3027
watch(
3128
[debouncedSearchQuery, updateKey],

src/components/rightSidePanel/parameters/TabParameters.vue

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,30 @@ import type { IBaseWidget } from '@/lib/litegraph/src/types/widgets'
77
import SidePanelSearch from '../layout/SidePanelSearch.vue'
88
import SectionWidgets from './SectionWidgets.vue'
99
10-
const props = defineProps<{
10+
const { nodes } = defineProps<{
1111
nodes: LGraphNode[]
1212
}>()
1313
14-
const widgetsSectionDataList = computed(() => {
15-
const list: {
16-
widgets: { node: LGraphNode; widget: IBaseWidget }[]
17-
node: LGraphNode
18-
}[] = []
19-
for (const node of props.nodes) {
20-
const shownWidgets: IBaseWidget[] = []
21-
for (const widget of node.widgets ?? []) {
22-
if (widget.options?.canvasOnly || widget.options?.hidden) continue
23-
shownWidgets.push(widget)
24-
}
25-
list.push({
26-
widgets: shownWidgets?.map((widget) => ({ node, widget })) ?? [],
14+
type NodeWidgetsList = Array<{ node: LGraphNode; widget: IBaseWidget }>
15+
type NodeWidgetsListList = Array<{
16+
node: LGraphNode
17+
widgets: NodeWidgetsList
18+
}>
19+
20+
const widgetsSectionDataList = computed((): NodeWidgetsListList => {
21+
return nodes.map((node) => {
22+
const { widgets = [] } = node
23+
const shownWidgets = widgets
24+
.filter((w) => !(w.options?.canvasOnly || w.options?.hidden))
25+
.map((widget) => ({ node, widget }))
26+
return {
27+
widgets: shownWidgets,
2728
node
28-
})
29-
}
30-
return list
29+
}
30+
})
3131
})
3232
33-
const searchedWidgetsSectionDataList = shallowRef<
34-
{
35-
widgets: { node: LGraphNode; widget: IBaseWidget }[]
36-
node: LGraphNode
37-
}[]
38-
>([])
33+
const searchedWidgetsSectionDataList = shallowRef<NodeWidgetsListList>([])
3934
4035
/**
4136
* Searches widgets in all selected nodes and returns search results.
@@ -72,8 +67,8 @@ async function searcher(query: string) {
7267
</script>
7368

7469
<template>
75-
<div class="p-4 flex gap-2 border-b border-interface-stroke">
76-
<SidePanelSearch :searcher :update-key="widgetsSectionDataList" />
70+
<div class="px-4 pb-4 flex gap-2 border-b border-interface-stroke">
71+
<SidePanelSearch :searcher :update-key="searchedWidgetsSectionDataList" />
7772
</div>
7873
<SectionWidgets
7974
v-for="section in searchedWidgetsSectionDataList"

0 commit comments

Comments
 (0)