Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
feat(client): mark each highlight format with the icon it is written by
Elian Doran8305dd228e42
diff --git a/apps/client/src/widgets/sidebar/HighlightsList.tsx b/apps/client/src/widgets/sidebar/HighlightsList.tsxindex 0f6108d588..4566eb2cca 100644--- a/apps/client/src/widgets/sidebar/HighlightsList.tsx+++ b/apps/client/src/widgets/sidebar/HighlightsList.tsx@@ -112,9 +112,10 @@ function HighlightsListMenu({ currentValue, onChange }: {// is rendered into the body to stand clear of it — as the card's help popup is.portalToBody>- {HIGHLIGHT_FORMATS.map(({ val, titleKey }) => (+ {HIGHLIGHT_FORMATS.map(({ val, titleKey, icon }) => (<FormListToggleableItemkey={val}+ icon={icon}title={t(titleKey)}currentValue={currentValue.includes(val)}onChange={(checked) => onChange(checkeddiff --git a/apps/client/src/widgets/type_widgets/options/highlights_list_options.tsx b/apps/client/src/widgets/type_widgets/options/highlights_list_options.tsxindex d8bc0aab04..e0111e6100 100644--- a/apps/client/src/widgets/type_widgets/options/highlights_list_options.tsx+++ b/apps/client/src/widgets/type_widgets/options/highlights_list_options.tsx@@ -27,17 +27,19 @@ export function HighlightsListOptions() {/*** The formats that can each be counted as a highlight or left out, in the order they are offered.- * Shared with the sidebar's highlights list, which offers the same choice from its own gear menu.+ * Shared with the sidebar's highlights list, which offers the same choice from its own gear menu —+ * where each row carries the icon the format is marked with in the formatting toolbar, so the choice+ * is read at a glance rather than word by word.** The titles are held as keys rather than resolved here: a module-level `t()` would run before the* translations have loaded.*/export const HIGHLIGHT_FORMATS = [- { val: "bold", titleKey: "highlights_list.bold" },- { val: "italic", titleKey: "highlights_list.italic" },- { val: "underline", titleKey: "highlights_list.underline" },- { val: "color", titleKey: "highlights_list.color" },- { val: "bgColor", titleKey: "highlights_list.bg_color" }+ { val: "bold", titleKey: "highlights_list.bold", icon: "bx bx-bold" },+ { val: "italic", titleKey: "highlights_list.italic", icon: "bx bx-italic" },+ { val: "underline", titleKey: "highlights_list.underline", icon: "bx bx-underline" },+ { val: "color", titleKey: "highlights_list.color", icon: "bx bx-font-color" },+ { val: "bgColor", titleKey: "highlights_list.bg_color", icon: "bx bx-highlight" }] as const;/** One of the formats the list can be told to count; the option holds a set of these. */