feat(contacts): add duplicate detection, photo upload, and batch operations

- Add duplicate detection service with merge functionality
  - Find duplicates by email, phone, or name
  - Merge contacts with field selection UI
  - Dismiss false positives

- Add contact photo upload
  - Upload photos to MinIO/S3 storage
  - Display photos in all contact views
  - Delete photo functionality

- Add batch operations for multiple contacts
  - Selection mode with checkboxes in all views
  - Batch delete, archive, and favorite actions
  - Fixed-height action bar to prevent layout shifts

- Add multiple contact view modes
  - List view, Grid view, Alphabet view
  - View mode toggle component
  - Sort by first/last name

- Increase avatar sizes across all views

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Till-JS 2025-12-09 17:45:29 +01:00
parent 23c2d85f6e
commit dd40bb40e7
41 changed files with 5174 additions and 619 deletions

View file

@ -35,91 +35,112 @@
}: Props = $props();
const isClickable = $derived(!!href || !!onclick);
// Tailwind classes
const baseRowClasses =
'flex items-center justify-between gap-4 px-5 py-4 bg-transparent w-full text-left no-underline transition-all duration-200';
const borderClasses = 'border-b border-black/[0.08] dark:border-white/10 last:border-b-0';
const clickableClasses = 'cursor-pointer hover:bg-black/[0.04] dark:hover:bg-white/[0.06]';
const disabledClasses = 'opacity-50 cursor-not-allowed pointer-events-none';
const iconClasses =
'flex items-center justify-center flex-shrink-0 w-9 h-9 rounded-[0.625rem] bg-black/[0.04] dark:bg-white/[0.08] text-primary';
function getRowClasses(isBordered: boolean, isClick: boolean, isDisabled: boolean): string {
let classes = baseRowClasses;
if (isBordered) classes += ' ' + borderClasses;
if (isClick) classes += ' ' + clickableClasses;
if (isDisabled) classes += ' ' + disabledClasses;
return classes;
}
</script>
{#if href}
<a
{href}
class="settings-row {border ? 'settings-row--border' : ''} settings-row--clickable {disabled
? 'settings-row--disabled'
: ''} {className}"
>
<div class="settings-row__content">
<a {href} class="{getRowClasses(border, true, disabled)} {className}">
<div class="flex items-center gap-3 flex-1 min-w-0">
{#if icon}
<span class="settings-row__icon">
<span class={iconClasses}>
{@render icon()}
</span>
{/if}
<div class="settings-row__text">
<span class="settings-row__label">{label}</span>
<div class="flex flex-col gap-0.5 min-w-0">
<span class="text-[0.9375rem] font-medium text-gray-700 dark:text-gray-100">{label}</span>
{#if description}
<span class="settings-row__description">{description}</span>
<span class="text-[0.8125rem] text-gray-500 dark:text-gray-400 leading-snug"
>{description}</span
>
{/if}
</div>
</div>
<div class="settings-row__control">
<div class="flex items-center flex-shrink-0">
{#if children}
{@render children()}
{:else}
<svg class="settings-row__chevron" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<svg
class="w-5 h-5 text-gray-400 dark:text-gray-500"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
>
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" />
</svg>
{/if}
</div>
</a>
{:else if onclick}
<button
type="button"
{onclick}
class="settings-row {border ? 'settings-row--border' : ''} settings-row--clickable {disabled
? 'settings-row--disabled'
: ''} {className}"
{disabled}
>
<div class="settings-row__content">
<button type="button" {onclick} class="{getRowClasses(border, true, disabled)} {className}" {disabled}>
<div class="flex items-center gap-3 flex-1 min-w-0">
{#if icon}
<span class="settings-row__icon">
<span class={iconClasses}>
{@render icon()}
</span>
{/if}
<div class="settings-row__text">
<span class="settings-row__label">{label}</span>
<div class="flex flex-col gap-0.5 min-w-0">
<span class="text-[0.9375rem] font-medium text-gray-700 dark:text-gray-100">{label}</span>
{#if description}
<span class="settings-row__description">{description}</span>
<span class="text-[0.8125rem] text-gray-500 dark:text-gray-400 leading-snug"
>{description}</span
>
{/if}
</div>
</div>
<div class="settings-row__control">
<div class="flex items-center flex-shrink-0">
{#if children}
{@render children()}
{:else}
<svg class="settings-row__chevron" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<svg
class="w-5 h-5 text-gray-400 dark:text-gray-500"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
>
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" />
</svg>
{/if}
</div>
</button>
{:else}
<div
class="settings-row {border ? 'settings-row--border' : ''} {disabled
? 'settings-row--disabled'
: ''} {className}"
>
<div class="settings-row__content">
<div class="{getRowClasses(border, false, disabled)} {className}">
<div class="flex items-center gap-3 flex-1 min-w-0">
{#if icon}
<span class="settings-row__icon">
<span class={iconClasses}>
{@render icon()}
</span>
{/if}
<div class="settings-row__text">
<span class="settings-row__label">{label}</span>
<div class="flex flex-col gap-0.5 min-w-0">
<span class="text-[0.9375rem] font-medium text-gray-700 dark:text-gray-100">{label}</span>
{#if description}
<span class="settings-row__description">{description}</span>
<span class="text-[0.8125rem] text-gray-500 dark:text-gray-400 leading-snug"
>{description}</span
>
{/if}
</div>
</div>
{#if children}
<div class="settings-row__control">
<div class="flex items-center flex-shrink-0">
{@render children()}
</div>
{/if}
@ -127,120 +148,9 @@
{/if}
<style>
.settings-row {
display: flex;
align-items: center;
justify-content: space-between;
gap: 1rem;
padding: 1rem 1.25rem;
background: transparent;
border: none;
width: 100%;
text-align: left;
text-decoration: none;
color: inherit;
transition: all 0.2s ease;
}
.settings-row--border {
border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
:global(.dark) .settings-row--border {
border-bottom-color: rgba(255, 255, 255, 0.1);
}
.settings-row--border:last-child {
border-bottom: none;
}
.settings-row--clickable {
cursor: pointer;
}
.settings-row--clickable:hover {
background: rgba(0, 0, 0, 0.04);
}
:global(.dark) .settings-row--clickable:hover {
background: rgba(255, 255, 255, 0.06);
}
.settings-row--disabled {
opacity: 0.5;
cursor: not-allowed;
pointer-events: none;
}
.settings-row__content {
display: flex;
align-items: center;
gap: 0.75rem;
flex: 1;
min-width: 0;
}
.settings-row__icon {
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
width: 2.25rem;
height: 2.25rem;
border-radius: 0.625rem;
background: rgba(0, 0, 0, 0.04);
color: hsl(var(--primary));
}
:global(.dark) .settings-row__icon {
background: rgba(255, 255, 255, 0.08);
}
.settings-row__icon :global(svg) {
/* Keep SVG sizing for icons passed via snippet */
:global(svg) {
width: 1.125rem;
height: 1.125rem;
}
.settings-row__text {
display: flex;
flex-direction: column;
gap: 0.125rem;
min-width: 0;
}
.settings-row__label {
font-size: 0.9375rem;
font-weight: 500;
color: #374151;
}
:global(.dark) .settings-row__label {
color: #f3f4f6;
}
.settings-row__description {
font-size: 0.8125rem;
color: #6b7280;
line-height: 1.4;
}
:global(.dark) .settings-row__description {
color: #9ca3af;
}
.settings-row__control {
display: flex;
align-items: center;
flex-shrink: 0;
}
.settings-row__chevron {
width: 1.25rem;
height: 1.25rem;
color: #9ca3af;
}
:global(.dark) .settings-row__chevron {
color: #6b7280;
}
</style>