From b0e7b6ce6738928f117f96e38cc70f29f0ee638a Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Thu, 25 Dec 2025 11:22:18 +0200 Subject: [PATCH] chore: address requested changes --- apps/client/src/widgets/layout/Breadcrumb.tsx | 2 +- apps/client/src/widgets/react/NoteLink.tsx | 4 ++-- apps/client/src/widgets/ribbon/NoteInfoTab.tsx | 1 - apps/server/src/services/window.ts | 9 ++++----- packages/ckeditor5/src/plugins.ts | 2 +- 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/apps/client/src/widgets/layout/Breadcrumb.tsx b/apps/client/src/widgets/layout/Breadcrumb.tsx index 0465a8f54..3809cc352 100644 --- a/apps/client/src/widgets/layout/Breadcrumb.tsx +++ b/apps/client/src/widgets/layout/Breadcrumb.tsx @@ -25,7 +25,7 @@ import ActionButton from "../react/ActionButton"; import { Badge } from "../react/Badge"; import Dropdown from "../react/Dropdown"; import { FormDropdownDivider, FormListItem } from "../react/FormList"; -import { useActiveNoteContext, useChildNotes, useNote, useNoteColorClass, useNoteIcon, useNoteLabel, useNoteLabelBoolean, useNoteProperty, useNoteTitle, useStaticTooltip, useTriliumOptionBool } from "../react/hooks"; +import { useActiveNoteContext, useChildNotes, useNote, useNoteColorClass, useNoteIcon, useNoteLabel, useNoteLabelBoolean, useNoteTitle, useStaticTooltip, useTriliumOptionBool } from "../react/hooks"; import Icon from "../react/Icon"; import { NewNoteLink } from "../react/NoteLink"; import { ParentComponent } from "../react/react_utils"; diff --git a/apps/client/src/widgets/react/NoteLink.tsx b/apps/client/src/widgets/react/NoteLink.tsx index b1b3d732b..c0efae557 100644 --- a/apps/client/src/widgets/react/NoteLink.tsx +++ b/apps/client/src/widgets/react/NoteLink.tsx @@ -1,10 +1,10 @@ import clsx from "clsx"; import { HTMLAttributes } from "preact"; -import { useEffect, useLayoutEffect, useRef, useState } from "preact/hooks"; +import { useEffect, useRef, useState } from "preact/hooks"; import link, { calculateHash, ViewScope } from "../../services/link"; import tree from "../../services/tree"; -import { useImperativeSearchHighlighlighting, useNote, useNoteColorClass, useNoteIcon, useNoteLabel, useNoteLabelBoolean, useNoteProperty, useNoteTitle, useTriliumEvent } from "./hooks"; +import { useImperativeSearchHighlighlighting, useNote, useNoteColorClass, useNoteIcon, useNoteLabelBoolean, useNoteTitle, useTriliumEvent } from "./hooks"; import Icon from "./Icon"; interface NoteLinkOpts { diff --git a/apps/client/src/widgets/ribbon/NoteInfoTab.tsx b/apps/client/src/widgets/ribbon/NoteInfoTab.tsx index f74e55c49..14888042e 100644 --- a/apps/client/src/widgets/ribbon/NoteInfoTab.tsx +++ b/apps/client/src/widgets/ribbon/NoteInfoTab.tsx @@ -8,7 +8,6 @@ import { t } from "../../services/i18n"; import server from "../../services/server"; import { formatSize } from "../../services/utils"; import { formatDateTime } from "../../utils/formatters"; -import Button from "../react/Button"; import { useTriliumEvent } from "../react/hooks"; import LinkButton from "../react/LinkButton"; import LoadingSpinner from "../react/LoadingSpinner"; diff --git a/apps/server/src/services/window.ts b/apps/server/src/services/window.ts index 572bee9cf..019ec58e8 100644 --- a/apps/server/src/services/window.ts +++ b/apps/server/src/services/window.ts @@ -1,5 +1,4 @@ -import type { App, BrowserWindow, BrowserWindowConstructorOptions, IpcMainEvent,WebContents } from "electron"; -import electron, { ipcMain } from "electron"; +import { type App, type BrowserWindow, type BrowserWindowConstructorOptions, default as electron, ipcMain, type IpcMainEvent, type WebContents } from "electron"; import fs from "fs/promises"; import { t } from "i18next"; import path from "path"; @@ -12,7 +11,7 @@ import optionService from "./options.js"; import port from "./port.js"; import { RESOURCE_DIR } from "./resource_dir.js"; import sqlInit from "./sql_init.js"; -import { formatDownloadTitle, isDev, isMac, isWindows } from "./utils.js"; +import { formatDownloadTitle, isMac, isWindows } from "./utils.js"; // Prevent the window being garbage collected let mainWindow: BrowserWindow | null; @@ -121,14 +120,14 @@ electron.ipcMain.on("export-as-pdf", async (e, { title, notePath, landscape, pag ` }); - } catch (e) { + } catch (_e) { electron.dialog.showErrorBox(t("pdf.unable-to-export-title"), t("pdf.unable-to-export-message")); return; } try { await fs.writeFile(filePath, buffer); - } catch (e) { + } catch (_e) { electron.dialog.showErrorBox(t("pdf.unable-to-export-title"), t("pdf.unable-to-save-message")); return; } diff --git a/packages/ckeditor5/src/plugins.ts b/packages/ckeditor5/src/plugins.ts index 68075cc0e..c8ca8c8ff 100644 --- a/packages/ckeditor5/src/plugins.ts +++ b/packages/ckeditor5/src/plugins.ts @@ -1,4 +1,4 @@ -import { Autoformat, AutoLink, BlockQuote, BlockToolbar, Bold, CKFinderUploadAdapter, Clipboard, Code, CodeBlock, Enter, Font, FontBackgroundColor, FontColor, GeneralHtmlSupport, Heading, HeadingButtonsUI, HorizontalLine, Image, ImageCaption, ImageInline, ImageResize, ImageStyle, ImageToolbar, ImageUpload, Alignment, Indent, IndentBlock, Italic, Link, List, ListProperties, Mention, PageBreak, Paragraph, ParagraphButtonUI, PasteFromOffice, PictureEditing, RemoveFormat, SelectAll, ShiftEnter, SpecialCharacters, SpecialCharactersEssentials, Strikethrough, Style, Subscript, Superscript, Table, TableCaption, TableCellProperties, TableColumnResize, TableProperties, TableSelection, TableToolbar, TextPartLanguage, TextTransformation, TodoList, Typing, Underline, Undo, Bookmark, Emoji, Notification, EmojiMention, EmojiPicker, FindAndReplaceEditing } from "ckeditor5"; +import { Autoformat, AutoLink, BlockQuote, BlockToolbar, Bold, CKFinderUploadAdapter, Clipboard, Code, CodeBlock, Enter, Font, FontBackgroundColor, FontColor, GeneralHtmlSupport, Heading, HeadingButtonsUI, HorizontalLine, Image, ImageCaption, ImageInline, ImageResize, ImageStyle, ImageToolbar, ImageUpload, Alignment, Indent, IndentBlock, Italic, Link, List, ListProperties, Mention, PageBreak, Paragraph, ParagraphButtonUI, PasteFromOffice, PictureEditing, RemoveFormat, SelectAll, ShiftEnter, SpecialCharacters, SpecialCharactersEssentials, Strikethrough, Style, Subscript, Superscript, Table, TableCaption, TableCellProperties, TableColumnResize, TableProperties, TableSelection, TableToolbar, TextPartLanguage, TextTransformation, TodoList, Typing, Underline, Undo, Bookmark, EmojiMention, EmojiPicker, FindAndReplaceEditing } from "ckeditor5"; import { SlashCommand, Template, FormatPainter } from "ckeditor5-premium-features"; import type { Plugin } from "ckeditor5"; import CutToNotePlugin from "./plugins/cuttonote.js";