Skip to content

Build your personal knowledge base with Trilium Notes

feat(links): lay out Add link in cards, as bulk actions is

Elian Dorane2613da37dd4
diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.json
index bd06a824ca..4c14af9676 100644
--- a/apps/client/src/translations/en/translation.json
+++ b/apps/client/src/translations/en/translation.json
@@ -60,8 +60,6 @@
"help_on_links": "Help on links",
"note": "Note",
"search_note": "search for note by its name",
- "link_title_mirrors": "link title mirrors the note's current title",
- "link_title_arbitrary": "link title can be changed arbitrarily",
"link_title": "Link title",
"anchor": "Anchor (optional)",
"anchor_none": "None (link to note)",
@@ -69,7 +67,9 @@
"button_edit_link": "Save link",
"button_fix_link": "Fix link",
"web_link": "Web link",
- "url": "URL"
+ "url": "URL",
+ "mirror_title": "Mirror the note's title",
+ "mirror_title_description": "The link shows the note's current title, and changes when the note is renamed."
},
"branch_prefix": {
"edit_branch_prefix": "Edit branch prefix",
diff --git a/apps/client/src/widgets/dialogs/add_link.css b/apps/client/src/widgets/dialogs/add_link.css
index e103ba100d..03e89fab01 100644
--- a/apps/client/src/widgets/dialogs/add_link.css
+++ b/apps/client/src/widgets/dialogs/add_link.css
@@ -1,3 +1,40 @@
-.modal.add-link-dialog .add-link-target {
- margin-bottom: 1rem;
+.modal.add-link-dialog {
+ .tn-card {
+ margin-bottom: 1rem;
+ }
+
+ .tn-card:last-child {
+ margin-bottom: 0;
+ }
+
+ /* Above the width at which Card.css stacks a wide control under its label. */
+ @container (min-width: 501px) {
+ :is(.add-link-note, .add-link-url, .add-link-text) {
+ --add-link-label-width: 8em;
+
+ > .tn-card-option-label {
+ flex: 0 0 var(--add-link-label-width);
+ min-width: max-content;
+ }
+
+ > :is(.form-control, .input-group) {
+ flex: 1 1 auto;
+ min-width: 0;
+ }
+ }
+
+ /* Narrower by the indent of the nested row, so its field lines up with the one above. */
+ .add-link-text.tn-card-section-nested {
+ --add-link-label-width: calc(8em - var(--card-nested-section-indent));
+ }
+ }
+
+ .add-link-target {
+ display: flex;
+ width: 100%;
+
+ .btn {
+ flex: 1;
+ }
+ }
}
diff --git a/apps/client/src/widgets/dialogs/add_link.spec.tsx b/apps/client/src/widgets/dialogs/add_link.spec.tsx
index 6d6f758af5..6258212810 100644
--- a/apps/client/src/widgets/dialogs/add_link.spec.tsx
+++ b/apps/client/src/widgets/dialogs/add_link.spec.tsx
@@ -1,3 +1,4 @@
+import type { RefObject } from "preact";
import { act } from "preact/test-utils";
import { beforeEach, describe, expect, it, vi } from "vitest";
@@ -14,9 +15,12 @@ const autocomplete = vi.hoisted(() => ({
vi.mock("../../services/i18n", () => ({ t: (key: string) => key }));
vi.mock("../react/NoteAutocomplete", () => ({
- default: ({ onChange }: { onChange: (suggestion: Suggestion | null) => void }) => {
+ default: ({ onChange, inputRef }: {
+ onChange: (suggestion: Suggestion | null) => void;
+ inputRef?: RefObject<HTMLInputElement>;
+ }) => {
autocomplete.onChange = onChange;
- return <input className="note-autocomplete" />;
+ return <input ref={inputRef} className="note-autocomplete" />;
}
}));
@@ -62,6 +66,24 @@ describe("AddLinkDialog", () => {
return choice().find((button) => button.classList.contains("active"))?.textContent?.trim();
}
+ function headings() {
+ return [ ...container.querySelectorAll(".tn-card-heading") ].map((heading) => heading.textContent);
+ }
+
+ function mirrorToggle() {
+ return container.querySelector<HTMLInputElement>(".add-link-mirror input.switch-toggle");
+ }
+
+ /** Whether the row of the field is indented under the row it depends on. */
+ function nested(name: "url" | "text") {
+ return container.querySelector(`.add-link-${name}`)?.classList.contains("tn-card-section-nested");
+ }
+
+ /** The rows that put their control under the label rather than beside it. */
+ function stacked() {
+ return [ ...container.querySelectorAll(".tn-card-option-stacked") ];
+ }
+
function field(name: "url" | "text") {
return container.querySelector<HTMLInputElement>(`.add-link-${name} input`);
}
@@ -86,6 +108,8 @@ describe("AddLinkDialog", () => {
it("inserts a typed web link, titled by its URL unless given a text", async () => {
await open();
+ expect(headings()).toStrictEqual([]);
+ expect(container.querySelector(".tn-card .tn-segmented-choice")).not.toBeNull();
expect(choice().map((button) => button.textContent?.trim()))
.toStrictEqual([ "add_link.note", "add_link.web_link" ]);
expect(current()).toBe("add_link.note");
@@ -104,17 +128,35 @@ describe("AddLinkDialog", () => {
await open();
await act(async () => choice()[1]?.click());
await type(field("url"), "https://trilium.cc");
+ expect(nested("text")).toBe(true);
+ expect(stacked()).toStrictEqual([]);
await type(field("text"), "Trilium");
await submit();
expect(addLink).toHaveBeenLastCalledWith("https://trilium.cc", "Trilium", true);
});
- it("still links a note picked on the note side", async () => {
+ it("links a note by its title, or by a text of its own once the title stops mirroring it", async () => {
const note = buildNote({ title: "Target" });
await open();
await act(async () => autocomplete.onChange?.({ notePath: `root/${note.noteId}` }));
+ expect(mirrorToggle()?.checked).toBe(true);
+ expect(field("text")).toBeNull();
+ await submit();
+ expect(addLink).toHaveBeenLastCalledWith(`root/${note.noteId}`, null);
+
+ await open();
+ await act(async () => autocomplete.onChange?.({ notePath: `root/${note.noteId}` }));
+ const toggle = mirrorToggle();
+ if (!toggle) throw new Error("No toggle to mirror the note's title.");
+ await act(async () => {
+ toggle.dispatchEvent(new Event("input", { bubbles: true }));
+ });
+ await vi.waitFor(() => expect(field("text")?.value).toBe("Target"));
+ expect(nested("text")).toBe(true);
+ expect(stacked()).toStrictEqual([]);
+ await type(field("text"), "See there");
await submit();
- expect(addLink).toHaveBeenCalledExactlyOnceWith(`root/${note.noteId}`, null);
+ expect(addLink).toHaveBeenLastCalledWith(`root/${note.noteId}`, "See there");
});
it("opens on the web link side for an edited external link or a selected URL", async () => {
diff --git a/apps/client/src/widgets/dialogs/add_link.tsx b/apps/client/src/widgets/dialogs/add_link.tsx
index cef498c456..6a4f3b0ebf 100644
--- a/apps/client/src/widgets/dialogs/add_link.tsx
+++ b/apps/client/src/widgets/dialogs/add_link.tsx
@@ -8,9 +8,10 @@ import type { Suggestion } from "../../services/note_autocomplete";
import tree from "../../services/tree";
import { logError } from "../../services/ws";
import Button from "../react/Button";
-import FormGroup from "../react/FormGroup.js";
-import FormRadioGroup from "../react/FormRadioGroup";
+import { Card, CardSection, OptionCardSection } from "../react/Card";
+import FormSelect from "../react/FormSelect";
import FormTextBox from "../react/FormTextBox";
+import FormToggle from "../react/FormToggle";
import { useTriliumEvent } from "../react/hooks";
import Modal from "../react/Modal";
import NoteAutocomplete, { type NoteAutocompleteHandle } from "../react/NoteAutocomplete";
@@ -135,6 +136,22 @@ export default function AddLinkDialog() {
}
}, [ target ]);
+ // A URL pasted on the note side moves to the web link side.
+ useEffect(() => {
+ const input = autocompleteRef.current;
+ if (!input || target !== "note" || opts?.fixLink) return;
+
+ const onPaste = (e: ClipboardEvent) => {
+ const text = e.clipboardData?.getData("text/plain").trim();
+ if (text && hasScheme(text)) {
+ e.preventDefault();
+ changeTarget("url", text);
+ }
+ };
+ input.addEventListener("paste", onPaste);
+ return () => input.removeEventListener("paste", onPaste);
+ }, [ target, opts ]);
+
async function setDefaultLinkTitle(noteId: string) {
const title = await tree.getNoteTitle(noteId);
setNoteTitle(title);
@@ -245,110 +262,17 @@ export default function AddLinkDialog() {
const buttonText = opts?.fixLink ? t("add_link.button_fix_link")
: opts?.currentLink ? t("add_link.button_edit_link") : t("add_link.button_add_link");
- const webLinkFields = (
- <>
- <FormGroup className="add-link-url" label={t("add_link.url")} name="url">
- <FormTextBox
- inputRef={webLinkRef}
- inputMode="url"
- autoCapitalize="off"
- autoCorrect="off"
- spellcheck={false}
- placeholder="https://"
- currentValue={webLink}
- onChange={changeWebLink}
- />
- </FormGroup>
-
- {!opts?.hasSelection && !opts?.targetOnly && (
- <FormGroup
- className="add-link-text" label={t("add_link.link_title")} name="link-title"
- >
- <FormTextBox
- currentValue={linkTitle}
- placeholder={suggestion?.externalLink}
- onChange={setLinkTitle}
- />
- </FormGroup>
- )}
- </>
- );
-
- const noteFields = (
- <>
- <div
- onPaste={(e) => {
- if (opts?.fixLink) return;
- const text = e.clipboardData?.getData("text/plain").trim();
- if (text && hasScheme(text)) {
- e.preventDefault();
- changeTarget("url", text);
- }
- }}
- >
- <FormGroup label={t("add_link.note")} name="note">
- <NoteAutocomplete
- inputRef={autocompleteRef}
- handleRef={handleRef}
- // A URL picked from the search belongs on the web link side.
- onChange={(picked) => (picked?.externalLink
- ? changeTarget("url", picked.externalLink)
- : setSuggestion(picked))}
- opts={{
- allowExternalLinks: !opts?.fixLink,
- allowCreatingNotes: true
- }}
- />
- </FormGroup>
- </div>
-
- {bookmarks.length > 0 && !opts?.targetOnly && (
- <FormGroup label={t("add_link.anchor")} name="anchor">
- <select
- className="form-select"
- value={selectedBookmark}
- onChange={(e) => setSelectedBookmark((e.target as HTMLSelectElement).value)}
- >
- <option value="">{t("add_link.anchor_none")}</option>
- {bookmarks.map((bk) => (
- <option key={bk} value={bk}>{bk}</option>
- ))}
- </select>
- </FormGroup>
- )}
-
- {!opts?.hasSelection && !opts?.targetOnly && !opts?.fixLink && (
- <div className="add-link-title-settings">
- {(linkType !== "external-link") && (
- <>
- <FormRadioGroup
- name="link-type"
- currentValue={linkType}
- values={[
- { value: "reference-link", label: t("add_link.link_title_mirrors") },
- { value: "hyper-link", label: t("add_link.link_title_arbitrary") }
- ]}
- onChange={(newValue) => setLinkType(newValue as LinkType)}
- />
- </>
- )}
-
- {(linkType !== "reference-link" && (
- <div className="add-link-title-form-group form-group">
- <br/>
- <label>
- {t("add_link.link_title")}
-
- <input className="link-title form-control" style={{ width: "100%" }}
- value={linkTitle}
- onInput={e => setLinkTitle((e.target as HTMLInputElement)?.value ?? "")}
- />
- </label>
- </div>
- ))}
- </div>
- )}
- </>
+ const showsTitle = !opts?.hasSelection && !opts?.targetOnly && !opts?.fixLink;
+ const titleSection = (
+ <OptionCardSection
+ className="add-link-text" name="link-title" label={t("add_link.link_title")}
+ >
+ <FormTextBox
+ currentValue={linkTitle}
+ placeholder={target === "url" ? suggestion?.externalLink : undefined}
+ onChange={setLinkTitle}
+ />
+ </OptionCardSection>
);
return (
@@ -387,19 +311,94 @@ export default function AddLinkDialog() {
}}
show={shown}
>
- {!opts?.fixLink && (
- <SegmentedChoice<LinkTarget>
- className="add-link-target"
- options={[
- { value: "note", label: t("add_link.note"), icon: "bx-note" },
- { value: "url", label: t("add_link.web_link"), icon: "bx-globe" }
- ]}
- currentValue={target}
- onChange={(next) => changeTarget(next)}
- />
- )}
-
- {target === "url" ? webLinkFields : noteFields}
+ <Card>
+ {!opts?.fixLink && (
+ <CardSection>
+ <SegmentedChoice<LinkTarget>
+ className="add-link-target"
+ options={[
+ { value: "note", label: t("add_link.note"), icon: "bx-note" },
+ { value: "url", label: t("add_link.web_link"), icon: "bx-globe" }
+ ]}
+ currentValue={target}
+ onChange={(next) => changeTarget(next)}
+ />
+ </CardSection>
+ )}
+
+ {target === "url" ? (
+ <OptionCardSection
+ className="add-link-url" name="url" label={t("add_link.url")}
+ subSectionsVisible={showsTitle}
+ subSections={titleSection}
+ >
+ <FormTextBox
+ inputRef={webLinkRef}
+ inputMode="url"
+ autoCapitalize="off"
+ autoCorrect="off"
+ spellcheck={false}
+ placeholder="https://"
+ currentValue={webLink}
+ onChange={changeWebLink}
+ />
+ </OptionCardSection>
+ ) : (
+ <>
+ <OptionCardSection
+ className="add-link-note" name="note" label={t("add_link.note")}
+ >
+ <NoteAutocomplete
+ inputRef={autocompleteRef}
+ handleRef={handleRef}
+ // A URL picked from the search belongs on the web link side.
+ onChange={(picked) => (picked?.externalLink
+ ? changeTarget("url", picked.externalLink)
+ : setSuggestion(picked))}
+ opts={{
+ allowExternalLinks: !opts?.fixLink,
+ allowCreatingNotes: true
+ }}
+ />
+ </OptionCardSection>
+
+ {bookmarks.length > 0 && !opts?.targetOnly && (
+ <OptionCardSection name="anchor" label={t("add_link.anchor")}>
+ <FormSelect
+ values={[
+ { value: "", title: t("add_link.anchor_none") },
+ ...bookmarks.map((bookmark) => ({
+ value: bookmark, title: bookmark
+ }))
+ ]}
+ keyProperty="value"
+ titleProperty="title"
+ currentValue={selectedBookmark}
+ onChange={setSelectedBookmark}
+ />
+ </OptionCardSection>
+ )}
+
+ {showsTitle && (
+ <OptionCardSection
+ className="add-link-mirror"
+ name="mirror-title"
+ label={t("add_link.mirror_title")}
+ description={t("add_link.mirror_title_description")}
+ subSectionsVisible={linkType === "hyper-link"}
+ subSections={titleSection}
+ >
+ <FormToggle
+ currentValue={linkType === "reference-link"}
+ onChange={(mirror) => {
+ setLinkType(mirror ? "reference-link" : "hyper-link");
+ }}
+ />
+ </OptionCardSection>
+ )}
+ </>
+ )}
+ </Card>
</Modal>
);
}
diff --git a/apps/server/src/assets/help/help_content.json b/apps/server/src/assets/help/help_content.json
index 64f0eb81db..ddaa7ceaec 100644
--- a/apps/server/src/assets/help/help_content.json
+++ b/apps/server/src/assets/help/help_content.json
@@ -141,7 +141,7 @@
"_help_UmgZAfcltxkS": "<p>Link previews turn a pasted URL into a rich, metadata-aware widget that can be displayed in three visual modes:</p><h2>Display modes</h2><p>A link preview can be displayed in one of three modes:</p><ul><li><strong>Inline</strong> — a link showing the site's favicon and page title (quite similar to&nbsp;<a class=\"reference-link\" href=\"#root/_help_hrZ1D00cLbal\">Internal (reference) links</a>). Use this when you want the link to flow with the surrounding paragraph.</li><li><strong>Card</strong> — a block-level preview with thumbnail, title, description, and site name. Use this when the link is the focus of a paragraph.</li><li><strong>Embed</strong> — a block-level interactive embed.<ul><li>Currently supported for YouTube videos, which render interactively (via an <code>iframe</code>).</li><li>To prevent unwanted remote requests, the video is shown only after clicking on it first.</li></ul></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"image image_resized\" style=\"width:100%;\"><img style=\"aspect-ratio:251/42;\" src=\"{{helpAssets}}/User%20Guide/Note%20Types/Text/Link%20Previews_image.png\" width=\"251\" height=\"42\"><figcaption><em>Inline</em> link preview</figcaption></figure></div><div class=\"trilium-multicolumn-column\"><figure class=\"image image_resized\" style=\"width:100%;\"><img style=\"aspect-ratio:1217/196;\" src=\"{{helpAssets}}/User%20Guide/Note%20Types/Text/2_Link%20Previews_image.png\" width=\"1217\" height=\"196\"><figcaption><em>Card</em> link preview</figcaption></figure></div><div class=\"trilium-multicolumn-column\"><figure class=\"image image_resized\" style=\"width:100%;\"><img style=\"aspect-ratio:994/563;\" src=\"{{helpAssets}}/User%20Guide/Note%20Types/Text/1_Link%20Previews_image.png\" width=\"994\" height=\"563\"><figcaption><em>Embed</em> link preview</figcaption></figure></div></div><h2>Inserting a link preview</h2><p>There are three ways to create one:</p><h3>1. By pasting a URL</h3><p>A link preview is automatically created:</p><ul><li>By pasting the URL and pressing <kbd>Space</kbd>. This will create an <em>inline</em> link preview.</li><li>When at the start of a new paragraph, pressing <kbd>Enter</kbd> will create a <em>card</em> or an <em>embed</em> for YouTube URLs.</li></ul><p>To undo an automatic link preview, press <kbd>Ctrl</kbd>+<kbd>Z</kbd> immediately afterwards which keeps it as a plain link instead. Alternatively, once a link preview was created, click on the link and select <em>Plain link</em> from the link preview toolbar.</p><p>This automatic conversion can be disabled by going to&nbsp;<a class=\"reference-link\" href=\"#root/_help_4TIF1oA4VQRO\">Options</a>&nbsp;→ <em>Text Notes</em> and unchecking <em>Autogenerate link previews</em> from the <em>Features</em> section.</p><p>If the link is not accessible to the Trilium server (or the network request fails for any other reason), it will not be converted to a link preview.</p><aside class=\"admonition note\"><p>A URL is only auto-converted when the pasted text <em>is</em> the URL. Links with a display name (e.g. <a href=\"https://triliumnotes.org\">Trilium Notes website</a>) are left as plain links.</p></aside><h3>2. By using the \"Link preview\" toolbar button</h3><p>Click <em>Link preview</em> (<span class=\"tn-icon cke cke-trilium-link-preview\"></span>) in the formatting toolbar to open the <em>Link preview</em> popup. Paste the URL and choose the type of preview.</p><h3>3. By saving browser tabs from the Web Clipper</h3><p>When the&nbsp;<a class=\"reference-link\" href=\"#root/_help_MtPxeAWVAzMg\">Web Clipper</a>&nbsp;saves the tabs of a window, each tab becomes an <em>inline</em> link preview showing the title and favicon the browser displays for it. Because this data comes from the browser, pages behind a login keep their real title, and the Trilium server does not contact the saved pages.</p><p>When <em>Autogenerate link previews</em> is turned off, the tabs are saved as a list of plain links instead.</p><h2>Altering an existing link preview</h2><p>Click on an inserted link preview to select it, and a small toolbar will appear with the following options:</p><ul><li>The normal link operations (opening in a new tab, copying the link, unlinking).</li><li>A button to edit the title of the link preview. This is especially useful if the title is hidden behind a login screen.</li><li>A way to switch between the link preview modes (Inline, Card or Embed) as well as to convert it to a normal link instead.<ul><li>The Embed option is only enabled when the URL points to a supported service (YouTube today).</li></ul></li></ul><h2>Where the preview data comes from</h2><p>When you insert a link preview, Trilium fetches metadata once and stores it inside the note's HTML:</p><ul><li><strong>YouTube URLs</strong> — title, channel name, and thumbnail are fetched via YouTube's public oEmbed endpoint.</li><li><strong>All other URLs</strong> — Trilium fetches the page and reads OpenGraph tags (<code>og:title</code>, <code>og:description</code>, <code>og:image</code>, <code>og:site_name</code>), falling back to the page's <code>&lt;title&gt;</code> and <code>&lt;meta name=\"description\"&gt;</code>. The site's favicon is downloaded and inlined.</li></ul><p>Because the data is stored in the note itself, link previews continue to render correctly when you reopen the note, share/publish it, or export to HTML — without any further network requests.</p><p>The metadata is captured <strong>at insertion time</strong> and is not automatically refreshed. If the linked page later changes its title or thumbnail, you'll need to re-insert the link to pick up the new values. To refresh a link, simply create it again.</p><p>When accessing a&nbsp;<a class=\"reference-link\" href=\"#root/_help_WOcw2SLH6tbX\">Server Installation</a>, the data is fetched from the remote URL by the server and not the client.</p><h2>Known limitations</h2><ul><li>The Embed display mode currently only supports YouTube. Other video and media platforms fall back to a Card preview.</li><li>Pages that block automated fetches may produce a minimal preview (hostname only).</li><li>Link previews require the Trilium server to reach the target URL, so they won't generate previews for pages on networks the server can't see.</li></ul>",
"_help_QEAPj01N5f7w": "<p>There are two types of links:</p><ul><li><a class=\"reference-link\" href=\"#root/_help_3IDVtesTQ8ds\">External links</a>, for standard hyperlinks to websites or other resources.</li><li><a class=\"reference-link\" href=\"#root/_help_hrZ1D00cLbal\">Internal (reference) links</a>&nbsp;for links to other notes within Trilium.<ul><li>The list of notes that refer to a particular note is called&nbsp;<a class=\"reference-link\" href=\"#root/_help_wfGXLmm7x27z\">Backlinks</a>.</li></ul></li></ul><h2>Note map</h2><p>Trilium provides a visualization of incoming and outgoing links for a particular note. See <a href=\"#root/_help_BCkXAVs63Ttv\">note map</a> for details.</p>",
"_help_3IDVtesTQ8ds": "<p>An external link is a standard web link targeting for example a website. For example, <a href=\"https://en.wikipedia.org/wiki/South_China_Sea\">https://en.wikipedia.org/wiki/South_China_Sea</a> is an external link to a Wikipedia page.</p><p>To create a link without a custom text:</p><ul><li>Press&nbsp;<span class=\"tn-icon cke cke-link\"></span> in the&nbsp;<a class=\"reference-link\" href=\"#root/_help_nRhnJkTT8cPs\">Formatting toolbar</a>:<ul><li>A popup will appear, type or paste the URL in the box.</li><li>Press <kbd>Enter</kbd> or the check mark icon to confirm.</li></ul></li><li>Alternatively, press <kbd>Ctrl</kbd>+<kbd>K</kbd> to trigger the aforementioned popup.</li><li>A simpler way is to paste the raw link and press space to turn it automatically into a link.</li><li>Since v0.107.0, the <em>Add link</em> dialog of <a class=\"reference-link\" href=\"#root/_help_hrZ1D00cLbal\">Internal (reference) links</a> (<kbd>Ctrl</kbd>+<kbd>L</kbd> or the <span class=\"tn-icon cke cke-trilium\"></span> button) creates external links as well. Select <em>Web link</em> at the top of the dialog, type or paste the address, and optionally a <em>Link title</em>; without one, the link shows its address. An address without a scheme, such as <code>example.com</code>, gets <code>https://</code>. A URL pasted into the <em>Note</em> field, or picked from its search, switches the dialog to <em>Web link</em>. The dialog also opens on <em>Web link</em> when the selected text is a URL.</li></ul><p>To create a link with a custom text:</p><ul><li>First, type and select the text which will be turned into a link.</li><li>Follow the previous steps to open the link interface (via the formatting toolbar, or <kbd>Ctrl</kbd>+<kbd>K</kbd>).</li><li>Alternatively, simply paste (<kbd>Ctrl</kbd>+<kbd>V</kbd>) over the selected text to turn it into a link.</li></ul><p>Once a link is inserted:</p><ul><li>The text inside the link can be changed if needed but the link itself will remain.</li><li>To modify the link, click on the link to display the popup and press the&nbsp;<span class=\"tn-icon cke cke-pencil\"></span> <em>Edit link</em> button.</li><li>To remove a link, click on it and press the&nbsp;<span class=\"tn-icon cke cke-unlink\"></span> <em>Unlink</em> button.</li></ul><p>You can follow external link by either double clicking (will open new tab/window) it or right clicking on them and choosing \"Open in new tab\".</p>",
- "_help_hrZ1D00cLbal": "<p>Internal links are links to other notes within Trilium.</p><p>You can open an internal link by clicking it. You can also see a read-only preview of an internal link's contents by hovering over it.</p><h2>Inserting internal links</h2><p>Internal links can be created at the current position in a text note by:</p><ol><li>Pressing <kbd>Ctrl</kbd> + <kbd>L</kbd> or the&nbsp;<span class=\"tn-icon cke cke-trilium\"></span> button underneath the&nbsp;<span class=\"tn-icon cke cke-plus\"></span> menu in the&nbsp;<a class=\"reference-link\" href=\"#root/_help_nRhnJkTT8cPs\">Formatting toolbar</a>.</li><li>Searching for the title of the desired note to link. It's also possible to create new notes from this dialog by typing a non-existing note title and selecting either <em>Create note</em>, which places it in the&nbsp;<a class=\"reference-link\" href=\"#root/_help_S0Fos78ZfcY7\">Note Inbox</a>&nbsp;(today's day note, or the top level, when no inbox is set), or <em>Create child note</em>, which places it under the note being edited.</li></ol><p>There are two link types which you can select when creating the link to the note:</p><ol><li><em>Link title mirrors the note's current title</em><ol><li>This is sometimes also called \"reference link\".</li><li>The title of this link cannot be changed. Instead, it will always show the current title of the linked note.</li><li>The icon of the linked note will also be displayed.</li><li>If the linked note is deleted, the link keeps the last title it showed, in red and with a <span class=\"tn-icon bx bx-x\"></span> icon instead of the note icon. Clicking it while editing opens the <em>Fix link</em> dialog, which searches for that title; picking a note, or creating a new one, replaces the link with one to that note.</li></ol></li><li><em>Link title can be changed arbitrarily</em><ol><li>This will create a traditional hyperlink, where the text of the link can be different from the note title.</li></ol></li></ol><h2>In-place linking</h2><p>You can also insert internal links “inline” by using the <code>@</code> symbol:</p><ol><li>Type <code>@</code> in a text note, which will open the note search menu.</li><li>Search for the desired note's title by typing a few characters. Use <kbd>Up</kbd> and <kbd>Down</kbd> to select the correct note, and press <kbd>Enter</kbd> or <kbd>Tab</kbd> to create the link. It's also possible to create new notes with this method by typing a non-existing note title and selecting <em>Create note</em> or <em>Create child note</em>, as described above.</li></ol><h2>Pasting internal links</h2><p>You can also insert internal links by copying a note from the note tree.</p><ol><li>In the&nbsp;<a class=\"reference-link\" href=\"#root/_help_oPVyFC7WL2Lp\">Note Tree</a>, select a note and press <kbd>Ctrl</kbd> + <kbd>C</kbd>.</li><li>In a text note, paste the link by pressing <kbd>Ctrl</kbd> + <kbd>V</kbd>.</li></ol>",
+ "_help_hrZ1D00cLbal": "<p>Internal links are links to other notes within Trilium.</p><p>You can open an internal link by clicking it. You can also see a read-only preview of an internal link's contents by hovering over it.</p><h2>Inserting internal links</h2><p>Internal links can be created at the current position in a text note by:</p><ol><li>Pressing <kbd>Ctrl</kbd> + <kbd>L</kbd> or the&nbsp;<span class=\"tn-icon cke cke-trilium\"></span> button underneath the&nbsp;<span class=\"tn-icon cke cke-plus\"></span> menu in the&nbsp;<a class=\"reference-link\" href=\"#root/_help_nRhnJkTT8cPs\">Formatting toolbar</a>.</li><li>Searching for the title of the desired note to link. It's also possible to create new notes from this dialog by typing a non-existing note title and selecting either <em>Create note</em>, which places it in the&nbsp;<a class=\"reference-link\" href=\"#root/_help_S0Fos78ZfcY7\">Note Inbox</a>&nbsp;(today's day note, or the top level, when no inbox is set), or <em>Create child note</em>, which places it under the note being edited.</li></ol><p>There are two link types, chosen with the <em>Mirror the note's title</em> switch of the dialog, which is on by default:</p><ol><li>With the switch on, the link mirrors the note's title.<ol><li>This is sometimes also called \"reference link\".</li><li>The title of this link cannot be changed. Instead, it will always show the current title of the linked note.</li><li>The icon of the linked note will also be displayed.</li><li>If the linked note is deleted, the link keeps the last title it showed, in red and with a <span class=\"tn-icon bx bx-x\"></span> icon instead of the note icon. Clicking it while editing opens the <em>Fix link</em> dialog, which searches for that title; picking a note, or creating a new one, replaces the link with one to that note.</li></ol></li><li>With the switch off, the link has a title of its own, typed in the <em>Link title</em> field.<ol><li>This will create a traditional hyperlink, where the text of the link can be different from the note title.</li></ol></li></ol><h2>In-place linking</h2><p>You can also insert internal links “inline” by using the <code>@</code> symbol:</p><ol><li>Type <code>@</code> in a text note, which will open the note search menu.</li><li>Search for the desired note's title by typing a few characters. Use <kbd>Up</kbd> and <kbd>Down</kbd> to select the correct note, and press <kbd>Enter</kbd> or <kbd>Tab</kbd> to create the link. It's also possible to create new notes with this method by typing a non-existing note title and selecting <em>Create note</em> or <em>Create child note</em>, as described above.</li></ol><h2>Pasting internal links</h2><p>You can also insert internal links by copying a note from the note tree.</p><ol><li>In the&nbsp;<a class=\"reference-link\" href=\"#root/_help_oPVyFC7WL2Lp\">Note Tree</a>, select a note and press <kbd>Ctrl</kbd> + <kbd>C</kbd>.</li><li>In a text note, paste the link by pressing <kbd>Ctrl</kbd> + <kbd>V</kbd>.</li></ol>",
"_help_wfGXLmm7x27z": "<p>A link points from one note to another; a <em>backlink</em> is that same connection seen from the other end: the list of notes that refer to the current one.</p><p>Backlinks are maintained automatically and are read-only from this side. A backlink disappears when the note that created it removes the link; it cannot be deleted from the note being pointed at.</p><h2>What counts as a backlink</h2><p>Any&nbsp;<a class=\"reference-link\" href=\"#root/_help_hrZ1D00cLbal\">Internal (reference) links</a>&nbsp;pointing at the current note, which covers two rather different cases:</p><ul><li>Relations that Trilium maintains on your behalf.<ul><li>The most common is <code>internalLink</code>, created whenever a note refers to another one through&nbsp;<a class=\"reference-link\" href=\"#root/_help_hrZ1D00cLbal\">Internal (reference) links</a>&nbsp;in its text.</li><li>Embedded images (<code>imageLink</code>), relation map connections (<code>relationMapLink</code>) and note inclusions (<code>includeNoteLink</code>) work the same way.</li></ul></li><li>Relations you define yourself.<ul><li>If another note has <code>~author</code> pointing at the current note, that note is listed here as well.</li></ul></li></ul><p>Relations coming from a&nbsp;<a class=\"reference-link\" href=\"#root/_help_m523cpzocqaD\">Saved Search</a>&nbsp;are excluded, since a search stores an <code>ancestor</code> relation that would otherwise list every one of its results as a backlink.</p><aside class=\"admonition note\"><p>Only some note types have their content scanned for links:&nbsp;<a class=\"reference-link\" href=\"#root/_help_iPIMuisry3hd\">Text</a>,&nbsp;<a class=\"reference-link\" href=\"#root/_help_6RM1Q7ppFVoj\">Markdown</a>,&nbsp;<a class=\"reference-link\" href=\"#root/_help_iRwzGnHPzonm\">Relation Map</a>&nbsp;and&nbsp;<a class=\"reference-link\" href=\"#root/_help_GBBMSlVSOIGP\">AI</a>&nbsp;chats. A link written inside a&nbsp;<a class=\"reference-link\" href=\"#root/_help_6f9hih2hXXZk\">Code</a>&nbsp;note is not registered and will not appear as a backlink on the target note. A relation set manually on a code note does still count.</p></aside><h2>How entries are displayed</h2><p>Each entry names the note the reference comes from, followed by one of:</p><ul><li><strong>An excerpt</strong> of the surrounding content, with the link itself highlighted. This is available for&nbsp;<a class=\"reference-link\" href=\"#root/_help_iPIMuisry3hd\">Text</a>&nbsp;notes and for&nbsp;<a class=\"reference-link\" href=\"#root/_help_GBBMSlVSOIGP\">AI</a>&nbsp;chat notes. Roughly 200 characters of context are quoted around the link, trimmed with an ellipsis where the surrounding text is longer, and images are left out.</li><li><strong>The name of the relation</strong>, for every other note type where the source cannot be quoted. This is the case for&nbsp;<a class=\"reference-link\" href=\"#root/_help_iRwzGnHPzonm\">Relation Map</a>&nbsp;notes and for any note carrying a relation you defined yourself.</li></ul><p>A note is listed once per reference it makes, so a note that links to the current one three times occupies three rows.</p><p>Of note:</p><ul><li>For AI chat notes, only the assistant's own prose is quoted. A chat that reached the note purely through tool calls has nothing to quote and is listed by relation name instead.</li><li>Excerpts are only generated for roughly the first 50 sources. On a heavily referenced note, the remaining entries fall back to showing the relation name.</li></ul><h2>Where backlinks are shown</h2><ul><li>In 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>, as a dedicated section.</li><li>As a badge in the&nbsp;<a class=\"reference-link\" href=\"#root/_help_AlJ73vBCjWDw\">Status bar</a>&nbsp;showing the number of backlinks. The badge only appears when the note is being read normally (not in a revision or attachment view) and when there is at least one backlink; pressing it opens the section above.</li><li>In&nbsp;<a class=\"reference-link\" href=\"#root/_help_ZjLYv08Rp3qC\">Quick edit</a>, as a button with a link icon in the header of the popup, under the same conditions; its tooltip gives the number of backlinks. Pressing a backlink opens that note in the popup.</li><li>Incoming links are also drawn on the link map, see&nbsp;<a class=\"reference-link\" href=\"#root/_help_BCkXAVs63Ttv\">Note Map (Link map, Tree map)</a>.</li></ul>",
"_help_S6Xx8QIWTV66": "<p>There are three types of lists supported by text notes:</p><ul><li><span class=\"tn-icon cke cke-bulleted-list\"></span>&nbsp;Bulleted lists (also known as unordered lists).</li><li><span class=\"tn-icon cke cke-numbered-list\"></span>&nbsp;Numbered lists (or ordered lists).</li><li><span class=\"tn-icon cke cke-todo-list\"></span>&nbsp;To-do lists</li></ul><p>For bulleted and numbered lists, it's possible to configure an alternative marker such as squares or Roman numbering by pressing the&nbsp;<span class=\"tn-icon cke cke-dropdown-arrow\"></span> icon. For numbered lists, it's also possible to specify the number to start at or whether to count in reverse order.</p><h2>Keyboard interaction</h2><ul><li>To create a new list:<ul><li>Bulleted list: Start a line with <code>*</code> or <code>-</code> followed by a space;</li><li>Numbered list: Start a line with <code>1.</code> or <code>1)</code> followed by a space;</li><li>To-do list: Start a line with <code>- [ ]</code> for an unchecked item or <code>[x]</code> for a checked item.</li></ul></li><li>To create a new item in the list, press <kbd>Enter</kbd>.</li><li>To create a blank line within a list item, press <kbd>Shift</kbd>+<kbd>Enter</kbd>.</li><li>To exit out of the list, press <kbd>Enter</kbd> twice.</li><li>To merge two lists, simply delete the gap between them.</li><li>To create nested lists, simply use the&nbsp;<span class=\"tn-icon cke cke-indent\"></span> button (see <em>Indentation</em> in&nbsp;<a class=\"reference-link\" href=\"#root/_help_dEHYtoWWi8ct\">Other features</a>) or the <kbd>Tab</kbd> key. To decrease the nesting level for the current element, press <kbd>Shift</kbd>+<kbd>Tab</kbd>.</li></ul><h2>Headings, code blocks within lists</h2><p>It possible to add content-level blocks such as headings, code blocks, tables within lists, as follows:</p><figure class=\"table\"><table><tbody><tr><td>1</td><td><img src=\"{{helpAssets}}/User%20Guide/Note%20Types/Text/2_Lists_image.jpg\"></td><td>First, create a list.</td></tr><tr><td>2</td><td><img src=\"{{helpAssets}}/User%20Guide/Note%20Types/Text/4_Lists_image.jpg\"></td><td>Press Enter to create a new list item.</td></tr><tr><td>3</td><td><img src=\"{{helpAssets}}/User%20Guide/Note%20Types/Text/1_Lists_image.jpg\"></td><td>Press Backspace to get rid of the bullet point. Notice the cursor position.</td></tr><tr><td>4</td><td><img class=\"image_resized\" style=\"aspect-ratio:676/112;width:98.29%;\" src=\"{{helpAssets}}/User%20Guide/Note%20Types/Text/5_Lists_image.jpg\" width=\"676\" height=\"112\"></td><td>At this point, insert any desired block-level item such as a code block.</td></tr><tr><td>5</td><td><img class=\"image_resized\" style=\"aspect-ratio:675/129;width:94.22%;\" src=\"{{helpAssets}}/User%20Guide/Note%20Types/Text/3_Lists_image.jpg\" width=\"675\" height=\"129\"></td><td>To continue with a new bullet point, press Enter until the cursor moves to a new blank position.</td></tr><tr><td>6</td><td><img class=\"image_resized\" style=\"aspect-ratio:675/129;width:100%;\" src=\"{{helpAssets}}/User%20Guide/Note%20Types/Text/Lists_image.jpg\" width=\"675\" height=\"129\"></td><td>Press Enter once more to create the new bullet.</td></tr></tbody></table></figure><p>The same principle applies to all three list types (bullet, numbered and to-do).</p><h2>To-do lists</h2><p>See&nbsp;<a class=\"reference-link\" href=\"#root/_help_fASfBrYnquKU\">To-do Lists</a>.</p><h2>Collapsible lists</h2><p>Starting with Trilium v0.104.0, it is possible to collapse nested list items. This applies to bullet lists, numbered lists as well as to-do lists.</p><p>To collapse or expand a list item that has nested sub-items:</p><ul><li>Using the mouse, move the cursor over the list item and an arrow will appear to its left. Clicking it will toggle between collapsed and expanded.</li><li>For bullet lists and numbered lists, it's also possible to click directly on the marker (e.g. the bullet or the number) instead of on the arrow to collapse or expand it. This won't work for to-do lists since this would toggle the to-do instead.</li><li>Press <kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>Enter</kbd> which will toggle the collapse/expand state for the item at the cursor position.</li></ul><p>Of note:</p><ul><li>Collapsed items always show the arrow to indicate its state.</li><li>The collapsed state is saved at note level and synced across instances, which means that it will restore after a refresh or reopening of the application.</li><li>The collapsed state is also persisted in&nbsp;<a class=\"reference-link\" href=\"#root/_help_mHbBMPDPkVV5\">Import &amp; Export</a>, but only for the HTML format. Markdown exports will not preserve the collapse state.</li><li>Collapsible bullets only exist in the context of editable text notes. Read-only lists will always be fully expanded.</li><li>The list items will auto-expand on edit to avoid typing in a hidden area.</li></ul>",
"_help_QrtTYPmdd1qq": "<p>Markdown-like formatting allows inserting some basic formatting by typing the Markdown equivalent. Note that this does not mean that&nbsp;<a class=\"reference-link\" href=\"#root/_help_iPIMuisry3hd\">Text</a>&nbsp;notes supports Markdown, these are just some convenience shortcuts.</p><p>To import more complex formatting into text notes, consider using the <a href=\"#root/_help_dEHYtoWWi8ct\"><em>Import from Markdown</em></a> function. For fully-fleged Markdown notes imports, consider using the dedicated <a href=\"#root/_help_Oau6X9rCuegd\">import</a> function.</p><ul><li>For <a href=\"#root/_help_Gr6xFaF6ioJ5\">headings:</a><ul><li><code>##</code> for Heading 2 (the first-level heading is reserved for the note title).</li><li><code>###</code> for Heading 3</li><li><code>####</code> for Heading 4</li><li><code>#####</code> for Heading 5</li><li><code>######</code> for Heading 6</li></ul></li><li>For&nbsp;<a class=\"reference-link\" href=\"#root/_help_Gr6xFaF6ioJ5\">General formatting</a>:<ul><li><strong>Bold</strong>: Type <code>**text**</code> or <code>__text__</code></li><li><em>Italic</em>: Type <code>*text*</code> or <code>_text_</code></li><li><del>Strikethrough</del>: Type <code>~~text~~</code></li></ul></li><li>For&nbsp;<a class=\"reference-link\" href=\"#root/_help_S6Xx8QIWTV66\">Lists</a>:<ul><li>Bulleted list: Start a line with <code>*</code> or <code>-</code> followed by a space;</li><li>Numbered list: Start a line with <code>1.</code> or <code>1)</code> followed by a space;</li><li>To-do list: Start a line with <code>[ ]</code> for an unchecked item or <code>[x]</code> for a checked item.</li></ul></li><li>For <a href=\"#root/_help_NwBbFdNZ9h7O\">block quotes</a>, press <code>&gt;</code>, followed by a space.</li><li>For&nbsp;<a class=\"reference-link\" href=\"#root/_help_QxEyIjRBizuC\">Code blocks</a>, type <code>```</code>.</li><li>For a <a href=\"#root/_help_dEHYtoWWi8ct\">horizontal line</a>, type <code>---</code>.</li><li>For <a href=\"#root/_help_NwBbFdNZ9h7O\">admonitions</a>:<ul><li><code>!!! note</code></li><li><code>!!! tip</code></li><li><code>!!! important</code></li><li><code>!!! caution</code></li><li><code>!!! warning</code></li><li>Starting any other text with <code>!!!</code> will insert a note admonition with the text inside of it.</li></ul></li><li>For <a href=\"#root/_help_CohkqWQC1iBv\">emojis</a>, type <code>:</code> followed by an emoji name to trigger an auto-completion.</li></ul><p>If auto-formatting is not desirable, press <kbd>Ctrl</kbd> + <kbd>Z</kbd> to revert the text to its original form.</p>",
diff --git a/docs/User Guide/User Guide/Note Types/Text/Links/Internal (reference) links.md b/docs/User Guide/User Guide/Note Types/Text/Links/Internal (reference) links.md
index 1a5da6217f..8070740203 100644
--- a/docs/User Guide/User Guide/Note Types/Text/Links/Internal (reference) links.md
+++ b/docs/User Guide/User Guide/Note Types/Text/Links/Internal (reference) links.md
@@ -10,14 +10,14 @@ Internal links can be created at the current position in a text note by:
1. Pressing <kbd>Ctrl</kbd> + <kbd>L</kbd> or the <span class="tn-icon cke cke-trilium"></span> button underneath the <span class="tn-icon cke cke-plus"></span> menu in the <a class="reference-link" href="../Formatting%20toolbar.md">Formatting toolbar</a>.
2. Searching for the title of the desired note to link. It's also possible to create new notes from this dialog by typing a non-existing note title and selecting either _Create note_, which places it in the <a class="reference-link" href="../../../Basic%20Concepts%20and%20Features/Notes/Note%20Inbox.md">Note Inbox</a> (today's day note, or the top level, when no inbox is set), or _Create child note_, which places it under the note being edited.
-There are two link types which you can select when creating the link to the note:
+There are two link types, chosen with the _Mirror the note's title_ switch of the dialog, which is on by default:
-1. _Link title mirrors the note's current title_
+1. With the switch on, the link mirrors the note's title.
1. This is sometimes also called "reference link".
2. The title of this link cannot be changed. Instead, it will always show the current title of the linked note.
3. The icon of the linked note will also be displayed.
4. If the linked note is deleted, the link keeps the last title it showed, in red and with a <span class="tn-icon bx bx-x"></span> icon instead of the note icon. Clicking it while editing opens the _Fix link_ dialog, which searches for that title; picking a note, or creating a new one, replaces the link with one to that note.
-2. _Link title can be changed arbitrarily_
+2. With the switch off, the link has a title of its own, typed in the _Link title_ field.
1. This will create a traditional hyperlink, where the text of the link can be different from the note title.
## In-place linking