From 1f6c88dcc1d912062b1c3e0bbfb4574d4aea9447 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Mon, 13 Apr 2026 15:20:12 +0300 Subject: [PATCH] chore(options/other): use options row for inputs with unit --- .../src/translations/en/translation.json | 15 +++--- .../options/components/OptionsRow.css | 4 +- .../widgets/type_widgets/options/other.tsx | 47 +++++++------------ 3 files changed, 29 insertions(+), 37 deletions(-) diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.json index a599249f40..a51f50031d 100644 --- a/apps/client/src/translations/en/translation.json +++ b/apps/client/src/translations/en/translation.json @@ -1307,8 +1307,8 @@ "attachment_erasure_timeout": { "attachment_erasure_timeout": "Attachment Erasure Timeout", "attachment_auto_deletion_description": "Attachments get automatically deleted (and erased) if they are not referenced by their note anymore after a defined time out.", - "erase_attachments_after": "Erase unused attachments after:", - "manual_erasing_description": "You can also trigger erasing manually (without considering the timeout defined above):", + "erase_attachments_after": "Erase unused attachments after", + "manual_erasing_description": "Trigger erasing manually, ignoring the timeout above.", "erase_unused_attachments_now": "Erase unused attachment notes now", "unused_attachments_erased": "Unused attachments have been erased." }, @@ -1319,22 +1319,25 @@ "note_erasure_timeout": { "note_erasure_timeout_title": "Note Erasure Timeout", "note_erasure_description": "Deleted notes (and attributes, revisions...) are at first only marked as deleted and it is possible to recover them from Recent Notes dialog. After a period of time, deleted notes are \"erased\" which means their content is not recoverable anymore. This setting allows you to configure the length of the period between deleting and erasing the note.", - "erase_notes_after": "Erase notes after:", - "manual_erasing_description": "You can also trigger erasing manually (without considering the timeout defined above):", + "erase_notes_after": "Erase notes after", + "manual_erasing_description": "Trigger erasing manually, ignoring the timeout above.", "erase_deleted_notes_now": "Erase deleted notes now", "deleted_notes_erased": "Deleted notes have been erased." }, "revisions_snapshot_interval": { "note_revisions_snapshot_interval_title": "Note Revision Snapshot Interval", "note_revisions_snapshot_description": "The Note revision snapshot interval is the time after which a new note revision will be created for the note. See wiki for more info.", - "snapshot_time_interval_label": "Note revision snapshot time interval:" + "note_revisions_snapshot_description_short": "Time after which a new note revision will be created.", + "snapshot_time_interval_label": "Snapshot interval" }, "revisions_snapshot_limit": { "note_revisions_snapshot_limit_title": "Note Revision Snapshot Limit", "note_revisions_snapshot_limit_description": "The note revision snapshot number limit refers to the maximum number of revisions that can be saved for each note. Where -1 means no limit, 0 means delete all revisions. You can set the maximum revisions for a single note through the #versioningLimit label.", - "snapshot_number_limit_label": "Note revision snapshot number limit:", + "note_revisions_snapshot_limit_description_short": "Max revisions per note. Use -1 for unlimited, 0 to disable.", + "snapshot_number_limit_label": "Maximum revisions", "snapshot_number_limit_unit": "snapshots", "erase_excess_revision_snapshots": "Erase excess revision snapshots now", + "erase_excess_revision_snapshots_description": "Delete revisions exceeding the limit for all notes.", "erase_excess_revision_snapshots_prompt": "Excess revision snapshots have been erased." }, "search": { diff --git a/apps/client/src/widgets/type_widgets/options/components/OptionsRow.css b/apps/client/src/widgets/type_widgets/options/components/OptionsRow.css index 54bc7d389f..2eed825448 100644 --- a/apps/client/src/widgets/type_widgets/options/components/OptionsRow.css +++ b/apps/client/src/widgets/type_widgets/options/components/OptionsRow.css @@ -38,7 +38,7 @@ color: var(--muted-text-color); } -.option-row:last-of-type { +.option-row:last-child { border-bottom: unset; } @@ -78,6 +78,6 @@ button.option-row-link { cursor: pointer; } -button.option-row-link:last-of-type { +button.option-row-link:last-child { border-bottom: none; } diff --git a/apps/client/src/widgets/type_widgets/options/other.tsx b/apps/client/src/widgets/type_widgets/options/other.tsx index 9b86093a07..ff835419fb 100644 --- a/apps/client/src/widgets/type_widgets/options/other.tsx +++ b/apps/client/src/widgets/type_widgets/options/other.tsx @@ -1,7 +1,5 @@ import { SANITIZER_DEFAULT_ALLOWED_TAGS } from "@triliumnext/commons"; import { useMemo } from "preact/hooks"; -import type React from "react"; -import { Trans } from "react-i18next"; import { t } from "../../../services/i18n"; import search from "../../../services/search"; @@ -15,7 +13,7 @@ import FormSelect from "../../react/FormSelect"; import FormText from "../../react/FormText"; import FormTextBox, { FormTextBoxWithUnit } from "../../react/FormTextBox"; import { useTriliumOption, useTriliumOptionBool, useTriliumOptionJson } from "../../react/hooks"; -import { OptionsRowWithToggle } from "./components/OptionsRow"; +import OptionsRow, { OptionsRowWithButton, OptionsRowWithToggle } from "./components/OptionsRow"; import OptionsSection from "./components/OptionsSection"; import TimeSelector from "./components/TimeSelector"; @@ -132,17 +130,16 @@ function TrayOptionsSettings() { function NoteErasureTimeout() { return ( - {t("note_erasure_timeout.note_erasure_description")} - + - - {t("note_erasure_timeout.manual_erasing_description")} + -