Adjust latent combo tree root (#9)

This commit is contained in:
Maxed-Out-99
2025-09-25 11:25:17 -07:00
committed by GitHub
parent 1a78af02fe
commit 612eea6e15
+21 -4
View File
@@ -272,11 +272,28 @@ app.registerExtension({
const itemsSymbol = Symbol("items");
// First pass - organize items into folder structure
for (const item of items) {
const path = item.getAttribute("data-value").split(splitBy);
for (const item of items) {
let path = item
.getAttribute("data-value")
.split(splitBy)
.filter((segment) => segment.length);
// Remove path from visible text
item.textContent = path[path.length - 1];
if (type === "latents") {
const latentsIndex = path.findIndex(
(segment) => segment.toLowerCase() === "latents"
);
if (latentsIndex !== -1) {
path = path.slice(latentsIndex + 1);
}
}
if (!path.length) {
item.remove();
continue;
}
// Remove path from visible text
item.textContent = path[path.length - 1];
if (path.length > 1) {
// Add the prefix path back in so it can be filtered on
const prefix = $el("span.pysssss-combo-prefix", {