feat(workspace): default new notes to blank with title 'Neue Notiz' and remove bottom bullet button
MindSift CI & Docker Release / Build, Test in Container & Push (push) Successful in 54s
MindSift CI & Docker Release / Build, Test in Container & Push (push) Successful in 54s
This commit is contained in:
1 parent
05de76cce4
commit
3c550373eb
1 file changed
+26
-43
@@ -211,23 +211,16 @@ export const WorkspaceView: React.FC<WorkspaceViewProps> = ({
|
|||||||
tags.push(`folder:${path}`);
|
tags.push(`folder:${path}`);
|
||||||
}
|
}
|
||||||
const created = await api.createDocument({
|
const created = await api.createDocument({
|
||||||
title: 'Neuer Gedanke / Notiz',
|
title: 'Neue Notiz',
|
||||||
icon: '📄',
|
icon: '📄',
|
||||||
folderPath: path,
|
folderPath: path,
|
||||||
blocks: [
|
blocks: [
|
||||||
{
|
{
|
||||||
id: `blk_${Date.now()}_1`,
|
id: `blk_${Date.now()}_1`,
|
||||||
type: 'bullet',
|
type: 'bullet',
|
||||||
content: 'Erster Gedanke…',
|
content: '',
|
||||||
level: 0,
|
level: 0,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
id: `blk_${Date.now()}_2`,
|
|
||||||
type: 'todo',
|
|
||||||
content: 'Nächste Aufgabe',
|
|
||||||
checked: false,
|
|
||||||
level: 1,
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
tags,
|
tags,
|
||||||
isPinned: false,
|
isPinned: false,
|
||||||
@@ -1391,6 +1384,17 @@ export const WorkspaceView: React.FC<WorkspaceViewProps> = ({
|
|||||||
type="text"
|
type="text"
|
||||||
value={selectedDoc.title}
|
value={selectedDoc.title}
|
||||||
onChange={(e) => persistDocument({ ...selectedDoc, title: e.target.value })}
|
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…"
|
placeholder="Dokument-Titel…"
|
||||||
className="w-full bg-transparent text-xl sm:text-2xl font-bold text-main focus:outline-none placeholder:text-faint"
|
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<WorkspaceViewProps> = ({
|
|||||||
{/* =========================================================== */}
|
{/* =========================================================== */}
|
||||||
{/* LOGSEQ HIERARCHICAL BULLET LIST CANVAS */}
|
{/* LOGSEQ HIERARCHICAL BULLET LIST CANVAS */}
|
||||||
{/* =========================================================== */}
|
{/* =========================================================== */}
|
||||||
<div className="space-y-1 pt-2">
|
<div
|
||||||
|
className="space-y-1 pt-2 min-h-[300px] cursor-text"
|
||||||
|
onClick={(e) => {
|
||||||
|
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 }) => {
|
{visibleBlocks.map(({ block, originalIndex }) => {
|
||||||
const blockLevel = Math.max(0, (block.level || 0) - (zoomedBlock ? (zoomedBlock.level || 0) + 1 : 0));
|
const blockLevel = Math.max(0, (block.level || 0) - (zoomedBlock ? (zoomedBlock.level || 0) + 1 : 0));
|
||||||
const isChildrenPresent = hasChildren(selectedDoc.blocks, originalIndex);
|
const isChildrenPresent = hasChildren(selectedDoc.blocks, originalIndex);
|
||||||
@@ -1738,39 +1754,6 @@ export const WorkspaceView: React.FC<WorkspaceViewProps> = ({
|
|||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Bottom Add Bullet Button */}
|
|
||||||
<div className="pt-3 border-t border-border flex items-center gap-2">
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
onClick={() => {
|
|
||||||
if (zoomedBlock) {
|
|
||||||
const lastDescendant = visibleBlocks[visibleBlocks.length - 1];
|
|
||||||
if (lastDescendant) {
|
|
||||||
insertNewBulletAfter(
|
|
||||||
lastDescendant.originalIndex,
|
|
||||||
lastDescendant.block.level || (zoomedBlock.level || 0) + 1
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
const zoomIdx = selectedDoc.blocks.findIndex((b) => b.id === zoomedBlock.id);
|
|
||||||
if (zoomIdx !== -1) {
|
|
||||||
insertNewBulletAfter(zoomIdx, (zoomedBlock.level || 0) + 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
const lastBlock = selectedDoc.blocks[selectedDoc.blocks.length - 1];
|
|
||||||
insertNewBulletAfter(
|
|
||||||
selectedDoc.blocks.length - 1,
|
|
||||||
lastBlock?.level || 0
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
className="btn-action text-xs flex items-center gap-1.5"
|
|
||||||
>
|
|
||||||
<Plus className="w-3.5 h-3.5 text-accent" />
|
|
||||||
<span>Neuer Bullet-Punkt (oder Enter drücken)</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div className="p-8 panel-surface text-center text-muted text-xs">
|
<div className="p-8 panel-surface text-center text-muted text-xs">
|
||||||
|
|||||||
Reference in new issue
Block a user