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
chore(client): address requested changes
Elian Doranea4a3b7f0792
diff --git a/apps/client/src/entities/fnote.ts b/apps/client/src/entities/fnote.tsindex cd255b72a8..cd1a8b7a7a 100644--- a/apps/client/src/entities/fnote.ts+++ b/apps/client/src/entities/fnote.ts@@ -268,9 +268,8 @@ export default class FNote {}}return results;- }+ }return this.children;-}async getSubtreeNoteIds(includeArchived = false) {@@ -471,9 +470,8 @@ export default class FNote {return a.isHidden ? 1 : -1;} else if (a.isSearch !== b.isSearch) {return a.isSearch ? 1 : -1;- }+ }return a.notePath.length - b.notePath.length;-});return notePaths;@@ -597,14 +595,12 @@ export default class FNote {} else if (this.type === "text") {if (this.isFolder()) {return "bx bx-folder";- }+ }return "bx bx-note";-} else if (this.type === "code" && this.mime.startsWith("text/x-sql")) {return "bx bx-data";- }+ }return NOTE_TYPE_ICONS[this.type];-}getColorClass() {@@ -811,9 +807,9 @@ export default class FNote {return this.getLabelValue(nameWithPrefix.substring(1));} else if (nameWithPrefix.startsWith("~")) {return this.getRelationValue(nameWithPrefix.substring(1));- }+ }return this.getLabelValue(nameWithPrefix);-+}/**@@ -878,10 +874,10 @@ export default class FNote {promotedAttrs.sort((a, b) => {if (a.noteId === b.noteId) {return a.position < b.position ? -1 : 1;- }+ }// inherited promoted attributes should stay grouped: https://github.com/zadam/trilium/issues/3761return a.noteId < b.noteId ? -1 : 1;-+});return promotedAttrs;diff --git a/apps/client/src/stylesheets/style.css b/apps/client/src/stylesheets/style.cssindex 24b9275fd5..f10ace6947 100644--- a/apps/client/src/stylesheets/style.css+++ b/apps/client/src/stylesheets/style.css@@ -724,6 +724,10 @@ table.promoted-attributes-in-tooltip th {z-index: 32767 !important;}+.pre-wrap-text {+ white-space: pre-wrap;+}+.bs-tooltip-bottom .tooltip-arrow::before {border-bottom-color: var(--main-border-color) !important;}diff --git a/apps/client/src/widgets/buttons/global_menu.tsx b/apps/client/src/widgets/buttons/global_menu.tsxindex fa24c8387f..255cf89c9f 100644--- a/apps/client/src/widgets/buttons/global_menu.tsx+++ b/apps/client/src/widgets/buttons/global_menu.tsx@@ -1,7 +1,7 @@import "./global_menu.css";import { KeyboardActionNames } from "@triliumnext/commons";-import { ComponentChildren } from "preact";+import { ComponentChildren, RefObject } from "preact";import { useContext, useEffect, useRef, useState } from "preact/hooks";import { CommandNames } from "../../components/app_context";@@ -30,13 +30,15 @@ export default function GlobalMenu({ isHorizontalLayout }: { isHorizontalLayout:const parentComponent = useContext(ParentComponent);const { isUpdateAvailable, latestVersion } = useTriliumUpdateStatus();const isMobileLocal = isMobile();+ const logoRef = useRef<SVGSVGElement>(null);+ useStaticTooltip(logoRef);return (<DropdownclassName="global-menu"buttonClassName={`global-menu-button ${isHorizontalLayout ? "bx bx-menu" : ""}`} noSelectButtonStyle iconAction hideToggleArrowtext={<>- {isVerticalLayout && <VerticalLayoutIcon />}+ {isVerticalLayout && <VerticalLayoutIcon logoRef={logoRef} />}{isUpdateAvailable && <div class="global-menu-button-update-available"><span className="bx bxs-down-arrow-alt global-menu-button-update-available-button" title={t("update_available.update_available")} /></div>}@@ -135,9 +137,9 @@ function SwitchToOptions() {return;} else if (!isMobile()) {return <MenuItem command="switchToMobileVersion" icon="bx bx-mobile" text={t("global_menu.switch_to_mobile_version")} />;- }+ }return <MenuItem command="switchToDesktopVersion" icon="bx bx-desktop" text={t("global_menu.switch_to_desktop_version")} />;-+}function MenuItem({ icon, text, title, command, disabled, active }: MenuItemProps<KeyboardActionNames | CommandNames | (() => void)>) {@@ -159,10 +161,7 @@ function KeyboardActionMenuItem({ text, command, ...props }: MenuItemProps<Keybo/>;}-function VerticalLayoutIcon() {- const logoRef = useRef<SVGSVGElement>(null);- useStaticTooltip(logoRef);-+export function VerticalLayoutIcon({ logoRef }: { logoRef?: RefObject<SVGSVGElement> }) {return (<svg ref={logoRef} viewBox="0 0 256 256" title={t("global_menu.menu")}><g>diff --git a/apps/client/src/widgets/dialogs/call_to_action.tsx b/apps/client/src/widgets/dialogs/call_to_action.tsxindex 9267384ae7..4f6da5293c 100644--- a/apps/client/src/widgets/dialogs/call_to_action.tsx+++ b/apps/client/src/widgets/dialogs/call_to_action.tsx@@ -41,9 +41,7 @@ export default function CallToActionDialog() {)}</>}>- <p style={{- whiteSpace: "pre-wrap"- }}>{activeItem.message}</p>+ <p className="pre-wrap-text">{activeItem.message}</p></Modal>);}diff --git a/apps/client/src/widgets/type_widgets/options/appearance.tsx b/apps/client/src/widgets/type_widgets/options/appearance.tsxindex 1896d1855a..feecb56f57 100644--- a/apps/client/src/widgets/type_widgets/options/appearance.tsx+++ b/apps/client/src/widgets/type_widgets/options/appearance.tsx@@ -6,6 +6,7 @@ import { useEffect, useState } from "preact/hooks";import { t } from "../../../services/i18n";import server from "../../../services/server";import { isElectron, isMobile, reloadFrontendApp, restartDesktopApp } from "../../../services/utils";+import { VerticalLayoutIcon } from "../../buttons/global_menu";import Button from "../../react/Button";import Column from "../../react/Column";import FormCheckbox from "../../react/FormCheckbox";@@ -135,7 +136,7 @@ function LayoutIllustration({ isNewLayout }: { isNewLayout?: boolean }) {return (<div className="old-layout-illustration"><div className="launcher-pane">- <svg viewBox="0 0 256 256" aria-label="Menu" data-bs-original-title="Menu"><g><path d="m202.9 112.7c-22.5 16.1-54.5 12.8-74.9 6.3l14.8-11.8 14.1-11.3 49.1-39.3-51.2 35.9-14.3 10-14.9 10.5c0.7-21.2 7-49.9 28.6-65.4 1.8-1.3 3.9-2.6 6.1-3.8 2.7-1.5 5.7-2.9 8.8-4.1 27.1-11.1 68.5-15.3 85.2-9.5 0.1 16.2-15.9 45.4-33.9 65.9-2.4 2.8-4.9 5.4-7.4 7.8-3.4 3.5-6.8 6.4-10.1 8.8z" class="st0" /><path d="m213.1 104c-22.2 12.6-51.4 9.3-70.3 3.2l14.1-11.3 49.1-39.3-51.2 35.9-14.3 10c0.5-18.1 4.9-42.1 19.7-58.6 2.7-1.5 5.7-2.9 8.8-4.1 27.1-11.1 68.5-15.3 85.2-9.5 0.1 16.2-15.9 45.4-33.9 65.9-2.3 2.8-4.8 5.4-7.2 7.8z" class="st1" /><path d="m220.5 96.2c-21.1 8.6-46.6 5.3-63.7-0.2l49.2-39.4-51.2 35.9c0.3-15.8 3.5-36.6 14.3-52.8 27.1-11.1 68.5-15.3 85.2-9.5 0.1 16.2-15.9 45.4-33.8 66z" class="st2" /><path d="m106.7 179c-5.8-21 5.2-43.8 15.5-57.2l4.8 14.2 4.5 13.4 15.9 47-12.8-47.6-3.6-13.2-3.7-13.9c15.5 6.2 35.1 18.6 40.7 38.8 0.5 1.7 0.9 3.6 1.2 5.5 0.4 2.4 0.6 5 0.7 7.7 0.9 23.1-7.1 54.9-15.9 65.7-12-4.3-29.3-24-39.7-42.8-1.4-2.6-2.7-5.1-3.8-7.6-1.6-3.5-2.9-6.8-3.8-10z" class="st3" /><path d="m110.4 188.9c-3.4-19.8 6.9-40.5 16.6-52.9l4.5 13.4 15.9 47-12.8-47.6-3.6-13.2c13.3 5.2 29.9 15 38.1 30.4 0.4 2.4 0.6 5 0.7 7.7 0.9 23.1-7.1 54.9-15.9 65.7-12-4.3-29.3-24-39.7-42.8-1.4-2.6-2.7-5.2-3.8-7.7z" class="st4" /><path d="m114.2 196.5c-0.7-18 8.6-35.9 17.3-47.1l15.9 47-12.8-47.6c11.6 4.4 26.1 12.4 35.2 24.8 0.9 23.1-7.1 54.9-15.9 65.7-12-4.3-29.3-24-39.7-42.8z" class="st5" /><path d="m86.3 59.1c21.7 10.9 32.4 36.6 35.8 54.9l-15.2-6.6-14.5-6.3-50.6-22 48.8 24.9 13.6 6.9 14.3 7.3c-16.6 7.9-41.3 14.5-62.1 4.1-1.8-0.9-3.6-1.9-5.4-3.2-2.3-1.5-4.5-3.2-6.8-5.1-19.9-16.4-40.3-46.4-42.7-61.5 12.4-6.5 41.5-5.8 64.8-0.3 3.2 0.8 6.2 1.6 9.1 2.5 4 1.3 7.6 2.8 10.9 4.4z" class="st6" /><path d="m75.4 54.8c18.9 12 28.4 35.6 31.6 52.6l-14.5-6.3-50.6-22 48.7 24.9 13.6 6.9c-14.1 6.8-34.5 13-53.3 8.2-2.3-1.5-4.5-3.2-6.8-5.1-19.8-16.4-40.2-46.4-42.6-61.5 12.4-6.5 41.5-5.8 64.8-0.3 3.1 0.8 6.2 1.6 9.1 2.6z" class="st7" /><path d="m66.3 52.2c15.3 12.8 23.3 33.6 26.1 48.9l-50.6-22 48.8 24.9c-12.2 6-29.6 11.8-46.5 10-19.8-16.4-40.2-46.4-42.6-61.5 12.4-6.5 41.5-5.8 64.8-0.3z" class="st8" /></g></svg>+ <VerticalLayoutIcon /><Icon icon="bx bx-send" /><Icon icon="bx bx-file-blank" /><Icon icon="bx bx-search" />