Nodes
@@ -819,6 +819,25 @@ const nodeFilter = reactive({
const filtersMenuOpen = ref(false)
+watch(flowSearch, (value) => {
+ if (value == null) {
+ flowSearch.value = ''
+ } else if (typeof value !== 'string') {
+ flowSearch.value = String(value)
+ }
+})
+
+watch(
+ () => nodeFilter.search,
+ (value) => {
+ if (value == null) {
+ nodeFilter.search = ''
+ } else if (typeof value !== 'string') {
+ nodeFilter.search = String(value)
+ }
+ }
+)
+
const activeFilterCount = computed(() => {
let count = 0
if (nodeFilter.role !== 'all') count += 1
@@ -881,7 +900,7 @@ let lastFlowAutosaveError = ''
let lastNodeAutosaveError = ''
const filteredFlows = computed(() => {
- const query = flowSearch.value.trim().toLowerCase()
+ const query = String(flowSearch.value ?? '').trim().toLowerCase()
if (!query) return flows.value
return flows.value.filter((flow) =>
[flow.name, flow.slug, flow.description].some((entry) => entry?.toLowerCase().includes(query))
@@ -904,7 +923,7 @@ const phaseFilterOptions = computed(() => {
const nodeSelectorItems = computed(() => {
if (!flowDetail.value) return []
- const query = nodeFilter.search.trim().toLowerCase()
+ const query = String(nodeFilter.search ?? '').trim().toLowerCase()
const role = nodeFilter.role
const phase = nodeFilter.phase
const autopOnly = nodeFilter.autopOnly
@@ -938,7 +957,7 @@ const nodeSelectorItems = computed(() => {
const canvasNodes = computed(() => {
if (!flowDetail.value) return []
const flow = flowDetail.value.flow
- const query = nodeFilter.search.trim().toLowerCase()
+ const query = String(nodeFilter.search ?? '').trim().toLowerCase()
return flowDetail.value.nodes.map((node) => {
const autopCount = (node.transitions || []).filter((transition) => transition.autoTrigger).length
const matchesRole = nodeFilter.role === 'all' || node.role === nodeFilter.role