diff --git a/src/components/FilterBar.tsx b/src/components/FilterBar.tsx index 6d852d9..2736568 100644 --- a/src/components/FilterBar.tsx +++ b/src/components/FilterBar.tsx @@ -15,7 +15,7 @@ export const FilterBar: Component = () => { const hasActiveFilters = () => { const f = store.filter; - return f.query !== "" || f.tags.length > 0 || f.priorityMin !== 1 || f.priorityMax !== 10 || f.urgencyMin !== 1 || f.urgencyMax !== 10; + return f.query !== "" || f.tags.length > 0 || f.priorityMin !== 1 || f.priorityMax !== 10 || f.urgencyMin !== 1 || f.urgencyMax !== 10 || f.editedToday; }; const allTags = () => store.tagDefinitions.map(d => d.name).sort(); @@ -44,10 +44,25 @@ export const FilterBar: Component = () => { {/* Header */}
-

- - Filters & Search -

+
+

+ + Filters +

+
+ +
- {/* Controls Grid */} + {/* Controls */}
{/* Search Input */}
diff --git a/src/components/TaskCard.tsx b/src/components/TaskCard.tsx index 5d4bed4..ed08083 100644 --- a/src/components/TaskCard.tsx +++ b/src/components/TaskCard.tsx @@ -50,6 +50,27 @@ export const TaskCard: Component<{ task: Task }> = (props) => { )}> {props.task.title} + {props.task.content && ( +
+ {(() => { + 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(//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, ' '); + })()} +
+ )}
{/* Priority */}
diff --git a/src/components/TaskEditor.tsx b/src/components/TaskEditor.tsx index cad891b..980449b 100644 --- a/src/components/TaskEditor.tsx +++ b/src/components/TaskEditor.tsx @@ -92,7 +92,7 @@ export const TaskEditor: Component = (props) => { return (
editor()?.chain().focus().run()} /> ); diff --git a/src/store/index.ts b/src/store/index.ts index 336c4a0..f707b53 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -58,6 +58,7 @@ export interface Filter { priorityMax: number; urgencyMin: number; urgencyMax: number; + editedToday: boolean; } interface TaskStore { @@ -85,7 +86,8 @@ export const [store, setStore] = createStore({ priorityMin: 1, priorityMax: 10, urgencyMin: 1, - urgencyMax: 10 + urgencyMax: 10, + editedToday: false } }); @@ -128,6 +130,13 @@ export const matchesFilter = (task: Task) => { const urgency = calculateUrgencyFromDate(task.dueDate); if (urgency < f.urgencyMin || urgency > f.urgencyMax) return false; + // Edited Today + if (f.editedToday) { + const today = new Date().toISOString().split('T')[0]; + const updated = new Date(task.updated).toISOString().split('T')[0]; + if (today !== updated) return false; + } + return true; }; @@ -732,7 +741,8 @@ export const clearFilter = () => { priorityMin: 1, priorityMax: 10, urgencyMin: 1, - urgencyMax: 10 + urgencyMax: 10, + editedToday: false }); };