Streamline save button and add calendar view with search

- Remove redundant Save button, keep only Save & New
- Add calendar view to timeline showing days with entries
- Add search functionality with highlighted matches
- Add date filtering by clicking calendar days
- Show results count when filtering

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Gemini Agent
2026-01-24 23:51:23 +00:00
parent 83ee6eefec
commit e35545b156
5 changed files with 375 additions and 49 deletions

View File

@@ -8,9 +8,27 @@ import type { EntryWithTags } from "@/lib/types";
interface EntryRowProps {
entry: EntryWithTags;
searchQuery?: string;
}
export function EntryRow({ entry }: EntryRowProps) {
function highlightText(text: string, query: string): React.ReactNode {
if (!query.trim()) return text;
const regex = new RegExp(`(${query.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")})`, "gi");
const parts = text.split(regex);
return parts.map((part, i) =>
regex.test(part) ? (
<mark key={i} className="bg-accent/30 text-foreground rounded px-0.5">
{part}
</mark>
) : (
part
)
);
}
export function EntryRow({ entry, searchQuery = "" }: EntryRowProps) {
// Truncate text to one line preview
const preview = entry.text.length > 80 ? entry.text.slice(0, 80) + "..." : entry.text;
@@ -31,10 +49,12 @@ export function EntryRow({ entry }: EntryRowProps) {
</span>
) : null}
</div>
<p className="text-foreground truncate">{preview}</p>
<p className="text-foreground truncate">
{highlightText(preview, searchQuery)}
</p>
{entry.tags.length > 0 && (
<div className="mt-2">
<TagChips tags={entry.tags} />
<TagChips tags={entry.tags} highlightQuery={searchQuery} />
</div>
)}
</div>