feat(studio): improve blocks panel UX

- Rename "Blocks" tab to "Catalog"
- Replace fullscreen hover popup with inline preview in main area
- Fix z-index: newly added blocks/components use max existing z-index + 1
  instead of element count, ensuring they appear on top
This commit is contained in:
Miguel Ángel
2026-05-21 18:27:29 -04:00
parent 1d6ea53db9
commit 9f9b9f4c06
6 changed files with 71 additions and 102 deletions
+6 -1
View File
@@ -126,7 +126,12 @@ export async function addBlockToProject(
? Math.max(...relevantElements.map((te) => te.track)) + 1
: 1);
const zIndex = Math.max(1, relevantElements.length + 1);
const zIndexMatches = originalContent.matchAll(/z-index:\s*(\d+)/g);
let maxExistingZ = 0;
for (const m of zIndexMatches) {
maxExistingZ = Math.max(maxExistingZ, parseInt(m[1]!, 10));
}
const zIndex = maxExistingZ + 1;
const width = isBlock
? (block as { dimensions: { width: number } }).dimensions.width