From 97730cd9f2608dfbe476c28afd2dcdfe48584f58 Mon Sep 17 00:00:00 2001 From: Till JS Date: Thu, 2 Apr 2026 13:19:01 +0200 Subject: [PATCH] feat(manacore/web): port full contact creation modal from standalone app Expand the minimal 6-field contact form to include all sections from the old contacts app: name, contact (email/mobile/phone), work (company/position/website), address (street/city/postal/country), birthday, notes, and social media (collapsible). Add mobile, street, city, postalCode, country, and social fields to the data model. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../contacts/stores/contacts.svelte.ts | 12 +- .../web/src/lib/modules/contacts/types.ts | 10 + .../src/routes/(app)/contacts/+page.svelte | 275 ++++++++++++++---- 3 files changed, 236 insertions(+), 61 deletions(-) diff --git a/apps/manacore/apps/web/src/lib/modules/contacts/stores/contacts.svelte.ts b/apps/manacore/apps/web/src/lib/modules/contacts/stores/contacts.svelte.ts index 270d37901..8b1b1cfed 100644 --- a/apps/manacore/apps/web/src/lib/modules/contacts/stores/contacts.svelte.ts +++ b/apps/manacore/apps/web/src/lib/modules/contacts/stores/contacts.svelte.ts @@ -10,18 +10,28 @@ import { toContact } from '../queries'; import type { LocalContact, Contact } from '../types'; export const contactsStore = { - async createContact(data: Partial) { + async createContact(data: Partial & Record) { const newLocal: LocalContact = { id: crypto.randomUUID(), firstName: data.firstName ?? undefined, lastName: data.lastName ?? undefined, email: data.email ?? undefined, phone: data.phone ?? undefined, + mobile: (data.mobile as string) ?? undefined, company: data.company ?? undefined, jobTitle: data.jobTitle ?? undefined, + street: (data.street as string) ?? undefined, + city: (data.city as string) ?? undefined, + postalCode: (data.postalCode as string) ?? undefined, + country: (data.country as string) ?? undefined, notes: data.notes ?? undefined, photoUrl: data.photoUrl ?? undefined, birthday: data.birthday ?? undefined, + linkedin: (data.linkedin as string) ?? undefined, + twitter: (data.twitter as string) ?? undefined, + instagram: (data.instagram as string) ?? undefined, + github: (data.github as string) ?? undefined, + website: (data.website as string) ?? undefined, tags: data.tags?.map((t) => t.name) ?? [], isFavorite: false, isArchived: false, diff --git a/apps/manacore/apps/web/src/lib/modules/contacts/types.ts b/apps/manacore/apps/web/src/lib/modules/contacts/types.ts index b882fcc0a..249db579b 100644 --- a/apps/manacore/apps/web/src/lib/modules/contacts/types.ts +++ b/apps/manacore/apps/web/src/lib/modules/contacts/types.ts @@ -9,12 +9,22 @@ export interface LocalContact extends BaseRecord { lastName?: string; email?: string; phone?: string; + mobile?: string; company?: string; jobTitle?: string; + street?: string; + city?: string; + postalCode?: string; + country?: string; address?: string; notes?: string; photoUrl?: string; birthday?: string; + linkedin?: string; + twitter?: string; + instagram?: string; + github?: string; + website?: string; tags?: string[]; tagIds?: string[]; isFavorite?: boolean; diff --git a/apps/manacore/apps/web/src/routes/(app)/contacts/+page.svelte b/apps/manacore/apps/web/src/routes/(app)/contacts/+page.svelte index b448bc6bc..bb54cf88d 100644 --- a/apps/manacore/apps/web/src/routes/(app)/contacts/+page.svelte +++ b/apps/manacore/apps/web/src/routes/(app)/contacts/+page.svelte @@ -27,6 +27,11 @@ PencilSimple, Funnel, Users, + User, + Envelope, + Briefcase, + MapPin, + X, } from '@manacore/shared-icons'; // Get contacts from layout context @@ -317,78 +322,184 @@ {#if contactModalStore.isOpen} {@const isEditing = !!contactModalStore.editContactId} +