xueyiming 6 дней назад
Родитель
Сommit
aeac0b45b6
2 измененных файлов с 10 добавлено и 12 удалено
  1. 5 9
      frontend/src/CategoryEffectTreeApp.tsx
  2. 5 3
      frontend/src/categoryEffectTree.css

+ 5 - 9
frontend/src/CategoryEffectTreeApp.tsx

@@ -968,19 +968,15 @@ export default function CategoryEffectTreeApp() {
 
     const levelHeaders: LevelHeader[] = [];
     for (let depth = 0; depth <= maxDepth; depth += 1) {
-      const nodesAtDepth = layoutNodes.filter((node) => node.depth === depth);
-      if (nodesAtDepth.length === 0) {
+      const categoryNodes = layoutNodes.filter(
+        (node) => node.depth === depth && node.kind === "category",
+      );
+      if (categoryNodes.length === 0) {
         continue;
       }
-      const categoryNodes = nodesAtDepth.filter((node) => node.kind === "category");
-      const elementOnly = categoryNodes.length === 0;
-      let label = "元素";
-      if (!elementOnly) {
-        label = `L${depth + 1}`;
-      }
       levelHeaders.push({
         depth,
-        label,
+        label: `L${depth + 1}`,
         x: depth * (NODE_WIDTH + COLUMN_GAP) + CANVAS_PADDING,
       });
     }

+ 5 - 3
frontend/src/categoryEffectTree.css

@@ -241,9 +241,10 @@ body {
 }
 
 .cet-viewport-controls {
-  position: absolute;
-  top: 10px;
-  right: 12px;
+  position: relative;
+  align-self: flex-end;
+  flex-shrink: 0;
+  margin: 6px 12px 0;
   z-index: 15;
   display: inline-flex;
   align-items: center;
@@ -300,6 +301,7 @@ body.cet-tree-fullscreen-active .demand-nav {
   border-bottom: 1px dashed #dbe3ef;
   background: linear-gradient(180deg, rgba(248, 250, 252, 0.98) 0%, rgba(248, 250, 252, 0.92) 100%);
   box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
+  padding-right: 12px;
 }
 
 .cet-level-headers-track {