feat(workspace): bring an extracted note back into the bullet
A bullet that is only a link to a note (as left by /extract) gets a
"Notiz zurückholen" button. POST /documents/{id}/inline returns the
linked note's blocks with fresh ids and trashes the note; the editor
puts the title back as text and inserts the blocks as an own edit, so
Strg+Z restores the link and the note. Only own notes that no other
note links to. Release 0.52.0.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
75aea4a7d4
commit
39a04082fc
15 files changed
+293
-11
No files matched your search
@@ -24,6 +24,7 @@ import {
|
||||
Mic,
|
||||
AudioLines,
|
||||
FileOutput,
|
||||
FileInput,
|
||||
Link2,
|
||||
Type,
|
||||
} from 'lucide-react';
|
||||
@@ -96,6 +97,7 @@ export interface OutlinerBlockProps {
|
||||
onZoomBlock?: (blockId: string) => void;
|
||||
/** Turns this bullet and its children into a note of its own */
|
||||
onExtractBlock?: (blockId: string) => void;
|
||||
onInlineBlock?: (blockId: string) => void;
|
||||
onUpdateBlock: (updated: DocumentBlock, immediate?: boolean) => void;
|
||||
onCreateBlockBelow: (afterBlockId: string, newContent?: string) => void;
|
||||
onDeleteBlock: (blockId: string, deleteSubtree?: boolean) => void;
|
||||
@@ -151,6 +153,7 @@ export const OutlinerBlock: React.FC<OutlinerBlockProps> = ({
|
||||
levelOffset = 0,
|
||||
onZoomBlock,
|
||||
onExtractBlock,
|
||||
onInlineBlock,
|
||||
onUpdateBlock,
|
||||
onCreateBlockBelow,
|
||||
onDeleteBlock,
|
||||
@@ -1724,6 +1727,19 @@ export const OutlinerBlock: React.FC<OutlinerBlockProps> = ({
|
||||
</button>
|
||||
)}
|
||||
|
||||
{/* The way back: a bullet that only links to a note gets that note's bullets again */}
|
||||
{canEdit && onInlineBlock && isNoteLinkOnly(localContent) && !mediaPicker && (
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => onInlineBlock(block.id)}
|
||||
className="p-1 sm:p-0.5 min-w-[28px] min-h-[28px] sm:min-w-0 sm:min-h-0 flex items-center justify-center text-faint hover:text-accent rounded-btn transition-colors cursor-pointer"
|
||||
title="Notiz zurückholen (ihre Punkte kommen wieder hierher, die Notiz in den Papierkorb)"
|
||||
aria-label="Notiz zurückholen"
|
||||
>
|
||||
<FileInput className="w-3.5 h-3.5" />
|
||||
</button>
|
||||
)}
|
||||
|
||||
{/* Zoom / Focus button */}
|
||||
{onZoomBlock && (
|
||||
<button
|
||||
|
||||
Reference in new issue
Block a user