From 669650be1a3c08c2177e425980cb6a3aaa620bd4 Mon Sep 17 00:00:00 2001 From: Arjun <6592213+arkml@users.noreply.github.com> Date: Wed, 1 Apr 2026 20:58:43 +0530 Subject: [PATCH] added last update time --- .../apps/renderer/src/components/bases-view.tsx | 17 +++++++++++++++++ .../core/src/knowledge/note_creation.ts | 1 + .../packages/core/src/knowledge/note_system.ts | 8 ++++---- .../core/src/knowledge/note_tagging_agent.ts | 12 ++++++------ 4 files changed, 28 insertions(+), 10 deletions(-) diff --git a/apps/x/apps/renderer/src/components/bases-view.tsx b/apps/x/apps/renderer/src/components/bases-view.tsx index 6eab6853..80b45fb8 100644 --- a/apps/x/apps/renderer/src/components/bases-view.tsx +++ b/apps/x/apps/renderer/src/components/bases-view.tsx @@ -153,6 +153,12 @@ function getSortValue(note: NoteEntry, column: string): string | number { if (column === 'mtimeMs') return note.mtimeMs const v = note.fields[column] if (!v) return '' + // Sort date-like columns numerically + if (column === 'last_update' || column === 'first_met') { + const s = Array.isArray(v) ? v[0] ?? '' : v + const ms = Date.parse(s) + return isNaN(ms) ? 0 : ms + } return Array.isArray(v) ? v[0] ?? '' : v } @@ -776,6 +782,17 @@ function CellRenderer({ return {formatDate(note.mtimeMs)} } + // Date-like frontmatter columns — render like Last Modified + if (column === 'last_update' || column === 'first_met') { + const value = note.fields[column] + if (!value || Array.isArray(value)) return null + const ms = Date.parse(value) + if (!isNaN(ms)) { + return {formatDate(ms)} + } + return {value} + } + // Frontmatter column const value = note.fields[column] if (!value) return null diff --git a/apps/x/packages/core/src/knowledge/note_creation.ts b/apps/x/packages/core/src/knowledge/note_creation.ts index c9f2d91a..61a27c54 100644 --- a/apps/x/packages/core/src/knowledge/note_creation.ts +++ b/apps/x/packages/core/src/knowledge/note_creation.ts @@ -925,6 +925,7 @@ If you discovered new name variants during resolution, add them to Aliases field - Note state changes with \`[Field → value]\` in activity - Escape quotes properly in shell commands - Write only one file per response (no multi-file write batches) +- **Always set \`Last update\`** in the Info section to the YYYY-MM-DD date of the source email or meeting. When updating an existing note, update this field to the new source event's date. --- diff --git a/apps/x/packages/core/src/knowledge/note_system.ts b/apps/x/packages/core/src/knowledge/note_system.ts index 39cf2695..d167e97c 100644 --- a/apps/x/packages/core/src/knowledge/note_system.ts +++ b/apps/x/packages/core/src/knowledge/note_system.ts @@ -23,7 +23,7 @@ const DEFAULT_NOTE_TYPE_DEFINITIONS: NoteTypeDefinition[] = [ **Email:** {email or leave blank} **Aliases:** {comma-separated: first name, nicknames, email} **First met:** {YYYY-MM-DD} -**Last seen:** {YYYY-MM-DD} +**Last update:** {YYYY-MM-DD} ## Summary {2-3 sentences: Who they are, why you know them, what you're working on together.} @@ -56,7 +56,7 @@ const DEFAULT_NOTE_TYPE_DEFINITIONS: NoteTypeDefinition[] = [ **Domain:** {primary email domain} **Aliases:** {comma-separated: short names, abbreviations} **First met:** {YYYY-MM-DD} -**Last seen:** {YYYY-MM-DD} +**Last update:** {YYYY-MM-DD} ## Summary {2-3 sentences: What this org is, what your relationship is.} @@ -90,7 +90,7 @@ const DEFAULT_NOTE_TYPE_DEFINITIONS: NoteTypeDefinition[] = [ **Type:** {deal|product|initiative|hiring|other} **Status:** {active|planning|on hold|completed|cancelled} **Started:** {YYYY-MM-DD or leave blank} -**Last activity:** {YYYY-MM-DD} +**Last update:** {YYYY-MM-DD} ## Summary {2-3 sentences: What this project is, goal, current state.} @@ -131,7 +131,7 @@ const DEFAULT_NOTE_TYPE_DEFINITIONS: NoteTypeDefinition[] = [ **Keywords:** {comma-separated} **Aliases:** {other ways this topic is referenced} **First mentioned:** {YYYY-MM-DD} -**Last mentioned:** {YYYY-MM-DD} +**Last update:** {YYYY-MM-DD} ## Related - [[People/{Person}]] — {relationship} diff --git a/apps/x/packages/core/src/knowledge/note_tagging_agent.ts b/apps/x/packages/core/src/knowledge/note_tagging_agent.ts index 8238e40a..0dc581f1 100644 --- a/apps/x/packages/core/src/knowledge/note_tagging_agent.ts +++ b/apps/x/packages/core/src/knowledge/note_tagging_agent.ts @@ -47,7 +47,7 @@ role: VP Engineering organization: Acme Corp email: sarah@acme.com first_met: "2024-06-15" -last_seen: "2025-01-20" +last_update: "2025-01-20" --- \`\`\` @@ -80,7 +80,7 @@ Use these exact keys for each tag category: Extract all \`**Key:** value\` fields from the \`## Info\` (or \`## About\`) section into YAML frontmatter keys: -1. **Convert keys to snake_case**: e.g. \`**First met:**\` → \`first_met\`, \`**Last activity:**\` → \`last_activity\`, \`**Last seen:**\` → \`last_seen\`. +1. **Convert keys to snake_case**: e.g. \`**First met:**\` → \`first_met\`, \`**Last update:**\` → \`last_update\`. 2. **Strip wiki-link syntax**: \`[[Organizations/Acme Corp]]\` → \`Acme Corp\`. Extract just the display name (last path segment). 3. **Skip blank/placeholder values**: If a field says "leave blank", is empty, or contains only template placeholders like \`{role}\`, omit it from the frontmatter. 4. **Quote dates**: Wrap date values in quotes, e.g. \`first_met: "2024-06-15"\`. @@ -93,10 +93,10 @@ Extract all \`**Key:** value\` fields from the \`## Info\` (or \`## About\`) sec **Per note type, extract these fields:** -- **People**: role, organization, email, aliases, first_met, last_seen -- **Organizations**: type, industry, relationship, domain, aliases, first_met, last_seen -- **Projects**: type, status, started, last_activity -- **Topics** (from \`## About\`): keywords, aliases, first_mentioned, last_mentioned +- **People**: role, organization, email, aliases, first_met, last_update +- **Organizations**: type, industry, relationship, domain, aliases, first_met, last_update +- **Projects**: type, status, started, last_update +- **Topics** (from \`## About\`): keywords, aliases, first_mentioned, last_update - **Meetings**: Extract from the note content and file path: - \`date\`: meeting date (from the file path \`Meetings/{source}/YYYY/MM/DD/\` or from \`created_at\`/\`Date:\` in content) - \`source\`: \`granola\` or \`fireflies\` (from the file path)