From ea4a3b7f079264dac1ba761892b4bd2f2ff10ac7 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Wed, 17 Dec 2025 17:04:47 +0200 Subject: [PATCH] chore(client): address requested changes --- apps/client/src/entities/fnote.ts | 20 ++++++++----------- apps/client/src/stylesheets/style.css | 4 ++++ .../src/widgets/buttons/global_menu.tsx | 15 +++++++------- .../src/widgets/dialogs/call_to_action.tsx | 4 +--- .../type_widgets/options/appearance.tsx | 3 ++- 5 files changed, 22 insertions(+), 24 deletions(-) diff --git a/apps/client/src/entities/fnote.ts b/apps/client/src/entities/fnote.ts index cd255b72a..cd1a8b7a7 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/3761 return a.noteId < b.noteId ? -1 : 1; - + }); return promotedAttrs; diff --git a/apps/client/src/stylesheets/style.css b/apps/client/src/stylesheets/style.css index 24b9275fd..f10ace694 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.tsx index fa24c8387..255cf89c9 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(null); + useStaticTooltip(logoRef); return ( - {isVerticalLayout && } + {isVerticalLayout && } {isUpdateAvailable && } @@ -135,9 +137,9 @@ function SwitchToOptions() { return; } else if (!isMobile()) { return ; - } + } return ; - + } function MenuItem({ icon, text, title, command, disabled, active }: MenuItemProps void)>) { @@ -159,10 +161,7 @@ function KeyboardActionMenuItem({ text, command, ...props }: MenuItemProps; } -function VerticalLayoutIcon() { - const logoRef = useRef(null); - useStaticTooltip(logoRef); - +export function VerticalLayoutIcon({ logoRef }: { logoRef?: RefObject }) { return ( diff --git a/apps/client/src/widgets/dialogs/call_to_action.tsx b/apps/client/src/widgets/dialogs/call_to_action.tsx index 9267384ae..4f6da5293 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() { )} } > -

{activeItem.message}

+

{activeItem.message}

); } diff --git a/apps/client/src/widgets/type_widgets/options/appearance.tsx b/apps/client/src/widgets/type_widgets/options/appearance.tsx index 1896d1855..feecb56f5 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 (
- +