+ );
+}
+
+/** True if HTML has visible text. */
+export function richTextHasContent(html: string): boolean {
+ const text = html
+ .replace(/ /gi, '')
+ .replace(/ /gi, ' ')
+ .replace(/<[^>]+>/g, '')
+ .trim();
+ return text.length > 0;
+}
diff --git a/src/components/SeguimientoBoard.tsx b/src/components/SeguimientoBoard.tsx
index 39b6d38..7da893e 100644
--- a/src/components/SeguimientoBoard.tsx
+++ b/src/components/SeguimientoBoard.tsx
@@ -14,6 +14,7 @@ import {
Send,
} from 'lucide-react';
import { PageHeader } from '@/components/ui';
+import NoteRichEditor, { richTextHasContent } from '@/components/NoteRichEditor';
type Entry = {
id: string;
@@ -49,7 +50,9 @@ function typeTone(t: string) {
}
function looksLikeHtml(s: string) {
- return /<\/?(?:ul|ol|li|p|a|strong|br)\b/i.test(s);
+ return /<\/?(?:ul|ol|li|p|a|strong|b|em|i|u|br|span|font|div|h[1-6])\b/i.test(
+ s
+ );
}
function escapeHtml(s: string) {
@@ -104,7 +107,7 @@ export default function SeguimientoBoard() {
}, [data, query]);
async function saveNote() {
- if (!noteBody.trim()) return;
+ if (!richTextHasContent(noteBody)) return;
setNoteBusy(true);
setNoteMsg(null);
try {
@@ -113,7 +116,7 @@ export default function SeguimientoBoard() {
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
title: noteTitle.trim() || 'Nota de seguimiento',
- body: noteBody.trim(),
+ body: noteBody,
occurredAt: new Date().toISOString(),
}),
});
@@ -209,8 +212,8 @@ export default function SeguimientoBoard() {
Nueva nota
- Se guarda con fecha. El histórico también incluye entradas
- sincronizadas desde Superhuman Docs (docs de seguimiento).
+ Formato enriquecido (negrita, color, resaltado, listas, enlaces). El
+ histórico también incluye entradas de Superhuman / Google Doc.