Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ const getInboxSignalFilters = () => {
chatUpdatedAt: { gte: twoWeeksAgo },
folderDone: false,
folderUpdatedAt: { gte: twoWeeksAgo },
// Foreign entities (e.g. GitHub PRs) with a not-done notification.
// Referencing `fef` also opts them into the signal query (otherwise
// defineQueryFilters excludes unreferenced entity types). Rendering is
// still gated on the supported-foreign-entities flag client-side.
foreignEntityDone: false,
emailShared: 'exclude',
},
exclude: getDisabledSnippetSubtypeExclude(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export const inboxFilter = config({
channelDone: false,
chatDone: false,
folderDone: false,
foreignEntityDone: false,
},
emailView: 'inbox',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ const FIELD_CONFIG: Record<
callStatus: { target: 'callf', field: 'Status' },
callAttended: { target: 'callf', field: 'Attended' },
foreignEntityRecordId: { target: 'fef', field: 'id' },
foreignEntitySeen: { target: 'fef', field: 'ns' },
foreignEntityDone: { target: 'fef', field: 'nd' },
crmCompanyId: { target: 'ccf', field: 'id' },
crmCompanyHidden: { target: 'ccf', field: 'hidden' },
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ export type ScalarFieldFilters = {
chatDone?: boolean;
folderSeen?: boolean;
folderDone?: boolean;
foreignEntitySeen?: boolean;
foreignEntityDone?: boolean;
callStatus?: CallStatus;
callAttended?: boolean;
crmCompanyHidden?: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@ export function signalFilter(entity: EntityData): boolean {
// Automations only show in the Agents > Scheduled tab, not Inbox.
return false;
case 'foreign':
return false;
// Foreign entities (e.g. GitHub PRs) are gated by the inbox query on the
// user's not-done notifications, so they're signal whenever returned.
return true;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* search_service
* OpenAPI spec version: 0.1.0
*/
import type { NotificationFilters } from './notificationFilters';

/**
* Filters for foreign entity records.
Expand All @@ -19,4 +20,7 @@ export interface ForeignEntityFilters {
participant (GitHub `involves:me` semantics for `github_pull_request` records). False or
absent applies no filter. Serialized in filter ASTs as the `"me"` literal. */
includes_me?: boolean;
/** Filter by the notification state of the foreign entity (e.g. whether the requesting user's
GitHub PR notification is done/seen). */
notification_filters?: NotificationFilters;
}
4 changes: 4 additions & 0 deletions js/app/packages/service-clients/service-search/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -2105,6 +2105,10 @@
"includes_me": {
"type": "boolean",
"description": "When true, only return foreign entities whose metadata lists the requesting user as a\nparticipant (GitHub `involves:me` semantics for `github_pull_request` records). False or\nabsent applies no filter. Serialized in filter ASTs as the `\"me\"` literal."
},
"notification_filters": {
"$ref": "#/components/schemas/NotificationFilters",
"description": "Filter by the notification state of the foreign entity (e.g. whether the requesting user's\nGitHub PR notification is done/seen)."
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* document_storage_service
* OpenAPI spec version: 0.1.0
*/
import type { NotificationFilters } from './notificationFilters';

/**
* Filters for foreign entity records.
Expand All @@ -19,4 +20,7 @@ export interface ForeignEntityFilters {
participant (GitHub `involves:me` semantics for `github_pull_request` records). False or
absent applies no filter. Serialized in filter ASTs as the `"me"` literal. */
includes_me?: boolean;
/** Filter by the notification state of the foreign entity (e.g. whether the requesting user's
GitHub PR notification is done/seen). */
notification_filters?: NotificationFilters;
}
17 changes: 17 additions & 0 deletions js/app/packages/service-clients/service-storage/generated/zod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7998,6 +7998,23 @@ export const postItemsSoupBody = zod
.describe(
'When true, only return foreign entities whose metadata lists the requesting user as a\nparticipant (GitHub `involves:me` semantics for `github_pull_request` records). False or\nabsent applies no filter. Serialized in filter ASTs as the `\"me\"` literal.'
),
notification_filters: zod
.object({
done: zod
.boolean()
.nullish()
.describe(
'Filter by notification done state. `Some(true)` selects done\nnotifications; `Some(false)` selects not-done notifications.'
),
seen: zod
.boolean()
.nullish()
.describe(
'Filter by notification seen state. `Some(true)` selects seen\nnotifications; `Some(false)` selects not-seen notifications.'
),
})
.optional()
.describe('Notification state filters for channel message queries.'),
})
.optional()
.describe('Filters for foreign entity records.'),
Expand Down
4 changes: 4 additions & 0 deletions js/app/packages/service-clients/service-storage/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -14059,6 +14059,10 @@
"includes_me": {
"type": "boolean",
"description": "When true, only return foreign entities whose metadata lists the requesting user as a\nparticipant (GitHub `involves:me` semantics for `github_pull_request` records). False or\nabsent applies no filter. Serialized in filter ASTs as the `\"me\"` literal."
},
"notification_filters": {
"$ref": "#/components/schemas/NotificationFilters",
"description": "Filter by the notification state of the foreign entity (e.g. whether the requesting user's\nGitHub PR notification is done/seen)."
}
}
},
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading