diff --git a/docs/api.md b/docs/api.md index bfac278..5a4c0c0 100644 --- a/docs/api.md +++ b/docs/api.md @@ -83,7 +83,7 @@ Triggers the download pipeline via the active provider. Requires a download prov ### POST /api/clips/share Authenticated via `?token=` query parameter (iOS Shortcut token). Allows sharing clips without a session cookie. ``` -Request: { "url": "https://tiktok.com/...", "phones": ["+1234567890"] } +Request: { "url": "https://tiktok.com/...", "phone": "+1234567890" } Response: { "ok": true, "clipId": "...", "status": "downloading" } (201 Created) ``` diff --git a/docs/architecture.md b/docs/architecture.md index 0b682f8..38fb380 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -90,12 +90,15 @@ scrolly/ │ │ │ ├── ProgressBar.svelte │ │ │ ├── InlineError.svelte │ │ │ ├── FilterBar.svelte # Feed filter tabs +│ │ │ ├── ShortcutGuideSheet.svelte # iOS Shortcut setup guide │ │ │ └── settings/ │ │ │ ├── GroupNameEdit.svelte │ │ │ ├── InviteLink.svelte │ │ │ ├── MemberList.svelte │ │ │ ├── RetentionPicker.svelte -│ │ │ └── ClipsManager.svelte +│ │ │ ├── ClipsManager.svelte +│ │ │ ├── GettingStartedChecklist.svelte +│ │ │ └── SetupDoneState.svelte │ │ ├── stores/ │ │ │ ├── notifications.ts # Notification polling + unread count │ │ │ ├── mute.ts # Global mute state diff --git a/docs/notifications.md b/docs/notifications.md index 4832e8b..71ab9be 100644 --- a/docs/notifications.md +++ b/docs/notifications.md @@ -35,6 +35,22 @@ Real-time push notifications via the Web Push Protocol (VAPID). **Timing rationale:** New clip notifications are deferred until the download pipeline finishes successfully. This avoids notifying users about clips that may fail to download. If a download fails, no notification is sent. Reactions and comments notify immediately since the action is already complete. +### Push Notification Payload + +All push notifications include these fields: + +| Field | Type | Description | +|-------|------|-------------| +| title | string | Notification title | +| body | string | Notification body text | +| icon | string? | Icon URL | +| url | string? | Deep link target (defaults to '/') | +| tag | string? | Notification grouping tag | +| image | string? | Image URL for rich notifications | +| badgeCount | number? | Unwatched clip count for app badge | + +The `badgeCount` is computed server-side per user/group and used by the service worker to call `navigator.setAppBadge()` on supported platforms. + ### Customization Users can toggle each notification type on/off in Settings. Preferences are stored in the `notification_preferences` table (created automatically on onboarding). diff --git a/src/lib/utils.ts b/src/lib/utils.ts index 4f6f1ec..a03a972 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -1,3 +1,4 @@ +/** Extract the filename from a file path. */ export function basename(filepath: string): string { return filepath.split('/').pop() || filepath; }