gui: drag-and-drop sidebar, tree expand, localization fixes

TreeNode.svelte:
- Native HTML5 drag-and-drop with move effect
- Lazy tree expand/collapse (arrow for container types only)
- Drop validation: no self-drop, container-only, descendant check
- 'case' icon kind added

App.svelte:
- toggleExpand loads children via ListChildren into tree
- handleNodeDrop calls MoveNode(draggedId, targetId), refreshes tree
- Root workspace area is a drop target (handleDropRoot)
- Overview section shows nodeKindLabel instead of raw type enum
- Context menu shows Create only for container types
- Create modal title uses 'Создать элемент'
- submitCreateNode expands parent after child creation

TemplateIcon.svelte: added 'case' icon (folder-like with dividers)
i18n: added nav.createNode key (ru+en)
This commit is contained in:
2026-06-03 03:18:04 +08:00
parent f022f46909
commit b2dcb116c9
10 changed files with 160 additions and 29 deletions
+5
View File
@@ -32,6 +32,11 @@
{:else if kind === 'file'}
<path d="M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"/>
<polyline points="13 2 13 9 20 9"/>
{:else if kind === 'case'}
<rect x="3" y="5" width="18" height="14" rx="2"/>
<polyline points="3 10 21 10"/>
<line x1="8" y1="5" x2="8" y2="19"/>
<line x1="16" y1="5" x2="16" y2="19"/>
{:else}
<circle cx="12" cy="12" r="10"/>
<line x1="12" y1="16" x2="12" y2="12"/>
+1
View File
@@ -15,6 +15,7 @@ export default {
'nav.noNodes': 'No nodes',
'nav.openFolder': 'Open folder',
'nav.createInside': 'Create inside',
'nav.createNode': 'Create element',
'nav.selectPrompt': 'Select a section or case',
'nav.brand': 'Verstak',
+1
View File
@@ -20,6 +20,7 @@ export default {
'nav.noNodes': 'Нет узлов',
'nav.openFolder': 'Открыть папку',
'nav.createInside': 'Создать внутри',
'nav.createNode': 'Создать элемент',
'tab.overview': 'Обзор',
'tab.notes': 'Заметки',