diff --git a/.claude/docs/entity-relationships.md b/.claude/docs/entity-relationships.md index ea526df..b44f1f2 100644 --- a/.claude/docs/entity-relationships.md +++ b/.claude/docs/entity-relationships.md @@ -1,8 +1,8 @@ # Entity Relationships -``` +```text ServiceProvider → type: "immich" (inferred capabilities: notifications, commands) -NotificationTracker → provider_id, collection_ids, scan_interval, batch_duration, enabled +NotificationTracker → provider_id, collection_ids, scan_interval, adaptive_max_skip, filters, default_tracking_config_id, default_template_config_id, enabled NotificationTrackerTarget → notification_tracker_id, target_id, tracking_config_id, template_config_id, quiet_hours, enabled TrackingConfig → provider_type, event flags, scheduling rules TemplateConfig → provider_type, Jinja2 template slots per event type diff --git a/frontend/src/lib/i18n/en.json b/frontend/src/lib/i18n/en.json index fb29bf0..c3de137 100644 --- a/frontend/src/lib/i18n/en.json +++ b/frontend/src/lib/i18n/en.json @@ -246,6 +246,9 @@ "selectAlbums": "Select albums...", "repositories": "Repositories", "selectRepositories": "Select repositories...", + "userAllowlist": "Only from users", + "userBlocklist": "Exclude users", + "selectUsers": "Pick users...", "boards": "Boards", "selectBoards": "Select boards...", "upsDevices": "UPS Devices", diff --git a/frontend/src/lib/i18n/ru.json b/frontend/src/lib/i18n/ru.json index 7ae7f49..40b9b61 100644 --- a/frontend/src/lib/i18n/ru.json +++ b/frontend/src/lib/i18n/ru.json @@ -246,6 +246,9 @@ "selectAlbums": "Выберите альбомы...", "repositories": "Репозитории", "selectRepositories": "Выберите репозитории...", + "userAllowlist": "Только от пользователей", + "userBlocklist": "Исключить пользователей", + "selectUsers": "Выберите пользователей...", "boards": "Доски", "selectBoards": "Выберите доски...", "upsDevices": "ИБП устройства", diff --git a/frontend/src/lib/providers/gitea.ts b/frontend/src/lib/providers/gitea.ts index 5c16645..c45f43c 100644 --- a/frontend/src/lib/providers/gitea.ts +++ b/frontend/src/lib/providers/gitea.ts @@ -56,5 +56,20 @@ export const giteaDescriptor: ProviderDescriptor = { desc: () => '', }, + userFilters: [ + { + key: 'senders', + label: 'notificationTracker.userAllowlist', + placeholder: 'notificationTracker.selectUsers', + icon: 'mdiAccountCheck', + }, + { + key: 'exclude_senders', + label: 'notificationTracker.userBlocklist', + placeholder: 'notificationTracker.selectUsers', + icon: 'mdiAccountOff', + }, + ], + webhookUrlPattern: '/api/webhooks/gitea/{token}', }; diff --git a/frontend/src/lib/providers/types.ts b/frontend/src/lib/providers/types.ts index 567a533..8803851 100644 --- a/frontend/src/lib/providers/types.ts +++ b/frontend/src/lib/providers/types.ts @@ -120,6 +120,25 @@ export interface CollectionMeta { desc: (col: any) => string; } +// ── User-identity filters (TrackerForm) ────────────────────────────── + +/** + * Declares a filter that picks user identities from the provider's known + * senders. Rendered as a MultiEntitySelect populated from the provider's + * `/users` endpoint. The picked values are stored as `string[]` under + * `tracker.filters[key]`. + */ +export interface UserFilterMeta { + /** Filter key inside `tracker.filters` (e.g. "senders", "exclude_senders"). */ + key: string; + /** i18n key for the label rendered above the picker. */ + label: string; + /** i18n key for the picker placeholder. */ + placeholder: string; + /** MDI icon shown on chips and dropdown rows. */ + icon: string; +} + // ── Main descriptor ────────────────────────────────────────────────── export interface ProviderDescriptor { @@ -153,6 +172,8 @@ export interface ProviderDescriptor { // ── Collections / Trackers ── /** Null means this provider has no collections (e.g. scheduler). */ collectionMeta: CollectionMeta | null; + /** Sender allowlist / blocklist pickers shown on the tracker form. */ + userFilters?: UserFilterMeta[]; /** Whether this provider is webhook-based (hides scan_interval). */ webhookBased?: boolean; diff --git a/frontend/src/routes/+page.svelte b/frontend/src/routes/+page.svelte index 8d45d89..b09daf0 100644 --- a/frontend/src/routes/+page.svelte +++ b/frontend/src/routes/+page.svelte @@ -1,7 +1,9 @@