Skip to content

Build your personal knowledge base with Trilium Notes

client: lazy load collection tabs at the application startup

Adorian Doranbc7a38c29c4b
diff --git a/apps/client/src/widgets/NoteDetail.spec.ts b/apps/client/src/widgets/NoteDetail.spec.ts
index c3284a6b81..51c26b2875 100644
--- a/apps/client/src/widgets/NoteDetail.spec.ts
+++ b/apps/client/src/widgets/NoteDetail.spec.ts
@@ -17,7 +17,7 @@ import {
getExtendedWidgetType, NoteDetailWrapper, shouldFocusOnNoteChange, useDeferredDetailFocus,
useNoteInfo
} from "./NoteDetail";
-import { isContextInActiveTab, useLegacyImperativeHandlers, useTriliumEvent } from "./react/hooks";
+import { useLegacyImperativeHandlers, useTriliumEvent } from "./react/hooks";
import {
ContainerVisibilityContext, NoteContextContext, ParentComponent
} from "./react/react_utils";
@@ -25,47 +25,6 @@ import type { TypeWidgetProps } from "./type_widgets/type_widget";
const FAKE_NOTE_ID = "blob-stub-note";
-/**
- * Builds a tab as a list of note contexts: the first is the main context (the tab itself),
- * the rest are its splits. Every context resolves its main context to the first one — the
- * same topology `NoteContext.getMainContext()` produces, without needing a real tab manager.
- */
-function buildTab(ntxIds: string[]): NoteContext[] {
- const contexts = ntxIds.map((id, i) => new NoteContext(id, "root", i === 0 ? null : ntxIds[0]));
- const mainContext = contexts[0];
- for (const context of contexts) {
- context.getMainContext = () => mainContext;
- }
- return contexts;
-}
-
-describe("isContextInActiveTab", () => {
- it("treats every split of the active tab as active, not just the focused one", () => {
- const [ mainContext, secondarySplit ] = buildTab([ "A", "B" ]);
-
- // The active tab is "A". Both the main split and the secondary (non-focused) split belong to
- // it, so both must load eagerly. The secondary split is the regression case: keying deferral on
- // the focused split alone (its own ntxId "B") would leave it blank until clicked.
- expect(isContextInActiveTab(mainContext, "A")).toBe(true);
- expect(isContextInActiveTab(secondarySplit, "A")).toBe(true);
- });
-
- it("defers splits that belong to a different (background) tab", () => {
- const [ backgroundMain, backgroundSplit ] = buildTab([ "C", "D" ]);
-
- expect(isContextInActiveTab(backgroundMain, "A")).toBe(false);
- expect(isContextInActiveTab(backgroundSplit, "A")).toBe(false);
- });
-
- it("returns false when the context is missing or no tab is active yet", () => {
- const [ , split ] = buildTab([ "A", "B" ]);
-
- expect(isContextInActiveTab(undefined, "A")).toBe(false);
- expect(isContextInActiveTab(split, null)).toBe(false);
- expect(isContextInActiveTab(split, undefined)).toBe(false);
- });
-});
-
describe("getExtendedWidgetType blob-stub routing", () => {
afterEach(() => {
delete froca.notes[FAKE_NOTE_ID];
diff --git a/apps/client/src/widgets/NoteDetail.tsx b/apps/client/src/widgets/NoteDetail.tsx
index 2d87dc544d..d56111a21b 100644
--- a/apps/client/src/widgets/NoteDetail.tsx
+++ b/apps/client/src/widgets/NoteDetail.tsx
@@ -26,7 +26,6 @@ import Button from "./react/Button";
import {
useDelayedVisibility,
useGetContextDataFrom,
- useHasTabBeenShown,
useLegacyComponentElement,
useNoteContext,
useTriliumEvent
@@ -57,9 +56,6 @@ export default function NoteDetail() {
const [ activeNoteType, setActiveNoteType ] = useState<ExtendedNoteType>();
const widgetRequestId = useRef(0);
- // Defer loading for tabs that haven't been active yet (e.g. on app refresh).
- const hasTabBeenActive = useHasTabBeenShown(noteContext);
-
const props: TypeWidgetProps = {
note: note!,
viewScope,
@@ -69,7 +65,7 @@ export default function NoteDetail() {
};
useEffect(() => {
- if (!type || !hasTabBeenActive) return;
+ if (!type) return;
const requestId = ++widgetRequestId.current;
if (!noteTypesToRender[type]) {
@@ -88,7 +84,7 @@ export default function NoteDetail() {
} else {
setActiveNoteType(type);
}
- }, [ note, viewScope, type, noteTypesToRender, hasTabBeenActive ]);
+ }, [ note, viewScope, type, noteTypesToRender ]);
// Detect note type changes.
useTriliumEvent("entitiesReloaded", async ({ loadResults }) => {
diff --git a/apps/client/src/widgets/containers/split_note_container.spec.tsx b/apps/client/src/widgets/containers/split_note_container.spec.tsx
index f3492da775..b8d6ab8199 100644
--- a/apps/client/src/widgets/containers/split_note_container.spec.tsx
+++ b/apps/client/src/widgets/containers/split_note_container.spec.tsx
@@ -1,11 +1,14 @@
import { useLayoutEffect } from "preact/hooks";
+import { act } from "preact/test-utils";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import appContext from "../../components/app_context";
import NoteContext from "../../components/note_context";
import type TabManager from "../../components/tab_manager";
import LoadResults from "../../services/load_results";
+import { buildNote } from "../../test/easy-froca";
import NoteWrapperWidget from "../note_wrapper";
+import { useNoteContext } from "../react/hooks";
import SplitNoteContainer from "./split_note_container";
// The resizer drives Split.js against the real #center-pane layout, on an animation frame that
@@ -100,6 +103,58 @@ describe("SplitNoteContainer", () => {
expect(isMounted).toBe(false);
});
+ it("keeps the note of a background tab from its panes until the tab is shown", async () => {
+ function Probe() {
+ const { note } = useNoteContext();
+ return <div className="probe">{note?.noteId ?? ""}</div>;
+ }
+
+ const container = new SplitNoteContainer(() => new NoteWrapperWidget().child(<Probe />));
+ container.render();
+
+ // A shown tab, then a background tab of two splits, each opened on a note as loadTabs() does:
+ // openEmptyTab() creates the pane, then setNote() switches it to the note.
+ const panes = [
+ new NoteContext("shown"),
+ new NoteContext("background"),
+ new NoteContext("background-split", "root", "background")
+ ];
+ await act(async () => {
+ for (const noteContext of panes) {
+ noteContext.setEmpty();
+ noteContexts.push(noteContext);
+ await container.newNoteContextCreatedEvent({ noteContext });
+
+ const { noteId } = buildNote({ id: `${noteContext.ntxId}-note`, title: "Note" });
+ noteContext.notePath = noteId;
+ noteContext.noteId = noteId;
+ await container.handleEvent("noteSwitched", { noteContext, notePath: noteId });
+ }
+ });
+
+ const findPane = (ntxId: string) => container.$widget.find(`[data-ntx-id="${ntxId}"]`);
+ const readProbe = (ntxId: string) => {
+ const $probe = findPane(ntxId).find(".probe");
+ expect($probe).toHaveLength(1);
+ return $probe.text();
+ };
+ expect(readProbe("shown")).toBe("shown-note");
+ expect(readProbe("background")).toBe("");
+ expect(readProbe("background-split")).toBe("");
+ // `resizer.ts` selects the panes of a tab by this class, also before the tab is shown.
+ expect(findPane("background").hasClass("note-split")).toBe(true);
+ expect(findPane("background-split").hasClass("note-split")).toBe(true);
+
+ // Focusing either split shows the whole tab.
+ appContext.tabManager.getActiveMainContext = () => panes[1];
+ await act(async () => {
+ await container.handleEvent("activeContextChanged", { noteContext: panes[2] });
+ });
+
+ expect(readProbe("background")).toBe("background-note");
+ expect(readProbe("background-split")).toBe("background-split-note");
+ });
+
describe("keyboard actions", () => {
it("closes the active split, leaving a tab that has no split alone", async () => {
const container = await openSplits([ "split-a", "split-b" ]);
diff --git a/apps/client/src/widgets/containers/split_note_container.ts b/apps/client/src/widgets/containers/split_note_container.ts
index 42ad8a751a..f7141d682f 100644
--- a/apps/client/src/widgets/containers/split_note_container.ts
+++ b/apps/client/src/widgets/containers/split_note_container.ts
@@ -9,6 +9,8 @@ import FlexContainer from "./flex_container.js";
interface SplitNoteWidget extends BasicWidget {
hasBeenAlreadyShown?: boolean;
+ /** Whether the widget has received `setNoteContext`. */
+ hasNoteContext?: boolean;
ntxId?: string;
}
@@ -48,7 +50,9 @@ export default class SplitNoteContainer extends FlexContainer<SplitNoteWidget> {
this.widgets[noteContext.ntxId] = widget;
}
- await widget.handleEvent("setNoteContext", { noteContext });
+ if (appContext.tabManager.getActiveMainContext() === noteContext.getMainContext()) {
+ await this.provideNoteContext(widget, noteContext);
+ }
this.child(widget);
@@ -288,9 +292,10 @@ export default class SplitNoteContainer extends FlexContainer<SplitNoteWidget> {
}
/**
- * widget.hasBeenAlreadyShown is intended for lazy loading of cached tabs - initial note switches of new tabs
- * are not executed, we're waiting for the first tab activation, and then we update the tab. After this initial
- * activation, further note switches are always propagated to the tabs.
+ * Delays the panes of a background tab until the tab is first shown, for tabs restored at
+ * startup and for tabs the user opens in the background. Until then a pane gets no
+ * `setNoteContext` and no `noteSwitched`, so its widgets have no note and load nothing. After
+ * the first showing, every `noteSwitched` is passed on.
*/
async handleEventInChildren<T extends EventNames>(name: T, data: EventData<T>) {
if (["noteSwitched", "noteSwitchedAndActivated"].includes(name)) {
@@ -307,6 +312,7 @@ export default class SplitNoteContainer extends FlexContainer<SplitNoteWidget> {
if (widget.hasBeenAlreadyShown || name === "noteSwitchedAndActivated" || appContext.tabManager.getActiveMainContext() === noteSwitchedContext.noteContext.getMainContext()) {
widget.hasBeenAlreadyShown = true;
+ await this.provideNoteContext(widget, noteSwitchedContext.noteContext);
// Promise.all (not a bare array) so that awaiting triggerEvent("noteSwitched")
// genuinely waits for the tab's widgets to process the switch.
@@ -335,7 +341,8 @@ export default class SplitNoteContainer extends FlexContainer<SplitNoteWidget> {
if (!widget.hasBeenAlreadyShown) {
widget.hasBeenAlreadyShown = true;
- promises.push(widget.handleEvent("activeContextChanged", { noteContext: subContext }));
+ promises.push(this.provideNoteContext(widget, subContext)
+ .then(() => widget.handleEvent("activeContextChanged", { noteContext: subContext })));
}
}
@@ -343,6 +350,16 @@ export default class SplitNoteContainer extends FlexContainer<SplitNoteWidget> {
return Promise.all(promises);
}
+
+ /** Sends `setNoteContext` to the widget, unless the widget has already received it. */
+ private async provideNoteContext(widget: SplitNoteWidget, noteContext: NoteContext) {
+ if (widget.hasNoteContext) {
+ return;
+ }
+
+ widget.hasNoteContext = true;
+ await widget.handleEvent("setNoteContext", { noteContext });
+ }
}
function recursiveCleanup(widget: Component) {
diff --git a/apps/client/src/widgets/note_wrapper.ts b/apps/client/src/widgets/note_wrapper.ts
index 7b984ec09b..087a255f22 100644
--- a/apps/client/src/widgets/note_wrapper.ts
+++ b/apps/client/src/widgets/note_wrapper.ts
@@ -19,6 +19,12 @@ export default class NoteWrapperWidget extends FlexContainer<BasicWidget> {
this.css("flex-grow", "1").collapsible();
}
+ doRender() {
+ super.doRender();
+ // Adds `note-split` before the note context arrives: `resizer.ts` selects the panes by it.
+ this.refresh();
+ }
+
setNoteContextEvent({ noteContext }: EventData<"setNoteContext">) {
this.noteContext = noteContext;
this.refresh();
diff --git a/apps/client/src/widgets/react/hooks.tsx b/apps/client/src/widgets/react/hooks.tsx
index 9708f1fa69..7ea9e7cc0f 100644
--- a/apps/client/src/widgets/react/hooks.tsx
+++ b/apps/client/src/widgets/react/hooks.tsx
@@ -542,48 +542,6 @@ export function useNoteContext() {
};
}
-/**
- * Whether the tab holding `noteContext` has been shown since the component mounted. A tab
- * restored or opened in the background reads `false` until the user switches to it. Every split
- * of a tab is shown with it, so the check is keyed on the tab's main context. Special contexts (an
- * ntxId starting with "_", such as the popup editor) always read `true`.
- */
-export function useHasTabBeenShown(noteContext: NoteContext | undefined) {
- const isShown = () => (noteContext?.ntxId?.startsWith("_") ?? false)
- || isContextInActiveTab(noteContext, appContext.tabManager.getActiveMainContext()?.ntxId);
- const [ hasBeenShown, setHasBeenShown ] = useState(isShown);
-
- useEffect(() => {
- if (!hasBeenShown && isShown()) {
- setHasBeenShown(true);
- }
- }, [ noteContext, hasBeenShown ]); // eslint-disable-line react-hooks/exhaustive-deps
- useTriliumEvent("activeNoteChanged", () => {
- if (!hasBeenShown && isShown()) {
- setHasBeenShown(true);
- }
- });
-
- return hasBeenShown;
-}
-
-/**
- * True when the given context belongs to the active tab, identified by `activeMainNtxId` (the
- * ntxId of the active tab's main context). A tab can hold several splits, but only one of them is
- * the "active" context at a time; every split of the active tab is visible and must load eagerly,
- * so the deferral check is keyed on the tab (the main context), not the individual split.
- */
-export function isContextInActiveTab(
- noteContext: NoteContext | undefined,
- activeMainNtxId: string | null | undefined
-): boolean {
- if (!noteContext || activeMainNtxId == null) {
- return false;
- }
-
- return activeMainNtxId === noteContext.getMainContext().ntxId;
-}
-
/**
* Registers `noteContext`, built outside the tab row, with `TabManager` for as long as the component
* uses it, so that commands naming its `ntxId` resolve to it.
diff --git a/apps/client/src/widgets/search_result.spec.tsx b/apps/client/src/widgets/search_result.spec.tsx
index 665cec07bd..2c27484302 100644
--- a/apps/client/src/widgets/search_result.spec.tsx
+++ b/apps/client/src/widgets/search_result.spec.tsx
@@ -12,8 +12,6 @@ const shownNote = vi.hoisted(() => ({
listeners: new Set<() => void>(),
parentComponent: null as import("../components/component").default | null
}));
-const shownTab = vi.hoisted(() => ({ activeMainNtxId: "ntx1" as string | null }));
-const tabContext = vi.hoisted(() => ({ ntxId: "ntx1", getMainContext() { return tabContext; } }));
vi.mock("./react/hooks", async (importOriginal) => {
const { useEffect, useState } = await import("preact/hooks");
return {
@@ -37,7 +35,6 @@ vi.mock("./react/hooks", async (importOriginal) => {
note,
notePath: note?.noteId,
ntxId: "ntx1",
- noteContext: tabContext,
parentComponent: shownNote.parentComponent
};
}
@@ -53,7 +50,6 @@ import { buildNote } from "../test/easy-froca";
import { ParentComponent } from "./react/react_utils";
import SearchResult from "./search_result";
-const realTabManager = appContext.tabManager;
let container: HTMLElement;
let parent: Component;
let realIntersectionObserver: typeof IntersectionObserver;
@@ -71,17 +67,11 @@ class ImmediateIntersectionObserver {
}
beforeEach(() => {
- shownTab.activeMainNtxId = "ntx1";
shownNote.listeners.clear();
// Collection views read their saved config from attachments, which these fixtures do not have.
vi.spyOn(froca, "getAttachmentsForNote").mockResolvedValue([]);
realIntersectionObserver = window.IntersectionObserver;
window.IntersectionObserver = ImmediateIntersectionObserver as unknown as typeof IntersectionObserver;
- // Client tests run without app start-up, which is what creates the tab manager.
- appContext.tabManager = {
- getActiveMainContext: () =>
- (shownTab.activeMainNtxId ? { ntxId: shownTab.activeMainNtxId } : null)
- } as never;
window.glob.TRILIUM_SAFE_MODE = false;
parent = new Component();
shownNote.parentComponent = parent;
@@ -91,7 +81,6 @@ beforeEach(() => {
afterEach(() => {
vi.restoreAllMocks();
- appContext.tabManager = realTabManager;
window.IntersectionObserver = realIntersectionObserver;
render(null, container);
container.remove();
@@ -181,7 +170,7 @@ describe("SearchResult", () => {
});
describe("running a saved search when it is shown", () => {
- it("runs a search shown in the active tab and shows progress until it answers", async () => {
+ it("runs a shown search and shows progress until it answers", async () => {
const savedSearch = searchNote("autoSearch", "#book");
const result = buildNote({ id: "autoResult", title: "Auto result" });
let answer: (value: unknown) => void = () => {};
@@ -250,22 +239,6 @@ describe("running a saved search when it is shown", () => {
expect(container.querySelector("button")).not.toBeNull();
});
- it("waits for a background tab to be shown before running its saved search", async () => {
- const savedSearch = searchNote("backgroundSearch", "#book");
- const loadSearchNote = vi.spyOn(froca, "loadSearchNote").mockResolvedValue(undefined);
- shownTab.activeMainNtxId = "otherTab";
-
- shownNote.current = savedSearch;
- await mount();
- expect(loadSearchNote).not.toHaveBeenCalled();
-
- await settle(() => {
- shownTab.activeMainNtxId = "ntx1";
- void parent.handleEvent("activeNoteChanged", { ntxId: "ntx1" });
- });
- expect(loadSearchNote).toHaveBeenCalledExactlyOnceWith("backgroundSearch");
- });
-
it("leaves the search to \"Search now\" in safe mode and after a failed request", async () => {
const safeSearch = searchNote("safeSearch", "#book");
const loadSearchNote = vi.spyOn(froca, "loadSearchNote")
diff --git a/apps/client/src/widgets/search_result.tsx b/apps/client/src/widgets/search_result.tsx
index 73654bd409..fbca69d6bd 100644
--- a/apps/client/src/widgets/search_result.tsx
+++ b/apps/client/src/widgets/search_result.tsx
@@ -9,7 +9,7 @@ import search from "../services/search";
import toast from "../services/toast";
import { SearchNoteList } from "./collections/NoteList";
import Button from "./react/Button";
-import { useHasTabBeenShown, useNoteContext, useTriliumEvent } from "./react/hooks";
+import { useNoteContext, useTriliumEvent } from "./react/hooks";
import NoItems from "./react/NoItems";
enum SearchResultState {
@@ -19,13 +19,13 @@ enum SearchResultState {
}
export default function SearchResult() {
- const { note, notePath, ntxId, noteContext, parentComponent } = useNoteContext();
+ const { note, notePath, ntxId, parentComponent } = useNoteContext();
const [ , setRefreshCount ] = useState(0);
const state = getSearchResultState(note);
const { isSearching, runSearch } = useSavedSearchRun(
note,
state === SearchResultState.NOT_EXECUTED,
- { noteContext, ntxId, parentComponent }
+ { ntxId, parentComponent }
);
const highlightedTokens = note?.highlightedTokenInfos ?? note?.highlightedTokens;
@@ -74,23 +74,20 @@ export default function SearchResult() {
);
}
-type SearchRunContext = Pick<
- ReturnType<typeof useNoteContext>,
- "noteContext" | "ntxId" | "parentComponent"
->;
+type SearchRunContext = Pick<ReturnType<typeof useNoteContext>, "ntxId" | "parentComponent">;
/**
* Runs a saved search that has no results yet, through `search.runSearchNote()`, when it is
- * shown in a visible tab, and reports while a run is in progress. A failed request waits for
- * `runSearch()` ("Search now") or the next showing. Safe mode runs nothing on its own, so a
- * hanging search cannot hang every start-up.
+ * shown, and reports while a run is in progress. A pane of a background tab gets its note from
+ * `SplitNoteContainer` only when the tab is shown. A failed request waits for `runSearch()`
+ * ("Search now") or the next showing. Safe mode runs nothing on its own, so a hanging search
+ * cannot hang every start-up.
*/
function useSavedSearchRun(
note: FNote | null | undefined,
hasNotRun: boolean,
- { noteContext, ntxId, parentComponent }: SearchRunContext
+ { ntxId, parentComponent }: SearchRunContext
) {
- const hasTabBeenShown = useHasTabBeenShown(noteContext);
// Tracks in-flight searches started by this hook by note ID.
const [ runningNoteIds, setRunningNoteIds ] = useState<ReadonlySet<string>>(new Set());
const autoRunNoteId = useRef<string | undefined>(undefined);
@@ -117,7 +114,7 @@ function useSavedSearchRun(
}
const isRunning = !!note && runningNoteIds.has(note.noteId);
- const runsOnShow = hasNotRun && hasTabBeenShown && !glob.TRILIUM_SAFE_MODE
+ const runsOnShow = hasNotRun && !glob.TRILIUM_SAFE_MODE
&& !!note && autoRunNoteId.current !== note.noteId;
useEffect(() => {
if (autoRunNoteId.current !== note?.noteId) {
diff --git a/apps/server/src/assets/help/help_content.json b/apps/server/src/assets/help/help_content.json
index 61e079408f..886273acbf 100644
--- a/apps/server/src/assets/help/help_content.json
+++ b/apps/server/src/assets/help/help_content.json
@@ -42,7 +42,7 @@
"_help_yTjUdsOi4CIE": "<p>In the&nbsp;<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&nbsp;<a class=\"reference-link\" href=\"#root/_help_oPVyFC7WL2Lp\">Note Tree</a>&nbsp;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&nbsp;<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&nbsp;<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&nbsp;<a class=\"reference-link\" href=\"#root/_help_aGlEvb9hyDhS\">Sorting Notes</a>).</li></ul><h2>Multiple selection</h2><p>See&nbsp;<a class=\"reference-link\" href=\"#root/_help_yTjUdsOi4CIE\">Multiple selection</a>&nbsp;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>",
"_help_wyaGBBQrl4i3": "<figure class=\"image image-style-align-right\"><img style=\"aspect-ratio:328/45;\" src=\"{{helpAssets}}/User%20Guide/Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree/1_Hiding%20the%20subtree_image.png\" width=\"328\" height=\"45\"><figcaption>An example of a collection with a relatively large number of children that are hidden from the tree.</figcaption></figure><p>The tree works well when the notes are structured in a hierarchy so that the number of items stays small. When a note has a large number of notes (in the order of thousands or tens of thousands), two problems arise:</p><ul><li>Navigating between notes becomes cumbersome and the tree itself gets cluttered with a large amount of notes.</li><li>The large amount of notes can slow down the application considerably.</li></ul><p>Since v0.102.0, Trilium allows the tree to hide the child notes of particular notes. This works for both&nbsp;<a class=\"reference-link\" href=\"#root/_help_GTwFsgaA0lCt\">Collections</a>&nbsp;and normal notes.</p><h2>Interaction</h2><p>When the subtree of a note is hidden, there are a few subtle changes:</p><ul><li>To indicate that the subtree is hidden, the note will not have an expand button and it will display the number of children to the right.</li><li>It's not possible to add a new note directly from the tree.<ul><li>For&nbsp;<a class=\"reference-link\" href=\"#root/_help_GTwFsgaA0lCt\">Collections</a>, it's best to use the built-in mechanism to create notes (for example by creating a new point on a geo-map, or by adding a new row in a table).</li><li>For normal notes, it's still possible to create children via other means such as using the&nbsp;<a class=\"reference-link\" href=\"#root/_help_hrZ1D00cLbal\">Internal (reference) links</a>&nbsp;system.</li></ul></li><li>Notes can be dragged from outside the note, case in which they will be cloned into it.<ul><li>Instead of switching to the child notes that were copied, the parent note is highlighted instead.</li><li>A notification will indicate this behavior.</li></ul></li><li>Similarly, features such as cut/copy and then paste into the note will also work.</li></ul><h2>Spotlighting</h2><figure class=\"image image-style-align-right\"><img style=\"aspect-ratio:322/83;\" src=\"{{helpAssets}}/User%20Guide/Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree/Hiding%20the%20subtree_image.png\" width=\"322\" height=\"83\"></figure><p>Even if the subtree of a note is hidden, if a child note manages to become active, it will still appear inside the tree in a special state called <em>spotlighted</em>.</p><p>During this state, the note remains under its normal hierarchy, so that its easy to tell its location. In addition, this means that:</p><ul><li>The note position is clearly visible when using the&nbsp;<a class=\"reference-link\" href=\"#root/_help_eIg8jdvaoNNd\">Search</a>.</li><li>The note can still be operated on from the tree, such as adding a&nbsp;<a class=\"reference-link\" href=\"#root/_help_TBwsyfadTA18\">Branch prefix</a>&nbsp;or moving it outside the collection.</li></ul><p>The note appears in italics to indicate its temporary display. When switching to another note, the spotlighted note will disappear.</p><aside class=\"admonition note\"><p>Only one note can be highlighted at the time. When working with multiple notes such as dragging them into the collection, no note will be spotlighted. This is intentional to avoid displaying a partial state of the subtree.</p></aside><h2>Working with collections</h2><p>For large collections, it can be helpful to hide their child notes for performance reasons or de-cluttering the tree.</p><p>To toggle this behavior:</p><ul><li>Open the collection and in&nbsp;<a class=\"reference-link\" href=\"#root/_help_CssoWBu8I7jF\">Collection Properties</a>, look for <em>Hide child notes in tree</em>.</li><li>Right click the collection note in the&nbsp;<a class=\"reference-link\" href=\"#root/_help_oPVyFC7WL2Lp\">Note Tree</a>&nbsp;and select <em>Advanced</em> → <em>Show subtree</em>.</li></ul><h2>Working with normal notes</h2><p>It's possible to hide the subtree for normal notes as well, not just collections. To do so, right click the note in the&nbsp;<a class=\"reference-link\" href=\"#root/_help_oPVyFC7WL2Lp\">Note Tree</a>&nbsp;and select <em>Advanced</em> → <em>Hide subtree.</em></p>",
- "_help_3seOhtN8uLIY": "<figure class=\"image image-style-align-center\"><img style=\"aspect-ratio:1119/43;\" src=\"{{helpAssets}}/User%20Guide/Basic%20Concepts%20and%20Features/UI%20Elements/Tabs_image.png\" width=\"1119\" height=\"43\"></figure><p>In Trilium, tabs allow easy switching between notes.</p><h2>Layout</h2><p>Depending on the&nbsp;<a class=\"reference-link\" href=\"#root/_help_x0JgW8UqGXvq\">Vertical and horizontal layout</a>:</p><ul><li>For the vertical layout, the tabs will be placed at the top but to the right of the&nbsp;<a class=\"reference-link\" href=\"#root/_help_oPVyFC7WL2Lp\">Note Tree</a>.</li><li>For the horizontal layout, the tabs will be placed at the top in full-width, above the&nbsp;<a href=\"#root/_help_oPVyFC7WL2Lp\">note tree</a>, allowing for more tabs to be comfortably displayed.</li></ul><h2>Interaction</h2><ul><li>To create a new tab, press the&nbsp;<span class=\"tn-icon bx bx-plus\"></span> button that is to the right of the last tab.</li><li>Right-clicking the <span class=\"tn-icon bx bx-plus\"></span> button shows a menu with <em>New tab</em> and, if there are any <a class=\"reference-link\" href=\"#root/_help_9sRHySam5fXb\">Workspaces</a>, one entry per workspace, which opens the workspace in a new tab, hoisted into it.</li><li>To close a tab, press the corresponding&nbsp;<span class=\"tn-icon bx bx-x\"></span> button.</li><li>For multitasking, tabs can be used alongside&nbsp;<a class=\"reference-link\" href=\"#root/_help_luNhaphA37EO\">Split View</a>. Each tab can have one or more notes, displayed horizontally.</li><li>Tabs can be reordered by drag-and-dropping it into a new position.</li><li>An existing tab can be displayed in a new window by dragging the tab upwards or downwards. It is not possible to combine tabs back into another window.</li></ul><h2>Keyboard interaction</h2><p>Since tabs are a commonly used feature, there are multiple keyboard shortcuts that can be used:</p><ul><li><kbd>Ctrl</kbd>+<kbd>T</kbd> to open a new tab.</li><li><kbd>Ctrl</kbd>+<kbd>W</kbd> to close the current tab.</li><li><kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>T</kbd> to reopen the last closed tab.</li><li><kbd>Ctrl</kbd>+<kbd>Tab</kbd> and <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>Tab</kbd> to go to the next or previous tab.</li><li><kbd>Ctrl</kbd>+<kbd>1</kbd>, <kbd>Ctrl</kbd>+<kbd>2</kbd>, up to <kbd>Ctrl</kbd>+<kbd>9</kbd> to activate the first, second and up to ninth tab.</li><li>There is also a shortcut to go to the last tab, but it is not assigned a key by default.</li></ul><h2>Mobile</h2><figure class=\"image image-style-align-right image_resized\" style=\"width:34.12%;\"><img style=\"aspect-ratio:1242/2688;\" src=\"{{helpAssets}}/User%20Guide/Basic%20Concepts%20and%20Features/UI%20Elements/Tabs_IMG_1767.PNG\" width=\"1242\" height=\"2688\"></figure><p>Tabs are also supported on the&nbsp;<a class=\"reference-link\" href=\"#root/_help_RDslemsQ6gCp\">Mobile Frontend</a>.</p><p>Since v0.102.0, the tabs are displayed by pressing the dedicated tab switcher button in the&nbsp;<a class=\"reference-link\" href=\"#root/_help_xYmIYSP6wE3F\">Launch Bar</a>. In this view the tabs are laid out on a grid with a preview of the note content.</p><p>The context menu button at the top-right of the popup allows creating a new tab, reopening the last closed tab and closing all the tabs.</p><p><a class=\"reference-link\" href=\"#root/_help_luNhaphA37EO\">Split View</a>s are also indicated in the tab switcher, with two titles displayed in a tab.</p><aside class=\"admonition note\"><p>Versions prior to v0.102.0 also supported tabs, but they were displayed directly above the&nbsp;<a class=\"reference-link\" href=\"#root/_help_xYmIYSP6wE3F\">Launch Bar</a>. The decision to use a more mobile-like tab switcher was taken because the original tab bar could not support many tabs at once and the new design better aligns with how mobile applications handle tabs.</p></aside>",
+ "_help_3seOhtN8uLIY": "<figure class=\"image image-style-align-center\"><img style=\"aspect-ratio:1119/43;\" src=\"{{helpAssets}}/User%20Guide/Basic%20Concepts%20and%20Features/UI%20Elements/Tabs_image.png\" width=\"1119\" height=\"43\"></figure><p>In Trilium, tabs allow easy switching between notes.</p><h2>Layout</h2><p>Depending on the&nbsp;<a class=\"reference-link\" href=\"#root/_help_x0JgW8UqGXvq\">Vertical and horizontal layout</a>:</p><ul><li>For the vertical layout, the tabs will be placed at the top but to the right of the&nbsp;<a class=\"reference-link\" href=\"#root/_help_oPVyFC7WL2Lp\">Note Tree</a>.</li><li>For the horizontal layout, the tabs will be placed at the top in full-width, above the&nbsp;<a href=\"#root/_help_oPVyFC7WL2Lp\">note tree</a>, allowing for more tabs to be comfortably displayed.</li></ul><h2>Interaction</h2><ul><li>To create a new tab, press the&nbsp;<span class=\"tn-icon bx bx-plus\"></span> button that is to the right of the last tab.</li><li>Right-clicking the <span class=\"tn-icon bx bx-plus\"></span> button shows a menu with <em>New tab</em> and, if there are any <a class=\"reference-link\" href=\"#root/_help_9sRHySam5fXb\">Workspaces</a>, one entry per workspace, which opens the workspace in a new tab, hoisted into it.</li><li>To close a tab, press the corresponding&nbsp;<span class=\"tn-icon bx bx-x\"></span> button.</li><li>For multitasking, tabs can be used alongside&nbsp;<a class=\"reference-link\" href=\"#root/_help_luNhaphA37EO\">Split View</a>. Each tab can have one or more notes, displayed horizontally.</li><li>Tabs can be reordered by drag-and-dropping it into a new position.</li><li>An existing tab can be displayed in a new window by dragging the tab upwards or downwards. It is not possible to combine tabs back into another window.</li></ul><h2>Keyboard interaction</h2><p>Since tabs are a commonly used feature, there are multiple keyboard shortcuts that can be used:</p><ul><li><kbd>Ctrl</kbd>+<kbd>T</kbd> to open a new tab.</li><li><kbd>Ctrl</kbd>+<kbd>W</kbd> to close the current tab.</li><li><kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>T</kbd> to reopen the last closed tab.</li><li><kbd>Ctrl</kbd>+<kbd>Tab</kbd> and <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>Tab</kbd> to go to the next or previous tab.</li><li><kbd>Ctrl</kbd>+<kbd>1</kbd>, <kbd>Ctrl</kbd>+<kbd>2</kbd>, up to <kbd>Ctrl</kbd>+<kbd>9</kbd> to activate the first, second and up to ninth tab.</li><li>There is also a shortcut to go to the last tab, but it is not assigned a key by default.</li></ul><h2>Background tabs</h2><p>When Trilium starts, it reopens the tabs from the previous session. Only the active tab loads its note right away; every other tab loads its note the first time you switch to it. This keeps startup fast when many tabs are open, especially tabs that show collections.</p><p>The same applies to a tab opened in the background, for example with a middle click or <kbd>Ctrl</kbd>+click on a link.</p><h2>Mobile</h2><figure class=\"image image-style-align-right image_resized\" style=\"width:34.12%;\"><img style=\"aspect-ratio:1242/2688;\" src=\"{{helpAssets}}/User%20Guide/Basic%20Concepts%20and%20Features/UI%20Elements/Tabs_IMG_1767.PNG\" width=\"1242\" height=\"2688\"></figure><p>Tabs are also supported on the&nbsp;<a class=\"reference-link\" href=\"#root/_help_RDslemsQ6gCp\">Mobile Frontend</a>.</p><p>Since v0.102.0, the tabs are displayed by pressing the dedicated tab switcher button in the&nbsp;<a class=\"reference-link\" href=\"#root/_help_xYmIYSP6wE3F\">Launch Bar</a>. In this view the tabs are laid out on a grid with a preview of the note content.</p><p>The context menu button at the top-right of the popup allows creating a new tab, reopening the last closed tab and closing all the tabs.</p><p><a class=\"reference-link\" href=\"#root/_help_luNhaphA37EO\">Split View</a>s are also indicated in the tab switcher, with two titles displayed in a tab.</p><aside class=\"admonition note\"><p>Versions prior to v0.102.0 also supported tabs, but they were displayed directly above the&nbsp;<a class=\"reference-link\" href=\"#root/_help_xYmIYSP6wE3F\">Launch Bar</a>. The decision to use a more mobile-like tab switcher was taken because the original tab bar could not support many tabs at once and the new design better aligns with how mobile applications handle tabs.</p></aside>",
"_help_xYmIYSP6wE3F": "<h2>Position of the Launch bar</h2><p>On desktop, depending on the layout selected, the launcher bar will either be on the left side of the screen with buttons displayed vertically or at the top of the screen. See&nbsp;<a class=\"reference-link\" href=\"#root/_help_x0JgW8UqGXvq\">Vertical and horizontal layout</a>&nbsp;for more information.</p><p>On mobile, the launch bar will always be at the bottom.</p><p>If there are too many items in the launch bar to fit the screen, it will become scrollable.</p><h2>Terminology</h2><ul><li><strong>Launcher</strong>: a button that can be (or is) displayed on the launch bar.</li><li><strong>Available Launcher</strong>: a launcher that is not displayed on the launch bar, but can be added.</li><li><strong>Visible Launcher</strong>: a launcher that is currently displayed on the launch bar.</li></ul><h2>Configuring the desktop Launch bar</h2><p>There are two ways to configure the launch bar:</p><ul><li>Right click in the empty space between launchers on the launch bar and select <em>Configure launch bar…</em></li><li>Click on the&nbsp;<a class=\"reference-link\" href=\"#root/_help_x3i7MxGccDuM\">Global menu</a>&nbsp;and select <em>Configure launch bar</em>.</li></ul><p>This will open a new tab with the&nbsp;<a class=\"reference-link\" href=\"#root/_help_oPVyFC7WL2Lp\">Note Tree</a>&nbsp;listing the launchers.</p><p><img src=\"{{helpAssets}}/User%20Guide/Basic%20Concepts%20and%20Features/UI%20Elements/Launch%20Bar_image.jpg\"></p><p>Expanding <em>Available Launchers</em> section will show the list of launchers that are not displayed on the launch bar. The <em>Visible Launchers</em> will show the ones that are currently displayed.</p><h2>Configuring the mobile launch bar</h2><p>The launch bar on mobile uses a different configuration from the desktop one. The reasoning is that not all desktop icons are available on mobile, and fewer icons fit on a mobile screen.</p><p>To configure the launch bar on mobile, go to&nbsp;<a class=\"reference-link\" href=\"#root/_help_x3i7MxGccDuM\">Global menu</a>&nbsp;and select <em>Configure launch bar</em>.</p><p>The configure the mobile launch bar while on the desktop (especially useful to configure more complicated launchers such as scripts or custom widgets), go to&nbsp;<a class=\"reference-link\" href=\"#root/_help_x3i7MxGccDuM\">Global menu</a>&nbsp;→ Advanced → Show hidden subtree and look for the <em>Mobile Launch Bar</em> section. While in the hidden subtree, it's also possible to drag launchers between the <em>Mobile Launch Bar</em> and (Desktop) <em>Launch Bar</em> sections.</p><h3>Adding/removing and reordering launchers</h3><p>To display a new launcher in the launch bar, first look for it in the <em>Available Launchers</em> section. Then right click it and select <em>Move to visible launchers</em>. It is also possible to drag and drop the item manually.</p><p>Similarly, to remove it from the launch bar, simply look for it in <em>Visible Launchers</em> then right click it and select <em>Move to available launchers</em> or use drag-and-drop.</p><p>Drag-and-drop the items in the&nbsp;tree&nbsp;in order to change their order. See&nbsp;<a class=\"reference-link\" href=\"#root/_help_oPVyFC7WL2Lp\">Note Tree</a>&nbsp;for more interaction options, including using keyboard shortcuts.</p><h2>Customizing the launcher</h2><ul><li>The icon of a launcher can be changed just like a normal note. See&nbsp;<a href=\"#root/_help_p9kXRFAkwN4o\">note icons</a>&nbsp;for more information.</li><li>The title of the launcher can also be changed.</li></ul><h3>Resetting</h3><p>Resetting allows restoring the original configuration of Trilium for the launcher bar, or for a portion of it. Simply right click a launcher (or even the entire <em>Launch Bar</em> section) and select <em>Reset</em> to bring it back to the original state.</p><h3>Creating new launchers / types of launchers</h3><p>Right click either the <em>Available launchers</em> or <em>Visible launchers</em> sections and select one of the options:</p><ol><li><p><strong>Note Launcher</strong><br>A note launcher will simply navigate to a specified note.</p><ol><li>Set the <code>target</code> promoted attribute to the note to navigate to.</li><li>Optionally, set <code>hoistedNote</code> to hoist a particular note. See&nbsp;<a class=\"reference-link\" href=\"#root/_help_OR8WJ7Iz9K4U\">Note Hoisting</a>&nbsp;for more information.</li><li>Optionally, set a <code>keyboardShortcut</code> to trigger the launcher.</li></ol></li><li><p><strong>Script Launcher</strong><br>An advanced launcher which will run a script upon pressing. See&nbsp;<a class=\"reference-link\" href=\"#root/_help_CdNpE2pqjmI6\">Scripting</a>&nbsp;for more information.</p><ol><li>Set <code>script</code> to point to the desired script to run.</li><li>Optionally, set a <code>keyboardShortcut</code> to trigger the launcher.</li></ol></li><li><p><strong>Custom Widget</strong></p><p>Allows defining a custom widget to be rendered inside the launcher. See&nbsp;<a class=\"reference-link\" href=\"#root/_help_SynTBQiBsdYJ\">Widget Basics</a>&nbsp;for more information.</p></li><li><p><strong>Spacers</strong><br>Launchers that create some distance between other launchers for better visual distinction.</p></li></ol><p>Launchers are configured via predefined&nbsp;<a class=\"reference-link\" href=\"#root/_help_OFXdgB2nNk1F\">Promoted Attributes</a>.</p>",
"_help_8YBEPzcpUgxw": "<figure class=\"image image-style-align-right image_resized\" style=\"width:25.95%;\"><img style=\"aspect-ratio:402/988;\" src=\"{{helpAssets}}/User%20Guide/Basic%20Concepts%20and%20Features/UI%20Elements/Note%20menu_image.png\" width=\"402\" height=\"988\"></figure><p>The note menu contains various actions and configurations for the current note. It can be found in the&nbsp;<a class=\"reference-link\" href=\"#root/_help_1P8QXI5edXNd\">Note buttons</a>&nbsp;area (to the right of the&nbsp;<a class=\"reference-link\" href=\"#root/_help_l7pigIGu01K2\">Title</a>).</p><p>Every split has a note menu of its own, which acts on the note displayed in that split. Entries that don't apply to the current note are still listed but grayed out, while entries that only exist for some notes (described in <em>Note-specific entries</em>) appear only on those notes.</p><h2>Navigating the note</h2><p>These entries are the row of icons at the top of the menu, each with a short title. Hovering one shows its full name and its keyboard shortcut. In Quick edit, where only the attachments are left, it is listed as an ordinary entry instead.</p><ul><li><span class=\"tn-icon bx bx-file-find\"></span>&nbsp;<em>Find</em> opens the&nbsp;<a class=\"reference-link\" href=\"#root/_help_McngOG2jbUWX\">Search in note</a>&nbsp;bar, to find and replace text inside the current note. On the desktop application, the same bar opens with <kbd>Ctrl</kbd>+<kbd>F</kbd>.<ul><li>It is available on&nbsp;<a class=\"reference-link\" href=\"#root/_help_iPIMuisry3hd\">Text</a>,&nbsp;<a class=\"reference-link\" href=\"#root/_help_6f9hih2hXXZk\">Code</a>,&nbsp;<a class=\"reference-link\" href=\"#root/_help_gBbsAeiuUxI5\">Mind Map</a>&nbsp;and&nbsp;<a class=\"reference-link\" href=\"#root/_help_GWHEkY4I4OE3\">Spreadsheets</a>&nbsp;notes,&nbsp;<a class=\"reference-link\" href=\"#root/_help_GTwFsgaA0lCt\">Collections</a>, PDF files, and any note displayed as&nbsp;<a class=\"reference-link\" href=\"#root/_help_4FahAwuGTAwC\">Note source</a>.</li></ul></li><li><span class=\"tn-icon bx bx-paperclip\"></span>&nbsp;<em>Attachments</em> switches the note to the list of its&nbsp;<a class=\"reference-link\" href=\"#root/_help_0vhv7lsOLy82\">Attachments</a>, where they can be uploaded, opened, downloaded, renamed or deleted.</li><li><span class=\"tn-icon bx bxs-network-chart\"></span>&nbsp;<em>Note map</em> opens the&nbsp;<a class=\"reference-link\" href=\"#root/_help_KRlZFoIH0j6p\">Connections tab</a>&nbsp;of the&nbsp;<a class=\"reference-link\" href=\"#root/_help_RnaPdbciOfeq\">Right Sidebar</a>, which shows the&nbsp;<a class=\"reference-link\" href=\"#root/_help_BCkXAVs63Ttv\">Note Map (Link map, Tree map)</a>&nbsp;centered on the current note.</li></ul><h2>Note properties</h2><p>The toggles in this section take effect immediately:</p><ul><li><span class=\"tn-icon bx bx-share-alt\"></span>&nbsp;<em>Shared</em> publishes the note via&nbsp;<a class=\"reference-link\" href=\"#root/_help_R9pX4DGra2Vt\">Sharing</a>, by cloning it into the <em>Shared Notes</em> tree.<ul><li>Turning it off removes the clone from that tree. If the note exists only as a shared note, Trilium asks for confirmation, since unsharing it deletes it.</li><li>The toggle is unavailable on the root note, on the <em>Shared Notes</em> note itself, and on system notes.</li></ul></li><li><span class=\"tn-icon bx bx-lock-alt\"></span>&nbsp;<em>Protect the note</em> encrypts the note, turning it into one of the&nbsp;<a class=\"reference-link\" href=\"#root/_help_bwg0e8ewQMak\">Protected Notes</a>. If no protected session is active, Trilium asks for the password first. Only the current note is affected, not its children.</li><li><span class=\"tn-icon bx bx-bookmark\"></span>&nbsp;<em>Bookmark</em> adds the note to the&nbsp;<a class=\"reference-link\" href=\"#root/_help_u3YFHC9tQlpm\">Bookmarks</a>&nbsp;that are displayed in the&nbsp;<a class=\"reference-link\" href=\"#root/_help_xYmIYSP6wE3F\">Launch Bar</a>, or removes it from them.</li><li><span class=\"tn-icon bx bx-copy-alt\"></span>&nbsp;<em>Template</em> marks the note as one of the&nbsp;<a class=\"reference-link\" href=\"#root/_help_KC1HB96bqqHX\">Templates</a>&nbsp;(by adding the <code>#template</code> label), which makes it available when creating a new note.</li><li><span class=\"tn-icon bx bx-expand-horizontal\"></span>&nbsp;<em>Full width</em> lets the note use the whole width of the window instead of the limit set in&nbsp;<a class=\"reference-link\" href=\"#root/_help_t596jLvPrqkS\">Content width</a>&nbsp;by adding the <code>#fullContentWidth</code> label. It is not listed for note types that are always displayed at full width.</li></ul><p>The two submenus in this section:</p><ul><li><span class=\"tn-icon bx bx-file\"></span>&nbsp;<em>Note type</em> changes the type of the note to any of the&nbsp;<a class=\"reference-link\" href=\"#root/_help_KSZ04uQ2D1St\">Note Types</a>; the current one is checked. If the note already has content, Trilium asks for confirmation first, since the content generally doesn't carry over.&nbsp;<a class=\"reference-link\" href=\"#root/_help_jludwdW7N4hg\">Converting between note types</a>.<ul><li>For a&nbsp;<a class=\"reference-link\" href=\"#root/_help_6f9hih2hXXZk\">Code</a>&nbsp;note, the language is chosen in the&nbsp;<a class=\"reference-link\" href=\"#root/_help_AlJ73vBCjWDw\">Status bar</a>&nbsp;instead.</li></ul></li><li><span class=\"tn-icon bx bx-edit-alt\"></span>&nbsp;<em>Editable</em> controls when the note opens as read-only (see&nbsp;<a class=\"reference-link\" href=\"#root/_help_CoFPLs3dRlXc\">Read-Only Notes</a>):<ul><li><em>Auto</em> (the default): the note is editable, unless it is long enough to be opened as read-only automatically.</li><li><em>Read-only</em>: the note always opens as read-only, but can still be edited after pressing <em>Edit note</em>.</li><li><em>Always editable</em>: the note is always editable, regardless of its length.</li></ul></li></ul><h2>Importing, exporting and printing</h2><ul><li><span class=\"tn-icon bx bx-import\"></span>&nbsp;<em>Import files</em> opens the import dialog, which imports files as children of the current note. See&nbsp;<a class=\"reference-link\" href=\"#root/_help_mHbBMPDPkVV5\">Import &amp; Export</a>. It is unavailable on&nbsp;<a class=\"reference-link\" href=\"#root/_help_m523cpzocqaD\">Saved Search</a>&nbsp;notes.</li><li><span class=\"tn-icon bx bx-export\"></span>&nbsp;<em>Export note</em> opens the export dialog with <em>Only this note</em> selected; select <em>This note &amp; all descendants</em> there to export the whole subtree.</li><li><span class=\"tn-icon bx bx-printer\"></span><em>Print/export to PDF…</em> prints the note or saves it as a PDF file. See&nbsp;<a class=\"reference-link\" href=\"#root/_help_NRnIZmSMc5sj\">Printing &amp; Exporting as PDF</a>, including which note types and collections can be printed.</li></ul><p>Some note types add their own export formats right below <em>Export note</em>:</p><ul><li><span class=\"tn-icon bx bxs-file-image\"></span><em>Export as image</em>, on&nbsp;<a class=\"reference-link\" href=\"#root/_help_s1aBHPd79XYj\">Mermaid Diagrams</a>&nbsp;and&nbsp;<a class=\"reference-link\" href=\"#root/_help_gBbsAeiuUxI5\">Mind Map</a>&nbsp;notes, downloads the diagram as <em>PNG (raster)</em> or <em>SVG (vector)</em>.</li><li><span class=\"tn-icon bx bxs-spreadsheet\"></span><em>Export to Excel (.xlsx)</em> and <em>Export to CSV (.csv)</em>, on&nbsp;<a class=\"reference-link\" href=\"#root/_help_GWHEkY4I4OE3\">Spreadsheets</a>, download the spreadsheet in those formats.</li></ul><h2>Revisions</h2><p>These entries manage the&nbsp;<a class=\"reference-link\" href=\"#root/_help_vZWERwf8U3nx\">Note Revisions</a>&nbsp;of the note:</p><ul><li><span class=\"tn-icon bx bx-history\"></span><em>Note revisions…</em> opens the revisions dialog, where previous versions can be previewed, compared with the current one, downloaded or restored. The arrow beside it opens the entries that save a revision right away. On mobile, tapping it opens those entries, with <em>Note revisions…</em> as the first one.<ul><li><span class=\"tn-icon bx bx-save\"></span><em>Save revision</em> saves a revision of the note right away, instead of waiting for the next automatic snapshot.</li><li><span class=\"tn-icon bx bx-purchase-tag\"></span><em>Save named revision…</em> also saves a revision right away, but first asks for a short description of the changes, which is shown in the revisions dialog.</li></ul></li></ul><h2>Note-specific entries</h2><p>The following entries only appear on some notes:</p><ul><li><span class=\"tn-icon bx bx-pencil\"></span><em>Edit note</em> appears at the top of the menu when the note is currently read-only. It enables editing until the note is closed.</li><li><span class=\"tn-icon bx bx-align-justify\"></span><em>Word wrap</em> appears at the top of the menu on&nbsp;<a class=\"reference-link\" href=\"#root/_help_6f9hih2hXXZk\">Code</a>&nbsp;notes, and sets whether long lines wrap in this note:<ul><li><em>Auto</em> (the default) follows&nbsp;<a class=\"reference-link\" href=\"#root/_help_4TIF1oA4VQRO\">Options</a>&nbsp;→ <em>Code Notes</em> → <em>Wrap lines in code notes</em>.</li><li><em>On</em> and <em>Off</em> override it for this note only, by setting the <code>#wrapLines</code> label.</li></ul></li><li><span class=\"tn-icon bx bx-paperclip\"></span><em>Convert into attachment</em> appears on an image note that has no children and a single parent which is a&nbsp;<a class=\"reference-link\" href=\"#root/_help_iPIMuisry3hd\">Text</a>&nbsp;note. After a confirmation, it turns the image into an attachment of its parent note and opens it there. See&nbsp;<a class=\"reference-link\" href=\"#root/_help_0vhv7lsOLy82\">Attachments</a>.</li><li><span class=\"tn-icon bx bx-extension\"></span><em>Re-render note</em> appears on a&nbsp;<a class=\"reference-link\" href=\"#root/_help_HcABDtFCkbFN\">Render Note</a>, and runs its script again to refresh the output.</li><li><span class=\"tn-icon bx bx-cog\"></span><em>Board properties</em> appears on a&nbsp;<a class=\"reference-link\" href=\"#root/_help_CtBQqbwXDx1w\">Kanban Board</a>, and configures its columns, card attributes and card templates.</li><li><span class=\"tn-icon bx bx-cog\"></span><em>Calendar properties</em> appears on a&nbsp;<a class=\"reference-link\" href=\"#root/_help_xWbu3jpNWapp\">Calendar</a> that creates events, and configures its event templates.</li><li><span class=\"tn-icon bx bx-cog\"></span><em>Geo map properties</em> appears on a&nbsp;<a class=\"reference-link\" href=\"#root/_help_81SGnPGMk7Xc\">Geo Map</a>, and configures its map settings and the image of an <a href=\"#root/_help_ZRDXGc0nAIh4\">image map</a>.</li><li><span class=\"tn-icon bx bx-cog\"></span><em>Table properties</em> appears on a <a class=\"reference-link\" href=\"#root/_help_2FvYrpmOXm29\">Table</a>, and configures which notes it shows.</li></ul><h2>Advanced</h2><p>The <span class=\"tn-icon bx bx-wrench\"></span><em>Advanced</em> submenu groups the actions that are needed less often:</p><ul><li><p><span class=\"tn-icon bx bx-file-find\"></span><em>Open note externally</em> (desktop application only) saves the note to a temporary file and opens it in the application that the operating system associates with it. Trilium watches the file, and offers to upload the modified version back into the note. It is unavailable on&nbsp;<a class=\"reference-link\" href=\"#root/_help_GTwFsgaA0lCt\">Collections</a>&nbsp;and&nbsp;<a class=\"reference-link\" href=\"#root/_help_m523cpzocqaD\">Saved Search</a>&nbsp;notes.</p></li><li><p><span class=\"tn-icon bx bx-customize\"></span><em>Open note custom</em> (desktop application only, Windows and Linux) works like <em>Open note externally</em>, but lets you pick the application to open the file with.</p></li><li><p><span class=\"tn-icon bx bx-code\"></span><em>Note source</em> shows the&nbsp;<a class=\"reference-link\" href=\"#root/_help_4FahAwuGTAwC\">Note source</a>, the content of the note exactly as it is stored.</p></li><li><p><span class=\"tn-icon bx bxl-markdown\"></span><em>Convert to Markdown note</em> (on text notes) and <em>Convert to text note</em> (on Markdown notes) switch the note between rich text and Markdown. After a confirmation, Trilium saves a revision and converts the content; the revision allows going back if some formatting was lost. See&nbsp;<a class=\"reference-link\" href=\"#root/_help_jludwdW7N4hg\">Converting between note types</a>.</p></li><li><p><span class=\"tn-icon bx bx-collapse-alt\"></span><em>Compress images</em> opens a dialog that reduces the size of the images in the note. It lists the images found and how much space they take, and offers to:</p><ul><li>Resize the images larger than a chosen size.</li><li>Keep, or compress, JPEG images.</li><li>Keep, optimize, or convert to JPEG the PNG images.</li><li><em>Process child notes as well</em>, to include the images of the notes beneath this one.</li></ul><p>Compressing cannot be undone. Images can also be compressed automatically on upload, see&nbsp;<a class=\"reference-link\" href=\"#root/_help_mT0HEkOsz6i1\">Images</a>.</p></li><li><p><span class=\"tn-icon bx bx-text\"></span><em>View OCR text</em> (on image and file notes) shows the text extracted from the note via&nbsp;<a class=\"reference-link\" href=\"#root/_help_TiQbQDgP8L5t\">Text Extraction (OCR)</a>. If the note has not been processed yet, the dialog offers to <em>Process OCR</em>.</p></li><li><p><span class=\"tn-icon bx bx-world\"></span><em>Open note on server</em> (desktop application only, listed when&nbsp;<a class=\"reference-link\" href=\"#root/_help_cbkrhQjrkKrh\">Synchronization</a>&nbsp;is configured) opens the same note on the sync server, in the web browser.</p></li></ul><h2>Deleting the note</h2><p><span class=\"tn-icon bx bx-trash\"></span><em>Delete note</em> opens the deletion dialog for the current note and its subtree. The dialog lists the notes that will be deleted and the relations that will be broken, and offers to:</p><ul><li>Also delete the other clones of the note, if it is cloned elsewhere. Otherwise, only the current placement is removed and the note stays in its other locations. See&nbsp;<a class=\"reference-link\" href=\"#root/_help_IakOLONlIfGI\">Cloning Notes</a>.</li><li><em>Erase permanently</em> instead of the usual soft deletion. This cannot be undone.</li></ul><p>Notes deleted without erasing can be brought back, see&nbsp;<a class=\"reference-link\" href=\"#root/_help_5Ct4MAJTS4tQ\">Restoring Deleted Notes</a>.</p><h2>Limitations</h2><ul><li>The note menu is not available on launchers.</li><li>On the notes of&nbsp;<a class=\"reference-link\" href=\"#root/_help_4TIF1oA4VQRO\">Options</a>&nbsp;and of the in-app help, most entries are grayed out, since these notes cannot be imported into, deleted or have revisions. Of the two, only the in-app help can be exported, see&nbsp;<a class=\"reference-link\" href=\"#root/_help_mHbBMPDPkVV5\">Import &amp; Export</a>.</li><li>The <a href=\"#note-properties\">Note properties</a> section is only listed when the note itself is displayed, not its&nbsp;<a class=\"reference-link\" href=\"#root/_help_0vhv7lsOLy82\">Attachments</a>&nbsp;or its&nbsp;<a class=\"reference-link\" href=\"#root/_help_4FahAwuGTAwC\">Note source</a>.</li><li>In&nbsp;<a class=\"reference-link\" href=\"#root/_help_ZjLYv08Rp3qC\">Quick edit</a>, <em>Find</em>, <em>Note map</em>, <em>Full width</em> and <em>Convert into attachment</em> are not listed.</li></ul><h2>Mobile support</h2><p>On the&nbsp;<a class=\"reference-link\" href=\"#root/_help_RDslemsQ6gCp\">Mobile Frontend</a>, the note menu opens as a sheet from the bottom of the screen. Besides the entries above, it contains the items that the desktop layout places elsewhere:</p><ul><li>Two more icons in the row of icons at the very top of the sheet, which reads <span class=\"tn-icon bx bx-dock-right\"></span>&nbsp;<em>New split</em>, <em>Note map</em>, <em>Find</em> and <span class=\"tn-icon bx bx-plus\"></span>&nbsp;<em>Child note</em> from left to right: <em>New split</em> opens a <a class=\"reference-link\" href=\"#root/_help_luNhaphA37EO\">Split View</a> while there is none in the tab, and <em>Child note</em> creates a note under the current one.</li><li><em>Backlinks</em> and <em>Note paths</em>, below the row of icons, which open the <a class=\"reference-link\" href=\"#root/_help_wfGXLmm7x27z\">Backlinks</a> and the other locations of the note.</li><li><span class=\"tn-icon bx bx-paperclip\"></span>&nbsp;<em>Attachments</em> and <span class=\"tn-icon bx bx-list-check\"></span>&nbsp;<em>Attributes</em>, under them, which open the attachments and the attributes of the note, each with the number the note has. Links made by the content of the note are not counted as attributes. <em>Attributes</em> is unavailable where the note cannot be edited. On mobile, <em>Attachments</em> is listed here instead of in the row of icons.</li><li>The custom buttons of the note type (such as <span class=\"tn-icon bx bx-download\"></span><em>Download</em> on a&nbsp;<a class=\"reference-link\" href=\"#root/_help_W8vYD3Q1zjCR\">File</a>).</li><li><em>Close this pane</em>, on the second note of a <a class=\"reference-link\" href=\"#root/_help_luNhaphA37EO\">Split View</a>.</li><li><span class=\"tn-icon bx bx-slider-alt\"></span>&nbsp;<em>Note settings</em>, below <em>Protect the note</em>, which opens <em>Shared</em> and <em>Bookmark</em>, then <em>Note type</em>, <em>Template</em> and <em>Full width</em>, on a page of their own, together with the language of the note: the content language on <a class=\"reference-link\" href=\"#root/_help_iPIMuisry3hd\">Text</a> notes (see <a class=\"reference-link\" href=\"#root/_help_veGu4faJErEM\">Content language &amp; Right-to-left support</a>), and the language of the code on <a class=\"reference-link\" href=\"#root/_help_6f9hih2hXXZk\">Code</a> notes. The choices of <em>Editable</em> are listed at the end of that page, under their own heading, instead of in a further submenu.</li><li><span class=\"tn-icon bx bx-info-circle\"></span>&nbsp;<em>Note info</em>, below <em>Note settings</em>, which opens the dates, type, ID and size of the note on a page of its own, ending with <em>Show similar notes</em> (see <a class=\"reference-link\" href=\"#root/_help_xWtq5NUHOwql\">Similar Notes</a>).</li><li><em>Note map</em> opens the map in a popup instead of the right sidebar.</li></ul>",
"_help_1P8QXI5edXNd": "<p>The note buttons is an area at the top-right of a note with a few buttons:</p><ul><li>The&nbsp;<a class=\"reference-link\" href=\"#root/_help_8YBEPzcpUgxw\">Note menu</a>&nbsp;which offers commands for the note or its subtree, such as import, export, viewing the&nbsp;<a href=\"#root/_help_4FahAwuGTAwC\">Note source code</a>&nbsp;or&nbsp;<a href=\"#root/_help_0vhv7lsOLy82\">Attachments</a>.</li><li><a class=\"reference-link\" href=\"#root/_help_luNhaphA37EO\">Split View</a>&nbsp;controls<ul><li><span class=\"tn-icon bx bx-dock-right\"></span>&nbsp;to open a new split</li><li><span class=\"tn-icon bx bx-chevron-right\"></span>/<span class=\"tn-icon bx bx-chevron-left\"></span> to move the pane around</li><li><span class=\"tn-icon bx bx-x\"></span>&nbsp;to close the pane.</li></ul></li><li>On some note types such as&nbsp;<a class=\"reference-link\" href=\"#root/_help_W8vYD3Q1zjCR\">File</a>&nbsp;and images, there are dedicated buttons (e.g.&nbsp;<span class=\"tn-icon bx bx-download\"></span> to download the file locally).</li></ul>",
diff --git a/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Tabs.md b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Tabs.md
index 2b699c21d2..d7bac9c580 100644
--- a/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Tabs.md
+++ b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Tabs.md
@@ -30,6 +30,12 @@ Since tabs are a commonly used feature, there are multiple keyboard shortcuts th
* <kbd>Ctrl</kbd>+<kbd>1</kbd>, <kbd>Ctrl</kbd>+<kbd>2</kbd>, up to <kbd>Ctrl</kbd>+<kbd>9</kbd> to activate the first, second and up to ninth tab.
* There is also a shortcut to go to the last tab, but it is not assigned a key by default.
+## Background tabs
+
+When Trilium starts, it reopens the tabs from the previous session. Only the active tab loads its note right away; every other tab loads its note the first time you switch to it. This keeps startup fast when many tabs are open, especially tabs that show collections.
+
+The same applies to a tab opened in the background, for example with a middle click or <kbd>Ctrl</kbd>+click on a link.
+
## Mobile
<figure class="image image-style-align-right image_resized" style="width:34.12%;"><img style="aspect-ratio:1242/2688;" src="Tabs_IMG_1767.PNG" width="1242" height="2688"></figure>