From f4cadc0d6516771790dcb843cadc6c866dae364e Mon Sep 17 00:00:00 2001 From: Owen Gretzinger Date: Mon, 14 Jul 2025 17:59:15 -0400 Subject: [PATCH] feat: add coffee chat template and ensure new defaults are loaded (#10) --- .../Managers/LocalStorageManager.swift | 19 ++++++++++--------- meetingnotes/Models/NoteTemplate.swift | 16 ++++++++++++++++ solo-pr.sh | 2 +- 3 files changed, 27 insertions(+), 10 deletions(-) diff --git a/meetingnotes/Managers/LocalStorageManager.swift b/meetingnotes/Managers/LocalStorageManager.swift index 1b3be6c..4e5990d 100644 --- a/meetingnotes/Managers/LocalStorageManager.swift +++ b/meetingnotes/Managers/LocalStorageManager.swift @@ -184,15 +184,16 @@ class LocalStorageManager { print("❌ Failed to read templates directory: \(error)") } - // If no templates exist (user may have deleted the Templates folder), - // automatically regenerate the built-in default templates. We keep - // writing the flag so previous versions that still rely on it remain - // functional, but we no longer gate the regeneration behind it. - if templates.isEmpty { - let defaultTemplates = NoteTemplate.defaultTemplates() - for template in defaultTemplates { - _ = saveTemplate(template) - templates.append(template) + // Always ensure all default templates are available + let defaultTemplates = NoteTemplate.defaultTemplates() + let existingTitles = Set(templates.map { $0.title }) + + // Add any missing default templates + for defaultTemplate in defaultTemplates { + if !existingTitles.contains(defaultTemplate.title) { + _ = saveTemplate(defaultTemplate) + templates.append(defaultTemplate) + print("✅ Added missing default template: \(defaultTemplate.title)") } } diff --git a/meetingnotes/Models/NoteTemplate.swift b/meetingnotes/Models/NoteTemplate.swift index 56a049e..7db0ddb 100644 --- a/meetingnotes/Models/NoteTemplate.swift +++ b/meetingnotes/Models/NoteTemplate.swift @@ -136,6 +136,22 @@ struct NoteTemplate: Codable, Identifiable, Hashable { TemplateSection(title: "Action Items and Accountability for the Week Ahead", description: "Record the action items assigned for the upcoming week, including who is responsible for each task and any deadlines or accountability measures that were agreed upon.") ], isDefault: true + ), + + // Coffee Chat / Intro + NoteTemplate( + id: UUID(), + title: "Coffee Chat / Intro", + context: "I had a casual meeting or introductory conversation with someone new. This could be a coffee chat, networking meeting, or informal introduction. The goal is to capture key information about the person and our conversation for future reference and potential collaboration.", + sections: [ + TemplateSection(title: "About them", description: "Basic background information about the person - their role, company, experience, and anything notable about their professional journey."), + TemplateSection(title: "Common ground", description: "Shared interests, connections, experiences, or topics we discussed that created a connection. This helps remember what we bonded over."), + TemplateSection(title: "Their current focus", description: "What they're currently working on, excited about, or focused on in their professional or personal life."), + TemplateSection(title: "Interesting insights", description: "Any interesting perspectives, stories, or insights they shared during our conversation that stood out."), + TemplateSection(title: "Potential opportunities", description: "Ways we might be able to help each other, collaborate, or connect in the future. Include any specific ideas or possibilities that came up."), + TemplateSection(title: "Follow-up", description: "Any agreed-upon next steps, promises to connect them with others, resources to share, or ways to stay in touch.") + ], + isDefault: true ) ] } diff --git a/solo-pr.sh b/solo-pr.sh index 7548645..00c2f39 100755 --- a/solo-pr.sh +++ b/solo-pr.sh @@ -35,7 +35,7 @@ git commit -m "$COMMIT_MSG" git push -u origin "$BRANCH_NAME" # Step 4: Create PR -gh pr create --title "$COMMIT_MSG" --body "$COMMIT_MSG" --base main --head "$BRANCH_NAME" +gh pr create --title "$COMMIT_MSG" --base main --head "$BRANCH_NAME" # Step 5: Merge PR gh pr merge "$BRANCH_NAME" --squash --delete-branch