Skip to content

Build your personal knowledge base with Trilium Notes

feat(status_bar): indicate selected code mime in menu

Elian Doran88a779bbdb0c
diff --git a/apps/client/src/widgets/layout/StatusBar.tsx b/apps/client/src/widgets/layout/StatusBar.tsx
index cbbb2f305a..2e5b78860f 100644
--- a/apps/client/src/widgets/layout/StatusBar.tsx
+++ b/apps/client/src/widgets/layout/StatusBar.tsx
@@ -364,6 +364,7 @@ function CodeNoteSwitcher({ note }: StatusBarContext) {
dropdownOptions={{ autoClose: true }}
>
<NoteTypeCodeNoteList
+ currentMimeType={currentNoteMime}
mimeTypes={mimeTypes}
changeNoteType={(type, mime) => server.put(`notes/${note.noteId}/type`, { type, mime })}
setModalShown={() => {}}
diff --git a/apps/client/src/widgets/ribbon/BasicPropertiesTab.tsx b/apps/client/src/widgets/ribbon/BasicPropertiesTab.tsx
index 75887c0b46..772acbc793 100644
--- a/apps/client/src/widgets/ribbon/BasicPropertiesTab.tsx
+++ b/apps/client/src/widgets/ribbon/BasicPropertiesTab.tsx
@@ -131,7 +131,8 @@ export function NoteTypeDropdownContent({ currentNoteType, currentNoteMime, note
);
}
-export function NoteTypeCodeNoteList({ mimeTypes, changeNoteType, setModalShown }: {
+export function NoteTypeCodeNoteList({ currentMimeType, mimeTypes, changeNoteType, setModalShown }: {
+ currentMimeType?: string;
mimeTypes: MimeType[];
changeNoteType(type: NoteType, mime: string): void;
setModalShown(shown: boolean): void;
@@ -141,6 +142,7 @@ export function NoteTypeCodeNoteList({ mimeTypes, changeNoteType, setModalShown
{mimeTypes.map(({ title, mime }) => (
<FormListItem
key={mime}
+ checked={mime === currentMimeType}
onClick={() => changeNoteType("code", mime)}
>
{title}