feat(dev): action to open print page easily

This commit is contained in:
Elian Doran 2025-11-26 15:10:17 +02:00
parent e4fae2d660
commit abbb4e793f
No known key found for this signature in database

View File

@ -105,10 +105,24 @@ function NoteContextMenu({ note, noteContext }: { note: FNote, noteContext?: Not
<FormDropdownDivider />
<CommandItem command="showAttachments" icon="bx bx-paperclip" disabled={isInOptionsOrHelp} text={t("note_actions.note_attachments")} />
{glob.isDev && <DevelopmentActions note={note} />}
</Dropdown>
);
}
function DevelopmentActions({ note }: { note: FNote }) {
return (
<>
<FormDropdownDivider />
<FormListItem disabled>Development-only Actions</FormListItem>
<FormListItem
icon="bx bx-printer"
onClick={() => window.open(`/?print=#root/${note.noteId}`, "_blank")}
>Open print page</FormListItem>
</>
)
}
function CommandItem({ icon, text, title, command, disabled }: { icon: string, text: string, title?: string, command: CommandNames | (() => void), disabled?: boolean, destructive?: boolean }) {
return <FormListItem
icon={icon}