From f613335f971dac442516df72d280593e5fdc8baa Mon Sep 17 00:00:00 2001 From: lucaronin Date: Tue, 17 Feb 2026 17:14:29 +0100 Subject: [PATCH] feat: add snippet field to frontend types and mock data Add snippet: string to VaultEntry TypeScript interface to match the Rust backend. Update mock data with snippets for all entries. Add .laputa-cache.json to .gitignore. Co-Authored-By: Claude Opus 4.6 --- .gitignore | 3 +++ src/components/NoteList.test.tsx | 5 +++++ src/mock-tauri.ts | 12 ++++++++++++ src/types.ts | 1 + 4 files changed, 21 insertions(+) diff --git a/.gitignore b/.gitignore index 3313b681..fffa5411 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,6 @@ dist-ssr # Playwright /test-results/ /playwright-report/ + +# Laputa vault cache +.laputa-cache.json diff --git a/src/components/NoteList.test.tsx b/src/components/NoteList.test.tsx index e4493a7d..71599223 100644 --- a/src/components/NoteList.test.tsx +++ b/src/components/NoteList.test.tsx @@ -21,6 +21,7 @@ const mockEntries: VaultEntry[] = [ modifiedAt: 1700000000, createdAt: null, fileSize: 1024, + snippet: 'Build a personal knowledge management app.', }, { path: '/Users/luca/Laputa/note/facebook-ads-strategy.md', @@ -36,6 +37,7 @@ const mockEntries: VaultEntry[] = [ modifiedAt: 1700000000, createdAt: null, fileSize: 847, + snippet: 'Lookalike audiences convert 3x better.', }, { path: '/Users/luca/Laputa/person/matteo-cellini.md', @@ -51,6 +53,7 @@ const mockEntries: VaultEntry[] = [ modifiedAt: 1700000000, createdAt: null, fileSize: 320, + snippet: 'Sponsorship manager.', }, { path: '/Users/luca/Laputa/event/2026-02-14-kickoff.md', @@ -66,6 +69,7 @@ const mockEntries: VaultEntry[] = [ modifiedAt: 1700000000, createdAt: null, fileSize: 512, + snippet: 'Project kickoff meeting notes.', }, { path: '/Users/luca/Laputa/topic/software-development.md', @@ -81,6 +85,7 @@ const mockEntries: VaultEntry[] = [ modifiedAt: 1700000000, createdAt: null, fileSize: 256, + snippet: 'Frontend, backend, and systems programming.', }, ] diff --git a/src/mock-tauri.ts b/src/mock-tauri.ts index 12a97e57..82b89a62 100644 --- a/src/mock-tauri.ts +++ b/src/mock-tauri.ts @@ -409,6 +409,7 @@ const MOCK_ENTRIES: VaultEntry[] = [ modifiedAt: Date.now() / 1000, createdAt: null, fileSize: 2048, + snippet: 'This paragraph has bold text, italic text, bold italic, strikethrough, and inline code. Here\'s a regular link and a wiki-link to Matteo Cellini.', }, { path: '/Users/luca/Laputa/responsibility/grow-newsletter.md', @@ -424,6 +425,7 @@ const MOCK_ENTRIES: VaultEntry[] = [ modifiedAt: Date.now() / 1000 - 3600, createdAt: null, fileSize: 1024, + snippet: 'Build a sustainable audience through high-quality weekly essays on engineering leadership, AI, and personal systems.', }, { path: '/Users/luca/Laputa/responsibility/manage-sponsorships.md', @@ -439,6 +441,7 @@ const MOCK_ENTRIES: VaultEntry[] = [ modifiedAt: Date.now() / 1000 - 7200, createdAt: null, fileSize: 890, + snippet: 'Revenue stream from newsletter sponsorships. Matteo Cellini handles day-to-day operations.', }, { path: '/Users/luca/Laputa/procedure/write-weekly-essays.md', @@ -454,6 +457,7 @@ const MOCK_ENTRIES: VaultEntry[] = [ modifiedAt: Date.now() / 1000 - 86400, createdAt: null, fileSize: 512, + snippet: 'Monday: Pick topic, outline Tuesday: First draft Wednesday: Edit and polish Thursday: Schedule for Tuesday send', }, { path: '/Users/luca/Laputa/procedure/run-sponsorships.md', @@ -469,6 +473,7 @@ const MOCK_ENTRIES: VaultEntry[] = [ modifiedAt: Date.now() / 1000 - 86400 * 2, createdAt: null, fileSize: 640, + snippet: 'Review pipeline in CRM Follow up with pending proposals Schedule confirmed sponsors Send performance reports to completed sponsors', }, { path: '/Users/luca/Laputa/experiment/stock-screener.md', @@ -484,6 +489,7 @@ const MOCK_ENTRIES: VaultEntry[] = [ modifiedAt: Date.now() / 1000 - 86400, createdAt: null, fileSize: 3200, + snippet: 'Stocks that wick below the 200-day EMA and close above it show a statistically significant bounce in the following 5-10 days.', }, { path: '/Users/luca/Laputa/note/facebook-ads-strategy.md', @@ -499,6 +505,7 @@ const MOCK_ENTRIES: VaultEntry[] = [ modifiedAt: Date.now() / 1000 - 3600 * 5, createdAt: null, fileSize: 847, + snippet: 'Lookalike audiences from newsletter subscribers convert 3x better than interest-based targeting Video ads outperform static images by 40% on engagement', }, { path: '/Users/luca/Laputa/note/budget-allocation.md', @@ -514,6 +521,7 @@ const MOCK_ENTRIES: VaultEntry[] = [ modifiedAt: Date.now() / 1000 - 86400, createdAt: null, fileSize: 560, + snippet: 'Under budget on ads due to improved targeting efficiency Consider reallocating savings to content production', }, { path: '/Users/luca/Laputa/person/matteo-cellini.md', @@ -529,6 +537,7 @@ const MOCK_ENTRIES: VaultEntry[] = [ modifiedAt: Date.now() / 1000 - 86400 * 7, createdAt: null, fileSize: 320, + snippet: 'Sponsorship manager — handles all sponsor relationships, proposals, and reporting.', }, { path: '/Users/luca/Laputa/event/2026-02-14-laputa-app-kickoff.md', @@ -544,6 +553,7 @@ const MOCK_ENTRIES: VaultEntry[] = [ modifiedAt: Date.now() / 1000 - 3600 * 2, createdAt: null, fileSize: 1200, + snippet: 'Agreed on four-panel layout inspired by Bear Notes CodeMirror 6 for the editor — live preview is critical MVP by end of Q1.', }, { path: '/Users/luca/Laputa/topic/software-development.md', @@ -559,6 +569,7 @@ const MOCK_ENTRIES: VaultEntry[] = [ modifiedAt: Date.now() / 1000 - 86400 * 30, createdAt: null, fileSize: 256, + snippet: 'A broad topic covering everything from frontend to systems programming.', }, { path: '/Users/luca/Laputa/topic/trading.md', @@ -574,6 +585,7 @@ const MOCK_ENTRIES: VaultEntry[] = [ modifiedAt: Date.now() / 1000 - 86400 * 14, createdAt: null, fileSize: 180, + snippet: 'Technical analysis (EMA, RSI, volume patterns) Algorithmic screening and alerts Risk management and position sizing', }, ] diff --git a/src/types.ts b/src/types.ts index 8d47ad71..4b2f68b8 100644 --- a/src/types.ts +++ b/src/types.ts @@ -12,6 +12,7 @@ export interface VaultEntry { modifiedAt: number | null createdAt: number | null fileSize: number + snippet: string } export interface GitCommit {