Spaces:
Sleeping
Sleeping
Commit ·
c1cf092
1
Parent(s): 38d18fd
fix UI
Browse files- app/static/Universe3D.js +9 -1
- app/static/script.js +3 -4
app/static/Universe3D.js
CHANGED
|
@@ -170,6 +170,9 @@ export function initUniverse(containerId, data, onNodeClick) {
|
|
| 170 |
stopAutoTour: stopAutoTour,
|
| 171 |
performQuantumMerge: performQuantumMerge,
|
| 172 |
isQuantumMergeActive: () => quantumMerge.active
|
|
|
|
|
|
|
|
|
|
| 173 |
};
|
| 174 |
}
|
| 175 |
|
|
@@ -696,13 +699,18 @@ function performQuantumMerge(keepSprite, deleteSprites) {
|
|
| 696 |
// 3. After 3 seconds, trigger supernova
|
| 697 |
setTimeout(() => {
|
| 698 |
triggerSupernova(() => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 699 |
console.log("Quantum merge complete!");
|
| 700 |
window.dispatchEvent(new CustomEvent('quantum-merge-complete', {
|
| 701 |
detail: { deleteSprites }
|
| 702 |
}));
|
| 703 |
});
|
| 704 |
}, 3000);
|
| 705 |
-
}
|
| 706 |
|
| 707 |
// --- SEARCH VISUALIZATION ---
|
| 708 |
function setupSearchEvents() {
|
|
|
|
| 170 |
stopAutoTour: stopAutoTour,
|
| 171 |
performQuantumMerge: performQuantumMerge,
|
| 172 |
isQuantumMergeActive: () => quantumMerge.active
|
| 173 |
+
findSpriteByPath: (path) => clusterParticles.find(p => p.userData.path === path),
|
| 174 |
+
findSpritesByClusterAndExclude: (cluster, excludePath) =>
|
| 175 |
+
clusterParticles.filter(p => p.userData.cluster === cluster && p.userData.path !== excludePath)
|
| 176 |
};
|
| 177 |
}
|
| 178 |
|
|
|
|
| 699 |
// 3. After 3 seconds, trigger supernova
|
| 700 |
setTimeout(() => {
|
| 701 |
triggerSupernova(() => {
|
| 702 |
+
deleteSprites.forEach(sprite => {
|
| 703 |
+
scene.remove(sprite);
|
| 704 |
+
const index = clusterParticles.indexOf(sprite);
|
| 705 |
+
if (index > -1) clusterParticles.splice(index, 1);
|
| 706 |
+
});
|
| 707 |
+
|
| 708 |
console.log("Quantum merge complete!");
|
| 709 |
window.dispatchEvent(new CustomEvent('quantum-merge-complete', {
|
| 710 |
detail: { deleteSprites }
|
| 711 |
}));
|
| 712 |
});
|
| 713 |
}, 3000);
|
|
|
|
| 714 |
|
| 715 |
// --- SEARCH VISUALIZATION ---
|
| 716 |
function setupSearchEvents() {
|
app/static/script.js
CHANGED
|
@@ -473,10 +473,9 @@ document.getElementById("smart-cleanup-btn").onclick = async () => {
|
|
| 473 |
if (!confirm(`Keep 1 and delete the rest of '${currentClusterName}'?`)) return;
|
| 474 |
|
| 475 |
if (universeController && universeState.data.length > 0) {
|
| 476 |
-
const keepSprite =
|
| 477 |
-
const deleteSprites =
|
| 478 |
-
|
| 479 |
-
);
|
| 480 |
|
| 481 |
if (keepSprite && deleteSprites.length > 0) {
|
| 482 |
universeController.performQuantumMerge(keepSprite, deleteSprites);
|
|
|
|
| 473 |
if (!confirm(`Keep 1 and delete the rest of '${currentClusterName}'?`)) return;
|
| 474 |
|
| 475 |
if (universeController && universeState.data.length > 0) {
|
| 476 |
+
const keepSprite = universeController.findSpriteByPath(keepPath);
|
| 477 |
+
const deleteSprites = universeController.findSpritesByClusterAndExclude(currentClusterName, keepPath);
|
| 478 |
+
|
|
|
|
| 479 |
|
| 480 |
if (keepSprite && deleteSprites.length > 0) {
|
| 481 |
universeController.performQuantumMerge(keepSprite, deleteSprites);
|