Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.

Commit adc9172

Browse files
committed
Merge branch 'develop' of https://github.com/TriliumNext/Notes into develop
2 parents 8994f53 + b93e44a commit adc9172

File tree

10 files changed

+53
-39
lines changed

10 files changed

+53
-39
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ Download the repository, install dependencies using `pnpm` and then run the envi
128128
git clone https://github.com/TriliumNext/Notes.git
129129
cd Notes
130130
pnpm install
131-
pnpm nx run edit-docs:serve
131+
pnpm nx run edit-docs:edit-docs
132132
```
133133

134134
### Building the Executable

apps/client/src/widgets/buttons/create_ai_chat_button.ts

Lines changed: 0 additions & 27 deletions
This file was deleted.

apps/client/src/widgets/buttons/note_actions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ export default class NoteActionsWidget extends NoteContextAwareWidget {
186186

187187
this.$convertNoteIntoAttachmentButton.toggle(note.isEligibleForConversionToAttachment());
188188

189-
this.toggleDisabled(this.$findInTextButton, ["text", "code", "book"].includes(note.type));
189+
this.toggleDisabled(this.$findInTextButton, ["text", "code", "book", "mindMap"].includes(note.type));
190190

191191
this.toggleDisabled(this.$showAttachmentsButton, !isInOptions);
192192
this.toggleDisabled(this.$showSourceButton, ["text", "code", "relationMap", "mermaid", "canvas", "mindMap", "geoMap"].includes(note.type));

apps/client/src/widgets/find.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ export default class FindWidget extends NoteContextAwareWidget {
188188
return;
189189
}
190190

191-
if (!["text", "code", "render"].includes(this.note?.type ?? "")) {
191+
if (!["text", "code", "render", "mindMap"].includes(this.note?.type ?? "")) {
192192
return;
193193
}
194194

@@ -250,6 +250,8 @@ export default class FindWidget extends NoteContextAwareWidget {
250250
case "text":
251251
const readOnly = await this.noteContext?.isReadOnly();
252252
return readOnly ? this.htmlHandler : this.textHandler;
253+
case "mindMap":
254+
return this.htmlHandler;
253255
default:
254256
console.warn("FindWidget: Unsupported note type for find widget", this.note?.type);
255257
}
@@ -352,7 +354,7 @@ export default class FindWidget extends NoteContextAwareWidget {
352354
}
353355

354356
isEnabled() {
355-
return super.isEnabled() && ["text", "code", "render"].includes(this.note?.type ?? "");
357+
return super.isEnabled() && ["text", "code", "render", "mindMap"].includes(this.note?.type ?? "");
356358
}
357359

358360
async entitiesReloadedEvent({ loadResults }: EventData<"entitiesReloaded">) {

apps/client/src/widgets/find_in_html.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export default class FindInHtml {
8585
if (this.$results?.length) {
8686
const $current = this.$results.eq(this.currentIndex);
8787
this.$results.removeClass(FIND_RESULT_SELECTED_CSS_CLASSNAME);
88-
$current[0].scrollIntoView();
88+
$current[0].scrollIntoView({ block: 'center', inline: 'center'});
8989
$current.addClass(FIND_RESULT_SELECTED_CSS_CLASSNAME);
9090
}
9191
}

apps/client/src/widgets/tab_row.ts

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -378,16 +378,45 @@ export default class TabRowWidget extends BasicWidget {
378378
}
379379

380380
scrollTabContainer(direction: number, behavior: ScrollBehavior = "smooth") {
381-
const currentScrollLeft = this.$tabScrollingContainer[0]?.scrollLeft;
382-
this.$tabScrollingContainer[0].scrollTo({
383-
left: currentScrollLeft + direction,
381+
this.$tabScrollingContainer[0].scrollBy({
382+
left: direction,
384383
behavior
385384
});
386385
};
387386

388387
setupScrollEvents() {
389-
this.$tabScrollingContainer[0].addEventListener('wheel', (event) => {
390-
this.scrollTabContainer(event.deltaY * 1.5);
388+
let deltaX = 0;
389+
let isScrolling = false;
390+
const stepScroll = () => {
391+
if (Math.abs(deltaX) > 5) {
392+
const step = Math.round(deltaX * 0.2);
393+
deltaX -= step;
394+
this.scrollTabContainer(step, "instant");
395+
requestAnimationFrame(stepScroll);
396+
} else {
397+
this.scrollTabContainer(deltaX, "instant");
398+
deltaX = 0;
399+
isScrolling = false;
400+
}
401+
};
402+
this.$tabScrollingContainer[0].addEventListener('wheel', async (event) => {
403+
if (!event.shiftKey && event.deltaX === 0) {
404+
event.preventDefault();
405+
// Clamp deltaX between TAB_CONTAINER_MIN_WIDTH and TAB_CONTAINER_MIN_WIDTH * 3
406+
deltaX += Math.sign(event.deltaY) * Math.max(Math.min(Math.abs(event.deltaY), TAB_CONTAINER_MIN_WIDTH * 3), TAB_CONTAINER_MIN_WIDTH);
407+
if (!isScrolling) {
408+
isScrolling = true;
409+
stepScroll();
410+
}
411+
} else if (event.shiftKey) {
412+
event.preventDefault();
413+
if (event.deltaY > 0) {
414+
await appContext.tabManager.activateNextTabCommand();
415+
} else {
416+
await appContext.tabManager.activatePreviousTabCommand();
417+
}
418+
this.activeTabEl.scrollIntoView();
419+
}
391420
});
392421

393422
this.$scrollButtonLeft[0].addEventListener('click', () => this.scrollTabContainer(-200));

apps/client/src/widgets/type_widgets/mind_map.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,4 +286,13 @@ export default class MindMapWidget extends TypeWidget {
286286
utils.downloadSvgAsPng(this.note.title, svg);
287287
}
288288

289+
async executeWithContentElementEvent({ resolve, ntxId }: EventData<"executeWithContentElement">) {
290+
if (!this.isNoteContext(ntxId)) {
291+
return;
292+
}
293+
294+
await this.initialized;
295+
296+
resolve(this.$content.find('.main-node-container'));
297+
}
289298
}

apps/server-e2e/src/layout/tab_bar.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ test("Search works when dismissing a tab", async ({ page, context }) => {
115115

116116
await app.getTab(0).click();
117117
await app.openAndClickNoteActionMenu("Search in note");
118-
await expect(app.findAndReplaceWidget).toBeVisible();
118+
await expect(app.findAndReplaceWidget.first()).toBeVisible();
119119
});
120120

121121
test("New tab displays workspaces", async ({ page, context }) => {

apps/server/src/services/hidden_subtree_launcherbar.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export default function buildLaunchBarConfig() {
7272
id: "_lbLlmChat",
7373
title: t("hidden-subtree.llm-chat-title"),
7474
type: "launcher",
75-
command: "createAiChat",
75+
builtinWidget: "aiChatLauncher",
7676
icon: "bx bx-bot",
7777
attributes: [
7878
{ type: "label", name: "desktopOnly" }

docs/Release Notes/Release Notes/v0.94.0.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
* [Text notes: add a way to move up and down text lines via a keyboard shortcut](https://github.com/TriliumNext/Notes/issues/1002) by @dogfuntom
6060
* [improve tab scroll UX by switching from instant to smooth behavior](https://github.com/TriliumNext/Notes/pull/2030) by @SiriusXT
6161
* Calendar view: display calendar view if `#viewType=calendar` is set.
62+
* [Mind map: add search support](https://github.com/TriliumNext/Notes/pull/2055) by @SiriusXT
6263

6364
## 📖 Documentation
6465

0 commit comments

Comments
 (0)