fix(webui): compact config viewer, clear unknown helper sel, harness port guard

This commit is contained in:
2026-11-25 11:52:38 +00:00
parent 1f8bdd8777
commit 945621a3c5
9 changed files with 123 additions and 16 deletions
+11
View File
@@ -38,3 +38,14 @@ export function filterSections(sections: ConfigSection[], query: string): Config
const q = query.trim().toLowerCase()
return q === '' ? sections : sections.filter((s) => s.key.toLowerCase().includes(q))
}
const SMALL_SECTION_LINES = 8
/** Keys of the sections that start collapsed: all but small ones, filter matches and the jump target. */
export function initialFold(sections: ConfigSection[], opts: { filter?: string; target?: string }): Set<string> {
const matched = new Set(filterSections(sections, opts.filter ?? '').map((s) => s.key))
const filtering = (opts.filter ?? '').trim() !== ''
return new Set(
sections.filter((s) => s.lineCount > SMALL_SECTION_LINES && s.key !== opts.target && !(filtering && matched.has(s.key))).map((s) => s.key),
)
}