diff --git a/frontend/src/features/workspace/OutlinerBlock.tsx b/frontend/src/features/workspace/OutlinerBlock.tsx index dd8b31e..612d85b 100644 --- a/frontend/src/features/workspace/OutlinerBlock.tsx +++ b/frontend/src/features/workspace/OutlinerBlock.tsx @@ -344,11 +344,19 @@ export const OutlinerBlock: React.FC = ({ return; } - // 2. Enter (without Shift) -> Create new block on same level + // 2. Enter (without Shift) -> If block is completely empty and level > minLevel, outdent (Shift+Tab behaviour), otherwise create new block below if (e.key === 'Enter' && !e.shiftKey && block.type !== 'code') { e.preventDefault(); e.stopPropagation(); setSlashSearch(null); + + const minLevel = levelOffset || 0; + if (localContent === '' && Math.max(0, block.level || 0) > minLevel) { + flushDebounce(localContent); + onIndentBlockRef.current(block.id, -1); + return; + } + flushDebounce(localContent); onCreateBlockBelowRef.current(block.id, localContent); return;