Merge branch 'main' of https://github.com/TriliumNext/Trilium into feat/ui-improvements

This commit is contained in:
Adorian Doran 2025-11-01 18:20:08 +02:00
commit 214ba5265a
20 changed files with 221 additions and 32 deletions

View File

@ -270,6 +270,7 @@ export type CommandMappings = {
closeThisNoteSplit: CommandData;
moveThisNoteSplit: CommandData & { isMovingLeft: boolean };
jumpToNote: CommandData;
openTodayNote: CommandData;
commandPalette: CommandData;
// Keyboard shortcuts

View File

@ -159,6 +159,16 @@ export default class Entrypoints extends Component {
this.openInWindowCommand({ notePath: "", hoistedNoteId: "root" });
}
async openTodayNoteCommand() {
const todayNote = await dateNoteService.getTodayNote();
if (!todayNote) {
console.warn("Missing today note.");
return;
}
await appContext.tabManager.openInSameTab(todayNote.noteId);
}
async runActiveNoteCommand() {
const noteContext = appContext.tabManager.getActiveContext();
if (!noteContext) {

View File

@ -417,7 +417,7 @@ export default class FNote {
return notePaths;
}
getSortedNotePathRecords(hoistedNoteId = "root"): NotePathRecord[] {
getSortedNotePathRecords(hoistedNoteId = "root", activeNotePath: string | null = null): NotePathRecord[] {
const isHoistedRoot = hoistedNoteId === "root";
const notePaths: NotePathRecord[] = this.getAllNotePaths().map((path) => ({
@ -428,7 +428,23 @@ export default class FNote {
isHidden: path.includes("_hidden")
}));
// Calculate the length of the prefix match between two arrays
const prefixMatchLength = (path: string[], target: string[]) => {
const diffIndex = path.findIndex((seg, i) => seg !== target[i]);
return diffIndex === -1 ? Math.min(path.length, target.length) : diffIndex;
};
notePaths.sort((a, b) => {
if (activeNotePath) {
const activeSegments = activeNotePath.split('/');
const aOverlap = prefixMatchLength(a.notePath, activeSegments);
const bOverlap = prefixMatchLength(b.notePath, activeSegments);
// Paths with more matching prefix segments are prioritized
// when the match count is equal, other criteria are used for sorting
if (bOverlap !== aOverlap) {
return bOverlap - aOverlap;
}
}
if (a.isInHoistedSubTree !== b.isInHoistedSubTree) {
return a.isInHoistedSubTree ? -1 : 1;
} else if (a.isArchived !== b.isArchived) {
@ -449,10 +465,11 @@ export default class FNote {
* Returns the note path considered to be the "best"
*
* @param {string} [hoistedNoteId='root']
* @param {string|null} [activeNotePath=null]
* @return {string[]} array of noteIds constituting the particular note path
*/
getBestNotePath(hoistedNoteId = "root") {
return this.getSortedNotePathRecords(hoistedNoteId)[0]?.notePath;
getBestNotePath(hoistedNoteId = "root", activeNotePath: string | null = null) {
return this.getSortedNotePathRecords(hoistedNoteId, activeNotePath)[0]?.notePath;
}
/**

View File

@ -26,21 +26,12 @@ async function resolveNotePathToSegments(notePath: string, hoistedNoteId = "root
}
const path = notePath.split("/").reverse();
if (!path.includes("root")) {
path.push("root");
}
const effectivePathSegments: string[] = [];
let childNoteId: string | null = null;
let i = 0;
while (true) {
if (i >= path.length) {
break;
}
const parentNoteId = path[i++];
for (let i = 0; i < path.length; i++) {
const parentNoteId = path[i];
if (childNoteId !== null) {
const child = await froca.getNote(childNoteId, !logErrors);
@ -65,7 +56,7 @@ async function resolveNotePathToSegments(notePath: string, hoistedNoteId = "root
return null;
}
if (!parents.some((p) => p.noteId === parentNoteId)) {
if (!parents.some(p => p.noteId === parentNoteId) || (i === path.length - 1 && parentNoteId !== 'root')) {
if (logErrors) {
const parent = froca.getNoteFromCache(parentNoteId);
@ -77,7 +68,8 @@ async function resolveNotePathToSegments(notePath: string, hoistedNoteId = "root
);
}
const bestNotePath = child.getBestNotePath(hoistedNoteId);
const activeNotePath = appContext.tabManager.getActiveContextNotePath();
const bestNotePath = child.getBestNotePath(hoistedNoteId, activeNotePath);
if (bestNotePath) {
const pathToRoot = bestNotePath.reverse().slice(1);
@ -108,7 +100,9 @@ async function resolveNotePathToSegments(notePath: string, hoistedNoteId = "root
if (!note) {
throw new Error(`Unable to find note: ${notePath}.`);
}
const bestNotePath = note.getBestNotePath(hoistedNoteId);
const activeNotePath = appContext.tabManager.getActiveContextNotePath();
const bestNotePath = note.getBestNotePath(hoistedNoteId, activeNotePath);
if (!bestNotePath) {
throw new Error(`Did not find any path segments for '${note.toString()}', hoisted note '${hoistedNoteId}'`);

View File

@ -11,7 +11,11 @@ export function reloadFrontendApp(reason?: string) {
logInfo(`Frontend app reload: ${reason}`);
}
if (isElectron()) {
dynamicRequire("@electron/remote").BrowserWindow.getFocusedWindow()?.reload();
} else {
window.location.reload();
}
}
export function restartDesktopApp() {

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,21 @@
<p>The desktop version of Trilium supports all three main operating systems:</p>
<ul>
<li data-list-item-id="e9369fe00e2202eddd7638f9115592204">Windows
<ul>
<li data-list-item-id="ecbf2fbdd331d51182332dd3d33aeab15">Windows 11 is officially supported.</li>
<li data-list-item-id="e029be961ae70031059602696f29f72bf">Windows on ARM is also supported</li>
</ul>
</li>
<li data-list-item-id="e87f0cd97f723e8bd59f181622122906b">Linux:
<ul>
<li data-list-item-id="efa1b52fdb55980bee3f3482ee0f55dfa">Most modern distributions are supported, including NixOS.</li>
<li data-list-item-id="efe26984776dbcafc56afcc83a4d1b85b">ARM is supported in <code>aarch64</code> (no ARM v7 support).&nbsp;</li>
</ul>
</li>
<li data-list-item-id="eabb3c5c35295997be8b2579caa6cae1b">macOS
<ul>
<li data-list-item-id="e2848f18f02ba6ded3f20f46e12fecc54">Minimum supported operating system: macOS Monterey&nbsp;</li>
<li data-list-item-id="ea709467c48e79ae0c7e4d3c5e9261505">Both Intel and Apple Silicon devices are supported.</li>
</ul>
</li>
</ul>

View File

@ -0,0 +1,17 @@
<ul>
<li data-list-item-id="edfd91483e74d0b747136f134131b9720">Using Docker, the server can be run on Windows, Linux and macOS devices.</li>
<li
data-list-item-id="efde3b56d3d4f5b167bad52f55637e111">Native binaries are provided for Linux x64 and ARM (<code>aarch64</code>).</li>
</ul>
<h2>Legacy ARM support</h2>
<p>The Docker builds also provide <code>linux/arm/v7</code> and <code>linux/arm/v8</code> platforms.
These platforms are considered legacy since Trilium uses Node.js version
24 which have <a href="https://github.com/nodejs/node/commit/6682861d6f">officially downgraded support</a> for
these platforms to “experimental”.</p>
<p>As a result, Trilium needs to use Node.js 22 for these versions. As soon
as soon Node.js 22 will no longer be compatible, support for <code>armv7</code> and <code>armv8</code> will
be dropped entirely.</p>
<p>Regardless of upstream support, these platforms are supported on a best-effort
basis and are not officially supported by the Trilium development team.
Bug reports are accepted but they will not be treated with priority; contributions
are welcome.</p>

View File

@ -402,7 +402,7 @@
"end-date": "終了日",
"start-time": "開始時刻",
"end-time": "終了時間",
"board": "ボード",
"board": "カンバンボード",
"status": "ステータス",
"board_note_first": "最初のノート",
"board_note_second": "2番目のート",

View File

@ -417,7 +417,7 @@
"end-time": "結束時間",
"geolocation": "地理位置",
"built-in-templates": "內建模版",
"board": "板",
"board": "儀表板",
"status": "狀態",
"board_note_first": "第一個筆記",
"board_note_second": "第二個筆記",

View File

@ -4,6 +4,7 @@ import type { Application } from "express";
import dayjs from "dayjs";
import { type SQLiteSessionStore } from "./session_parser.js";
import { SessionData } from "express-session";
import cls from "../services/cls.js";
let app: Application;
let sessionStore: SQLiteSessionStore;
@ -106,7 +107,7 @@ describe("Login Route test", () => {
expect(expiry).toBeTruthy();
vi.setSystemTime(expiry!);
vi.advanceTimersByTime(CLEAN_UP_INTERVAL);
cls.init(() => vi.advanceTimersByTime(CLEAN_UP_INTERVAL));
({ session } = await getSessionFromCookie(setCookieHeader));
expect(session).toBeFalsy();
});

View File

@ -41,6 +41,14 @@ function getDefaultKeyboardActions() {
scope: "window",
ignoreFromCommandPalette: true
},
{
actionName: "openTodayNote",
friendlyName: t("hidden-subtree.open-today-journal-note-title"),
iconClass: "bx bx-calendar",
defaultShortcuts: [],
description: t("hidden-subtree.open-today-journal-note-title"),
scope: "window"
},
{
actionName: "commandPalette",
friendlyName: t("keyboard_action_names.command-palette"),

View File

@ -70,7 +70,7 @@
"calendar_description": "カレンダーを使って、個人的な予定や仕事上の予定を管理しましょう。終日イベントと複数日イベントに対応しています。週、月、年表示でイベントを一目で確認できます。イベントの追加やドラッグ操作で簡単に行えます。",
"table_title": "テーブル",
"table_description": "ノートに関する情報を表形式で表示・編集できます。テキスト、数値、チェックボックス、日時、リンク、色など、様々な列タイプに対応し、リレーションもサポートしています。オプションで、ノートを表内のツリー階層に表示することもできます。",
"board_title": "ボード",
"board_title": "カンバンボード",
"board_description": "新しい項目や列を簡単に作成し、ボード上でドラッグするだけでステータスを変更できるカンバン ボードで、タスクやプロジェクトのステータスを整理できます。",
"geomap_title": "ジオマップ",
"geomap_description": "カスタマイズ可能なマーカーを使って、休暇を計画したり、興味のある場所を地図上に直接マークしたりできます。記録されたGPXトラックを表示して、旅程を追跡できます。",

View File

@ -1 +1,22 @@
{}
{
"get-started": {
"title": "Começar",
"architecture": "Arquitetura:",
"older_releases": "Ver versões anteriores",
"server_title": "Configurar um servidor para aceder a partir de vários dispositivos"
},
"hero_section": {
"title": "Organiza as tuas ideias. Constrói a tua base de conhecimento pessoal.",
"subtitle": "O Trilium é uma solução de código aberto para tomar notas e organizar a tua base de conhecimento pessoal. Usa-o localmente no teu computador ou sincroniza-o com o teu próprio servidor para teres as tuas notas acessíveis em qualquer lugar.",
"get_started": "Começar",
"github": "GitHub",
"dockerhub": "Docker Hub",
"screenshot_alt": "Captura de ecrã da aplicação Trilium Notes para computador"
},
"organization_benefits": {
"title": "Organização",
"note_structure_description": "As notas podem ser organizadas de forma hierárquica. Não há necessidade de pastas, pois cada nota pode conter sub notas. Uma única nota pode ser adicionada em vários locais da hierarquia.",
"attributes_description": "Utiliza relações entre notas ou adiciona etiquetas para uma categorização fácil. Usa atributos promovidos para inserir informação estruturada, que pode ser utilizada em tabelas ou quadros.",
"hoisting_description": "Separa facilmente as tuas notas pessoais e de trabalho agrupando-as num espaço de trabalho, que focaliza a árvore de notas para mostrar apenas um conjunto específico de notas."
}
}

View File

@ -70,7 +70,7 @@
"calendar_description": "使用行事曆規劃個人或專業活動,支援全天及多日活動。透過週、月、年檢視模式,一覽所有活動。通過簡單互動即可新增或拖曳活動。",
"table_title": "表格",
"table_description": "以表格結構顯示並編輯筆記資訊,支援多種欄位類型,包括文字、數字、核取方塊、日期與時間、連結及顏色,並支援關聯功能。可選擇性地在表格內以樹狀層級結構顯示筆記內容。",
"board_title": "板",
"board_title": "儀表板",
"board_description": "將您的任務或專案狀態整理成看板,輕鬆建立新項目與欄位,並透過在看板上拖曳即可簡單變更狀態。",
"geomap_title": "地理地圖",
"geomap_description": "使用可自訂的標記直接在地圖上規劃您的假期行程或標記感興趣的地點。顯示已記錄的GPX軌跡以便追蹤行程路線。",
@ -115,7 +115,7 @@
},
"social_buttons": {
"github": "GitHub",
"github_discussions": "GitHub Discussions",
"github_discussions": "GitHub 討論",
"matrix": "Matrix",
"reddit": "Reddit"
},

13
docs/README-pt.md vendored
View File

@ -25,27 +25,28 @@ status](https://hosted.weblate.org/widget/trilium/svg-badge.svg)](https://hosted
| [Japanese](./docs/README-ja.md) | [Italian](./docs/README-it.md) |
[Spanish](./docs/README-es.md)
Trilium Notes is a free and open-source, cross-platform hierarchical note taking
application with focus on building large personal knowledge bases.
Trilium Notes é uma aplicação gratuita e de código aberto, multiplataforma, para
a criação hierárquica de notas, com foco na construção de grandes bases de
conhecimento pessoais.
See [screenshots](https://triliumnext.github.io/Docs/Wiki/screenshot-tour) for
quick overview:
<a href="https://triliumnext.github.io/Docs/Wiki/screenshot-tour"><img src="./docs/app.png" alt="Trilium Screenshot" width="1000"></a>
## ⏬ Download
## ⏬ Transferir
- [Latest release](https://github.com/TriliumNext/Trilium/releases/latest)
stable version, recommended for most users.
- [Nightly build](https://github.com/TriliumNext/Trilium/releases/tag/nightly)
unstable development version, updated daily with the latest features and
fixes.
## 📚 Documentation
## 📚 Documentação
**Visit our comprehensive documentation at
[docs.triliumnotes.org](https://docs.triliumnotes.org/)**
Our documentation is available in multiple formats:
A nossa documentação está disponível em múltiplos formatos:
- **Online Documentation**: Browse the full documentation at
[docs.triliumnotes.org](https://docs.triliumnotes.org/)
- **In-App Help**: Press `F1` within Trilium to access the same documentation
@ -53,7 +54,7 @@ Our documentation is available in multiple formats:
- **GitHub**: Navigate through the [User
Guide](./docs/User%20Guide/User%20Guide/) in this repository
### Quick Links
### Links rápidos
- [Getting Started Guide](https://docs.triliumnotes.org/)
- [Installation
Instructions](./docs/User%20Guide/User%20Guide/Installation%20&%20Setup/Server%20Installation.md)

View File

@ -331,6 +331,41 @@
"format": "markdown",
"dataFileName": "Using the desktop application .md",
"attachments": []
},
{
"isClone": false,
"noteId": "Rp0q8bSP6Ayl",
"notePath": [
"pOsGYCXsbNQG",
"Otzi9La2YAUX",
"poXkQfguuA0U",
"Rp0q8bSP6Ayl"
],
"title": "System Requirements",
"notePosition": 20,
"prefix": null,
"isExpanded": false,
"type": "text",
"mime": "text/html",
"attributes": [
{
"type": "label",
"name": "shareAlias",
"value": "system-requirements",
"isInheritable": false,
"position": 30
},
{
"type": "label",
"name": "iconClass",
"value": "bx bx-chip",
"isInheritable": false,
"position": 40
}
],
"format": "markdown",
"dataFileName": "System Requirements.md",
"attachments": []
}
]
},
@ -1151,6 +1186,41 @@
"format": "markdown",
"dataFileName": "Third-party cloud hosting.md",
"attachments": []
},
{
"isClone": false,
"noteId": "iGTnKjubbXkA",
"notePath": [
"pOsGYCXsbNQG",
"Otzi9La2YAUX",
"WOcw2SLH6tbX",
"iGTnKjubbXkA"
],
"title": "System Requirements",
"notePosition": 140,
"prefix": null,
"isExpanded": false,
"type": "text",
"mime": "text/html",
"attributes": [
{
"type": "label",
"name": "shareAlias",
"value": "system-requirements",
"isInheritable": false,
"position": 30
},
{
"type": "label",
"name": "iconClass",
"value": "bx bx-chip",
"isInheritable": false,
"position": 40
}
],
"format": "markdown",
"dataFileName": "System Requirements.md",
"attachments": []
}
]
},

View File

@ -0,0 +1,12 @@
# System Requirements
The desktop version of Trilium supports all three main operating systems:
* Windows
* Windows 11 is officially supported.
* Windows on ARM is also supported
* Linux:
* Most modern distributions are supported, including NixOS.
* ARM is supported in `aarch64` (no ARM v7 support).
* macOS
* Minimum supported operating system: macOS Monterey
* Both Intel and Apple Silicon devices are supported.

View File

@ -0,0 +1,11 @@
# System Requirements
* Using Docker, the server can be run on Windows, Linux and macOS devices.
* Native binaries are provided for Linux x64 and ARM (`aarch64`).
## Legacy ARM support
The Docker builds also provide `linux/arm/v7` and `linux/arm/v8` platforms. These platforms are considered legacy since Trilium uses Node.js version 24 which have [officially downgraded support](https://github.com/nodejs/node/commit/6682861d6f) for these platforms to “experimental”.
As a result, Trilium needs to use Node.js 22 for these versions. As soon as soon Node.js 22 will no longer be compatible, support for `armv7` and `armv8` will be dropped entirely.
Regardless of upstream support, these platforms are supported on a best-effort basis and are not officially supported by the Trilium development team. Bug reports are accepted but they will not be treated with priority; contributions are welcome.

View File

@ -35,6 +35,7 @@ const enum KeyboardActionNamesEnum {
activateNextTab,
activatePreviousTab,
openNewWindow,
openTodayNote,
toggleTray,
toggleZenMode,
firstTab,