Added 'edited today' filter and task description previews

This commit is contained in:
2026-02-04 13:34:16 -06:00
parent a717095bd1
commit 6b8be90295
4 changed files with 56 additions and 10 deletions
+21
View File
@@ -50,6 +50,27 @@ export const TaskCard: Component<{ task: Task }> = (props) => {
)}>
{props.task.title}
</h3>
{props.task.content && (
<div class="text-[11px] sm:text-xs text-muted-foreground/60 line-clamp-1 mt-1 leading-tight whitespace-pre">
{(() => {
let html = props.task.content || "";
// Replace block tags with newlines first to preserve structure
html = html.replace(/<\/p>/gi, '\n')
.replace(/<\/div>/gi, '\n')
.replace(/<br\s*\/?>/gi, '\n')
.replace(/<\/li>/gi, '\n')
.replace(/<\/h[1-6]>/gi, '\n');
const tmp = document.createElement("DIV");
tmp.innerHTML = html;
const text = tmp.textContent || tmp.innerText || "";
// Replace newlines (and surrounding whitespace) with a wide gap
// Using 5 non-breaking spaces worth of visual space
return text.trim().replace(/\s*[\r\n]+\s*/g, ' ');
})()}
</div>
)}
<div class="flex flex-wrap items-center gap-x-3 gap-y-1.5 mt-1 min-w-0">
{/* Priority */}
<div class="flex items-center gap-1.5 shrink-0">