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
client/note tree: add a display density option
Adorian Dorana0ca92742af6
diff --git a/apps/client/src/stylesheets/tree.css b/apps/client/src/stylesheets/tree.cssindex ef454ded11..d2fab0859d 100644--- a/apps/client/src/stylesheets/tree.css+++ b/apps/client/src/stylesheets/tree.css@@ -44,6 +44,16 @@ span.fancytree-node.fancytree-hide {color: var(--custom-color, inherit);}+.tree-wrapper.dense {+ .fancytree-node {+ height: calc(1lh + 6px);+ }++ .tn-icon.tree-item-button {+ font-size: 1em;+ }+}+.fancytree-node:not(.fancytree-loading) .fancytree-expander {background: none;height: auto;diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.jsonindex 668b3d834b..ee10911776 100644--- a/apps/client/src/translations/en/translation.json+++ b/apps/client/src/translations/en/translation.json@@ -2854,7 +2854,10 @@"subtree-hidden-moved-description-collection": "This collection hides its child notes in the tree.","subtree-hidden-moved-description-other": "Child notes are hidden in the tree for this note.","show-all-notes": "Show all notes",- "back-to-tree": "Note tree"+ "back-to-tree": "Note tree",+ "display-density": "Display density",+ "display-density-relaxed": "Relaxed",+ "display-density-dense": "Dense"},"mobile_note_navigator": {"back": "Go up one level",diff --git a/apps/client/src/widgets/note_tree.spec.ts b/apps/client/src/widgets/note_tree.spec.tsindex 5a58d7d703..5cde00dc64 100644--- a/apps/client/src/widgets/note_tree.spec.ts+++ b/apps/client/src/widgets/note_tree.spec.ts@@ -145,6 +145,22 @@ describe("NoteTreeWidget", () => {expect(isHoisted).toHaveBeenCalledWith("_taskStates");});+ it("follows the display density option, also when it changes", async () => {+ options.set("treeDensity", "dense");+ const widget = await renderWidget();+ vi.spyOn(widget, "activityDetected").mockImplementation(() => {});+ expect(widget.$widget.hasClass("dense")).toBe(true);++ options.set("treeDensity", "relaxed");+ await widget.entitiesReloadedEvent({+ loadResults: {+ isOptionReloaded: (name: string) => name === "treeDensity",+ isEmptyForTree: () => true+ }+ } as unknown as EventData<"entitiesReloaded">);+ expect(widget.$widget.hasClass("dense")).toBe(false);+ });+describe("the title of a protected note", () => {function prepareProtectedNode(isUnlocked: boolean) {vi.spyOn(protectedSessionHolder, "isProtectedSessionAvailable").mockReturnValue(isUnlocked);@@ -192,6 +208,7 @@ describe("NoteTreeWidget", () => {await widget.entitiesReloadedEvent({loadResults: {+ isOptionReloaded: () => false,isEmptyForTree: () => false,getAttributeRows: () => [],getBranchRows: () => [],diff --git a/apps/client/src/widgets/note_tree.ts b/apps/client/src/widgets/note_tree.tsindex cb61aaf7ef..7778811433 100644--- a/apps/client/src/widgets/note_tree.ts+++ b/apps/client/src/widgets/note_tree.ts@@ -224,7 +224,10 @@ export default class NoteTreeWidget extends NoteContextAwareWidget {});// note tree starts initializing already during render which is atypical- Promise.all([options.initializedPromise, froca.initializedPromise]).then(() => this.initFancyTree());+ Promise.all([options.initializedPromise, froca.initializedPromise]).then(() => {+ this.applyDensity();+ this.initFancyTree();+ });this.setupNoteTitleTooltip();}@@ -272,6 +275,11 @@ export default class NoteTreeWidget extends NoteContextAwareWidget {return options.is("treeScrollFollowNavigation");}+ /** Makes the rows compact while the `treeDensity` option is `dense`. */+ private applyDensity() {+ this.$widget.toggleClass("dense", options.get("treeDensity") === "dense");+ }+private toggleSettings(isShown: boolean) {if (isShown === this.isSettingsShown) {return;@@ -1182,6 +1190,10 @@ export default class NoteTreeWidget extends NoteContextAwareWidget {async entitiesReloadedEvent({ loadResults }: EventData<"entitiesReloaded">) {this.activityDetected();+ if (loadResults.isOptionReloaded("treeDensity")) {+ this.applyDensity();+ }+if (loadResults.isEmptyForTree()) {return;}diff --git a/apps/client/src/widgets/note_tree_settings.spec.tsx b/apps/client/src/widgets/note_tree_settings.spec.tsxindex 3e36166261..6098952341 100644--- a/apps/client/src/widgets/note_tree_settings.spec.tsx+++ b/apps/client/src/widgets/note_tree_settings.spec.tsx@@ -20,6 +20,7 @@ describe("TreeSettings", () => {options.set("hideArchivedNotes_main", "false");options.set("autoCollapseNoteTree", "true");options.set("treeScrollFollowNavigation", "true");+ options.set("treeDensity", "relaxed");});afterEach(() => {@@ -28,14 +29,16 @@ describe("TreeSettings", () => {});function open(props: Partial<TreeSettingsProps> = {}) {- renderInto(- <TreeSettings- anchor={anchor}- onHideArchivedNotesChange={vi.fn()}- onClose={vi.fn()}- {...props}- />- );+ act(() => {+ renderInto(+ <TreeSettings+ anchor={anchor}+ onHideArchivedNotesChange={vi.fn()}+ onClose={vi.fn()}+ {...props}+ />+ );+ });const popup = document.querySelector<HTMLElement>(".tree-settings.tn-tool-dialog");if (!popup) throw new Error("Expected the tree settings popup.");return popup;@@ -53,7 +56,15 @@ describe("TreeSettings", () => {});}- it("shows each option as a toggle in a card section of its own, with no save button", () => {+ function densityButton(popup: HTMLElement, density: string) {+ const label = `note_tree.display-density-${density}`;+ const buttons = popup.querySelectorAll<HTMLButtonElement>(".tn-segmented-choice button");+ const button = [ ...buttons ].find((candidate) => candidate.textContent?.trim() === label);+ if (!button) throw new Error(`No ${density} button.`);+ return button;+ }++ it("shows each option in a card section of its own, with no save button", () => {const popup = open();expect(popup.getAttribute("role")).toBe("dialog");@@ -62,12 +73,19 @@ describe("TreeSettings", () => {expect(popup.getAttribute("aria-labelledby")).toBe(title?.id);expect(popup.querySelectorAll(".tn-card")).toHaveLength(1);const sections = [ ...popup.querySelectorAll(".tn-card .tn-card-section") ];- expect(sections.map((section) => section.querySelectorAll("input.switch-toggle").length))- .toEqual([ 1, 1, 1 ]);+ expect(sections.map((section) => [+ section.querySelectorAll(".tn-segmented-choice").length,+ section.querySelectorAll("input.switch-toggle").length+ ])).toEqual([ [ 1, 0 ], [ 0, 1 ], [ 0, 1 ], [ 0, 1 ] ]);+ expect(sections[0].classList).not.toContain("tn-card-option-wide");+ expect(densityButton(popup, "relaxed").getAttribute("aria-pressed")).toBe("true");+ expect(densityButton(popup, "dense").getAttribute("aria-pressed")).toBe("false");expect(toggleNamed(popup, "hide-archived-notes").checked).toBe(false);expect(toggleNamed(popup, "auto-collapse-note-tree").checked).toBe(true);expect(toggleNamed(popup, "follow-active-note").checked).toBe(true);- expect(popup.querySelectorAll("button")).toHaveLength(1);+ const otherButtons = [ ...popup.querySelectorAll("button") ]+ .filter((button) => !button.closest(".tn-segmented-choice"));+ expect(otherButtons).toHaveLength(1);});it("saves each change at once and reloads the tree only for archived notes", async () => {@@ -75,6 +93,10 @@ describe("TreeSettings", () => {const onHideArchivedNotesChange = vi.fn();const popup = open({ onHideArchivedNotesChange });+ await act(async () => densityButton(popup, "dense").click());+ expect(save).toHaveBeenLastCalledWith("treeDensity", "dense");+ expect(densityButton(popup, "dense").getAttribute("aria-pressed")).toBe("true");+await flip(popup, "follow-active-note");expect(save).toHaveBeenLastCalledWith("treeScrollFollowNavigation", "false");diff --git a/apps/client/src/widgets/note_tree_settings.tsx b/apps/client/src/widgets/note_tree_settings.tsxindex d8998106d7..54b0a2425e 100644--- a/apps/client/src/widgets/note_tree_settings.tsx+++ b/apps/client/src/widgets/note_tree_settings.tsx@@ -1,15 +1,17 @@import "./note_tree_settings.css";import type { ReferenceElement } from "@floating-ui/dom";+import type { TreeDensity } from "@triliumnext/commons";import { useEffect, useMemo } from "preact/hooks";import { t } from "../services/i18n.js";import ActionButton from "./react/ActionButton.jsx";import { Card, OptionCardSection } from "./react/Card.jsx";import FormToggle from "./react/FormToggle.jsx";-import { useTriliumOptionBool, useUniqueName } from "./react/hooks.jsx";+import { useTriliumOption, useTriliumOptionBool, useUniqueName } from "./react/hooks.jsx";import { suspendModalFocusTraps } from "./react/modal_focustrap.js";import Popup from "./react/Popup.jsx";+import SegmentedChoice, { type SegmentedChoiceOption } from "./react/SegmentedChoice.jsx";export interface TreeSettingsProps {/** The tree toolbar. The popup opens above its inline-end edge. */@@ -26,6 +28,11 @@ export default function TreeSettings(props: TreeSettingsProps) {const [ isAutoCollapsed, setAutoCollapsed ] = useTriliumOptionBool("autoCollapseNoteTree");const [ isFollowingActiveNote, setFollowingActiveNote ] =useTriliumOptionBool("treeScrollFollowNavigation");+ const [ density, setDensity ] = useTriliumOption("treeDensity");+ const densities: SegmentedChoiceOption<TreeDensity>[] = [+ { value: "relaxed", label: t("note_tree.display-density-relaxed") },+ { value: "dense", label: t("note_tree.display-density-dense") }+ ];const titleId = useUniqueName("tree-settings-title");// The toolbar's start edge moves when it collapses. Its end edge does not.const reference = useMemo(() => inlineEndEdge(anchor), [ anchor ]);@@ -59,6 +66,14 @@ export default function TreeSettings(props: TreeSettingsProps) {</div><Card>+ <OptionCardSection label={t("note_tree.display-density")} inline>+ <SegmentedChoice+ options={densities}+ currentValue={density}+ onChange={setDensity}+ />+ </OptionCardSection>+<OptionCardSectionname="hide-archived-notes"label={t("note_tree.hide-archived-notes")}diff --git a/apps/client/src/widgets/react/Card.spec.tsx b/apps/client/src/widgets/react/Card.spec.tsxindex 1086ef7423..babfec75f6 100644--- a/apps/client/src/widgets/react/Card.spec.tsx+++ b/apps/client/src/widgets/react/Card.spec.tsx@@ -145,6 +145,11 @@ describe("OptionCardSection", () => {// at every width.expect(draw(<OptionCardSection label="Backup" href="#root/_hidden/_options" />)).not.toContain("tn-card-option-wide");+ // The caller knows the control fits.+ const inline = (+ <OptionCardSection label="Density" inline><input type="text" /></OptionCardSection>+ );+ expect(draw(inline)).not.toContain("tn-card-option-wide");});});diff --git a/apps/client/src/widgets/react/Card.tsx b/apps/client/src/widgets/react/Card.tsxindex c261dd7200..0cf5b70ca7 100644--- a/apps/client/src/widgets/react/Card.tsx+++ b/apps/client/src/widgets/react/Card.tsx@@ -184,6 +184,11 @@ export interface OptionCardSectionProps extends CardSectionProps {* whole width — a URL, a path, anything read as well as typed.*/stacked?: boolean;+ /**+ * Keeps the control beside the label on a narrow card too, for a control known to fit there,+ * such as a segmented choice between two short words. The opposite of {@link stacked}.+ */+ inline?: boolean;/** The controls the option is operated with, placed on the trailing edge. */children?: ComponentChildren;/**@@ -205,7 +210,7 @@ export interface OptionCardSectionProps extends CardSectionProps {*/export function OptionCardSection(props: OptionCardSectionProps) {const {- label, description, name, stacked, children, className, subSections,+ label, description, name, stacked, inline, children, className, subSections,filterExtraKeywords, ...rest} = props;const matched = useFilterMatch(label, description, filterExtraKeywords);@@ -229,7 +234,7 @@ export function OptionCardSection(props: OptionCardSectionProps) {return <CardSection elementRef={keepRow}className={clsx("tn-card-option", className, {"tn-card-option-stacked": stacked,- "tn-card-option-wide": wide+ "tn-card-option-wide": wide && !inline})}// Kept for its details rather than itself, which is what a companion is.filterRole={filtering ? (matched ? "match" : "companion") : undefined}diff --git a/apps/server/src/assets/help/help_content.json b/apps/server/src/assets/help/help_content.jsonindex a33d8e2d24..a6f247bc27 100644--- a/apps/server/src/assets/help/help_content.json+++ b/apps/server/src/assets/help/help_content.json@@ -37,7 +37,7 @@"_help_ebyr7ES2SwOW": "<p>Downloaded resources are large files that some features need but that do not ship with Trilium, such as the speech recognition models used to transcribe meetings. Trilium downloads them the first time a feature needs them, and keeps them on the device for later use.</p><p>Currently, only <a class=\"reference-link\" href=\"#root/_help_Y84QCbArmK3z\">Meeting transcription</a> on the desktop application uses downloaded resources:</p><figure class=\"table\"><table><thead><tr><th>Resource</th><th>Size</th><th>License</th><th>Used for</th></tr></thead><tbody><tr><td>Parakeet TDT 0.6B v3 (standard)</td><td>0.6 GB</td><td>CC-BY-4.0</td><td>Recognizing speech, with the <em>Standard</em> model.</td></tr><tr><td>Parakeet TDT 0.6B v3 (high accuracy)</td><td>2.4 GB</td><td>CC-BY-4.0</td><td>Recognizing speech, with the <em>High accuracy</em> model.</td></tr><tr><td>Silero VAD</td><td>0.6 MB</td><td>MIT</td><td>Detecting when someone speaks.</td></tr><tr><td>TitaNet</td><td>40 MB</td><td>Apache-2.0</td><td>Telling speakers apart, while <em>Identify speakers</em> is on.</td></tr></tbody></table></figure><h2>Downloading resources</h2><p>When a feature needs resources that are not on the device yet, Trilium asks before downloading them. The dialog lists each resource with what it is used for, where it is downloaded from, its license and its size, followed by the total download size and the free space on the disk.</p><ul><li>To start the download, press <em>Download</em>. Each resource shows its progress, and the feature continues once all of them are downloaded.</li><li>To stop the download, press <em>Cancel</em> or close the dialog. The files already downloaded are kept, and the next download continues where this one stopped, even within a large file.</li><li>If the disk does not have enough free space, the dialog says so and the download cannot be started.</li></ul><p>Every file is checked against a checksum built into Trilium before it is used, so a file that was damaged or altered during the download is discarded.</p><aside class=\"admonition note\"><p>Downloaded resources are not synchronized. Each device that uses a feature downloads its resources separately, even when the notes are kept in sync through <a class=\"reference-link\" href=\"#root/_help_cbkrhQjrkKrh\">Synchronization</a>.</p></aside><h2>Managing downloaded resources</h2><p>To see the downloaded resources, go to <a class=\"reference-link\" href=\"#root/_help_4TIF1oA4VQRO\">Options</a> → <em>Downloaded resources</em>. Each resource that was downloaded, or partly downloaded by an interrupted download, is listed with the space it takes on the disk and its status. Below the list, <em>Space used</em> shows the space they take in total, and how much free space is left on the disk.</p><ul><li>To open the folder of a resource, press the <span class=\"tn-icon bx bx-folder-open\"></span> button (desktop only).</li><li>To delete a resource, press the <span class=\"tn-icon bx bx-trash\"></span> button. If a feature needs it again, it is downloaded again.</li></ul><p>The list also shows, faded out, anything else in the resources folder:</p><ul><li><em>Older version</em>: the files of an earlier version of a resource. When a resource is updated, the new version is downloaded into a new folder, and the old one is left behind.</li><li><em>Not used</em>: a resource that no feature of this installation uses, for example one downloaded by a feature that was removed.</li><li><em>Unknown</em>: any other file or folder, for example one copied there by hand.</li></ul><p>These can be deleted in the same way.</p><aside class=\"admonition warning\"><p>If a server and a desktop application share the same data directory, a resource used by only one of them shows as <em>Not used</em> in the other. Deleting it there removes it for both.</p></aside><h2>Location</h2><p>The resources are stored in the <code>resources</code> folder of the <a class=\"reference-link\" href=\"#root/_help_tAassRL4RSQL\">Data directory</a>, one folder per resource. To store them elsewhere, set the <code>TRILIUM_RESOURCES_DIR</code> environment variable to another folder before starting Trilium.</p><h2>Installing without an Internet connection</h2><p>To install a resource on a device that cannot download it, copy its folder from the <code>resources</code> folder of a device that already has it into the same place on the other device. The next time a feature asks to download it, press <em>Download</em>: the files already in place are checked against their checksums and kept, and only the missing ones are downloaded.</p>","_help_x0JgW8UqGXvq": "<p>Trilium supports two different layouts, based on your preference.</p><h3>Vertical layout</h3><p>The vertical layout is Trilium's original layout:</p><ul><li>The <a class=\"reference-link\" href=\"#root/_help_xYmIYSP6wE3F\">Launch Bar</a> is positioned on the left side of the screen, with buttons being laid out vertically.</li><li>The tab bar is at the top, but to the right of the <a class=\"reference-link\" href=\"#root/_help_oPVyFC7WL2Lp\">Note Tree</a>.</li><li>The <a class=\"reference-link\" href=\"#root/_help_Ms1nauBra7gq\">Quick search</a> is at the top of the <a class=\"reference-link\" href=\"#root/_help_oPVyFC7WL2Lp\">Note Tree</a>.</li><li>The <a class=\"reference-link\" href=\"#root/_help_oPVyFC7WL2Lp\">Note Tree</a> can be collapsed by pressing the <span class=\"tn-icon bx bx-chevrons-left\"></span> button at the bottom of the <a class=\"reference-link\" href=\"#root/_help_xYmIYSP6wE3F\">Launch Bar</a>. While collapsed, it can be peeked temporarily above the content by pressing the strip on the right side of the <a class=\"reference-link\" href=\"#root/_help_xYmIYSP6wE3F\">Launch Bar</a>.</li><li>The <a class=\"reference-link\" href=\"#root/_help_x3i7MxGccDuM\">Global menu</a> can be accessed via the <span class=\"tn-icon cke cke-trilium\"></span> icon at the top of the <a class=\"reference-link\" href=\"#root/_help_xYmIYSP6wE3F\">Launch Bar</a>.</li></ul><p><img src=\"{{helpAssets}}/User%20Guide/Basic%20Concepts%20and%20Features/UI%20Elements/1_Vertical%20and%20horizontal%20layout_image.jpg\"></p><h3>Horizontal layout</h3><p>The horizontal layout is a more traditional layout, since it bears similarity with other applications. In this mode:</p><ul><li>The <a class=\"reference-link\" href=\"#root/_help_xYmIYSP6wE3F\">Launch Bar</a> is at the top of the screen, with the buttons laid horizontally.</li><li>The tab bar is at the top of the screen, but now covers the entirety of the width, allowing for more tabs to be displayed at once.</li><li>The <a class=\"reference-link\" href=\"#root/_help_Ms1nauBra7gq\">Quick search</a> is now part of the <a class=\"reference-link\" href=\"#root/_help_xYmIYSP6wE3F\">Launch Bar</a>. It can be moved around according to preference and even removed if needed.</li><li>The <a class=\"reference-link\" href=\"#root/_help_oPVyFC7WL2Lp\">Note Tree</a> can be collapsed by pressing the small <span class=\"tn-icon bx bx-sidebar\"></span> button to the left of the first tab. While collapsed, it can be peeked temporarily above the content by pressing the strip on the left edge of the app.</li><li>The <a class=\"reference-link\" href=\"#root/_help_x3i7MxGccDuM\">Global menu</a> can be accessed via the <span class=\"tn-icon bx bx-menu\"></span> button at the end of the <a class=\"reference-link\" href=\"#root/_help_xYmIYSP6wE3F\">Launch Bar</a>.</li></ul><p><img src=\"{{helpAssets}}/User%20Guide/Basic%20Concepts%20and%20Features/UI%20Elements/Vertical%20and%20horizontal%20layout_image.jpg\"></p><h2>Changing the layout</h2><p>Go to <a class=\"reference-link\" href=\"#root/_help_4TIF1oA4VQRO\">Options</a> and look for the <em>Appearance</em> option on the left. Then look for the <em>Layout</em> section, where there is the possibility to switch between the two available layouts.</p><p>Clicking an option will immediately apply the selected layout by reloading the window.</p>","_help_x3i7MxGccDuM": "<p>The global menu configures the current window (zoom, keeping the window on top), switches the theme and offers access to some more advanced options.</p><p><img src=\"{{helpAssets}}/User%20Guide/Basic%20Concepts%20and%20Features/UI%20Elements/Global%20menu_image.jpg\"></p><h2>Accessing the global menu</h2><p>See <a href=\"#root/_help_x0JgW8UqGXvq\">Vertical and horizontal layout</a> since the position of the global menu is changed based on which layout has been selected.</p><h2>Switching the theme</h2><p>The <em>Theme</em> submenu changes the look of the application without opening the <a class=\"reference-link\" href=\"#root/_help_4TIF1oA4VQRO\">Options</a>. A check mark at the end of a row shows the active choice. The submenu is not shown on mobile; change the theme from <a class=\"reference-link\" href=\"#root/_help_4TIF1oA4VQRO\">Options</a> → <em>Appearance</em> there.</p><ul><li>Under <em>Color scheme</em>, choose <em>System</em> to follow the light or dark mode of the operating system, or <em>Light</em> or <em>Dark</em> to use one regardless.</li><li>Under <em>Theme</em>, choose <em>Modern</em> (the default theme) or one of the custom themes, each shown with the icon of its note. Switching to <em>Modern</em> keeps the current color scheme.</li></ul><p>A custom theme brings its own colors, so the color schemes are unavailable while one is active. The legacy theme is not listed; select it from <a class=\"reference-link\" href=\"#root/_help_4TIF1oA4VQRO\">Options</a> → <em>Appearance</em> instead.</p><p>For more about the built-in and custom themes, see <a class=\"reference-link\" href=\"#root/_help_Wy267RK4M69c\">Themes</a>.</p>",- "_help_oPVyFC7WL2Lp": "<p>This page explains how to manipulate the note tree in TriliumNext, focusing on moving notes.</p><p><img src=\"{{helpAssets}}/User%20Guide/Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree_image.jpg\"></p><h2>Drag and Drop</h2><p><img src=\"{{helpAssets}}/User%20Guide/Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree_drag-and-drop.gif\" alt=\"Drag and drop example\"></p><p>You can easily rearrange the note tree by dragging and dropping notes, as demonstrated in the example above.</p><h3>Importing files</h3><p>A file or archive can easily be imported into Trilium just by dragging it inside the note tree.</p><p>Note that a drag & drop always imports with <em>safe import</em> on, meaning that some features such as scripts are disabled in the upcoming notes. To bypass that, use the dedicated <a href=\"#root/_help_mHbBMPDPkVV5\">import</a> feature (right click → <em>Import into note</em>).</p><p>Unlike the import dialog, the drag & drop also has some basic auto-detection of the import. For example, dragging a .zip file with a <code>.obsidian</code> folder in it will automatically trigger a dedicated <a class=\"reference-link\" href=\"#root/_help_iWD7wiIuMtgV\">Obsidian</a> import.</p><h2>Keyboard Manipulation</h2><p><img src=\"{{helpAssets}}/User%20Guide/Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree_move-note-with-keyboard.gif\" alt=\"Example of using keyboard keys to move a note\">Trilium offers efficient keyboard-based manipulation using the following <a href=\"#root/_help_A9Oc6YKKc65v\">shortcuts</a>:</p><ul><li><kbd>Ctrl</kbd> + <kbd>↑</kbd> and <kbd>Ctrl</kbd> +<kbd>↓</kbd>: Move the note up or down in the order.</li><li><kbd>Ctrl</kbd>+<kbd>←</kbd>: Move the note up in the hierarchy by changing its parent to the note's grandparent.</li><li><kbd>Ctrl</kbd>+<kbd>→</kbd>: Move the note down in the hierarchy by setting its parent to the note currently above it (this action is best understood through a demo or hands-on experience).</li><li><kbd>←</kbd> and <kbd>→</kbd>: Expand and collapse a sub-tree.</li></ul><h2>Context Menu</h2><p>You can also move notes using the familiar cut and paste functions available in the context menu, or with the associated keyboard <a href=\"#root/_help_A9Oc6YKKc65v\">shortcuts</a>: <code>CTRL-C</code> ( <a href=\"#root/_help_IakOLONlIfGI\">copy</a>), <kbd>Ctrl</kbd> + <kbd>X</kbd> (cut) and <kbd>Ctrl</kbd> + <kbd>V</kbd> (paste).</p><p>See <a class=\"reference-link\" href=\"#root/_help_YtSN43OrfzaA\">Note tree contextual menu</a> for more information.</p><h2>Tree Settings</h2><p>Click the tree icon in the tree toolbar to open the tree settings popup. Each option is a toggle that takes effect as soon as it is switched:</p><ul><li><em>Hide archived notes</em>: When enabled, archived notes are not shown in the tree.</li><li><em>Automatically collapse notes</em>: When enabled, notes are collapsed after a period of inactivity to keep the tree tidy.</li><li><em>Follow active note</em>: When enabled (default), the tree automatically scrolls and expands parent nodes to keep the currently active note visible. When disabled, the tree is fully detached from navigation — only the background highlight of the active note is updated, but the tree viewport and its expanded/collapsed state are never changed by navigation. Use the crosshair button to manually jump the tree to the active note at any time.</li></ul><h2>Hiding and peeking the tree</h2><p>To hide or show the note tree, press the <span class=\"tn-icon bx bx-sidebar\"></span> button to the left of the first tab in the horizontal layout, or the <span class=\"tn-icon bx bx-chevrons-left\"></span> button at the bottom of the <a class=\"reference-link\" href=\"#root/_help_xYmIYSP6wE3F\">Launch Bar</a> in the vertical layout. The <em>Toggle Left Pane</em> <a href=\"#root/_help_A9Oc6YKKc65v\">keyboard shortcut</a>, which is not assigned by default, does the same. See <a class=\"reference-link\" href=\"#root/_help_x0JgW8UqGXvq\">Vertical and horizontal layout</a>.</p><p>A small strip with an arrow icon runs along the left edge of the app in the horizontal layout. In the vertical layout, it runs along the right side of the <a class=\"reference-link\" href=\"#root/_help_xYmIYSP6wE3F\">Launch Bar</a>, and only shows while the tree is hidden.</p><ul><li>When the tree is hidden, pressing the strip will <em>peek</em> the tree.<ul><li>In this mode the tree is shown temporarily above the content, without shifting the content of your notes.</li><li>Clicking outside the tree, pressing <kbd>Esc</kbd> or pressing the strip again will hide the tree.</li><li>Pressing the button that shows the tree will dock it.</li></ul></li><li>In the horizontal layout, pressing the strip while the tree is docked will hide it.</li></ul><p>The <em>Peek Tree Pane</em> <a href=\"#root/_help_A9Oc6YKKc65v\">keyboard shortcut</a>, <kbd>Alt</kbd>+<kbd>[</kbd> by default, does the same as pressing the strip. Only one panel is peeked at a time: peeking the tree hides a peeked <a class=\"reference-link\" href=\"#root/_help_RnaPdbciOfeq\">Right Sidebar</a>, and the other way around.</p><h2>Keyboard shortcuts</h2><p>The note tree comes with multiple keyboard shortcuts to make editing faster, consult the dedicated <a class=\"reference-link\" href=\"#root/_help_DvdZhoQZY9Yd\">Keyboard shortcuts</a> section.</p>",+ "_help_oPVyFC7WL2Lp": "<p>This page explains how to manipulate the note tree in TriliumNext, focusing on moving notes.</p><p><img src=\"{{helpAssets}}/User%20Guide/Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree_image.jpg\"></p><h2>Drag and Drop</h2><p><img src=\"{{helpAssets}}/User%20Guide/Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree_drag-and-drop.gif\" alt=\"Drag and drop example\"></p><p>You can easily rearrange the note tree by dragging and dropping notes, as demonstrated in the example above.</p><h3>Importing files</h3><p>A file or archive can easily be imported into Trilium just by dragging it inside the note tree.</p><p>Note that a drag & drop always imports with <em>safe import</em> on, meaning that some features such as scripts are disabled in the upcoming notes. To bypass that, use the dedicated <a href=\"#root/_help_mHbBMPDPkVV5\">import</a> feature (right click → <em>Import into note</em>).</p><p>Unlike the import dialog, the drag & drop also has some basic auto-detection of the import. For example, dragging a .zip file with a <code>.obsidian</code> folder in it will automatically trigger a dedicated <a class=\"reference-link\" href=\"#root/_help_iWD7wiIuMtgV\">Obsidian</a> import.</p><h2>Keyboard Manipulation</h2><p><img src=\"{{helpAssets}}/User%20Guide/Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree_move-note-with-keyboard.gif\" alt=\"Example of using keyboard keys to move a note\">Trilium offers efficient keyboard-based manipulation using the following <a href=\"#root/_help_A9Oc6YKKc65v\">shortcuts</a>:</p><ul><li><kbd>Ctrl</kbd> + <kbd>↑</kbd> and <kbd>Ctrl</kbd> +<kbd>↓</kbd>: Move the note up or down in the order.</li><li><kbd>Ctrl</kbd>+<kbd>←</kbd>: Move the note up in the hierarchy by changing its parent to the note's grandparent.</li><li><kbd>Ctrl</kbd>+<kbd>→</kbd>: Move the note down in the hierarchy by setting its parent to the note currently above it (this action is best understood through a demo or hands-on experience).</li><li><kbd>←</kbd> and <kbd>→</kbd>: Expand and collapse a sub-tree.</li></ul><h2>Context Menu</h2><p>You can also move notes using the familiar cut and paste functions available in the context menu, or with the associated keyboard <a href=\"#root/_help_A9Oc6YKKc65v\">shortcuts</a>: <code>CTRL-C</code> ( <a href=\"#root/_help_IakOLONlIfGI\">copy</a>), <kbd>Ctrl</kbd> + <kbd>X</kbd> (cut) and <kbd>Ctrl</kbd> + <kbd>V</kbd> (paste).</p><p>See <a class=\"reference-link\" href=\"#root/_help_YtSN43OrfzaA\">Note tree contextual menu</a> for more information.</p><h2>Tree Settings</h2><p>Click the tree icon in the tree toolbar to open the tree settings popup. Each option takes effect as soon as it is changed:</p><ul><li><em>Display density</em>: <em>Relaxed</em> (default) or <em>Dense</em>. Dense rows are shorter, so more notes fit on the screen. This setting is not synchronized, so each device keeps its own.</li><li><em>Hide archived notes</em>: When enabled, archived notes are not shown in the tree.</li><li><em>Automatically collapse notes</em>: When enabled, notes are collapsed after a period of inactivity to keep the tree tidy.</li><li><em>Follow active note</em>: When enabled (default), the tree automatically scrolls and expands parent nodes to keep the currently active note visible. When disabled, the tree is fully detached from navigation — only the background highlight of the active note is updated, but the tree viewport and its expanded/collapsed state are never changed by navigation. Use the crosshair button to manually jump the tree to the active note at any time.</li></ul><h2>Hiding and peeking the tree</h2><p>To hide or show the note tree, press the <span class=\"tn-icon bx bx-sidebar\"></span> button to the left of the first tab in the horizontal layout, or the <span class=\"tn-icon bx bx-chevrons-left\"></span> button at the bottom of the <a class=\"reference-link\" href=\"#root/_help_xYmIYSP6wE3F\">Launch Bar</a> in the vertical layout. The <em>Toggle Left Pane</em> <a href=\"#root/_help_A9Oc6YKKc65v\">keyboard shortcut</a>, which is not assigned by default, does the same. See <a class=\"reference-link\" href=\"#root/_help_x0JgW8UqGXvq\">Vertical and horizontal layout</a>.</p><p>A small strip with an arrow icon runs along the left edge of the app in the horizontal layout. In the vertical layout, it runs along the right side of the <a class=\"reference-link\" href=\"#root/_help_xYmIYSP6wE3F\">Launch Bar</a>, and only shows while the tree is hidden.</p><ul><li>When the tree is hidden, pressing the strip will <em>peek</em> the tree.<ul><li>In this mode the tree is shown temporarily above the content, without shifting the content of your notes.</li><li>Clicking outside the tree, pressing <kbd>Esc</kbd> or pressing the strip again will hide the tree.</li><li>Pressing the button that shows the tree will dock it.</li></ul></li><li>In the horizontal layout, pressing the strip while the tree is docked will hide it.</li></ul><p>The <em>Peek Tree Pane</em> <a href=\"#root/_help_A9Oc6YKKc65v\">keyboard shortcut</a>, <kbd>Alt</kbd>+<kbd>[</kbd> by default, does the same as pressing the strip. Only one panel is peeked at a time: peeking the tree hides a peeked <a class=\"reference-link\" href=\"#root/_help_RnaPdbciOfeq\">Right Sidebar</a>, and the other way around.</p><h2>Keyboard shortcuts</h2><p>The note tree comes with multiple keyboard shortcuts to make editing faster, consult the dedicated <a class=\"reference-link\" href=\"#root/_help_DvdZhoQZY9Yd\">Keyboard shortcuts</a> section.</p>","_help_YtSN43OrfzaA": "<figure class=\"image image-style-align-right\"><img style=\"aspect-ratio:269/608;\" src=\"{{helpAssets}}/User%20Guide/Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree/1_Note%20tree%20contextual%20menu_image.png\" width=\"269\" height=\"608\"></figure><p>The <em>note tree menu</em> can be accessed by right-clicking in the <a class=\"reference-link\" href=\"#root/_help_oPVyFC7WL2Lp\">Note Tree</a>.</p><h2>Interaction</h2><p>The contextual menu can operate:</p><ul><li>On a single note, by right clicking it in the note tree.</li><li>On multiple notes, by selecting them first. See <a class=\"reference-link\" href=\"#root/_help_yTjUdsOi4CIE\">Multiple selection</a> on how to do so.<ul><li>When right clicking, do note that usually the note being right clicked is also included in the affected notes, regardless of whether it was selected or not.</li></ul></li></ul><h2>Available options</h2><aside class=\"admonition note\"><p>When multiple notes are selected, only a subset of notes will be active. The ones that do support multiple notes will mention this in the list below.</p></aside><p>The most frequent actions stand side by side at the top of the menu, each as an icon over its name. Use <kbd>←</kbd> and <kbd>→</kbd>, or <kbd>↑</kbd> and <kbd>↓</kbd>, to move between them.</p><ul><li><strong>Cut</strong><ul><li>Will place the given notes in clipboard.</li><li>Use one of the two paste functions (or the keyboard shortcuts) to move them to the desired location.</li></ul></li><li><strong>Copy</strong><ul><li>Will place the given notes in clipboard.</li><li>Use one of the two paste functions (or the keyboard shortcuts) to copy them to the desired location.</li><li>Note that the copy function here works according to the <a class=\"reference-link\" href=\"#root/_help_IakOLONlIfGI\">Cloning Notes</a> functionality (i.e. the note itself will be present in two locations at once, and editing it in one place will edit it everywhere).</li><li>To simply create a duplicate note that can be modified independently, look for <em>Duplicate</em>.</li></ul></li><li><strong>Paste into</strong><ul><li>Pastes the notes in clipboard as child notes of the right-clicked one.</li><li>Shown only after notes have been cut or copied.</li></ul></li><li><strong>Paste after</strong><ul><li>Pastes the notes in clipboard underneath the right-clicked one.</li><li>Shown only after notes have been cut or copied.</li></ul></li><li><strong>Delete</strong><ul><li>Will delete the given notes, asking for confirmation first.</li><li>In the dialog, the following options can be configured:<ul><li><em>Delete also all clones</em> to ensure that the note will be deleted everywhere if it has been placed into multiple locations (see <a class=\"reference-link\" href=\"#root/_help_IakOLONlIfGI\">Cloning Notes</a>).</li><li><em>Erase notes permanently</em> will ensure that the note cannot be recovered from <a class=\"reference-link\" href=\"#root/_help_r5JGHN99bVKn\">Recent Changes</a>.</li></ul></li></ul></li></ul><p>The rest of the menu lists its options one per row:</p><ul><li><strong>Open note</strong><ul><li>Clicking it opens the note in a new <a href=\"#root/_help_3seOhtN8uLIY\">tab</a>.</li><li>Hovering it or clicking its arrow opens a submenu with the places the note can be opened in: <em>Open in a new tab</em>, <em>Open in a new split</em> (to the right of the note, within the current tab) and <em>Open in a new window</em>.</li></ul></li><li><strong>Quick edit</strong><ul><li>Opens the note in <a class=\"reference-link\" href=\"#root/_help_ZjLYv08Rp3qC\">Quick edit</a>, over the current one.</li></ul></li><li><strong>Hoist note</strong><ul><li>Will focus the note tree on this note. See <a class=\"reference-link\" href=\"#root/_help_OR8WJ7Iz9K4U\">Note Hoisting</a> for more information.</li></ul></li><li><strong>Insert note after</strong><ul><li>Allows easy creation of a note with a specified <a href=\"#root/_help_KSZ04uQ2D1St\">note type</a>.</li><li>The <em>Code</em> submenu starts with the scripting notes, each a code note set up for its role: <em>Custom CSS</em> (with <code>#appCss</code>), <em>Widget</em> (with <code>#widget</code> and a starting skeleton) and <em>Backend script</em>. The enabled code languages follow.</li><li><a class=\"reference-link\" href=\"#root/_help_GTwFsgaA0lCt\">Collections</a> are grouped in the <em>Collection</em> submenu. The note types created less often, the <a class=\"reference-link\" href=\"#root/_help_B2ORr7OVEZtc\">Snippets</a> and the AI quick action are in the <em>More</em> submenu.</li><li><a class=\"reference-link\" href=\"#root/_help_KC1HB96bqqHX\">Templates</a> will also be present (if any) at the end of the list, under a <em>Templates</em> heading. The <span class=\"tn-icon bx bx-cog\"></span> button beside the heading opens <em>Content Manager</em> in the <a class=\"reference-link\" href=\"#root/_help_4TIF1oA4VQRO\">Options</a>, where the templates can be managed.</li><li>To find an entry quickly, type into the search box at the top of the submenu, or just start typing while the submenu is open. The submenu then lists every matching entry, including those inside its own submenus (such as a code language or a collection), each with the submenu it comes from. Use <kbd>↑</kbd> and <kbd>↓</kbd> to pick a match, <kbd>Enter</kbd> to create it, and <kbd>Esc</kbd> to clear the search.</li><li>The note will be added on the same level of hierarchy as the note selected.</li></ul></li><li><strong>Insert child note</strong><ul><li>Same as <em>Insert note after</em>, but the note will be created as a child of the selected note.</li></ul></li><li><strong>Move to…</strong><ul><li>Will display a modal to specify where to move the desired notes.</li></ul></li><li><strong>Clone to…</strong><ul><li>Will display a modal to specify where to <a href=\"#root/_help_IakOLONlIfGI\">clone</a> the desired notes.</li></ul></li><li><strong>Duplicate</strong><ul><li>Creates a copy of the note and its descendants, placed right after the original.</li><li>When the note has child notes, the item also has an arrow, set apart by a divider. Hovering the item or clicking the arrow opens a submenu:<ul><li><em>Note and its children</em> does the same as clicking <em>Duplicate</em>.</li><li><em>This note only</em> copies the note with its content and attributes, but without any of its child notes. Links and relations to the original children keep pointing at them.</li></ul></li><li>This process is different from <a class=\"reference-link\" href=\"#root/_help_IakOLONlIfGI\">Cloning Notes</a> since the duplicated note can be edited independently from the original.</li><li>An alternative to this, if done regularly, would be <a class=\"reference-link\" href=\"#root/_help_KC1HB96bqqHX\">Templates</a>.</li></ul></li><li><strong>Archive/Unarchive</strong><ul><li>Marks a note as <a href=\"#root/_help_MKmLg5x6xkor\">archived</a>.</li><li>If the note is already archived, it will be unarchived instead.</li><li>Multiple notes can be selected as well. However, all the selected notes must be in the same state (archived or not), otherwise the option will be disabled.</li></ul></li><li><strong>Protect subtree/Unprotect subtree</strong><ul><li>On a note that is not protected, <em>Protect subtree</em> marks this note and all of its descendants as protected. On a protected note, the item reads <em>Unprotect subtree</em> and unprotects them instead. See <a class=\"reference-link\" href=\"#root/_help_bwg0e8ewQMak\">Protected Notes</a> for more information.</li><li>Hovering the item or clicking its arrow opens a submenu with both actions, for instance to unprotect the protected notes below a note that is not protected itself.</li></ul></li><li><strong>Import into note…</strong><ul><li>Opens the <a href=\"#root/_help_mHbBMPDPkVV5\">import</a> dialog and places the imported notes as child notes of the selected one.</li></ul></li><li><strong>Export…</strong><ul><li>Opens the <a href=\"#root/_help_mHbBMPDPkVV5\">export</a> dialog for the selected notes.</li></ul></li><li><strong>Search in subtree</strong><ul><li>Opens a full <a class=\"reference-link\" href=\"#root/_help_eIg8jdvaoNNd\">Search</a> with it preconfigured to only look into this note and its descendants (the <em>Ancestor</em> field).</li></ul></li></ul><h2>Advanced options</h2><figure class=\"image image-style-align-right\"><img style=\"aspect-ratio:231/263;\" src=\"{{helpAssets}}/User%20Guide/Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree/Note%20tree%20contextual%20menu_image.png\" width=\"231\" height=\"263\"></figure><p>The advanced options menu offers some of the less frequently used actions for notes.</p><p>To access these options, first look for the <em>Advanced</em> option at the bottom of the contextual menu to reveal a sub-menu with:</p><ul><li><strong>Apply bulk actions…</strong><ul><li>Opens the <a class=\"reference-link\" href=\"#root/_help_ivYnonVFBxbQ\">Bulk Actions</a> dialog, to apply actions such as adding labels or moving notes to multiple notes at once (see <a class=\"reference-link\" href=\"#root/_help_yTjUdsOi4CIE\">Multiple selection</a>).</li></ul></li><li><strong>Edit branch prefix…</strong><ul><li>Opens a dialog to assign a name to be able to distinguish <a href=\"#root/_help_IakOLONlIfGI\">clones</a>, see <a class=\"reference-link\" href=\"#root/_help_TBwsyfadTA18\">Branch prefix</a> for more information.</li></ul></li><li><strong>Convert to attachment…</strong><ul><li>Converts the selected notes to <a class=\"reference-link\" href=\"#root/_help_0vhv7lsOLy82\">Attachments</a> of their parent notes.</li><li>This functional is most useful when dealing with image <a class=\"reference-link\" href=\"#root/_help_W8vYD3Q1zjCR\">File</a> notes that were imported from an external source or an older version of Trilium.</li></ul></li><li><strong>Expand subtree</strong><ul><li>Expands all the child notes in the <a class=\"reference-link\" href=\"#root/_help_oPVyFC7WL2Lp\">Note Tree</a>.</li></ul></li><li><strong>Collapse subtree</strong><ul><li>Collapses all the child notes in the note tree.</li></ul></li><li><strong>Sort by…</strong><ul><li>Opens a dialog to sort all the child notes of the selected note.</li><li>The sorting is done only once, there is an automatic sorting mechanism as well that can be set using <a class=\"reference-link\" href=\"#root/_help_zEY4DaJG4YT5\">Attributes</a>.</li><li>See <a class=\"reference-link\" href=\"#root/_help_aGlEvb9hyDhS\">Sorting Notes</a> for more information.</li></ul></li><li><strong>Copy note path to clipboard</strong><ul><li>Copies a URL fragment representing the full path to this branch for a note, such as <code>#root/Hb2E70L7HPuf/4sRFgMZhYFts/2IVuShedRJ3U/LJVMvKXOFv7n</code>.</li><li>The URL to manually create <a class=\"reference-link\" href=\"#root/_help_QEAPj01N5f7w\">Links</a> within notes, or for note <a class=\"reference-link\" href=\"#root/_help_wArbEsdSae6g\">Navigation</a>.</li></ul></li><li><strong>Recent changes in subtree</strong><ul><li>This will open <a class=\"reference-link\" href=\"#root/_help_r5JGHN99bVKn\">Recent Changes</a>, but filtered to only the changes related to this note or one of its descendants.</li></ul></li></ul>","_help_yTjUdsOi4CIE": "<p>In the <a class=\"reference-link\" href=\"#root/_help_oPVyFC7WL2Lp\">Note Tree</a>, it's possible to select multiple notes at one time. This won't affect the currently displayed note, but it allows to do batch operations.</p><h2>Types of multiple selection</h2><figure class=\"image image-style-align-right image_resized\" style=\"width:28.54%;\"><img style=\"aspect-ratio:335/306;\" src=\"{{helpAssets}}/User%20Guide/Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree/Multiple%20selection_image.png\" width=\"335\" height=\"306\"></figure><h3>Selecting notes one by one</h3><p>To individually select each note, press the <kbd>Alt</kbd> key and click on the note to be selected.</p><p>The selected notes will be indicated via a different background color and an icon.</p><h3>Selecting notes in a sequence</h3><figure class=\"image image-style-align-right image_resized\" style=\"width:29.24%;\"><img style=\"aspect-ratio:233/205;\" src=\"{{helpAssets}}/User%20Guide/Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree/Multiple%20selection_image.jpg\" width=\"233\" height=\"205\"></figure><p>When notes are in a sequence (e.g. one underneath the other), the entire selection can be made just by selecting the first and the last item instead of individually clicking all the notes.</p><p>To do so, first select the note to start the selection with. Then hold <kbd>Shift</kbd> and click on the note to end the selection with. All the notes between the start and the end note will be selected as well.</p><h2>Selected notes vs. active note</h2><p>There is a distinction between <em>selected notes</em> and the <em>active note</em>:</p><ul><li><em>Selected notes</em> are simply the notes that were selected in the multiple section process (i.e. either via <kbd>Alt</kbd> or <kbd>Shift</kbd>).</li><li>The <em>active note</em> is simply the note that whose content is being displayed to the right of the tree.<ul><li><p>Visually, it's identified in the tree by having a different background color and a subtle shadow.</p></li><li><p>The active note can also be selected case in which the icon and background will also change:</p><img class=\"image_resized\" style=\"aspect-ratio:317/223;width:35.1%;\" src=\"{{helpAssets}}/User%20Guide/Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree/1_Multiple%20selection_image.png\" width=\"317\" height=\"223\"></li></ul></li></ul>","_help_DvdZhoQZY9Yd": "<p>The <a class=\"reference-link\" href=\"#root/_help_oPVyFC7WL2Lp\">Note Tree</a> comes with multiple keyboard shortcuts to make editing faster:</p><h2>Navigation within the tree</h2><ul><li><kbd><span>↑</span></kbd> and <kbd><span>↑</span></kbd> to navigate between notes.</li><li><kbd><span>←</span></kbd> to collapse a note with children, or <kbd><span>→</span></kbd> to expand it.</li><li><kbd><span>←</span></kbd> on a note with no children to navigate to its parent.</li></ul><h2>Opening notes</h2><ul><li><kbd>Click</kbd> to open the note in the current tab.</li><li><kbd>Ctrl</kbd>+<kbd>Click</kbd> or <kbd>Middle click</kbd> to open the note in a new tab.</li><li><kbd>Ctrl</kbd>+<kbd>Right click</kbd> to open the note in <a class=\"reference-link\" href=\"#root/_help_ZjLYv08Rp3qC\">Quick edit</a>.</li></ul><h2>Clipboard management</h2><ul><li><kbd>Ctrl</kbd>+<kbd>C</kbd> to copy one or more notes based on selection (see <a class=\"reference-link\" href=\"#root/_help_IakOLONlIfGI\">Cloning Notes</a>).</li><li><kbd>Ctrl</kbd>+<kbd>X</kbd> to cut one or more notes (for moving them).</li><li><kbd>Ctrl</kbd>+<kbd>V</kbd> to paste them somewhere (which results in a copy or move based on the shortcut used).</li></ul><h2>Moving notes</h2><ul><li><kbd>Ctrl</kbd> + <kbd><span>↑</span></kbd> , <kbd>Ctrl</kbd> + <kbd><span>↓</span></kbd> - move note up/down in the note list.</li><li><kbd>Ctrl</kbd> + <kbd><span>←</span></kbd> - move note up in the note tree.</li><li><kbd>Ctrl</kbd>+<kbd><span>→</span></kbd> - move note down in the note tree.</li><li><kbd>Del</kbd> - deletes note and optionally its subtree (asked in the dialog).</li><li><kbd>Alt</kbd>+<kbd>S</kbd> - sorts the child notes of the note (see <a class=\"reference-link\" href=\"#root/_help_aGlEvb9hyDhS\">Sorting Notes</a>).</li></ul><h2>Multiple selection</h2><p>See <a class=\"reference-link\" href=\"#root/_help_yTjUdsOi4CIE\">Multiple selection</a> for more information about how selection works.</p><ul><li><kbd>Alt</kbd>+<kbd>Click</kbd> – add a single note to the current selection.</li><li><kbd>Shift</kbd>+<kbd>Click</kbd> – select a range of notes, starting from the current note (the highlighted one) to the one that is being clicked.</li><li><kbd>Shift</kbd>+<kbd><span>↑</span></kbd>, <kbd>Shift</kbd>+<kbd><span>↓</span></kbd> – multi-select not above/below.</li><li><kbd>Ctrl</kbd>+<kbd>A</kbd> – select all notes in the current level</li></ul>",diff --git a/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree.md b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree.mdindex 545b2434dd..9d1ba2fe30 100644--- a/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree.md+++ b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree.md@@ -34,8 +34,9 @@ See <a class="reference-link" href="Note%20Tree/Note%20tree%20contextual%20menu## Tree Settings-Click the tree icon in the tree toolbar to open the tree settings popup. Each option is a toggle that takes effect as soon as it is switched:+Click the tree icon in the tree toolbar to open the tree settings popup. Each option takes effect as soon as it is changed:+* _Display density_: _Relaxed_ (default) or _Dense_. Dense rows are shorter, so more notes fit on the screen. This setting is not synchronized, so each device keeps its own.* _Hide archived notes_: When enabled, archived notes are not shown in the tree.* _Automatically collapse notes_: When enabled, notes are collapsed after a period of inactivity to keep the tree tidy.* _Follow active note_: When enabled (default), the tree automatically scrolls and expands parent nodes to keep the currently active note visible. When disabled, the tree is fully detached from navigation — only the background highlight of the active note is updated, but the tree viewport and its expanded/collapsed state are never changed by navigation. Use the crosshair button to manually jump the tree to the active note at any time.diff --git a/packages/commons/src/lib/options_interface.ts b/packages/commons/src/lib/options_interface.tsindex df506d3a13..e6c33a7186 100644--- a/packages/commons/src/lib/options_interface.ts+++ b/packages/commons/src/lib/options_interface.ts@@ -13,6 +13,9 @@ type KeyboardShortcutsOptions<T extends KeyboardActionNames> = {[key in T as `keyboardShortcuts${Capitalize<key>}`]: string;};+/** How tall the rows of the note tree are. */+export type TreeDensity = "relaxed" | "dense";+export type FontFamily = "theme" | "serif" | "sans-serif" | "monospace" | string;/**@@ -227,6 +230,8 @@ export interface OptionDefinitions extends KeyboardShortcutsOptions<KeyboardActidebugModeEnabled: boolean;autoCollapseNoteTree: boolean;treeScrollFollowNavigation: boolean;+ /** Not synced, so each device keeps its own. */+ treeDensity: TreeDensity;dailyBackupEnabled: boolean;weeklyBackupEnabled: boolean;monthlyBackupEnabled: boolean;diff --git a/packages/trilium-core/src/routes/api/options.ts b/packages/trilium-core/src/routes/api/options.tsindex 37307b5205..cd1c932ff1 100644--- a/packages/trilium-core/src/routes/api/options.ts+++ b/packages/trilium-core/src/routes/api/options.ts@@ -84,6 +84,7 @@ const ALLOWED_OPTIONS = new Set<OptionNames>(["headingStyle","autoCollapseNoteTree","treeScrollFollowNavigation",+ "treeDensity","autoReadonlySizeText","customDateTimeFormat","autoReadonlySizeCode",diff --git a/packages/trilium-core/src/services/options_init.ts b/packages/trilium-core/src/services/options_init.tsindex ce8a9aec1c..25cb691465 100644--- a/packages/trilium-core/src/services/options_init.ts+++ b/packages/trilium-core/src/services/options_init.ts@@ -216,6 +216,7 @@ const defaultOptions: DefaultOption[] = [{ name: "headingStyle", value: "underline", isSynced: true },{ name: "autoCollapseNoteTree", value: "true", isSynced: true },{ name: "treeScrollFollowNavigation", value: "true", isSynced: true },+ { name: "treeDensity", value: "relaxed", isSynced: false },{ name: "autoReadonlySizeText", value: "32000", isSynced: false },{ name: "autoReadonlySizeCode", value: "64000", isSynced: false },{ name: "dailyBackupEnabled", value: "true", isSynced: false },