feat(workspace): turn a branch into its own note, merge notes
MindSift CI & Docker Release / Build, Test in Container & Push (push) Successful in 1m56s
MindSift CI & Docker Release / Build, Test in Container & Push (push) Successful in 1m56s
- Extract: button on the bullet (desktop) or /extract (/notiz). The bullet becomes the title (hashtags stay at the link), its children the content of a new note in the same folder with the source's shares (a foreign source owner gets write access); the branch becomes [[title]] through the operation log, so open editors follow. - Merge: drop a note onto another in the sidebar or use "Mit anderer Notiz zusammenführen…" in the note header. The own source is appended as an h2 section with its bullets below and goes to the trash; the toast offers a complete undo. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4c26eb2960
commit
4d1b37c956
15 files changed
+934
-9
No files matched your search
@@ -36,6 +36,7 @@ import {
|
||||
User,
|
||||
UserInvite,
|
||||
VoiceAdminStatus,
|
||||
MergeResult,
|
||||
WSMessage,
|
||||
} from './types';
|
||||
import { extractHashtags } from './hashtags';
|
||||
@@ -708,6 +709,29 @@ export const api = {
|
||||
return request<TrashedDocument[]>('/api/v1/documents/trash');
|
||||
},
|
||||
|
||||
/** Turns a bullet and its children into a note of its own; the bullet becomes a [[link]]. */
|
||||
async extractBranch(docId: string, blockId: string, clientId: string): Promise<Document> {
|
||||
return request<Document>(`/api/v1/documents/${docId}/extract`, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ blockId, clientId }),
|
||||
});
|
||||
},
|
||||
|
||||
/** Appends the source note to the target; the source goes to the trash. */
|
||||
async mergeDocuments(targetId: string, sourceId: string): Promise<MergeResult> {
|
||||
return request<MergeResult>(`/api/v1/documents/${targetId}/merge`, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ sourceId }),
|
||||
});
|
||||
},
|
||||
|
||||
async undoMerge(m: MergeResult): Promise<void> {
|
||||
await request(`/api/v1/documents/${m.targetId}/merge/undo`, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ sourceId: m.sourceId, headingId: m.headingId }),
|
||||
});
|
||||
},
|
||||
|
||||
async restoreDocument(id: string): Promise<void> {
|
||||
await request(`/api/v1/documents/${id}/restore`, { method: 'POST' });
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user