Skip to content

Build your personal knowledge base with Trilium Notes

client/text editor/custom task states: tweak the editor tooltip

Adorian Doranad30cf81886b
diff --git a/apps/client/src/stylesheets/style.css b/apps/client/src/stylesheets/style.css
index 7987852099..2e80f7a10c 100644
--- a/apps/client/src/stylesheets/style.css
+++ b/apps/client/src/stylesheets/style.css
@@ -2936,6 +2936,14 @@ iframe.print-iframe {
transform: translateY(-0.05em);
}
+/* Status line block above the checkbox tooltip's body. The 8px bottom margin
+ separates it from the "Right click…" hint when the line is present; when
+ the state is an anchor (unchecked/checked) the line is omitted entirely,
+ so no spacing is added. */
+.tn-task-tooltip-state {
+ margin-bottom: 8px;
+}
+
/* Prevent variables from bleeding into nested items */
.ck-content .todo-list .todo-list {
--task-state-glyph: initial;
diff --git a/packages/ckeditor5/src/plugins/todo_list_multistate/todo_list_multistate_editing.ts b/packages/ckeditor5/src/plugins/todo_list_multistate/todo_list_multistate_editing.ts
index 9500591e55..4d26a1e596 100644
--- a/packages/ckeditor5/src/plugins/todo_list_multistate/todo_list_multistate_editing.ts
+++ b/packages/ckeditor5/src/plugins/todo_list_multistate/todo_list_multistate_editing.ts
@@ -253,7 +253,9 @@ function buildTooltipTitle(
translate("text-editor.checkbox-tooltip-state-unknown-suffix")
);
const label = translate("text-editor.checkbox-tooltip-state-label");
- return `${label} ${suffix}<br><br>${body}`;
+ // The status line is a block-level <div> so it forces a line break before
+ // the body and the CSS `margin-bottom: 8px` cleanly separates the two.
+ return `<div class="tn-task-tooltip-state">${label} ${suffix}</div>${body}`;
}
/**