feat(breadcrumb): allow creating notes from separator menu

This commit is contained in:
Elian Doran 2025-12-16 15:35:14 +02:00
parent 5449d033bf
commit 3a4cff6529
No known key found for this signature in database
2 changed files with 9 additions and 2 deletions

View File

@ -2148,7 +2148,8 @@
"hoisted_badge": "Hoisted", "hoisted_badge": "Hoisted",
"hoisted_badge_title": "Unhoist", "hoisted_badge_title": "Unhoist",
"workspace_badge": "Workspace", "workspace_badge": "Workspace",
"scroll_to_top_title": "Jump to the beginning of the note" "scroll_to_top_title": "Jump to the beginning of the note",
"create_new_note": "Create new child note"
}, },
"breadcrumb_badges": { "breadcrumb_badges": {
"read_only_explicit": "Read-only", "read_only_explicit": "Read-only",

View File

@ -23,7 +23,7 @@ import tree from "../../services/tree";
import ActionButton from "../react/ActionButton"; import ActionButton from "../react/ActionButton";
import { Badge } from "../react/Badge"; import { Badge } from "../react/Badge";
import Dropdown from "../react/Dropdown"; import Dropdown from "../react/Dropdown";
import { FormListItem } from "../react/FormList"; import { FormDropdownDivider, FormListItem } from "../react/FormList";
import { useActiveNoteContext, useChildNotes, useNote, useNoteColorClass, useNoteIcon, useNoteLabel, useNoteLabelBoolean, useNoteProperty, useStaticTooltip } from "../react/hooks"; import { useActiveNoteContext, useChildNotes, useNote, useNoteColorClass, useNoteIcon, useNoteLabel, useNoteLabelBoolean, useNoteProperty, useStaticTooltip } from "../react/hooks";
import Icon from "../react/Icon"; import Icon from "../react/Icon";
import { NewNoteLink } from "../react/NoteLink"; import { NewNoteLink } from "../react/NoteLink";
@ -208,6 +208,12 @@ function BreadcrumbSeparatorDropdownContent({ notePath, noteContext, activeNoteP
</FormListItem> </FormListItem>
</li>; </li>;
})} })}
<FormDropdownDivider />
<FormListItem
icon="bx bx-plus"
onClick={() => note_create.createNote(notePath, { activate: true })}
>{t("breadcrumb.create_new_note")}</FormListItem>
</ul> </ul>
); );
} }