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/launch bar/recent changes: add a "recently changed notes" section into the context menu
Adorian Dorand55e47cd117b
diff --git a/apps/client/src/menus/recent_changes_menu_items.spec.ts b/apps/client/src/menus/recent_changes_menu_items.spec.tsindex 8c06fff339..bda882905b 100644--- a/apps/client/src/menus/recent_changes_menu_items.spec.ts+++ b/apps/client/src/menus/recent_changes_menu_items.spec.ts@@ -4,7 +4,9 @@ import type { CommandNames } from "../components/app_context";import froca from "../services/froca";import { buildNote } from "../test/easy-froca";import type { MenuItem } from "./context_menu";-import { getRecentChangesMenuItems } from "./recent_changes_menu_items";+import {+ getRecentChangesMenuItems, getRecentlyChangedNotesMenuItems+} from "./recent_changes_menu_items";const mocks = vi.hoisted(() => ({get: vi.fn(async (_url: string): Promise<string[]> => []),@@ -105,6 +107,19 @@ describe("getRecentChangesMenuItems", () => {});});+describe("getRecentlyChangedNotesMenuItems", () => {+ it("lists the heading and the notes without the dialog entry, or nothing", async () => {+ mocks.get.mockResolvedValueOnce([ "plan3" ]);+ expect((await getRecentlyChangedNotesMenuItems()).map(describeItem)).toEqual([+ [ "header", "tab_row.recently_changed_notes" ],+ [ "Plan 3", "Work" ]+ ]);++ mocks.get.mockResolvedValueOnce([]);+ expect(await getRecentlyChangedNotesMenuItems()).toEqual([]);+ });+});+function describeItem(item: MenuItem<CommandNames>) {if ("kind" in item) {return item.kind === "header" ? [ item.kind, item.title ] : [ item.kind ];diff --git a/apps/client/src/menus/recent_changes_menu_items.ts b/apps/client/src/menus/recent_changes_menu_items.tsindex 43f6962b5b..794602364b 100644--- a/apps/client/src/menus/recent_changes_menu_items.ts+++ b/apps/client/src/menus/recent_changes_menu_items.ts@@ -3,7 +3,7 @@ import froca from "../services/froca";import hoistedNoteService from "../services/hoisted_note";import { t } from "../services/i18n";import server from "../services/server";-import type { MenuItem } from "./context_menu";+import type { MenuCommandItem, MenuItem } from "./context_menu";import { notePathMenuItem } from "./context_menu_utils";/** The number of notes the "Recently changed notes" section lists. */@@ -14,6 +14,35 @@ const RECENT_CHANGES_LIMIT = 15;* open tab, newest first, followed by an entry that opens the Recent changes dialog.*/export async function getRecentChangesMenuItems(): Promise<MenuItem<CommandNames>[]> {+ const noteItems = await getRecentlyChangedNoteItems();++ return [+ { kind: "header", title: t("tab_row.recently_changed_notes") },+ ...noteItems,+ ...(noteItems.length > 0 ? [ { kind: "separator" } as const ] : []),+ {+ title: t("tab_row.show_all_recent_changes"),+ command: "showRecentChanges",+ uiIcon: "bx bx-history",+ keyboardShortcut: "showRecentChanges"+ }+ ];+}++/**+ * Returns the "Recently changed notes" heading and its notes, without the entry that opens the+ * Recent changes dialog. Returns nothing when no note qualifies.+ */+export async function getRecentlyChangedNotesMenuItems(): Promise<MenuItem<CommandNames>[]> {+ const noteItems = await getRecentlyChangedNoteItems();+ if (noteItems.length === 0) {+ return [];+ }++ return [ { kind: "header", title: t("tab_row.recently_changed_notes") }, ...noteItems ];+}++async function getRecentlyChangedNoteItems(): Promise<MenuCommandItem<CommandNames>[]> {const hoistedNoteId = hoistedNoteService.getHoistedNoteId();const openNoteIds = new Set<string>();for (const noteContext of appContext.tabManager.getNoteContexts()) {@@ -32,9 +61,7 @@ export async function getRecentChangesMenuItems(): Promise<MenuItem<CommandNamestrue);- const items: MenuItem<CommandNames>[] = [- { kind: "header", title: t("tab_row.recently_changed_notes") }- ];+ const items: MenuCommandItem<CommandNames>[] = [];for (const note of notes) {const notePath = note.getBestNotePathString(hoistedNoteId);if (!notePath) {@@ -46,15 +73,5 @@ export async function getRecentChangesMenuItems(): Promise<MenuItem<CommandNames}));}- if (items.length > 1) {- items.push({ kind: "separator" });- }- items.push({- title: t("tab_row.show_all_recent_changes"),- command: "showRecentChanges",- uiIcon: "bx bx-history",- keyboardShortcut: "showRecentChanges"- });-return items;}diff --git a/apps/client/src/widgets/launch_bar/LauncherDefinitions.spec.tsx b/apps/client/src/widgets/launch_bar/LauncherDefinitions.spec.tsxnew file mode 100644index 0000000000..a0f5c90e2e--- /dev/null+++ b/apps/client/src/widgets/launch_bar/LauncherDefinitions.spec.tsx@@ -0,0 +1,89 @@+import { render } from "preact";+import { act } from "preact/test-utils";+import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";++import type FNote from "../../entities/fnote";+import { buildNote } from "../../test/easy-froca";+import { useCommandLauncherContextMenu } from "./LauncherDefinitions";++const mocks = vi.hoisted(() => ({+ showLauncherContextMenu: vi.fn(),+ getRecentlyChangedNotesMenuItems: vi.fn()+}));++vi.mock("../../menus/launcher_button_context_menu", () => ({+ showLauncherContextMenu: mocks.showLauncherContextMenu+}));+vi.mock("../../menus/recent_changes_menu_items", () => ({+ getRecentlyChangedNotesMenuItems: mocks.getRecentlyChangedNotesMenuItems+}));++const SECTION = [ { kind: "header", title: "Recently changed notes" } ];++describe("useCommandLauncherContextMenu", () => {+ let container: HTMLElement;+ let launcherNote: FNote;++ beforeEach(() => {+ vi.clearAllMocks();+ mocks.getRecentlyChangedNotesMenuItems.mockResolvedValue(SECTION);+ launcherNote = buildNote({ id: "_lbRecentChanges", title: "Recent Changes" });+ container = document.createElement("div");+ document.body.append(container);+ });++ afterEach(() => {+ act(() => render(null, container));+ container.remove();+ vi.useRealTimers();+ });++ it("adds the recently changed notes to the launcher menu on a right-click", async () => {+ const button = renderProbe("showRecentChanges");++ const event = new MouseEvent("contextmenu", { bubbles: true, cancelable: true });+ button.dispatchEvent(event);+ expect(event.defaultPrevented).toBe(true);++ await vi.waitFor(() => expect(mocks.showLauncherContextMenu).toHaveBeenCalledOnce());+ expect(mocks.showLauncherContextMenu)+ .toHaveBeenCalledWith(launcherNote, event, { extraItems: SECTION });+ });++ it("opens the same menu on a held press", async () => {+ vi.useFakeTimers();+ const button = renderProbe("showRecentChanges");++ button.dispatchEvent(new PointerEvent("pointerdown", { bubbles: true, button: 0 }));+ vi.advanceTimersByTime(500);++ await vi.waitFor(() => expect(mocks.showLauncherContextMenu).toHaveBeenCalledOnce());+ const [ note, event, options ] = mocks.showLauncherContextMenu.mock.calls[0];+ expect(note).toBe(launcherNote);+ expect(event).toMatchObject({ type: "pointerdown" });+ expect(options).toEqual({ extraItems: SECTION });+ });++ it("leaves a command without a section to the default launcher menu", () => {+ const button = renderProbe("showDeletedNotes");++ const event = new MouseEvent("contextmenu", { bubbles: true, cancelable: true });+ button.dispatchEvent(event);++ expect(event.defaultPrevented).toBe(false);+ expect(mocks.getRecentlyChangedNotesMenuItems).not.toHaveBeenCalled();+ expect(mocks.showLauncherContextMenu).not.toHaveBeenCalled();+ });++ function renderProbe(command: string) {+ function Probe() {+ const menuProps = useCommandLauncherContextMenu(command, launcherNote);+ return <button type="button" {...menuProps} />;+ }++ act(() => render(<Probe />, container));+ const button = container.querySelector("button");+ if (!button) throw new Error("The probe did not render its button.");+ return button;+ }+});diff --git a/apps/client/src/widgets/launch_bar/LauncherDefinitions.tsx b/apps/client/src/widgets/launch_bar/LauncherDefinitions.tsxindex 5aaae7e1a5..88c861d48a 100644--- a/apps/client/src/widgets/launch_bar/LauncherDefinitions.tsx+++ b/apps/client/src/widgets/launch_bar/LauncherDefinitions.tsx@@ -2,6 +2,9 @@ import { useCallback, useContext, useEffect, useState } from "preact/hooks";import appContext, { CommandNames } from "../../components/app_context";import FNote from "../../entities/fnote";+import type { MenuItem } from "../../menus/context_menu";+import { showLauncherContextMenu } from "../../menus/launcher_button_context_menu";+import { getRecentlyChangedNotesMenuItems } from "../../menus/recent_changes_menu_items";import date_notes from "../../services/date_notes";import { LauncherWidgetDefinitionWithType } from "../../services/frontend_script_api_preact";import { t } from "../../services/i18n";@@ -10,7 +13,9 @@ import { getErrorMessage, isMobile } from "../../services/utils";import BasicWidget from "../basic_widget";import NoteContextAwareWidget from "../note_context_aware_widget";import QuickSearch from "../quick_search";-import { useGlobalShortcut, useLegacyWidget, useNoteLabel, useNoteRelationTarget } from "../react/hooks";+import {+ useGlobalShortcut, useHoldContextMenu, useLegacyWidget, useNoteLabel, useNoteRelationTarget+} from "../react/hooks";import { ParentComponent } from "../react/react_utils";import { CustomNoteLauncher } from "./GenericButtons";import { LaunchBarActionButton, LaunchBarContext, launcherContextMenuHandler, LauncherNoteProps, useLauncherIconAndTitle } from "./launch_bar_widgets";@@ -18,6 +23,7 @@ import { LaunchBarActionButton, LaunchBarContext, launcherContextMenuHandler, Laexport function CommandButton({ launcherNote }: LauncherNoteProps) {const { icon, title } = useLauncherIconAndTitle(launcherNote);const [ command ] = useNoteLabel(launcherNote, "command");+ const contextMenuProps = useCommandLauncherContextMenu(command, launcherNote);return command && (<LaunchBarActionButton@@ -25,10 +31,37 @@ export function CommandButton({ launcherNote }: LauncherNoteProps) {icon={icon}text={title}triggerCommand={command as CommandNames}+ {...contextMenuProps}/>);}+/** The menu sections that command launchers list above "Remove from launch bar". */+const COMMAND_MENU_ITEMS: Partial<Record<string, () => Promise<MenuItem<CommandNames>[]>>> = {+ showRecentChanges: getRecentlyChangedNotesMenuItems+};++/**+ * Returns props that open the launcher menu with the section of `command` from+ * {@link COMMAND_MENU_ITEMS}, on a right-click or a held press. Returns nothing for a command+ * without a section.+ */+export function useCommandLauncherContextMenu(+ command: string | null | undefined,+ launcherNote: FNote+) {+ const getMenuItems = command ? COMMAND_MENU_ITEMS[command] : undefined;+ const handler = useCallback((e: MouseEvent) => {+ e.preventDefault();+ void getMenuItems?.().then((extraItems) => {+ void showLauncherContextMenu(launcherNote, e, { extraItems });+ });+ }, [ getMenuItems, launcherNote ]);+ const holdProps = useHoldContextMenu(handler);++ return getMenuItems ? holdProps : undefined;+}+// we're intentionally displaying the launcher title and icon instead of the target,// e.g. you want to make launchers to 2 mermaid diagrams which both have mermaid icon (ok),// but on the launchpad you want them distinguishable.diff --git a/apps/server/src/assets/help/help_content.json b/apps/server/src/assets/help/help_content.jsonindex 4f9d2af9de..18adccf0a4 100644--- a/apps/server/src/assets/help/help_content.json+++ b/apps/server/src/assets/help/help_content.json@@ -53,7 +53,7 @@"_help_uNtgN0cUKEBc": "<figure class=\"image image-style-align-right image_resized\" style=\"width:34.71%;\"><img style=\"aspect-ratio:596/1688;\" src=\"{{helpAssets}}/User%20Guide/Basic%20Concepts%20and%20Features/UI%20Elements/Right%20Sidebar/Attributes%20tab_image.png\" width=\"596\" height=\"1688\"></figure><p>The attributes tab provides a more graphical way to view and edit <a href=\"#root/_help_zEY4DaJG4YT5\">attributes</a>.</p><h2>Sections</h2><p>The attributes are grouped into collapsible sections, each showing the number of attributes it holds next to its name:</p><ul><li><em>Owned</em> contains a list of the attributes that belong to this note.</li><li><em>Inherited</em> contains the attributes that apply to the current note but come through <a class=\"reference-link\" href=\"#root/_help_bwZpz2ajCEwO\">Attribute Inheritance</a>. This section is only displayed if the note inherits attributes.</li><li><em>Definitions</em> describe the type of attributes and are used in <a class=\"reference-link\" href=\"#root/_help_OFXdgB2nNk1F\">Promoted Attributes</a> and <a class=\"reference-link\" href=\"#root/_help_2FvYrpmOXm29\">Table</a> collections. This section is only displayed if the note has or inherits definitions.</li></ul><p>Clicking the name of a section collapses or expands it, and the collapsed state is remembered.</p><h2>Toolbar</h2><p>Above the sections there is a toolbar with:</p><ul><li>A <em>Select all</em> checkbox, which selects every attribute (see <a href=\"#selecting-attributes\">Selecting attributes</a>).</li><li>A <span class=\"tn-icon bx bx-paste\"></span> button, which only appears after attributes are copied. It lists the copied attributes and offers to paste them into the current note or to clear them.</li><li>A <span class=\"tn-icon bx bx-plus\"></span> <em>Add a new attribute</em> button, which offers to add a label, a relation, a label definition or a relation definition. This shows the full detail popup.</li></ul><p>On a note that cannot be edited (such as a page of the in-app help), the paste and add buttons are replaced by a <span class=\"tn-icon bx bx-lock-alt\"></span> <em>Read-only</em> indicator. Attributes can still be selected and copied from such a note.</p><h2>Owned attributes</h2><p>Every item is structured as such:</p><ul><li>The icon of each item indicates whether it's a <a href=\"#root/_help_HI6GBBIduIgv\">label</a> (<span class=\"tn-icon bx bx-hash\"></span>) or a <a href=\"#root/_help_Cq5X6iKQop6R\">relation</a> (<span class=\"tn-icon bx bx-transfer\"></span>, link to another note).</li><li>The first text is the name of the label.</li><li>The value of the attribute is displayed after the name, if present.<ul><li>The value is shown in a graphical way: a relation's value is a clickable note link; a color label shows a color chip.</li></ul></li></ul><p>System attributes (that have a special meaning in Trilium) show a small <span class=\"tn-icon bx bx-cog\"></span> cog near the icon and are grouped separately from the user-defined ones.</p><p>Interaction:</p><ul><li>Clicking on the item (apart from the value and links) reveals a dedicated popup where the name, value and <a class=\"reference-link\" href=\"#root/_help_bwZpz2ajCEwO\">Attribute Inheritance</a> can be defined.</li><li>The value of the attributes can be edited in-place:<ul><li>The input box follows the type defined in a corresponding label definition (date, color, dropdown, numbers), as well as for system attributes that have a specific type (e.g. <code>color</code>).</li><li>For labels, clicking on the value edits its in-place.<ul><li>Press <kbd>Enter</kbd> to confirm or click outside the input box, or <kbd>Esc</kbd> to dismiss.</li><li>For multi-line text, <kbd>Ctrl</kbd>+<kbd>Enter</kbd> confirms whereas <kbd>Enter</kbd> creates a newline.</li></ul></li><li>For checkbox attributes, clicking on the checkbox will toggle its state.</li><li>For labels without a value, a value can be added by clicking on the <em>No value</em> text which appears while the mouse is hovered on the item.</li><li>For relations, there is a dedicated <span class=\"tn-icon bx bx-pencil\"></span> button instead.</li></ul></li><li>An attribute can be deleted by pressing the <span class=\"tn-icon bx bx-trash\"></span> button to its right, which only appears while hovered. A confirmation screen is displayed first to ensure the attribute is not accidentally deleted.</li></ul><p>Attributes can be added in two ways:</p><ul><li>A new label, relation or attribute definition can be added from the <span class=\"tn-icon bx bx-plus\"></span> button in the <a href=\"#toolbar\">toolbar</a>. This shows the full detail popup.</li><li>To quickly add a label or a relation directly from the sidebar, click the <em>Add attribute</em> (<span class=\"tn-icon bx bx-plus\"></span>) item at the end of the list.<ul><li>The name field will be focused first. By default, a label will be created instead but it can be toggled to a relation by typing <kbd>~</kbd> or pressing the <span class=\"tn-icon bx bx-hash\"></span> icon (similarly, typing <code>#</code> will switch back to a label instead of a relation).</li><li>Once the name is filled, press <kbd>Enter</kbd> to continue to the value. Type in a value if desired and then press <kbd>Enter</kbd> again to create the attribute.</li><li>Clicking outside the editor will also create the attribute, but only if a name is specified.</li></ul></li></ul><h2>Inherited attributes</h2><p>Inherited labels or relations are shown in the same fashion as the owned ones.</p><p>The only differences are:</p><ul><li>To the right of the inherited attribute there is a link to the note where the attribute comes from, as well as an <span class=\"tn-icon bx bx-sitemap\"></span> icon to indicate that it's inheritable.</li><li>Clicking on an inherited attribute will reveal the same popup as owned attributes, but it is not editable. To edit it, first navigate to the note where the attribute is defined.</li></ul><h2>Definitions</h2><p>For attribute definition (see <a class=\"reference-link\" href=\"#root/_help_OFXdgB2nNk1F\">Promoted Attributes</a>):</p><ul><li>The icon indicates the type of the attribute (text, number).<ul><li>If an attribute is promoted, it has a small <span class=\"tn-icon bx bx-chevron-up\"></span> chevron icon overlaid on top of it.</li></ul></li><li>The name indicates the name of the attribute it defines (without the <code>label:</code> or <code>relation:</code> prefix).</li><li>To the right of the name a short summary is displayed which indicates the display name (alias), whether it has multiple values or an inverse relation.</li><li>Clicking on a definition reveals a popup, where the name, type, display name and other aspects can be configured.</li><li>To add a label definition, click the <em>Add definition</em> (<span class=\"tn-icon bx bx-plus\"></span>) item at the end of the list; its type can be changed to a relation from the popup. Both kinds of definitions can also be added from the <span class=\"tn-icon bx bx-plus\"></span> button in the <a href=\"#toolbar\">toolbar</a>.</li><li>For inherited definition, there is a link to the note where the definition comes from, as well as an <span class=\"tn-icon bx bx-sitemap\"></span> icon to indicate that it's inherited.</li></ul><h2>Selecting attributes</h2><p>Multiple attributes can be selected in order to copy or delete them together:</p><ul><li>Hovering over an attribute shows a checkbox in place of its icon. Click it to select the attribute.</li><li>Alternatively, hold <kbd>Ctrl</kbd> (<kbd>Cmd</kbd> on macOS) while clicking an attribute to select it, or <kbd>Shift</kbd> to select a range of attributes. A range can span multiple sections.</li><li>Once at least one attribute is selected, every attribute shows its checkbox, and clicking anywhere on an attribute selects or deselects it instead of opening the detail popup.</li><li>The <em>Select all</em> checkbox in the toolbar selects every attribute; while attributes are selected, it shows how many. Clicking it again clears the selection, as does pressing <kbd>Esc</kbd>.</li></ul><p>While attributes are selected, the toolbar shows:</p><ul><li>A <span class=\"tn-icon bx bx-copy\"></span> button, which copies the selected attributes.</li><li>A <span class=\"tn-icon bx bx-trash\"></span> button, which deletes the selected attributes after a confirmation. It only appears if all the selected attributes belong to the current note, since inherited attributes can only be deleted from the note they come from.</li></ul><p>Right-clicking an attribute shows a menu with the same actions, as well as pasting. If the attribute is not part of the selection, the menu applies only to that attribute.</p><h2>Copying and pasting attributes</h2><p>Attributes can be copied from one note and pasted into another:</p><ul><li>To copy, select the attributes and press <kbd>Ctrl</kbd>+<kbd>C</kbd>, or use the <span class=\"tn-icon bx bx-copy\"></span> button in the toolbar or the context menu.</li><li>To paste, navigate to the destination note and press <kbd>Ctrl</kbd>+<kbd>V</kbd> after clicking anywhere in the attributes tab, or use the <span class=\"tn-icon bx bx-paste\"></span> button in the toolbar. Right-clicking an attribute or an empty area of a section also offers to paste.</li></ul><p>Attributes are copied as text, in the same format as the attributes editor (for example <code>#author=John ~template=#root/abc123 #tag(inheritable)</code>). As a result:</p><ul><li>Copied attributes can be pasted into the attributes editor or into a note, and the text of the attributes editor can be pasted into the attributes tab.</li><li>Attributes can be written by hand in any other application and then pasted into Trilium.</li></ul><p>When pasting, the attributes become owned attributes of the current note, even if they were inherited in the source note:</p><ul><li>If the note already has an attribute with the same name, its value is replaced by the pasted one.</li><li>If a definition marks the attribute as having multiple values (see <a class=\"reference-link\" href=\"#root/_help_OFXdgB2nNk1F\">Promoted Attributes</a>), the pasted value is added alongside the existing ones instead, unless the same value is already present.</li></ul><aside class=\"admonition note\"><p><kbd>Ctrl</kbd>+<kbd>V</kbd> pastes what the system clipboard holds, whereas the <span class=\"tn-icon bx bx-paste\"></span> button and the context menu paste the attributes last copied in Trilium. The two differ if something else was copied in the meantime.</p></aside><h2>Mobile</h2><p>The attributes can also be edited visually on mobile, but not as part of the sidebar. Go to <a class=\"reference-link\" href=\"#root/_help_8YBEPzcpUgxw\">Note menu</a> and select <em>Attributes</em>, below <em>Backlinks</em> and <em>Note paths</em>, which opens the attributes in a sheet at the bottom of the screen.</p><p>On mobile, each section is displayed as a separate card:</p><ul><li>Attributes are added from the <span class=\"tn-icon bx bx-plus\"></span> button in the toolbar, or from the <span class=\"tn-icon bx bx-plus\"></span> button in the header of the <em>Definitions</em> card.</li><li>To select an attribute, press and hold it. Once an attribute is selected, tapping other attributes selects them as well.</li><li>Copying, pasting and deleting work the same way as on desktop, from the toolbar.</li></ul>","_help_LrKznOtw9cQD": "<p>Once the <a class=\"reference-link\" href=\"#root/_help_GBBMSlVSOIGP\">AI</a> integration is activated, a <em>Chat</em> entry will appear in the <a class=\"reference-link\" href=\"#root/_help_RnaPdbciOfeq\">Right Sidebar</a>.</p><ul><li>Unlike the dedicated note type, the side bar has optional access to the current note, making it easy to ask for information or modifications to a note without having to search for the note first.<ul><li>To toggle whether the current note is visible to the AI, simply click on the file icon at the bottom of the chat interface.</li></ul></li><li>On the top-right of the sidebar there are three buttons:<ul><li>Create a new conversation.</li><li>Go to a previous conversation</li><li>Save the current conversation as a dedicated note in the <a class=\"reference-link\" href=\"#root/_help_l0tKav7yLHGF\">Day Notes</a>, which turns it into a dedicated chat note.</li></ul></li></ul><aside class=\"admonition note\"><p>The sidebar chats are stored in the <a class=\"reference-link\" href=\"#root/_help_2mUhVmZK8RF3\">Hidden Notes</a> and can be seen in the <em>AI Chat History</em> section.</p></aside>","_help_KRlZFoIH0j6p": "<figure class=\"image image-style-align-right image_resized\" style=\"width:33.35%;\"><img style=\"aspect-ratio:490/1801;\" src=\"{{helpAssets}}/User%20Guide/Basic%20Concepts%20and%20Features/UI%20Elements/Right%20Sidebar/Connections%20tab_image.png\" width=\"490\" height=\"1801\"></figure><p>The connections tab groups together all the information about the current note and how it relates to other notes, in four different sections.</p><aside class=\"admonition note\"><p>It's generally best to keep only the desired sections expanded as each of the sections have to retrieve additional data that might not otherwise be needed. While collapsed, the sections do not retrieve any additional data.</p></aside><h2>Note map</h2><p>The note map displays a graph which shows the relation between the current notes and other notes on the hierarchy. There are two types of visualizations, which can be selected from the top-right part of the section:</p><ul><li>The <em>Link map</em> (<span class=\"tn-icon bx bx-network-chart\"></span>), which displays the <a href=\"#root/_help_Cq5X6iKQop6R\">relations</a> between notes.</li><li>The <em>Tree map</em> (<span class=\"tn-icon bx bx-sitemap\"></span>), which displays the hierarchical structure.</li></ul><p>The sidebar will remember which visualization is selected, as a global option. Note that note maps also have a <code>#mapType</code> which describes which visualization to use, but the sidebar deliberately ignores that to keep consistency when switching between notes.</p><p>The map can also be expanded by pressing the <span class=\"tn-icon bx bx-expand-alt\"></span> button in the top-right of the section. When expanded, the map is displayed in a separate dialog. Alternatively, all other sections can be collapsed, which will make the note map taller and the sidebar can be dragged to make for more lateral space.</p><p>The note map view inside the sidebar is deliberately more compact in order to fit the space: the link map would also show notes that don't have a link to the current note from the hierarchy (creating a cloud of dots) but this is only shown while the map is expanded. Similarly, the link strength and pin configuration buttons are not displayed here.</p><p>See also:</p><ul><li>The <a class=\"reference-link\" href=\"#root/_help_bdUJEHsAPYQR\">Note Map</a> note type</li><li><a class=\"reference-link\" href=\"#root/_help_BCkXAVs63Ttv\">Note Map (Link map, Tree map)</a> for more information on the concept as a whole.</li></ul><h2>Note paths</h2><p>The note paths section displays the locations in which the current note is <a href=\"#root/_help_IakOLONlIfGI\">cloned</a>. Each segment of the note path is clickable, in order to navigate to that note or clone. The root note is shown as its icon, the same as in the <a class=\"reference-link\" href=\"#root/_help_I6p2a06hdnL6\">Breadcrumb</a>; hovering it shows its title.</p><p>A new clone can be created from the <span class=\"tn-icon bx bx-duplicate\"></span> button at the top-right.</p><h2>Backlinks</h2><p>Backlinks list the notes that refer to the current note, as well as a preview of the content where the reference to the note is made.</p><p>For more information, see <a class=\"reference-link\" href=\"#root/_help_wfGXLmm7x27z\">Backlinks</a>.</p><h2>Similar notes</h2><p>Displays a list of notes that appear similar based on the content of the notes and their attributes. For more information, see <a class=\"reference-link\" href=\"#root/_help_xWtq5NUHOwql\">Similar Notes</a>.</p>",- "_help_r5JGHN99bVKn": "<figure class=\"image image-style-align-center image_resized\" style=\"width:50%;\"><img style=\"aspect-ratio:988/572;\" src=\"{{helpAssets}}/User%20Guide/Basic%20Concepts%20and%20Features/UI%20Elements/Recent%20Changes_image.png\" width=\"988\" height=\"572\"></figure><h2>Accessing the recent changes</h2><ul><li>For an overview of the changes across all documents, press the <span class=\"tn-icon bx bx-history\"></span> button in the <a class=\"reference-link\" href=\"#root/_help_xYmIYSP6wE3F\">Launch Bar</a>.<ul><li>If there is a <a href=\"#root/_help_OR8WJ7Iz9K4U\">hoisted note</a> or a <a href=\"#root/_help_9sRHySam5fXb\">workspace</a>, the list of recent changes will be limited to the descendents of the hoisted note, or the workspace.</li></ul></li><li>To limit the list of recent changes to a note and its descendants, look for the corresponding option in the <a class=\"reference-link\" href=\"#root/_help_YtSN43OrfzaA\">Note tree contextual menu</a> → Advanced.</li><li>Right-clicking or pressing and holding the <span class=\"tn-icon bx bx-plus\"></span> button of the <a class=\"reference-link\" href=\"#root/_help_3seOhtN8uLIY\">Tabs</a> bar lists the most recently changed notes that are not open in a tab. <em>Show all recent changes</em>, at the bottom of that menu, opens this dialog.</li></ul><h2>Interaction</h2><ul><li>Notes which were changed will appear in reverse chronological order (latest update first).</li><li>The title of the note is displayed, as well as the note path. Clicking on the note title will dismiss the dialog and navigate to that particular note.</li><li>Deleted notes will also be listed here, at their time of deletion. Press the <em>Undelete</em> link next to them in order to recover them.</li></ul>",+ "_help_r5JGHN99bVKn": "<figure class=\"image image-style-align-center image_resized\" style=\"width:50%;\"><img style=\"aspect-ratio:988/572;\" src=\"{{helpAssets}}/User%20Guide/Basic%20Concepts%20and%20Features/UI%20Elements/Recent%20Changes_image.png\" width=\"988\" height=\"572\"></figure><h2>Accessing the recent changes</h2><ul><li>For an overview of the changes across all documents, press the <span class=\"tn-icon bx bx-history\"></span> button in the <a class=\"reference-link\" href=\"#root/_help_xYmIYSP6wE3F\">Launch Bar</a>.<ul><li>If there is a <a href=\"#root/_help_OR8WJ7Iz9K4U\">hoisted note</a> or a <a href=\"#root/_help_9sRHySam5fXb\">workspace</a>, the list of recent changes will be limited to the descendents of the hoisted note, or the workspace.</li><li>Right-clicking or pressing and holding the button lists up to 15 of the most recently changed notes that are not open in a tab. Selecting a note opens it in a new tab.</li></ul></li><li>To limit the list of recent changes to a note and its descendants, look for the corresponding option in the <a class=\"reference-link\" href=\"#root/_help_YtSN43OrfzaA\">Note tree contextual menu</a> → Advanced.</li><li>Right-clicking or pressing and holding the <span class=\"tn-icon bx bx-plus\"></span> button of the <a class=\"reference-link\" href=\"#root/_help_3seOhtN8uLIY\">Tabs</a> bar lists the most recently changed notes that are not open in a tab. <em>Show all recent changes</em>, at the bottom of that menu, opens this dialog.</li></ul><h2>Interaction</h2><ul><li>Notes which were changed will appear in reverse chronological order (latest update first).</li><li>The title of the note is displayed, as well as the note path. Clicking on the note title will dismiss the dialog and navigate to that particular note.</li><li>Deleted notes will also be listed here, at their time of deletion. Press the <em>Undelete</em> link next to them in order to recover them.</li></ul>","_help_ny318J39E5Z0": "<p>Zoom applies to the entire UI, including text.</p><p>On the desktop application, use the <a class=\"reference-link\" href=\"#root/_help_x3i7MxGccDuM\">Global menu</a> to zoom in/out.</p><p>On both web browser and the desktop, the keyboard shortcuts <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>+</kbd> and <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>-</kbd> can be used.</p><h2>Adjusting the text size instead</h2><p>As an alternative to the zoom, the text size can be individually adjusted by going to <a class=\"reference-link\" href=\"#root/_help_4TIF1oA4VQRO\">Options</a> → <em>Appearance</em>.</p>","_help_lgKX7r3aL30x": "<figure class=\"image image-style-align-right\"><img style=\"aspect-ratio:505/261;\" src=\"{{helpAssets}}/User%20Guide/Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tooltip_image.png\" width=\"505\" height=\"261\"></figure><p>The note tooltip is a convenience feature which displays a popup when hovering over an <a href=\"#root/_help_hrZ1D00cLbal\">internal link</a> to another note.</p><p>The following information is displayed:</p><ul><li>The note path, at the top of the popup.</li><li>The title of the note.<ul><li>Clicking on the title will open the note in the current tab.</li><li>Holding <kbd>Ctrl</kbd> pressed while clicking the title will open in a new tab instead of the current one.</li></ul></li><li>A snippet of the content will be displayed as well.</li><li>A button to <a href=\"#root/_help_ZjLYv08Rp3qC\">quickly edit</a> the note in a popup.</li></ul><p>For a link to an <a href=\"#root/_help_0vhv7lsOLy82\">attachment</a>, the tooltip shows the attachment instead: its title after the path of the note that owns it, a line giving its size (for example <em>Attachment • 20.59 MiB</em>), a preview of its content where one is available, and the quick edit button opening the attachment.</p><p>The tooltip can be found in multiple places, including:</p><ul><li>In <a class=\"reference-link\" href=\"#root/_help_iPIMuisry3hd\">Text</a> notes, when hovering over <a class=\"reference-link\" href=\"#root/_help_hrZ1D00cLbal\">Internal (reference) links</a> .</li><li><a class=\"reference-link\" href=\"#root/_help_GTwFsgaA0lCt\">Collections</a>: <ul><li><a class=\"reference-link\" href=\"#root/_help_81SGnPGMk7Xc\">Geo Map View</a>, when hovering over a marker.</li><li><a class=\"reference-link\" href=\"#root/_help_xWbu3jpNWapp\">Calendar View</a>, when hovering over an event.</li><li><a class=\"reference-link\" href=\"#root/_help_2FvYrpmOXm29\">Table View</a>, when hovering over a note title, or over a <a href=\"#root/_help_Cq5X6iKQop6R\">relation</a>.</li></ul></li></ul>","_help_SL5f1Auq7sVN": "<p>Split view is a feature of <a class=\"reference-link\" href=\"#root/_help_s1aBHPd79XYj\">Mermaid Diagrams</a> and <a class=\"reference-link\" href=\"#root/_help_6RM1Q7ppFVoj\">Markdown</a> notes which displays both the source code on one side and the preview of the content on the other.</p><p><a class=\"reference-link\" href=\"#root/_help_s1aBHPd79XYj\">Mermaid Diagrams</a> also allow changing between a horizontal or a vertical split, to accommodate for the various sizes of diagrams.</p><h2>Display modes and interaction</h2><p>The split comes with three different display modes which can be toggled from the <a class=\"reference-link\" href=\"#root/_help_1P8QXI5edXNd\">Note buttons</a> area:</p><ul><li><span class=\"tn-icon bx bxs-dock-left\"></span> <em>(Split view)</em>, in which both the source code is available on one side and can be edited, and the preview is available on the other side.<ul><li>In this mode, the size of either the source pane or the preview pane can be adjusted by dragging the small border between them.</li></ul></li><li><span class=\"tn-icon bx bx-code\"></span> (<em>Source view)</em> which shows the source code on the entire screen for a more focused editing experience.</li><li><span class=\"tn-icon bx bx-show\"></span> <em>(Preview)</em> which displays only the rendering of the diagram or text in full screen, especially useful for read-only notes.</li></ul><p>The display node is stored at note level.</p><p>A Markdown note included in a text note, or a Markdown file embedded in one, has the same three display modes, switched from the title row and the toolbar of the include. See <em>Included Markdown</em> in <a class=\"reference-link\" href=\"#root/_help_nBAXQFj20hS1\">Include Note</a>.</p><h2>Relation to read-only notes</h2><p>If a note is marked as <a href=\"#root/_help_CoFPLs3dRlXc\">read-only</a>, the source view will not be editable. While in preview mode, marking a note as read-only has no effect since the preview itself is not editable.</p>",diff --git a/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Recent Changes.md b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Recent Changes.mdindex 8100314536..cfdb26bf5b 100644--- a/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Recent Changes.md+++ b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Recent Changes.md@@ -5,6 +5,7 @@* For an overview of the changes across all documents, press the <span class="tn-icon bx bx-history"></span> button in the <a class="reference-link" href="Launch%20Bar.md">Launch Bar</a>.* If there is a [hoisted note](../Navigation/Note%20Hoisting.md) or a [workspace](../Navigation/Workspaces.md), the list of recent changes will be limited to the descendents of the hoisted note, or the workspace.+ * Right-clicking or pressing and holding the button lists up to 15 of the most recently changed notes that are not open in a tab. Selecting a note opens it in a new tab.* To limit the list of recent changes to a note and its descendants, look for the corresponding option in the <a class="reference-link" href="Note%20Tree/Note%20tree%20contextual%20menu.md">Note tree contextual menu</a> → Advanced.* Right-clicking or pressing and holding the <span class="tn-icon bx bx-plus"></span> button of the <a class="reference-link" href="Tabs.md">Tabs</a> bar lists the most recently changed notes that are not open in a tab. _Show all recent changes_, at the bottom of that menu, opens this dialog.