Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
feat(mobile/note_actions): integrate similar notes
Elian Doran52b41b1bb0e7
diff --git a/apps/client/src/widgets/layout/StatusBar.css b/apps/client/src/widgets/layout/StatusBar.cssindex c1dad02671..a0b22c8d26 100644--- a/apps/client/src/widgets/layout/StatusBar.css+++ b/apps/client/src/widgets/layout/StatusBar.css@@ -117,10 +117,6 @@}- div.similar-notes-widget div.similar-notes-wrapper {- max-height: unset;- }-button.select-button:not(:focus-visible) {outline: none;}@@ -156,6 +152,15 @@ body.experimental-feature-new-layout .note-info-content {}}+body.experimental-feature-new-layout div.similar-notes-widget div.similar-notes-wrapper {+ max-height: unset;+}++body.experimental-feature-new-layout.mobile div.similar-notes-widget div.similar-notes-wrapper {+ max-height: unset;+ padding: 0;+}+.bottom-panel {margin: 0 !important;padding: 0;diff --git a/apps/client/src/widgets/mobile_widgets/mobile_detail_menu.tsx b/apps/client/src/widgets/mobile_widgets/mobile_detail_menu.tsxindex 769ac20ab4..3a89bdec85 100644--- a/apps/client/src/widgets/mobile_widgets/mobile_detail_menu.tsx+++ b/apps/client/src/widgets/mobile_widgets/mobile_detail_menu.tsx@@ -12,6 +12,7 @@ import Modal from "../react/Modal";import { NoteContextMenu } from "../ribbon/NoteActions";import NoteActionsCustom from "../ribbon/NoteActionsCustom";import { NotePathsWidget, useSortedNotePaths } from "../ribbon/NotePathsTab";+import SimilarNotesTab from "../ribbon/SimilarNotesTab";export default function MobileDetailMenu() {const { note, noteContext, parentComponent, ntxId, viewScope, hoistedNoteId } = useNoteContext();@@ -20,6 +21,7 @@ export default function MobileDetailMenu() {const [ backlinksModalShown, setBacklinksModalShown ] = useState(false);const [ notePathsModalShown, setNotePathsModalShown ] = useState(false);const [ noteInfoModalShown, setNoteInfoModalShown ] = useState(false);+ const [ similarNotesModalShown, setSimilarNotesModalShown ] = useState(false);const sortedNotePaths = useSortedNotePaths(note, hoistedNoteId);const backlinksCount = useBacklinkCount(note, viewScope?.viewMode === "default");@@ -74,10 +76,8 @@ export default function MobileDetailMenu() {>{t("close_pane_button.close_this_pane")}</FormListItem></>}<FormDropdownDivider />- <FormListItem- icon="bx bx-info-circle"- onClick={() => setNoteInfoModalShown(true)}- >{t("note_info_widget.title")}</FormListItem>+ <FormListItem icon="bx bx-info-circle" onClick={() => setNoteInfoModalShown(true)} >{t("note_info_widget.title")}</FormListItem>+ <FormListItem icon="bx bx-bar-chart" onClick={() => setSimilarNotesModalShown(true)}>{t("similar_notes.title")}</FormListItem><FormDropdownDivider /></>}/>@@ -94,6 +94,7 @@ export default function MobileDetailMenu() {<BacklinksModal note={note} modalShown={backlinksModalShown} setModalShown={setBacklinksModalShown} /><NotePathsModal note={note} modalShown={notePathsModalShown} notePath={noteContext?.notePath} sortedNotePaths={sortedNotePaths} setModalShown={setNotePathsModalShown} /><NoteInfoModal note={note} modalShown={noteInfoModalShown} setModalShown={setNoteInfoModalShown} />+ <SimilarNotesModal note={note} modalShown={similarNotesModalShown} setModalShown={setSimilarNotesModalShown} /></>), document.body)}</div>@@ -153,3 +154,17 @@ function NoteInfoModal({ note, modalShown, setModalShown }: { note: FNote | null</Modal>);}++function SimilarNotesModal({ note, modalShown, setModalShown }: { note: FNote | null | undefined } & WithModal) {+ return (+ <Modal+ className="similar-notes-modal"+ size="md"+ title={t("similar_notes.title")}+ show={modalShown}+ onHidden={() => setModalShown(false)}+ >+ <SimilarNotesTab note={note} />+ </Modal>+ );+}