diff --git a/frontend/src/features/workspace/WorkspaceView.tsx b/frontend/src/features/workspace/WorkspaceView.tsx index d90b017..6335247 100644 --- a/frontend/src/features/workspace/WorkspaceView.tsx +++ b/frontend/src/features/workspace/WorkspaceView.tsx @@ -211,23 +211,16 @@ export const WorkspaceView: React.FC = ({ tags.push(`folder:${path}`); } const created = await api.createDocument({ - title: 'Neuer Gedanke / Notiz', + title: 'Neue Notiz', icon: '📄', folderPath: path, blocks: [ { id: `blk_${Date.now()}_1`, type: 'bullet', - content: 'Erster Gedanke…', + content: '', level: 0, }, - { - id: `blk_${Date.now()}_2`, - type: 'todo', - content: 'Nächste Aufgabe', - checked: false, - level: 1, - }, ], tags, isPinned: false, @@ -1391,6 +1384,17 @@ export const WorkspaceView: React.FC = ({ type="text" value={selectedDoc.title} onChange={(e) => persistDocument({ ...selectedDoc, title: e.target.value })} + onKeyDown={(e) => { + if (e.key === 'Enter') { + e.preventDefault(); + if (selectedDoc.blocks.length > 0) { + const firstId = selectedDoc.blocks[0].id; + blockInputRefs.current[firstId]?.focus(); + } else { + insertNewBulletAfter(-1, 0); + } + } + }} placeholder="Dokument-Titel…" className="w-full bg-transparent text-xl sm:text-2xl font-bold text-main focus:outline-none placeholder:text-faint" /> @@ -1423,7 +1427,19 @@ export const WorkspaceView: React.FC = ({ {/* =========================================================== */} {/* LOGSEQ HIERARCHICAL BULLET LIST CANVAS */} {/* =========================================================== */} -
+
{ + if (e.target === e.currentTarget) { + if (selectedDoc.blocks.length === 0) { + insertNewBulletAfter(-1, 0); + } else { + const lastBlock = selectedDoc.blocks[selectedDoc.blocks.length - 1]; + blockInputRefs.current[lastBlock.id]?.focus(); + } + } + }} + > {visibleBlocks.map(({ block, originalIndex }) => { const blockLevel = Math.max(0, (block.level || 0) - (zoomedBlock ? (zoomedBlock.level || 0) + 1 : 0)); const isChildrenPresent = hasChildren(selectedDoc.blocks, originalIndex); @@ -1738,39 +1754,6 @@ export const WorkspaceView: React.FC = ({ ); })}
- - {/* Bottom Add Bullet Button */} -
- -
) : (