fix(workspace): Enter keeps an empty bullet on its level when siblings follow
MindSift CI & Docker Release / Build, Test in Container & Push (push) Successful in 1m17s

Outdenting an empty bullet on Enter only happens when no bullet on the
same level follows in the branch; otherwise a new bullet is added below.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
sandrodachandClaude Opus 5.5 committed 2026-10-30 22:09:47 +01:00
1 parent b136e5dfad
commit 05355989a8
4 files changed
+50 -3

No files matched your search

@@ -207,6 +207,33 @@ describe('slash command menu and outliner fixes', () => {
expect(onCreateBelow).toHaveBeenCalledWith('b1', '');
});
it('keeps an empty indented bullet on its level when another bullet on that level follows', () => {
const onIndent = vi.fn();
const onCreateBelow = vi.fn();
const { container } = render(
<OutlinerBlock
docId="d"
block={{ id: 'b1', type: 'bullet', content: '', level: 1 } as DocumentBlock}
index={0}
isLast={false}
siblingFollows
maxAllowedLevel={2}
hasChildren={false}
isFocused
canEdit
onUpdateBlock={() => {}}
onCreateBlockBelow={onCreateBelow}
onDeleteBlock={() => {}}
onIndentBlock={onIndent}
onNavigateFocus={() => {}}
registerTextareaRef={() => {}}
/>
);
fireEvent.keyDown(container.querySelector('textarea') as HTMLTextAreaElement, { key: 'Enter' });
expect(onIndent).not.toHaveBeenCalled();
expect(onCreateBelow).toHaveBeenCalledWith('b1', '');
});
it('inserts a bare URL for /link with a web address in an empty bullet, and [Text](url) otherwise', () => {
const updates: DocumentBlock[] = [];
const block = { id: 'b1', type: 'bullet', content: '', level: 0 } as DocumentBlock;