Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
feat(tasks): add due-date views and generic property sorting (#8494)
dev-rbb192d1b29998
diff --git a/.agents/rules/rust/guardrails.md b/.agents/rules/rust/guardrails.mdindex d6dc77f27b..198a0904ce 100644--- a/.agents/rules/rust/guardrails.md+++ b/.agents/rules/rust/guardrails.md@@ -21,7 +21,9 @@ alwaysApply: falseTests compile against the live database, so they don't need the cache.- Across domain crates, depend on the owning domain service or port; only acomposition root may construct that crate's outbound adapters. Never import- another crate's `outbound` module from an outbound adapter.+ another crate's `outbound` module from an outbound adapter. Soup's candidate+ repository may read `entity_properties` after the properties service authorizes+ the selected definitions; keep execution and entity access gates in Soup.- Read the [Rust development guide](../../../docs/development/rust.md) beforebuilding or testing, and the hexagonal architecture skill before changinginbound, domain, or outbound code.diff --git a/.agents/rules/web/architecture.md b/.agents/rules/web/architecture.mdindex 83eb9278c4..16702bde92 100644--- a/.agents/rules/web/architecture.md+++ b/.agents/rules/web/architecture.md@@ -94,6 +94,7 @@ Module layout, layering, and TypeScript conventions.- Name module-level value constants in `SCREAMING_SNAKE_CASE`, except schema definitions; keep functions and local variables in `camelCase`.- For exhaustive matching use `match(...).exhaustive()` from `ts-pattern`, nevera hand-written `switch`.+- Use early returns or named variables instead of nested ternaries.- **FE-47** Blocks are a legacy integration pattern we live with, not anarchitecture to build on. Keep `definition.ts` to registration and lazyloading, and the `<name>-block.tsx` adapter to translating block state once;diff --git a/.agents/skills/git/SKILL.md b/.agents/skills/git/SKILL.mdindex 13f7a66579..e3eb3a4120 100644--- a/.agents/skills/git/SKILL.md+++ b/.agents/skills/git/SKILL.md@@ -15,7 +15,8 @@ message, PR title, or PR description. That includes emails, phone numbers,physical addresses, API keys, and tokens. Refer to people as "the customer"or a placeholder (`[email protected]`).-The pre-commit hook scans staged added lines. Do not skip it (`--no-verify`).+The pre-commit hook scans staged added lines; during merges it scans additions+relative to every parent, not unchanged imported content. Do not skip it (`--no-verify`).Do not add lines to `tooling/pii/exceptions` unless a human asks you to.Before opening or updating a PR, reread the title and body and strip any PII@@ -130,9 +131,9 @@ machines, pipelines). Drop it for small or mechanical changes.```No test plan or testing section in PR descriptions or commit messages: CI shows-the checks, and what you ran goes in your report to the user. Attach proof for-user-visible changes: screenshots or a recording (see the `record-proof` skill-when it is available).+the checks, and what you ran goes in your report to the user. Attach screenshots+or recordings to the PR for user-visible changes (see the `record-proof` skill+when available). Do not commit verification captures unless explicitly requested.## Handing off a PRdiff --git a/.github/workspace-dep-closures.json b/.github/workspace-dep-closures.jsonindex 4625f57ed9..31467df120 100644--- a/.github/workspace-dep-closures.json+++ b/.github/workspace-dep-closures.json@@ -3909,6 +3909,7 @@"crates/entity_registry/entity_registry","crates/entity_registry/entity_registry_db_utils","crates/entity_registry/shared_entity_registry",+ "crates/filter_ast","crates/folds/agent_fold","crates/genai_telemetry","crates/harness_id",@@ -3916,6 +3917,7 @@"crates/initiative","crates/invite_email","crates/ip_extractor",+ "crates/item_filters","crates/kafka_util","crates/last_online_tracker","crates/lexical_client",@@ -6754,12 +6756,14 @@"crates/entity_registry/entity_registry","crates/entity_registry/entity_registry_db_utils","crates/entity_registry/shared_entity_registry",+ "crates/filter_ast","crates/genai_telemetry","crates/harness_id","crates/harness_token","crates/initiative","crates/invite_email","crates/ip_extractor",+ "crates/item_filters","crates/kafka_util","crates/last_online_tracker","crates/macro_auth",@@ -9167,12 +9171,14 @@"crates/entity_registry/entity_registry","crates/entity_registry/entity_registry_db_utils","crates/entity_registry/shared_entity_registry",+ "crates/filter_ast","crates/genai_telemetry","crates/harness_id","crates/harness_token","crates/initiative","crates/invite_email","crates/ip_extractor",+ "crates/item_filters","crates/kafka_util","crates/last_online_tracker","crates/macro_auth",@@ -9438,11 +9444,13 @@"crates/document_sub_type","crates/entity_access","crates/entity_access_db_utils",+ "crates/filter_ast","crates/genai_telemetry","crates/harness_id","crates/harness_token","crates/initiative","crates/invite_email",+ "crates/item_filters","crates/kafka_util","crates/last_online_tracker","crates/macro_auth",@@ -9501,6 +9509,7 @@"crates/entity_registry/entity_registry","crates/entity_registry/entity_registry_db_utils","crates/entity_registry/shared_entity_registry",+ "crates/filter_ast","crates/folds/agent_fold","crates/genai_telemetry","crates/harness_id",@@ -9509,6 +9518,7 @@"crates/initiative_description","crates/invite_email","crates/ip_extractor",+ "crates/item_filters","crates/kafka_util","crates/last_online_tracker","crates/lexical_client",@@ -9755,6 +9765,7 @@"crates/document_sub_type","crates/entity_access","crates/entity_access_db_utils",+ "crates/filter_ast","crates/folds/agent_fold","crates/genai_telemetry","crates/harness_id",@@ -9762,6 +9773,7 @@"crates/initiative","crates/invite_email","crates/ip_extractor",+ "crates/item_filters","crates/kafka_util","crates/last_online_tracker","crates/lexical_client",@@ -9820,6 +9832,7 @@"crates/document_sub_type","crates/entity_access","crates/entity_access_db_utils",+ "crates/filter_ast","crates/folds/agent_fold","crates/genai_telemetry","crates/harness_id",@@ -9827,6 +9840,7 @@"crates/initiative","crates/invite_email","crates/ip_extractor",+ "crates/item_filters","crates/kafka_util","crates/last_online_tracker","crates/lexical_client",@@ -9967,12 +9981,14 @@"crates/entity_registry/entity_registry","crates/entity_registry/entity_registry_db_utils","crates/entity_registry/shared_entity_registry",+ "crates/filter_ast","crates/genai_telemetry","crates/harness_id","crates/harness_token","crates/initiative","crates/invite_email","crates/ip_extractor",+ "crates/item_filters","crates/kafka_util","crates/last_online_tracker","crates/macro_auth",@@ -10067,12 +10083,14 @@"crates/entity_registry/entity_registry","crates/entity_registry/entity_registry_db_utils","crates/entity_registry/shared_entity_registry",+ "crates/filter_ast","crates/genai_telemetry","crates/harness_id","crates/harness_token","crates/initiative","crates/invite_email","crates/ip_extractor",+ "crates/item_filters","crates/kafka_util","crates/last_online_tracker","crates/macro_auth",@@ -10465,12 +10483,14 @@"crates/document_sub_type","crates/entity_access","crates/entity_access_db_utils",+ "crates/filter_ast","crates/genai_telemetry","crates/harness_id","crates/harness_token","crates/initiative","crates/invite_email","crates/ip_extractor",+ "crates/item_filters","crates/kafka_util","crates/last_online_tracker","crates/macro_auth",@@ -10648,7 +10668,11 @@"crates/workspace-hack"],"models_grouping": [+ "crates/document_sub_type",+ "crates/model-error-response","crates/models_grouping",+ "crates/models_pagination",+ "crates/models_properties","crates/workspace-hack"],"models_opensearch": [@@ -11125,12 +11149,14 @@"crates/entity_registry/entity_registry","crates/entity_registry/entity_registry_db_utils","crates/entity_registry/shared_entity_registry",+ "crates/filter_ast","crates/genai_telemetry","crates/harness_id","crates/harness_token","crates/initiative","crates/invite_email","crates/ip_extractor",+ "crates/item_filters","crates/kafka_util","crates/last_online_tracker","crates/macro_auth",@@ -11597,10 +11623,12 @@"crates/document_sub_type","crates/entity_access","crates/entity_access_db_utils",+ "crates/filter_ast","crates/genai_telemetry","crates/harness_id","crates/harness_token","crates/invite_email",+ "crates/item_filters","crates/kafka_util","crates/last_online_tracker","crates/macro_auth",@@ -11651,10 +11679,12 @@"crates/document_sub_type","crates/entity_access","crates/entity_access_db_utils",+ "crates/filter_ast","crates/genai_telemetry","crates/harness_id","crates/harness_token","crates/invite_email",+ "crates/item_filters","crates/kafka_util","crates/last_online_tracker","crates/macro_auth",@@ -13729,6 +13759,7 @@"crates/embedding","crates/entity_access","crates/entity_access_db_utils",+ "crates/filter_ast","crates/folds/agent_fold","crates/genai_telemetry","crates/harness_id",@@ -13736,6 +13767,7 @@"crates/initiative","crates/invite_email","crates/ip_extractor",+ "crates/item_filters","crates/kafka_util","crates/last_online_tracker","crates/lexical_client",@@ -14266,12 +14298,14 @@"crates/entity_registry/entity_registry","crates/entity_registry/entity_registry_db_utils","crates/entity_registry/shared_entity_registry",+ "crates/filter_ast","crates/genai_telemetry","crates/harness_id","crates/harness_token","crates/initiative","crates/invite_email","crates/ip_extractor",+ "crates/item_filters","crates/kafka_util","crates/last_online_tracker","crates/macro_auth",diff --git a/Cargo.lock b/Cargo.lockindex 8855038919..98b312ea3b 100644--- a/Cargo.lock+++ b/Cargo.lock@@ -5358,6 +5358,7 @@ dependencies = ["messages","model-error-response","models_databases",+ "models_pagination","models_permissions","models_properties","properties",@@ -9109,6 +9110,7 @@ dependencies = ["async-graphql","axum","axum-extra",+ "chrono","filter_ast","item_filters","macro_authorization",@@ -13312,7 +13314,10 @@ name = "models_grouping"version = "0.1.0"dependencies = ["chrono",+ "models_pagination",+ "models_properties","serde",+ "utoipa","uuid","workspace-hack",]@@ -15718,7 +15723,9 @@ dependencies = ["document_sub_type","entity_access","entity_access_db_utils",+ "filter_ast","futures",+ "item_filters","macro_authorization","macro_db_migrator","macro_event_broker",@@ -15729,6 +15736,7 @@ dependencies = ["model-entity","model_notifications","model_owner",+ "models_pagination","models_permissions","models_properties","notification",diff --git a/apps/web/AGENTS.md b/apps/web/AGENTS.mdindex 29d828bc04..29395dd65e 100644--- a/apps/web/AGENTS.md+++ b/apps/web/AGENTS.md@@ -558,6 +558,10 @@ resolved session ID; keep the existing `AgentSessionProvider` subscription to- When adding or changing a feature flag, follow the `feature-flags` skill.- Gate routine template actions, pages, dialogs, and message cards on `enable-routine-sharing`; keep ordinary routines usable while it is off.- When adding or changing a view's feature tour, follow the `add-tour` skill.+- Keep Tasks date ranges on view-owned date-bucket boundaries in `features/tasks-view/core/task-due-date.ts`; send `sort_method=property` with the selected definition and direction, use keyed `date_ranges` grouping, and restart pages when midnight/timezone/resume changes the query key; preserve text-search ordering.+- Render Tasks due dates in an editable list-property column with a calendar icon only when a date is set; show only the urgency-colored icon on phones and narrow panes, keep the current date visible in its dropdown, and limit warning urgency to today and tomorrow.+- Revalidate Soup queries whose selected sort/group property or date predicate matches an edited definition; compute loaded date-group movement in TypeScript, then refetch authoritative counts and unloaded rows. Keep property sorts and date filters out of the timestamp-only WASM projection.+- Keep REST grouped Soup item pools and `itemIds` keyed by raw entity IDs, matching Tasks readers and the normalized cache.## Rulesdiff --git a/apps/web/src/features/entity/README.md b/apps/web/src/features/entity/README.mdindex fcab9689fc..59d9456baf 100644--- a/apps/web/src/features/entity/README.md+++ b/apps/web/src/features/entity/README.md@@ -9,3 +9,7 @@ app-local entry point.existing inline metadata area. Names and icons use the shared property previewcache; the row does not search for related entities. Narrow rows compact thesepills to icons, with full names available in tooltips and the overflow menu.++Compose persistent trailing metadata through `NarrowLayout` children, before+standard row actions and properties; keep feature-specific rendering and styling+in the caller.diff --git a/apps/web/src/features/entity/composed/list-entity/narrow-layout.tsx b/apps/web/src/features/entity/composed/list-entity/narrow-layout.tsxindex d2a08ced3c..6c701632cc 100644--- a/apps/web/src/features/entity/composed/list-entity/narrow-layout.tsx+++ b/apps/web/src/features/entity/composed/list-entity/narrow-layout.tsx@@ -1,5 +1,5 @@import { cn } from '@ui';-import { Show } from 'solid-js';+import { children, type ParentProps, Show } from 'solid-js';import { Entity } from '../../entity';import {isChannelEntity,@@ -20,7 +20,8 @@ import { RowEnd } from './row-end';import { SOUP_ROW_CLASS } from './row-geometry';import { type LayoutProps, RowIndicator } from './shared';-export function NarrowLayout(props: LayoutProps) {+export function NarrowLayout(props: ParentProps<LayoutProps>) {+ const trailingMetadata = children(() => props.children);const pullRequest = () => {const entity = props.entity;return isGithubPrEntity(entity) ? entity : undefined;@@ -113,6 +114,7 @@ export function NarrowLayout(props: LayoutProps) {<Showwhen={+ trailingMetadata() ||props.referenceProperties ||props.scheduleStatus ||(!props.hasNotifications &&@@ -125,6 +127,7 @@ export function NarrowLayout(props: LayoutProps) {>{props.referenceProperties}{props.scheduleStatus}+ {trailingMetadata()}<Show when={!props.hasNotifications}><RowEnd actions={props.actions} leadingAction={props.leadingAction}><Showdiff --git a/apps/web/src/features/entity/index.ts b/apps/web/src/features/entity/index.tsindex bcc4eaf4c4..c3683b1539 100644--- a/apps/web/src/features/entity/index.ts+++ b/apps/web/src/features/entity/index.ts@@ -74,6 +74,7 @@ export {COMPANY_STAGE_OPTIONS,getPropertyOptionLabel,getTaskAssigneeIds,+ getTaskDueDate,getTaskPriorityOptionId,getTaskReferencedEntityIds,getTaskStatusOptionId,diff --git a/apps/web/src/features/entity/utils/task-properties.ts b/apps/web/src/features/entity/utils/task-properties.tsindex 7cd76d7e4e..ee2b642cd4 100644--- a/apps/web/src/features/entity/utils/task-properties.ts+++ b/apps/web/src/features/entity/utils/task-properties.ts@@ -1,6 +1,18 @@import { PROPERTY_OPTION_IDS, SYSTEM_PROPERTY_IDS } from '@property/constants';import type { TaskEntityWithProperties } from '../types/entity';+/** The stored due-date instant; absent and cleared DATE values are undated. */+export function getTaskDueDate(+ entity: TaskEntityWithProperties+): string | undefined {+ const value = entity.properties?.find(+ (property) => property.definition.id === SYSTEM_PROPERTY_IDS.DUE_DATE+ )?.value;+ return value?.type === 'Date' && typeof value.value === 'string'+ ? value.value+ : undefined;+}+export const TASK_STATUS_OPTIONS = [{ value: PROPERTY_OPTION_IDS.STATUS.NOT_STARTED, label: 'Not Started' },{ value: PROPERTY_OPTION_IDS.STATUS.IN_PROGRESS, label: 'In Progress' },diff --git a/apps/web/src/features/next-soup/sidebar/__snapshots__/soup-filter-presets.test.ts.snap b/apps/web/src/features/next-soup/sidebar/__snapshots__/soup-filter-presets.test.ts.snapindex 6de5f76487..6a5d304003 100644--- a/apps/web/src/features/next-soup/sidebar/__snapshots__/soup-filter-presets.test.ts.snap+++ b/apps/web/src/features/next-soup/sidebar/__snapshots__/soup-filter-presets.test.ts.snap@@ -74,6 +74,7 @@ exports[`documents view GraphQL input contract > captures every production tab w"limit": 100,"sortDirection": undefined,"sortMethod": "UPDATED_AT",+ "sortPropertyDefinitionId": undefined,},},"attachments": {@@ -137,6 +138,7 @@ exports[`documents view GraphQL input contract > captures every production tab w"limit": 100,"sortDirection": undefined,"sortMethod": "UPDATED_AT",+ "sortPropertyDefinitionId": undefined,},},"owned": {@@ -229,6 +231,7 @@ exports[`documents view GraphQL input contract > captures every production tab w"limit": 100,"sortDirection": undefined,"sortMethod": "UPDATED_AT",+ "sortPropertyDefinitionId": undefined,},},"shared": {@@ -323,6 +326,7 @@ exports[`documents view GraphQL input contract > captures every production tab w"limit": 100,"sortDirection": undefined,"sortMethod": "UPDATED_AT",+ "sortPropertyDefinitionId": undefined,},},}@@ -393,6 +397,7 @@ exports[`documents view GraphQL input contract > captures every production tab w"limit": 100,"sortDirection": undefined,"sortMethod": "UPDATED_AT",+ "sortPropertyDefinitionId": undefined,},},"attachments": {@@ -456,6 +461,7 @@ exports[`documents view GraphQL input contract > captures every production tab w"limit": 100,"sortDirection": undefined,"sortMethod": "UPDATED_AT",+ "sortPropertyDefinitionId": undefined,},},"owned": {@@ -539,6 +545,7 @@ exports[`documents view GraphQL input contract > captures every production tab w"limit": 100,"sortDirection": undefined,"sortMethod": "UPDATED_AT",+ "sortPropertyDefinitionId": undefined,},},"shared": {@@ -624,6 +631,7 @@ exports[`documents view GraphQL input contract > captures every production tab w"limit": 100,"sortDirection": undefined,"sortMethod": "UPDATED_AT",+ "sortPropertyDefinitionId": undefined,},},}diff --git a/apps/web/src/features/projects/components/project-row.tsx b/apps/web/src/features/projects/components/project-row.tsxindex 1eb9c93b0c..697f4be15e 100644--- a/apps/web/src/features/projects/components/project-row.tsx+++ b/apps/web/src/features/projects/components/project-row.tsx@@ -8,22 +8,20 @@ import StackIcon from '@icon/system/regular/stack.svg';import { ListPropertyValue } from '@property/component/ListPropertyValue';import { Modals } from '@property/component/modal';import { PropertiesProvider } from '@property/context/PropertiesContext';-import { SYSTEM_PROPERTY_IDS } from '@property/identifiers';import type { Property, PropertyApiValues } from '@property/types';import { cn } from '@ui';import { For, Show, Suspense } from 'solid-js';import type { ProjectRow as ProjectRowData } from '../context/projects-context';import { canEditProject } from '../core/project';-// Projects reuse the task grid; its project column holds the due date.-const gridStyle = taskGridTemplate({ indicator: true, project: true });+// Projects reuse the task grid, including its single due-date column.+const gridStyle = taskGridTemplate({ indicator: true, project: false });const columns = [{ area: 'content', label: 'Project' },...TASK_GRID_COLUMNS.map((column) => ({area: column.id,label: column.label,})),- { area: 'initiative', label: 'Due date' },{ area: 'createdBy', label: 'Tasks' },{ area: 'timestamp', label: 'Updated' },];@@ -44,7 +42,8 @@ export function ProjectListHeader() {class={cn('truncate',column.area === 'createdBy' && '@max-[1220px]/u-list:hidden',- column.area === 'timestamp' && 'text-right'+ column.area === 'timestamp' &&+ 'text-right @max-[840px]/u-list:hidden')}>{column.label}@@ -144,16 +143,6 @@ export function ProjectRow(props: {</Entity.Slot>)}</For>- <Entity.Slot placement="initiative" class="min-w-0 text-xs">- <Show when={propertyFor(SYSTEM_PROPERTY_IDS.DUE_DATE)}>- {(property) => (- <ListPropertyValue- entityId={props.row.project.id}- property={property()}- />- )}- </Show>- </Entity.Slot><Entity.Slotplacement="createdBy"class="min-w-0 text-xs text-ink-muted @max-[1220px]/u-list:hidden"@@ -166,7 +155,7 @@ export function ProjectRow(props: {</Entity.Slot><Entity.Slotplacement="timestamp"- class="text-right text-xs font-light text-ink-extra-muted"+ class="text-right text-xs font-light text-ink-extra-muted @max-[840px]/u-list:hidden"><time dateTime={props.row.project.updatedAt}>{updated()}</time></Entity.Slot>diff --git a/apps/web/src/features/property/component/ListPropertyValue.test.tsx b/apps/web/src/features/property/component/ListPropertyValue.test.tsxindex c78cce176d..2c9ae58d22 100644--- a/apps/web/src/features/property/component/ListPropertyValue.test.tsx+++ b/apps/web/src/features/property/component/ListPropertyValue.test.tsx@@ -72,14 +72,18 @@ it('shows the linked project name and follows reassignment and clearing', () =><ListPropertyValue entityId="task" property={property()} />));- expect(view.getByRole('button').textContent).toBe('Product launch');+ expect(+ view.getByRole('button', { name: 'Project: Product launch' })+ ).toBeDefined();setProperty({...project,value: [{ entity_id: 'redesign', entity_type: 'INITIATIVE' }],});- expect(view.getByRole('button').textContent).toBe('Website redesign');+ expect(+ view.getByRole('button', { name: 'Project: Website redesign' })+ ).toBeDefined();setProperty({ ...project, value: null });- expect(view.getByRole('button').textContent).toBe('Project');+ expect(view.getByRole('button', { name: 'Project' })).toBeDefined();});it('keeps a count when multiple projects are linked', () => {@@ -95,5 +99,5 @@ it('keeps a count when multiple projects are linked', () => {}}/>));- expect(view.getByRole('button').textContent).toBe('2 items');+ expect(view.getByRole('button', { name: 'Project: 2 items' })).toBeDefined();});diff --git a/apps/web/src/features/property/component/ListPropertyValue.tsx b/apps/web/src/features/property/component/ListPropertyValue.tsxindex 2dbf8a2094..2ad6ee611d 100644--- a/apps/web/src/features/property/component/ListPropertyValue.tsx+++ b/apps/web/src/features/property/component/ListPropertyValue.tsx@@ -3,13 +3,15 @@ import { Property } from '@property';import { usePropertiesContext } from '@property/context/PropertiesContext';import type { Property as PropertyType } from '@property/types';import { getEntityValues, hasValue } from '@property/utils';-import { Layer } from '@ui';+import { cn, Layer } from '@ui';import { type Accessor, Match, Show, Switch } from 'solid-js';+import { formatDate } from '../utils/formatting';/** Shared property cell for unified task and native project lists. */export function ListPropertyValue(props: {property: PropertyType;entityId: string;+ class?: string;}) {const context = usePropertiesContext();const isInlineType = () =>@@ -51,7 +53,11 @@ export function ListPropertyValue(props: {onSave={context.saveHandler.saveProperty}>{(property) => (- <ListPropertyCell property={property} entityId={props.entityId} />+ <ListPropertyCell+ property={property}+ entityId={props.entityId}+ class={props.class}+ />)}</Property.Root>);@@ -60,6 +66,7 @@ export function ListPropertyValue(props: {function ListPropertyCell(props: {property: Accessor<PropertyType>;entityId: string;+ class?: string;}) {const context = usePropertiesContext();const isUserEntity = () =>@@ -70,18 +77,40 @@ function ListPropertyCell(props: {return getEntityValues(props.property()).length;};const isEmpty = () => !hasValue(props.property());+ const label = () => {+ const property = props.property();+ if (property.valueType === 'DATE' && property.value) {+ return `${property.displayName}: ${formatDate(property.value)}`;+ }+ return undefined;+ };return (<><Property.Tooltip property={props.property()}><Layer depth={2}>- <Property.EditTrigger class="list-property-cell inline-flex w-full max-w-full min-w-0 items-center gap-1 overflow-hidden rounded-full px-2 py-1.5 text-left leading-tight hover:bg-surface/50 @max-[840px]/u-list:px-1">+ <Property.EditTrigger+ aria-label={label()}+ class={cn(+ 'list-property-cell inline-flex min-h-7 w-full max-w-full min-w-0 items-center gap-1 overflow-hidden rounded-full px-2 py-1.5 text-left leading-tight hover:bg-surface/50 @max-[840px]/u-list:px-1',+ props.class+ )}+ >+ <span class="sr-only">+ {props.property().displayName}+ {isEmpty() ? '' : ': '}+ </span><Showwhen={!isEmpty()}fallback={<>- <CircleDashedEmpty class="size-3 shrink-0 opacity-50 @max-[840px]/u-list:size-4" />- <span class="min-w-0 flex-1 truncate opacity-50 @max-[840px]/u-list:hidden">+ <Show when={props.property().valueType !== 'DATE'}>+ <CircleDashedEmpty class="size-3 shrink-0 opacity-50 @max-[840px]/u-list:size-4" />+ </Show>+ <span+ aria-hidden="true"+ class="min-w-0 flex-1 truncate opacity-50 @max-[840px]/u-list:hidden"+ >{props.property().displayName}</span></>@@ -122,7 +151,7 @@ function ListPropertyCell(props: {resolveSingleEntity={props.property().specificEntityType === 'INITIATIVE'}- class="min-w-0 max-w-full flex-1 @max-[840px]/u-list:hidden"+ class="min-w-0 max-w-full flex-1 @max-[840px]/u-list:sr-only"/></Show><Property.Caret class="@max-[840px]/u-list:hidden" />diff --git a/apps/web/src/features/property/editors/selectors/PropertyDateSelector.tsx b/apps/web/src/features/property/editors/selectors/PropertyDateSelector.tsxindex 813b673baa..458a85440f 100644--- a/apps/web/src/features/property/editors/selectors/PropertyDateSelector.tsx+++ b/apps/web/src/features/property/editors/selectors/PropertyDateSelector.tsx@@ -1,6 +1,7 @@import { DatePickerUI } from '@core/component/DatePicker/DatePickerUI';import { useDateSearch } from '@core/util/dateSearch/useDateSearch';import { useKeyPressed } from '@core/util/useKeyPressed';+import CalendarIcon from '@icon/system/regular/calendar-blank.svg';import SearchIcon from '@icon/system/regular/magnifying-glass.svg';import type { DateProperty } from '@property/types';import { useSearchInputFocus } from '@property/utils/focus';@@ -17,6 +18,7 @@ import {Show,Switch,} from 'solid-js';+import { formatDate } from '../../utils/formatting';type DateSelectorMode = 'search' | 'calendar';@@ -44,6 +46,12 @@ export const PropertyDateSelector = (props: DateSelectorProps) => {});const hasClear = () => props.selectedDate != null;+ const selectedDateLabel = () => {+ const date = props.selectedDate;+ return date+ ? formatDate(date)+ : `No ${props.property.displayName.toLowerCase()}`;+ };// When a date is set, replace the last suggestion with the Clear row so// the section height stays the same.const visibleDateOptions = createMemo(() => {@@ -175,6 +183,11 @@ export const PropertyDateSelector = (props: DateSelectorProps) => {disabled={mode() !== 'search'}/></div>+ <p class="flex items-center gap-2 border-b border-edge-muted px-3 py-2">+ <CalendarIcon class="size-4 shrink-0 text-ink-muted" />+ <span class="text-ink-muted">Current:</span>+ <span class="min-w-0 truncate">{selectedDateLabel()}</span>+ </p><Switch><Match when={mode() === 'search'}>{/* Picking a row keeps focus in the date field, so the phonediff --git a/apps/web/src/features/property/extractors/PropertyIcon.tsx b/apps/web/src/features/property/extractors/PropertyIcon.tsxindex dbf95dc7db..0b0d14e4f2 100644--- a/apps/web/src/features/property/extractors/PropertyIcon.tsx+++ b/apps/web/src/features/property/extractors/PropertyIcon.tsx@@ -1,4 +1,5 @@import { UserIcon } from '@core/component/UserIcon';+import CalendarIcon from '@phosphor/calendar-blank.svg';import { PropertyValueIcon } from '@property/component/propertyValue/PropertyValueIcon';import { cn } from '@ui';import { type JSX, Show } from 'solid-js';@@ -14,11 +15,15 @@ type Props = {* Renders the icon associated with a property's value:* - SELECT_*: option icon for the first value (status/priority icons).* - ENTITY+USER: avatar for the first user.+ * - DATE: calendar icon.* - everything else: null (extractor stays uninvolved).** Layout-free — caller controls sizing/spacing.*/export function PropertyIcon(props: Props): JSX.Element {+ if (props.property.valueType === 'DATE') {+ return <CalendarIcon class={props.class} />;+ }if (props.property.valueType === 'SELECT_STRING' ||props.property.valueType === 'SELECT_NUMBER'diff --git a/apps/web/src/features/property/utils/sort.ts b/apps/web/src/features/property/utils/sort.tsnew file mode 100644index 0000000000..d3d486cd26--- /dev/null+++ b/apps/web/src/features/property/utils/sort.ts@@ -0,0 +1,61 @@+import type { SoupProperty } from '@service-storage/generated/schemas/soupProperty';+import { parseISO } from 'date-fns';+import type { PropertyOption } from '../types';++/** Epoch microseconds, retaining RFC3339 precision beyond JavaScript's milliseconds. */+export function propertyDateSortKey(+ value: string | Date | null | undefined+): number | undefined {+ if (typeof value !== 'string') {+ const milliseconds = value?.getTime();+ return milliseconds !== undefined && Number.isFinite(milliseconds)+ ? milliseconds * 1000+ : undefined;+ }+ const fraction = /\.(\d+)(?:Z|[+-]\d{2}:\d{2})$/i.exec(value)?.[1] ?? '';+ // Truncate before constructing a Date: sub-millisecond negative instants otherwise round to zero.+ const milliseconds = parseISO(+ value.replace(/(\.\d{3})\d+(?=(?:Z|[+-]\d{2}:\d{2})$)/i, '$1')+ ).getTime();+ if (!Number.isFinite(milliseconds)) return;+ const microseconds = Math.round(+ Number(`0.${fraction.slice(3) || '0'}`) * 1000+ );+ return milliseconds * 1000 + microseconds;+}++/** The numeric property key used by Soup; mismatched value variants are missing. */+export function propertySortKey(+ property: SoupProperty | undefined,+ options: readonly PropertyOption[] = []+): number | undefined {+ const value = property?.value;+ if (!value || !property) return;+ switch (property.definition.data_type) {+ case 'DATE':+ return value.type === 'Date'+ ? propertyDateSortKey(value.value)+ : undefined;+ case 'NUMBER':+ return value.type === 'Number' && Number.isFinite(value.value)+ ? value.value+ : undefined;+ case 'BOOLEAN':+ return value.type === 'Boolean' ? Number(value.value) : undefined;+ case 'SELECT_STRING':+ case 'SELECT_NUMBER':+ case 'TAG': {+ if (value.type !== 'SelectOption') return;+ const orders = options+ .filter(+ (option) =>+ option.property_definition_id === property.definition.id &&+ value.value.includes(option.id)+ )+ .map((option) => option.display_order);+ return orders.length ? Math.min(...orders) : undefined;+ }+ default:+ return undefined;+ }+}diff --git a/apps/web/src/features/tasks-view/AGENTS.md b/apps/web/src/features/tasks-view/AGENTS.mdindex 7c30e6ad64..7f19384ee6 100644--- a/apps/web/src/features/tasks-view/AGENTS.md+++ b/apps/web/src/features/tasks-view/AGENTS.md@@ -8,7 +8,7 @@ Main Tasks and reusable task-list hosts. Projects and CRM embed `TasksViewProvid- `tasks-view.tsx` and `tasks-view-context.tsx`: independent saved-view list/detail query composition, filter state, router integration, and task-list source ownership.- `filters/task-saved-view.ts`: strict capture and permissive reading of supported filters, with diagnostics for skipped conditions.-- `primitives/create-task-saved-view-draft.ts`: confirmed filter/layout/grouping/sort snapshots, dirty state, skipped-setting diagnostics, and revision-aware reconciliation; receives only the detail source, without navigation, mutation, or dialog state.+- `primitives/create-task-saved-view-draft.ts`: confirmed filter/due-date/layout/grouping/sort snapshots, dirty state, skipped-setting diagnostics, and revision-aware reconciliation; receives only the detail source, without navigation, mutation, or dialog state.- `views/task-saved-views.tsx`: compound sidebar/mobile lists, filter summaries, imperative action dialogs, and request-scoped write/reload completion; the Tasks host owns selection and navigation.- `queries/use-tasks-query.ts`: shared list, board, Gantt, and search filtering.@@ -18,14 +18,14 @@ Main Tasks and reusable task-list hosts. Projects and CRM embed `TasksViewProvid- Keep project navigation in a separate Projects section above Saved views, with assigned-to-me, all-accessible, and created-by-me views; replace individual-project shortcuts and use one mobile Projects picker.- Preserve project scope through detail navigation, history, pagination, and editable-filter clearing; keep project views out of task queries and saved-task-view capture.-- Save filters, selected layout, grouping, and ordered sort directions; keep text search and scroll state local, and capture implicit person conditions as normal OR-valued facets.+- Save filters, relative due dates or valid calendar bounds, selected layout, grouping, and ordered sort directions; keep text search and scroll state local, and capture implicit person conditions as normal OR-valued facets.- Preserve stable tag/property bindings when labels disappear; skip unsupported or malformed conditions without discarding supported filters.- Label the semantic viewer token Me, explain it with “Matches whoever opens this saved view,” and resolve it only when executing a filter; a selected fixed user stays fixed.- Keep saved views on All Tasks with every restriction in editable facets; accept only the final v1 person-filter format, without a separate Scope control.-- Do not persist temporary saved-view filters in entry snapshots; detail navigation discards those edits but retains the saved-view ID.+- Do not persist temporary saved-view filters, including due-date predicates, in entry snapshots; detail navigation discards those edits but retains the saved-view ID.- Pass saved-view state through the existing Tasks search codec; split URLs namespace it as `s0.tasks.savedView`.- Keep embedded Project/CRM task consumers free of saved-view management.-- Show filled Save view and Save changes actions; place mobile creation in a borderless, edge-to-edge info banner overlaying filter content immediately above the footer with unpunctuated copy and a leading bookmark icon on its button only when filters, layout, grouping, or sort differ from the built-in tab defaults, excluding search.+- Show filled Save view and Save changes actions; place mobile creation in a borderless, edge-to-edge info banner overlaying filter content immediately above the footer with unpunctuated copy and a leading bookmark icon on its button only when filters, due date, layout, grouping, or sort differ from the built-in tab defaults, excluding search.- Render Save view and draft Cancel as separate standalone buttons; preserve their existing dialog and cancellation behavior.- Keep sidebar actions targeted to their own record; Edit combines naming and sharing without saving temporary settings, and Duplicate starts with a prefilled private copy and warns before omitting unsupported settings.- Keep saved-view names and menus in the mobile picker; overlay creation above the filter drawer footer on a drawer-colored backing without blocking the last scrollable controls, and put Save changes at the footer's right edge, opposite Clear all.diff --git a/apps/web/src/features/tasks-view/components/TasksControls.tsx b/apps/web/src/features/tasks-view/components/TasksControls.tsxindex 7ba78f55af..d1ca554635 100644--- a/apps/web/src/features/tasks-view/components/TasksControls.tsx+++ b/apps/web/src/features/tasks-view/components/TasksControls.tsx@@ -19,6 +19,7 @@ import { useTaskFilters } from '../filters/use-task-filters';import { useTasksView } from '../tasks-view-context';import { TASKS_TOUR } from '../tour';import { TasksFilterDrawer } from './TasksFilterDrawer';+import { TaskDueDateRangeDialog } from './task-due-date-range-dialog';export function TasksControls() {return (@@ -60,7 +61,7 @@ function DesktopTasksControls() {sort: {description: 'Sort tasks',run: () => {- if (!sortTrigger) return false;+ if (!sortTrigger || state.search.trim()) return false;setOpenMenu('sort');return true;@@ -69,7 +70,7 @@ function DesktopTasksControls() {});const primarySort = () => state.sort[0]?.id ?? 'updated_at';- const isBoardSearch = () => state.layout === 'board' && !!state.search.trim();+ const isSearching = () => !!state.search.trim();const groupOptions = () => {if (state.layout !== 'board') {@@ -141,13 +142,13 @@ function DesktopTasksControls() {</HeaderActionGroup><HeaderActionGroup label="Task view options" size="md"><Show- when={!isBoardSearch()}+ when={!isSearching()}fallback={<spanclass="text-xs text-ink-muted"- title="Search results are ranked by relevance. Clear search to sort the board."+ title="Search keeps its existing result ordering. Clear search to sort tasks.">- Relevance+ Search order</span>}>@@ -172,6 +173,11 @@ function DesktopTasksControls() {onChange={(groupBy) => setState('groupBy', groupBy)}/></HeaderActionGroup>+ <TaskDueDateRangeDialog+ value={filters.customRange()}+ onChange={filters.setCustomRange}+ onApply={filters.applyCustomRange}+ /></>);}diff --git a/apps/web/src/features/tasks-view/components/TasksFilterDrawer.tsx b/apps/web/src/features/tasks-view/components/TasksFilterDrawer.tsxindex fd4190825f..693fcbfced 100644--- a/apps/web/src/features/tasks-view/components/TasksFilterDrawer.tsx+++ b/apps/web/src/features/tasks-view/components/TasksFilterDrawer.tsx@@ -3,7 +3,14 @@ import { MobileDrawer } from '@components/app/mobile/MobileDrawer';import { fireAndForget } from '@core/util/fireAndForget';import { Accordion } from '@kobalte/core/accordion';import type { DialogHandle } from '@ui';-import { createMemo, createSignal, For, getOwner, onCleanup } from 'solid-js';+import {+ createMemo,+ createSignal,+ For,+ getOwner,+ onCleanup,+ Show,+} from 'solid-js';import { TASK_GROUP_OPTIONS, TASK_SORT_OPTIONS } from '../constants';import { useTaskFilters } from '../filters/use-task-filters';import { useTasksView } from '../tasks-view-context';@@ -11,6 +18,7 @@ import {TaskSavedViewActions,TaskSavedViewCreateBanner,} from '../views/task-saved-views';+import { TaskDueDateRangeDialog } from './task-due-date-range-dialog';export function TasksFilterDrawer() {const { state, setPrimarySort, setState, savedViews, savedViewScope } =@@ -61,110 +69,131 @@ export function TasksFilterDrawer() {};return (- <MobileFilterDrawer- open={open()}- onOpenChange={setOpen}- onContentPresentChange={afterClose}- triggerLabel="Open task filters"- label="Task list controls"- activeCount={filters.activeCount()}- onClear={filters.clear}- contentOverlay={() => (- <TaskSavedViewCreateBanner dialogOwner={owner} onCreate={onCreate} />- )}- footerEnd={() =>- editingSavedView() && (- <TaskSavedViewActions dialogOwner={owner} onCreate={onCreate} />- )- }- >- <MobileDrawer.Label id="task-sort-label" class="pt-4">- Sort- </MobileDrawer.Label>- <MobileDrawer.Section role="radiogroup" aria-labelledby="task-sort-label">- <For each={TASK_SORT_OPTIONS}>- {(option) => {- const selected = () => primarySort() === option.id;-- return (- <MobileFilterDrawer.Option- selectionMode="single"- checked={selected()}- onChange={() => setPrimarySort(option.id)}- >- {option.label}- </MobileFilterDrawer.Option>- );- }}- </For>- </MobileDrawer.Section>-- <MobileDrawer.Label id="task-group-label" class="pt-4">- Group- </MobileDrawer.Label>- <MobileDrawer.Section- role="radiogroup"- aria-labelledby="task-group-label"+ <>+ <MobileFilterDrawer+ open={open()}+ onOpenChange={setOpen}+ onContentPresentChange={afterClose}+ triggerLabel="Open task filters"+ label="Task list controls"+ activeCount={filters.activeCount()}+ onClear={filters.clear}+ contentOverlay={() => (+ <TaskSavedViewCreateBanner dialogOwner={owner} onCreate={onCreate} />+ )}+ footerEnd={() =>+ editingSavedView() && (+ <TaskSavedViewActions dialogOwner={owner} onCreate={onCreate} />+ )+ }>- <For each={TASK_GROUP_OPTIONS}>- {(option) => {- const selected = () => state.groupBy === option.id;+ <Show+ when={!state.search.trim()}+ fallback={+ <MobileDrawer.Label class="pt-4">+ Search ordering+ </MobileDrawer.Label>+ }+ >+ <MobileDrawer.Label id="task-sort-label" class="pt-4">+ Sort+ </MobileDrawer.Label>+ <MobileDrawer.Section+ role="radiogroup"+ aria-labelledby="task-sort-label"+ >+ <For each={TASK_SORT_OPTIONS}>+ {(option) => {+ const selected = () => primarySort() === option.id;- return (- <MobileFilterDrawer.Option- selectionMode="single"- checked={selected()}- onChange={() => setState('groupBy', option.id)}- >- {option.label}- </MobileFilterDrawer.Option>- );- }}- </For>- </MobileDrawer.Section>+ return (+ <MobileFilterDrawer.Option+ selectionMode="single"+ checked={selected()}+ onChange={() => setPrimarySort(option.id)}+ >+ {option.label}+ </MobileFilterDrawer.Option>+ );+ }}+ </For>+ </MobileDrawer.Section>+ </Show>- <MobileDrawer.Label class="pt-4">Filters</MobileDrawer.Label>- <Accordion- multiple- collapsible- defaultValue={[filters.groups()[0]?.id ?? 'status']}- >- <div class="flex flex-col gap-3">- <For each={filters.groups()}>- {(group) => {- const activeCount = createMemo(- () =>- group.options.filter((option) =>- filters.isSelected(group.id, option.id)- ).length- );+ <MobileDrawer.Label id="task-group-label" class="pt-4">+ Group+ </MobileDrawer.Label>+ <MobileDrawer.Section+ role="radiogroup"+ aria-labelledby="task-group-label"+ >+ <For each={TASK_GROUP_OPTIONS}>+ {(option) => {+ const selected = () => state.groupBy === option.id;return (- <MobileFilterDrawer.Section- value={group.id}- label={group.label}- activeCount={activeCount()}+ <MobileFilterDrawer.Option+ selectionMode="single"+ checked={selected()}+ onChange={() => setState('groupBy', option.id)}>- <For each={group.options}>- {(option) => (- <MobileFilterDrawer.Option- selectionMode={group.selectionMode ?? 'multiple'}- checked={filters.isSelected(group.id, option.id)}- onChange={(checked) =>- filters.setSelected(group.id, option.id, checked)- }- icon={option.icon?.()}- >- {option.content?.() ?? option.label}- </MobileFilterDrawer.Option>- )}- </For>- </MobileFilterDrawer.Section>+ {option.label}+ </MobileFilterDrawer.Option>);}}</For>- </div>- </Accordion>- </MobileFilterDrawer>+ </MobileDrawer.Section>++ <MobileDrawer.Label class="pt-4">Filters</MobileDrawer.Label>+ <Accordion+ multiple+ collapsible+ defaultValue={[filters.groups()[0]?.id ?? 'status']}+ >+ <div class="flex flex-col gap-3">+ <For each={filters.groups()}>+ {(group) => {+ const activeCount = createMemo(+ () =>+ group.options.filter(+ (option) =>+ option.id !== group.defaultOptionId &&+ filters.isSelected(group.id, option.id)+ ).length+ );++ return (+ <MobileFilterDrawer.Section+ value={group.id}+ label={group.label}+ activeCount={activeCount()}+ >+ <For each={group.options}>+ {(option) => (+ <MobileFilterDrawer.Option+ selectionMode={group.selectionMode ?? 'multiple'}+ checked={filters.isSelected(group.id, option.id)}+ onChange={(checked) =>+ filters.setSelected(group.id, option.id, checked)+ }+ icon={option.icon?.()}+ >+ {option.content?.() ?? option.label}+ </MobileFilterDrawer.Option>+ )}+ </For>+ </MobileFilterDrawer.Section>+ );+ }}+ </For>+ </div>+ </Accordion>+ </MobileFilterDrawer>+ <TaskDueDateRangeDialog+ value={filters.customRange()}+ onChange={filters.setCustomRange}+ onApply={filters.applyCustomRange}+ />+ </>);}diff --git a/apps/web/src/features/tasks-view/components/task-board-property.tsx b/apps/web/src/features/tasks-view/components/task-board-property.tsxindex 72aa89c6b0..74588bd597 100644--- a/apps/web/src/features/tasks-view/components/task-board-property.tsx+++ b/apps/web/src/features/tasks-view/components/task-board-property.tsx@@ -29,6 +29,9 @@ export function TaskBoardColumnIcon(props: {<Match when={hasOptionIcon()}><PropertyValueIcon optionId={props.id} class="size-4" /></Match>+ <Match when={props.grouping === 'due_date' && props.id !== 'no_due_date'}>+ <CalendarIcon class="size-4 text-ink-muted" />+ </Match><Match when={props.grouping === 'project'}><ProjectIcon class="size-4 text-ink-muted" /></Match>@@ -57,6 +60,7 @@ export function TaskBoardProperty(props: {canEdit: boolean;iconOnly?: boolean;onSave: PropertySaveFn;+ dueDateUrgency?: 'danger' | 'warning';}) {return (<Property.Root@@ -109,7 +113,15 @@ export function TaskBoardProperty(props: {</Show></Match><Match when={isDate()}>- <CalendarIcon class="size-3.5 shrink-0" />+ <Show when={shown().value != null}>+ <CalendarIcon+ class="size-3.5 shrink-0"+ classList={{+ 'text-failure': props.dueDateUrgency === 'danger',+ 'text-warning': props.dueDateUrgency === 'warning',+ }}+ />+ </Show></Match><Match when={hasSelectIcon()}><Property.Icon@@ -122,7 +134,7 @@ export function TaskBoardProperty(props: {<Property.Textproperty={shown()}resolveSingleEntity={isProject()}- class="min-w-0 truncate"+ class={`min-w-0 truncate ${isDate() && props.dueDateUrgency === 'danger' ? 'text-failure' : ''} ${isDate() && props.dueDateUrgency === 'warning' ? 'text-warning' : ''}`}fallback={<span>{shown().displayName}</span>}/></Show>diff --git a/apps/web/src/features/tasks-view/components/task-deadline-move-dialog.tsx b/apps/web/src/features/tasks-view/components/task-deadline-move-dialog.tsxnew file mode 100644index 0000000000..32cd9dc740--- /dev/null+++ b/apps/web/src/features/tasks-view/components/task-deadline-move-dialog.tsx@@ -0,0 +1,50 @@+import { Button } from '@ui/components/Button';+import { DatePicker } from '@ui/components/DatePicker';+import { Dialog } from '@ui/components/Dialog';+import { createUniqueId } from 'solid-js';++export function TaskDeadlineMoveDialog(props: {+ picker:+ | { label: string; value: string; min?: string; max?: string }+ | undefined;+ onChange(value: string): void;+ onApply(): void;+ onCancel(): void;+}) {+ const titleId = createUniqueId();+ return (+ <Dialog+ open={!!props.picker}+ onOpenChange={(open) => !open && props.onCancel()}+ class="max-w-sm"+ position="center"+ >+ <div class="flex flex-col gap-4 p-5">+ <Dialog.Title id={titleId} class="text-base font-medium">+ Reschedule task+ </Dialog.Title>+ <p class="text-sm text-ink-muted">+ Choose a due date in {props.picker?.label}.+ </p>+ <DatePicker+ aria-label="New task due date"+ required+ value={props.picker?.value ?? ''}+ min={props.picker?.min}+ max={props.picker?.max}+ onChange={props.onChange}+ />+ <div class="flex justify-end gap-2">+ <Button onClick={props.onCancel}>Cancel</Button>+ <Button+ variant="accent"+ disabled={!props.picker?.value}+ onClick={props.onApply}+ >+ Apply+ </Button>+ </div>+ </div>+ </Dialog>+ );+}diff --git a/apps/web/src/features/tasks-view/components/task-due-date-range-dialog.tsx b/apps/web/src/features/tasks-view/components/task-due-date-range-dialog.tsxnew file mode 100644index 0000000000..d962fe1750--- /dev/null+++ b/apps/web/src/features/tasks-view/components/task-due-date-range-dialog.tsx@@ -0,0 +1,68 @@+import { Button } from '@ui/components/Button';+import { DatePicker } from '@ui/components/DatePicker';+import { Dialog } from '@ui/components/Dialog';+import { createUniqueId } from 'solid-js';++export type TaskDateRangeDraft = { start: string; end: string };++export function TaskDueDateRangeDialog(props: {+ value: TaskDateRangeDraft | undefined;+ onChange(value: TaskDateRangeDraft | undefined): void;+ onApply(): void;+}) {+ const titleId = createUniqueId();+ const valid = () =>+ props.value &&+ Boolean(props.value.start || props.value.end) &&+ (!props.value.start ||+ !props.value.end ||+ props.value.start <= props.value.end);+ return (+ <Dialog+ open={!!props.value}+ onOpenChange={(open) => !open && props.onChange(undefined)}+ class="max-w-md"+ position="center"+ >+ <div class="flex flex-col gap-4 p-5">+ <Dialog.Title id={titleId} class="text-base font-medium">+ Due date range+ </Dialog.Title>+ <p class="text-sm text-ink-muted">+ Include tasks due on these dates. Leave either end empty for an+ open-ended range.+ </p>+ <div class="grid grid-cols-2 gap-3">+ <label class="flex flex-col gap-1 text-sm">+ From+ <DatePicker+ aria-label="Due date from"+ value={props.value?.start ?? ''}+ max={props.value?.end || undefined}+ onChange={(start) =>+ props.onChange({ start, end: props.value?.end ?? '' })+ }+ />+ </label>+ <label class="flex flex-col gap-1 text-sm">+ Through+ <DatePicker+ aria-label="Due date through"+ value={props.value?.end ?? ''}+ min={props.value?.start || undefined}+ onChange={(end) =>+ props.onChange({ start: props.value?.start ?? '', end })+ }+ />+ </label>+ </div>+ <div class="flex justify-end gap-2">+ <Button onClick={() => props.onChange(undefined)}>Cancel</Button>+ <Button variant="accent" disabled={!valid()} onClick={props.onApply}>+ Apply+ </Button>+ </div>+ </div>+ </Dialog>+ );+}diff --git a/apps/web/src/features/tasks-view/components/task-list/TaskGridLayout.tsx b/apps/web/src/features/tasks-view/components/task-list/TaskGridLayout.tsxindex a7af3d88fc..ee9021f84e 100644--- a/apps/web/src/features/tasks-view/components/task-list/TaskGridLayout.tsx+++ b/apps/web/src/features/tasks-view/components/task-list/TaskGridLayout.tsx@@ -11,9 +11,11 @@ import {CreatedByBadgeSmall,SharedBadgeSmall,} from '@entity/components/Badges';+import { NarrowLayout } from '@entity/composed/list-entity/narrow-layout';import type { LayoutProps } from '@entity/composed/list-entity/shared';import { soupPropertyToProperty } from '@entity/extractors-property';import { EntityReferenceProperties } from '@entity/extractors-property/entity-reference-properties';+import { getTaskDueDate, isTaskClosed } from '@entity/utils/task-properties';import { ListPropertyValue } from '@property/component/ListPropertyValue';import { Modals } from '@property/component/modal';import {@@ -26,8 +28,13 @@ import { useBulkSaveEntityPropertiesMutation } from '@queries/properties/entity'import { EntityType } from '@service-properties/generated/schemas/entityType';import type { SoupProperty } from '@service-storage/generated/schemas/soupProperty';import { cn } from '@ui/utils/classname';-import { createMemo, For, Show, Suspense } from 'solid-js';+import { type Accessor, createMemo, For, Show, Suspense } from 'solid-js';import {+ type DateBucketBoundaries,+ taskDueDateUrgency,+} from '../../core/task-due-date';+import {+ TASK_DUE_DATE_COLUMN,TASK_GRID_COLUMNS,TASK_PROJECT_COLUMN,type TaskGridColumn,@@ -62,6 +69,8 @@ function buildStubProperty(col: TaskGridColumn): Property {type TaskGridLayoutProps = Omit<LayoutProps, 'entity'> & {entity: TaskEntityWithProperties;onFilterByTag?: (optionId: string) => void;+ compact?: boolean;+ calendar: Accessor<DateBucketBoundaries>;referencePropertyIds?: readonly string[];};@@ -103,6 +112,19 @@ export function TaskGridLayout(props: TaskGridLayoutProps) {saveOne(property, { valueType: 'DATE', value: date }),};+ const dueDateClass = () => {+ const urgency = taskDueDateUrgency(+ getTaskDueDate(props.entity),+ isTaskClosed(props.entity),+ props.calendar()+ );+ return cn({+ 'text-failure': urgency === 'danger',+ 'text-warning': urgency === 'warning',+ 'text-ink-muted': !urgency,+ });+ };+return (<PropertiesProviderentityId={props.entity.id}@@ -114,133 +136,152 @@ export function TaskGridLayout(props: TaskGridLayoutProps) {onPropertyDeleted={() => {}}saveHandler={saveHandler}>- <Entity.Layout- class={cn(- 'task-grid-row w-full min-h-[inherit] items-center text-sm px-2',- 'gap-2 grid grid-rows-[1fr]'- )}- style={taskGridTemplate({- indicator: !props.hideCheckbox,- project: props.showProject === true,- })}- >- <Show when={!props.hideCheckbox}>- <Entity.Slot placement="indicator" class="relative size-full group">- <div class="absolute inset-0 grid place-items-center group-hover:opacity-0">- <UnreadIndicator active={props.unread} />- </div>- <div- class={cn(- 'absolute inset-0 grid place-items-center opacity-0 group-hover:opacity-100',- {- 'opacity-100': props.checked,+ <Show+ when={!props.compact}+ fallback={+ <NarrowLayout {...props}>+ <div class="w-8 min-w-0">+ <ListPropertyValue+ entityId={props.entity.id}+ property={+ propertyMap().get(TASK_DUE_DATE_COLUMN.defId) ??+ buildStubProperty(TASK_DUE_DATE_COLUMN)}- )}- >- <MultiSelectCheckbox- checked={props.checked}- onChecked={props.onChecked}+ class={dueDateClass()}/></div>- </Entity.Slot>- </Show>-- <Entity.Slot- placement="content"- class="ph-no-capture font-medium truncate items-center gap-2 flex min-w-0"+ </NarrowLayout>+ }+ >+ <Entity.Layout+ class={cn(+ 'task-grid-row w-full min-h-[inherit] items-center text-sm px-2',+ 'gap-2 grid grid-rows-[1fr]'+ )}+ style={taskGridTemplate({+ indicator: !props.hideCheckbox,+ project: props.showProject === true,+ })}>- <div class="size-4 shrink-0">- <Entity.Icon- entity={props.entity}- streamState={props.streamState}- />- </div>- <span class="truncate min-w-0">- <Entity.Title entity={props.entity} />- </span>- <Show when={isProjectContainedEntity(props.entity) && props.entity}>- {(entity) => (- <span class="ph-no-capture text-ink text-xs shrink-0 truncate border border-edge-muted px-2 rounded-sm py-0.5">- <ProjectBreadCrumb- entity={entity()}- onClick={props.onProjectClick}+ <Show when={!props.hideCheckbox}>+ <Entity.Slot placement="indicator" class="relative size-full group">+ <div class="absolute inset-0 grid place-items-center group-hover:opacity-0">+ <UnreadIndicator active={props.unread} />+ </div>+ <div+ class={cn(+ 'absolute inset-0 grid place-items-center opacity-0 group-hover:opacity-100',+ {+ 'opacity-100': props.checked,+ }+ )}+ >+ <MultiSelectCheckbox+ checked={props.checked}+ onChecked={props.onChecked}/>- </span>- )}- </Show>- <Show when={props.isShared}>- <span class="@min-[841px]/u-list:hidden">- <SharedBadgeSmall ownerId={props.entity.ownerId} />- </span>- <span class="hidden @min-[841px]/u-list:inline @min-[1221px]/u-list:hidden">- <CreatedByBadgeSmall ownerId={props.entity.ownerId} />- </span>+ </div>+ </Entity.Slot></Show>- <Show when={props.referencePropertyIds}>- {(ids) => (- <EntityReferenceProperties++ <Entity.Slot+ placement="content"+ class="ph-no-capture font-medium truncate items-center gap-2 flex min-w-0"+ >+ <div class="size-4 shrink-0">+ <Entity.Iconentity={props.entity}- propertyIds={ids()}- compact={false}+ streamState={props.streamState}/>+ </div>+ <span class="truncate min-w-0">+ <Entity.Title entity={props.entity} />+ </span>+ <Show when={isProjectContainedEntity(props.entity) && props.entity}>+ {(entity) => (+ <span class="ph-no-capture text-ink text-xs shrink-0 truncate border border-edge-muted px-2 rounded-sm py-0.5">+ <ProjectBreadCrumb+ entity={entity()}+ onClick={props.onProjectClick}+ />+ </span>+ )}+ </Show>+ <Show when={props.isShared}>+ <span class="@min-[841px]/u-list:hidden">+ <SharedBadgeSmall ownerId={props.entity.ownerId} />+ </span>+ <span class="hidden @min-[841px]/u-list:inline @min-[1221px]/u-list:hidden">+ <CreatedByBadgeSmall ownerId={props.entity.ownerId} />+ </span>+ </Show>+ <Show when={props.referencePropertyIds}>+ {(ids) => (+ <EntityReferenceProperties+ entity={props.entity}+ propertyIds={ids()}+ compact={false}+ />+ )}+ </Show>+ <EntityRowTags+ entityId={props.entity.id}+ entityType={EntityType.TASK}+ properties={entity().properties}+ onFilterByTag={props.onFilterByTag}+ class="ml-auto"+ />+ </Entity.Slot>++ <For each={TASK_GRID_COLUMNS}>+ {(col) => (+ <Entity.Slot+ placement={col.id}+ class="flex items-center min-w-0 text-xs ph-no-capture @container/slot @max-[840px]/u-list:justify-center"+ >+ <ListPropertyValue+ entityId={props.entity.id}+ class={col.id === 'dueDate' ? dueDateClass() : undefined}+ property={+ propertyMap().get(col.defId) ?? buildStubProperty(col)+ }+ />+ </Entity.Slot>)}- </Show>- <EntityRowTags- entityId={props.entity.id}- entityType={EntityType.TASK}- properties={entity().properties}- onFilterByTag={props.onFilterByTag}- class="ml-auto"- />- </Entity.Slot>-- <For each={TASK_GRID_COLUMNS}>- {(col) => (+ </For>++ <Show when={props.showProject}><Entity.Slot- placement={col.id}+ placement={TASK_PROJECT_COLUMN.id}class="flex items-center min-w-0 text-xs ph-no-capture @container/slot @max-[840px]/u-list:justify-center"><ListPropertyValueentityId={props.entity.id}property={- propertyMap().get(col.defId) ?? buildStubProperty(col)+ propertyMap().get(TASK_PROJECT_COLUMN.defId) ??+ buildStubProperty(TASK_PROJECT_COLUMN)}/></Entity.Slot>- )}- </For>+ </Show>- <Show when={props.showProject}><Entity.Slot- placement={TASK_PROJECT_COLUMN.id}- class="flex items-center min-w-0 text-xs ph-no-capture @container/slot @max-[840px]/u-list:justify-center"+ placement="createdBy"+ class="hidden @min-[1221px]/u-list:flex items-center min-w-0 overflow-hidden text-xs text-ink-muted ph-no-capture">- <ListPropertyValue- entityId={props.entity.id}- property={- propertyMap().get(TASK_PROJECT_COLUMN.defId) ??- buildStubProperty(TASK_PROJECT_COLUMN)- }- />+ <OwnerLabel ownerId={props.entity.ownerId} viewerLabel="Me" /></Entity.Slot>- </Show>-- <Entity.Slot- placement="createdBy"- class="hidden @min-[1221px]/u-list:flex items-center min-w-0 overflow-hidden text-xs text-ink-muted ph-no-capture"- >- <OwnerLabel ownerId={props.entity.ownerId} viewerLabel="Me" />- </Entity.Slot>- <Entity.Slot- placement="timestamp"- class="text-xs text-right text-ink-extra-muted font-light"- >- <Show when={!props.hasNotifications}>- <Entity.Timestamp entity={props.entity} />- </Show>- </Entity.Slot>- </Entity.Layout>+ <Entity.Slot+ placement="timestamp"+ class="text-xs text-right text-ink-extra-muted font-light @max-[840px]/u-list:hidden"+ >+ <Show when={!props.hasNotifications}>+ <Entity.Timestamp entity={props.entity} />+ </Show>+ </Entity.Slot>+ </Entity.Layout>+ </Show><Suspense><Modals /></Suspense>diff --git a/apps/web/src/features/tasks-view/components/task-list/TaskList.tsx b/apps/web/src/features/tasks-view/components/task-list/TaskList.tsxindex 871bb7ecbb..dd9d1292e3 100644--- a/apps/web/src/features/tasks-view/components/task-list/TaskList.tsx+++ b/apps/web/src/features/tasks-view/components/task-list/TaskList.tsx@@ -105,6 +105,7 @@ export function TaskList(props: TaskListProps) {const panel = useSplitPanelOrThrow();const {state,+ calendar,projectsEnabled,showTaskProject,setState,@@ -586,6 +587,7 @@ export function TaskList(props: TaskListProps) {<TaskListEntityreferencePropertyIds={props.referencePropertyIds}showProject={showTaskProject()}+ calendar={calendar}rowId={entityRow().id}entity={entityRow().entity}highlighted={list.focus.key() === entityRow().id}diff --git a/apps/web/src/features/tasks-view/components/task-list/TaskListEntity.tsx b/apps/web/src/features/tasks-view/components/task-list/TaskListEntity.tsxindex 4110980823..9bf592ad44 100644--- a/apps/web/src/features/tasks-view/components/task-list/TaskListEntity.tsx+++ b/apps/web/src/features/tasks-view/components/task-list/TaskListEntity.tsx@@ -17,7 +17,6 @@ import {unreadFilterFn,useIsShared,} from '@entity';-import { NarrowLayout } from '@entity/composed/list-entity/narrow-layout';import {type BaseListEntityProps,hasSearchContentHits,@@ -37,6 +36,7 @@ import {} from '@service-connection/stream-events';import { mergeRefs } from '@solid-primitives/refs';import { cn } from '@ui/utils/classname';+import type { Accessor } from 'solid-js';import {createEffect,createSignal,@@ -46,10 +46,12 @@ import {Switch,useContext,} from 'solid-js';+import type { DateBucketBoundaries } from '../../core/task-due-date';import { TaskGridLayout } from './TaskGridLayout';type TaskListEntityProps = Omit<BaseListEntityProps, 'entity'> & {entity: TaskEntityWithProperties;+ calendar: Accessor<DateBucketBoundaries>;rowId?: string;showUnrollNotifications?: boolean;/** Show the Project column (Projects enabled). */@@ -121,6 +123,7 @@ export function TaskListEntity(props: TaskListEntityProps) {const layoutProps = () => ({entity: props.entity,+ calendar: props.calendar,checked: props.checked,hideCheckbox: props.hideCheckbox,onChecked: props.onChecked,@@ -188,7 +191,7 @@ export function TaskListEntity(props: TaskListEntityProps) {entityId={props.entity.id}config={props.entityRowConfig}>- <NarrowLayout {...layoutProps()} />+ <TaskGridLayout {...layoutProps()} compact /><Show when={props.referencePropertyIds}>{(ids) => (<div class="px-3 pb-1">diff --git a/apps/web/src/features/tasks-view/components/task-list/TaskListHeader.tsx b/apps/web/src/features/tasks-view/components/task-list/TaskListHeader.tsxindex 0b2d3afe9d..e2c21cddd0 100644--- a/apps/web/src/features/tasks-view/components/task-list/TaskListHeader.tsx+++ b/apps/web/src/features/tasks-view/components/task-list/TaskListHeader.tsx@@ -9,12 +9,19 @@ function SortableHeader(props: {label: string;area: string;sortId?: TaskSortId;+ reverseSortId?: TaskSortId;align?: 'start' | 'end';class?: string;}) {const { state, setPrimarySort } = useTasksView();- const active = () => state.sort[0]?.id === props.sortId;- const reversed = () => active() && state.sort[0]?.reversed === true;+ const active = () =>+ state.sort[0]?.id === props.sortId ||+ (props.reverseSortId !== undefined &&+ state.sort[0]?.id === props.reverseSortId);+ const reversed = () =>+ active() &&+ (state.sort[0]?.id === props.reverseSortId ||+ state.sort[0]?.reversed === true);const alignment = () => {if (props.align === 'end') return 'justify-end';return 'justify-start';@@ -38,7 +45,13 @@ function SortableHeader(props: {'flex h-full min-w-0 items-center gap-1 text-ink-extra-muted hover:text-ink',active() && 'text-ink')}- onClick={() => setPrimarySort(sortId())}+ onClick={() => {+ if (props.reverseSortId && state.sort[0]?.id === sortId()) {+ setPrimarySort(props.reverseSortId);+ return;+ }+ setPrimarySort(sortId());+ }}><span class="truncate">{props.label}</span><ArrowDownIcon@@ -73,6 +86,12 @@ export function TaskListHeader() {<SortableHeader label="Status" area="status" /><SortableHeader label="Priority" area="priority" /><SortableHeader label="Assignees" area="assignees" />+ <SortableHeader+ label="Due date"+ area="dueDate"+ sortId="due_date_earliest"+ reverseSortId="due_date_latest"+ /><Show when={showTaskProject()}><SortableHeader label="Project" area="initiative" /></Show>@@ -86,6 +105,7 @@ export function TaskListHeader() {area="timestamp"sortId="updated_at"align="end"+ class="@max-[840px]/u-list:hidden"/></div>);diff --git a/apps/web/src/features/tasks-view/components/task-list/task-grid-template.ts b/apps/web/src/features/tasks-view/components/task-list/task-grid-template.tsindex 26d1bae3bd..fe93b606bb 100644--- a/apps/web/src/features/tasks-view/components/task-list/task-grid-template.ts+++ b/apps/web/src/features/tasks-view/components/task-list/task-grid-template.ts@@ -2,6 +2,15 @@ import { SYSTEM_PROPERTY_IDS } from '@property/constants';import { DataType } from '@service-storage/generated/schemas/dataType';import { EntityType } from '@service-storage/generated/schemas/entityType';+export const TASK_DUE_DATE_COLUMN = {+ id: 'dueDate',+ label: 'Due date',+ defId: SYSTEM_PROPERTY_IDS.DUE_DATE,+ dataType: DataType.DATE,+ isMultiSelect: false,+ specificEntityType: null,+ width: 'var(--task-col-due-date, 8.5rem)',+} as const;export const TASK_GRID_COLUMNS = [{id: 'status',@@ -32,6 +41,7 @@ export const TASK_GRID_COLUMNS = [specificEntityType: EntityType.USER,width: 'var(--task-col-assignees, 7rem)',},+ TASK_DUE_DATE_COLUMN,] as const;/** The task's project, shown only while Projects is enabled. */@@ -75,4 +85,4 @@ export function taskGridTemplate(options: {}/** Column span for full-width rows such as group headers. */-export const taskGridColumnCount = (project: boolean) => (project ? 8 : 7);+export const taskGridColumnCount = (project: boolean) => (project ? 9 : 8);diff --git a/apps/web/src/features/tasks-view/components/task-list/task-list.css b/apps/web/src/features/tasks-view/components/task-list/task-list.cssindex 6ea96889e0..1526cf6ac2 100644--- a/apps/web/src/features/tasks-view/components/task-list/task-list.css+++ b/apps/web/src/features/tasks-view/components/task-list/task-list.css@@ -2,6 +2,7 @@--task-col-status: 7.25rem;--task-col-priority: 7rem;--task-col-assignees: 9rem;+ --task-col-due-date: 8.5rem;--task-col-created-by: 7rem;--task-col-timestamp: 5rem;--task-col-initiative: 8rem;@@ -14,14 +15,15 @@}}-/* Narrow containers: collapse property columns to icons */+/* Narrow containers: collapse property values to icons. */@container u-list (max-width: 840px) {.task-grid-row {--task-col-status: 2rem;--task-col-priority: 2rem;--task-col-assignees: 3rem;+ --task-col-due-date: 2rem;--task-col-created-by: 0rem;- --task-col-timestamp: 5rem;+ --task-col-timestamp: 0rem;--task-col-initiative: 6rem;}}diff --git a/apps/web/src/features/tasks-view/constants.ts b/apps/web/src/features/tasks-view/constants.tsindex d710db47c6..a9583793d5 100644--- a/apps/web/src/features/tasks-view/constants.ts+++ b/apps/web/src/features/tasks-view/constants.ts@@ -1,7 +1,14 @@import type { SortDefinition } from '@app/features/soup';+import {+ type SortSelection,+ sortItems,+} from '@app/features/soup/collection/transforms';import { t } from '@app/lib/i18n';import { compareDateDesc } from '@core/util/date';import type { TaskEntityWithProperties } from '@entity';+import { SYSTEM_PROPERTY_IDS } from '@property/identifiers';+import type { PropertyDefinitionDomain } from '@property/types';+import { propertyDateSortKey, propertySortKey } from '@property/utils/sort';import type { ProjectTab, TaskGroupBy, TaskSortId, TasksTab } from './types';export type TaskTabItem = {@@ -75,6 +82,7 @@ export const TASK_GROUP_OPTIONS: {{ id: 'assignee', label: 'Assignee' },{ id: 'project', label: 'Project' },{ id: 'date', label: 'Date' },+ { id: 'due_date', label: 'Due date' },];export const TASK_SORT_DEFINITIONS: SortDefinition<@@ -107,11 +115,94 @@ export const TASK_SORT_DEFINITIONS: SortDefinition<},];+export type TaskPropertySort = {+ propertyDefinitionId: string;+ direction: 'asc' | 'desc';+};+export const TASK_SORT_OPTIONS: {id: TaskSortId;label: string;+ property?: TaskPropertySort;}[] = [{ id: 'viewed_at', label: 'Viewed' },{ id: 'updated_at', label: 'Updated' },{ id: 'created_at', label: 'Created' },+ {+ id: 'status',+ label: 'Status',+ property: {+ propertyDefinitionId: SYSTEM_PROPERTY_IDS.STATUS,+ direction: 'asc',+ },+ },+ {+ id: 'priority',+ label: 'Priority',+ property: {+ propertyDefinitionId: SYSTEM_PROPERTY_IDS.PRIORITY,+ direction: 'desc',+ },+ },+ {+ id: 'due_date_earliest',+ label: 'Due soonest',+ property: {+ propertyDefinitionId: SYSTEM_PROPERTY_IDS.DUE_DATE,+ direction: 'asc',+ },+ },+ {+ id: 'due_date_latest',+ label: 'Due furthest away',+ property: {+ propertyDefinitionId: SYSTEM_PROPERTY_IDS.DUE_DATE,+ direction: 'desc',+ },+ },];++export function taskPropertySort(id: TaskSortId): TaskPropertySort | undefined {+ return TASK_SORT_OPTIONS.find((option) => option.id === id)?.property;+}++/** Property order matches Soup: missing last, then newest update and descending ID. */+export function sortTasks(+ items: TaskEntityWithProperties[],+ selections: SortSelection<TaskSortId>[],+ definitions?: ReadonlyMap<string, PropertyDefinitionDomain>+): TaskEntityWithProperties[] {+ const selection = selections[0];+ const propertySort = selection && taskPropertySort(selection.id);+ if (!propertySort) return sortItems(items, selections, TASK_SORT_DEFINITIONS);+ const definition = definitions?.get(propertySort.propertyDefinitionId);+ // Keep server order until selectable option metadata is available.+ if (selection.id === 'status' || selection.id === 'priority') {+ if (!definition?.options) return items;+ }+ let ascending = propertySort.direction === 'asc';+ if (selection.reversed && !selection.id.startsWith('due_date_'))+ ascending = !ascending;+ const key = (item: TaskEntityWithProperties) =>+ propertySortKey(+ item.properties?.find(+ (property) =>+ property.definition.id === propertySort.propertyDefinitionId+ ),+ definition?.options+ );+ return [...items].sort((left, right) => {+ const a = key(left);+ const b = key(right);+ if (a === undefined && b !== undefined) return 1;+ if (a !== undefined && b === undefined) return -1;+ if (a !== undefined && b !== undefined && a !== b)+ return ascending ? a - b : b - a;+ const updated =+ (propertyDateSortKey(right.updatedAt) ?? 0) -+ (propertyDateSortKey(left.updatedAt) ?? 0);+ if (updated) return updated;+ if (left.id === right.id) return 0;+ return left.id > right.id ? -1 : 1;+ });+}diff --git a/apps/web/src/features/tasks-view/context/task-board.ts b/apps/web/src/features/tasks-view/context/task-board.tsindex 5a764c5041..7fa7727773 100644--- a/apps/web/src/features/tasks-view/context/task-board.ts+++ b/apps/web/src/features/tasks-view/context/task-board.ts@@ -20,7 +20,7 @@ export type TaskBoardData = {task(id: string): TaskBoardTask | undefined;/** Instantiate under the mounted column label's owner. */createAssigneeName(id: Accessor<string>): Accessor<string | undefined>;- compareTasks?: (left: string, right: string) => number;+ compareTasks?: (left: TaskBoardTask, right: TaskBoardTask) => number;actions: TaskBoardActions;property(taskId: string, propertyId: string): Property | undefined;canEditProperty(taskId: string, propertyId: string): boolean;diff --git a/apps/web/src/features/tasks-view/core/task-board-optimism.test.ts b/apps/web/src/features/tasks-view/core/task-board-optimism.test.tsindex fe31b1ce4a..5eeaa1215e 100644--- a/apps/web/src/features/tasks-view/core/task-board-optimism.test.ts+++ b/apps/web/src/features/tasks-view/core/task-board-optimism.test.ts@@ -1,3 +1,4 @@+import { PROPERTY_OPTION_IDS } from '@property/identifiers';import { describe, expect, it } from 'vitest';import type { TaskBoardColumn, TaskBoardTask } from './task-board';import {@@ -47,6 +48,48 @@ describe('optimistic task placements', () => {});+ it('keeps a task neutral immediately when moved into a closed status', () => {+ for (const status of [+ PROPERTY_OPTION_IDS.STATUS.COMPLETED,+ PROPERTY_OPTION_IDS.STATUS.CANCELED,+ ]) {+ expect(+ movedTask(task, 'status', {+ id: task.id,+ fromLane: 'todo',+ toLane: status,+ }).closed+ ).toBe(true);+ }+ });++ it('removes urgency when reopening a status-only closed task, but retains subtype completion', () => {+ const move = {+ id: task.id,+ fromLane: PROPERTY_OPTION_IDS.STATUS.COMPLETED,+ toLane: 'todo',+ };+ expect(+ movedTask(+ { ...task, closed: true, statusId: move.fromLane },+ 'status',+ move+ ).closed+ ).toBe(false);+ expect(+ movedTask(+ {+ ...task,+ closed: true,+ subtypeCompleted: true,+ statusId: move.fromLane,+ },+ 'status',+ move+ ).closed+ ).toBe(true);+ });+it('preserves other assignees, deduplicates destinations, and adjusts loaded counts once', () => {const placement = {task: movedTask(task, 'assignee', {@@ -87,7 +130,7 @@ describe('optimistic task placements', () => {const result = projectTaskBoardPlacements([column('todo', [task]), column('done', [earlier, later])],[placement],- (left, right) => rank.indexOf(left) - rank.indexOf(right)+ (left, right) => rank.indexOf(left.id) - rank.indexOf(right.id));expect(result[1].tasks.map((task) => task.id)).toEqual(rank);const hidden = projectTaskBoardPlacements(diff --git a/apps/web/src/features/tasks-view/core/task-board-optimism.ts b/apps/web/src/features/tasks-view/core/task-board-optimism.tsindex e036944d53..2ac2c7e387 100644--- a/apps/web/src/features/tasks-view/core/task-board-optimism.ts+++ b/apps/web/src/features/tasks-view/core/task-board-optimism.ts@@ -1,3 +1,4 @@+import { PROPERTY_OPTION_IDS } from '@property/identifiers';import {moveTaskAssignees,type TaskBoardColumn,@@ -6,6 +7,7 @@ import {type TaskBoardTask,taskBoardGroupKeys,} from './task-board';+import { isTaskDueDateBucket } from './task-due-date';export type TaskBoardPlacement = {task: TaskBoardTask;@@ -22,8 +24,23 @@ export function movedTask(move: TaskBoardMove): TaskBoardTask {switch (grouping) {+ case 'due_date':+ return {+ ...task,+ dueDate: move.dueDate ?? undefined,+ deadline: isTaskDueDateBucket(move.toLane)+ ? move.toLane+ : task.deadline,+ };case 'status':- return { ...task, statusId: move.toLane || undefined };+ return {+ ...task,+ statusId: move.toLane || undefined,+ closed:+ task.subtypeCompleted ||+ move.toLane === PROPERTY_OPTION_IDS.STATUS.COMPLETED ||+ move.toLane === PROPERTY_OPTION_IDS.STATUS.CANCELED,+ };case 'priority':return { ...task, priorityId: move.toLane || undefined };case 'project':@@ -57,7 +74,7 @@ export function placementMatches(export function projectTaskBoardPlacements(columns: readonly TaskBoardColumn[],placements: readonly TaskBoardPlacement[],- compare?: (left: string, right: string) => number+ compare?: (left: TaskBoardTask, right: TaskBoardTask) => number): readonly TaskBoardColumn[] {if (placements.length === 0) {return columns;@@ -76,6 +93,7 @@ export function projectTaskBoardPlacements(if (index >= 0 && belongs) {tasks[index] = task;+ if (compare) tasks.sort(compare);continue;}@@ -90,7 +108,7 @@ export function projectTaskBoardPlacements(}const before = compare- ? tasks.findIndex((item) => compare(task.id, item.id) < 0)+ ? tasks.findIndex((item) => compare(task, item) < 0): -1;tasks.splice(before < 0 ? tasks.length : before, 0, task);if (!placement.previousGroupKeys.includes(column.id)) {diff --git a/apps/web/src/features/tasks-view/core/task-board.ts b/apps/web/src/features/tasks-view/core/task-board.tsindex 088dc23443..7d23ef0b7a 100644--- a/apps/web/src/features/tasks-view/core/task-board.ts+++ b/apps/web/src/features/tasks-view/core/task-board.ts@@ -1,7 +1,13 @@import { match } from 'ts-pattern';import type { TaskGroupBy } from '../types';+import type { TaskDueDateBucket } from './task-due-date';-export type TaskBoardGrouping = 'status' | 'priority' | 'assignee' | 'project';+export type TaskBoardGrouping =+ | 'status'+ | 'priority'+ | 'assignee'+ | 'project'+ | 'due_date';export const TASK_BOARD_GROUP_OPTIONS: {id: TaskBoardGrouping;@@ -11,13 +17,21 @@ export const TASK_BOARD_GROUP_OPTIONS: {{ id: 'priority', label: 'Priority' },{ id: 'assignee', label: 'Assignee' },{ id: 'project', label: 'Project' },+ { id: 'due_date', label: 'Due date' },];/** List-only groupings display Status columns in the board layout. */export function toTaskBoardGrouping(groupBy: TaskGroupBy): TaskBoardGrouping {return match(groupBy).with('none', 'date', () => 'status' as const)- .with('status', 'priority', 'assignee', 'project', (grouping) => grouping)+ .with(+ 'status',+ 'priority',+ 'assignee',+ 'project',+ 'due_date',+ (grouping) => grouping+ ).exhaustive();}@@ -28,6 +42,10 @@ export type TaskBoardTask = {priorityId?: string;assigneeIds: readonly string[];projectIds: readonly string[];+ dueDate?: string;+ closed?: boolean;+ subtypeCompleted?: boolean;+ deadline?: TaskDueDateBucket;};export type TaskBoardColumn = {@@ -44,6 +62,8 @@ export type TaskBoardMove = {id: string;fromLane: string;toLane: string;+ /** Resolved UTC instant, or null to clear; supplied before a deadline move saves. */+ dueDate?: string | null;};export function taskBoardGroupKeys(@@ -55,6 +75,7 @@ export function taskBoardGroupKeys(.with('priority', () => (task.priorityId ? [task.priorityId] : [])).with('assignee', () => task.assigneeIds).with('project', () => task.projectIds)+ .with('due_date', () => [task.deadline ?? 'no_due_date']).exhaustive();return values.length ? values : [''];diff --git a/apps/web/src/features/tasks-view/core/task-due-date.ts b/apps/web/src/features/tasks-view/core/task-due-date.tsnew file mode 100644index 0000000000..06aa2ae30e--- /dev/null+++ b/apps/web/src/features/tasks-view/core/task-due-date.ts@@ -0,0 +1,184 @@+import { TZDate } from '@date-fns/tz';+import { addDays, format, isMatch, parse, startOfDay } from 'date-fns';+import { match } from 'ts-pattern';++export const TASK_DUE_DATE_BUCKETS = [+ { id: 'overdue', label: 'Overdue' },+ { id: 'today', label: 'Today' },+ { id: 'tomorrow', label: 'Tomorrow' },+ { id: 'next_7_days', label: 'Next 7 days' },+ { id: 'later', label: 'Later' },+ { id: 'no_due_date', label: 'No due date' },+] as const;++export type TaskDueDateBucket = (typeof TASK_DUE_DATE_BUCKETS)[number]['id'];+export type TaskDueDateFilter =+ | { type: TaskDueDateBucket | 'has_due_date' }+ | { type: 'range'; start?: string; end?: string };++/** Frozen viewer-local date-bucket boundaries shared by filtering and pagination. */+export type DateBucketBoundaries = {+ timeZone: string;+ today: string;+ boundaries: {+ today: string;+ tomorrow: string;+ day_two: string;+ day_eight: string;+ };+};++export type TaskDatePredicate =+ | { hasDate: boolean }+ | { dateRange: { start?: string; end?: string } };++export function createDateBucketBoundaries(+ now: Date,+ timeZone: string+): DateBucketBoundaries {+ const today = startOfDay(new TZDate(now, timeZone));+ const utc = (days: number) => new Date(addDays(today, days)).toISOString();+ return {+ timeZone,+ today: format(today, 'yyyy-MM-dd'),+ boundaries: {+ today: utc(0),+ tomorrow: utc(1),+ day_two: utc(2),+ day_eight: utc(8),+ },+ };+}++/** A picker day becomes midnight in the viewer's timezone, not midnight UTC. */+export function taskDateOnlyToIso(+ value: string,+ timeZone: string+): string | undefined {+ if (!isMatch(value, 'yyyy-MM-dd')) return;+ return new Date(+ parse(value, 'yyyy-MM-dd', new TZDate(0, timeZone))+ ).toISOString();+}++export function taskDueDatePredicate(+ filter: TaskDueDateFilter | undefined,+ calendar: DateBucketBoundaries+): TaskDatePredicate | undefined {+ if (!filter) return;+ const b = calendar.boundaries;+ return match(filter)+ .with({ type: 'has_due_date' }, () => ({ hasDate: true }))+ .with({ type: 'no_due_date' }, () => ({ hasDate: false }))+ .with({ type: 'overdue' }, () => ({ dateRange: { end: b.today } }))+ .with({ type: 'today' }, () => ({+ dateRange: { start: b.today, end: b.tomorrow },+ }))+ .with({ type: 'tomorrow' }, () => ({+ dateRange: { start: b.tomorrow, end: b.day_two },+ }))+ .with({ type: 'next_7_days' }, () => ({+ dateRange: { start: b.day_two, end: b.day_eight },+ }))+ .with({ type: 'later' }, () => ({ dateRange: { start: b.day_eight } }))+ .with({ type: 'range' }, ({ start, end }) => {+ const endDay = end && taskDateOnlyToIso(end, calendar.timeZone);+ return {+ dateRange: {+ ...(start && { start: taskDateOnlyToIso(start, calendar.timeZone) }),+ ...(endDay && {+ end: new Date(+ addDays(new TZDate(endDay, calendar.timeZone), 1)+ ).toISOString(),+ }),+ },+ };+ })+ .exhaustive();+}++export function taskMatchesDueDate(+ value: string | undefined,+ predicate: TaskDatePredicate | undefined+): boolean {+ if (!predicate) return true;+ const due = value ? Date.parse(value) : NaN;+ if ('hasDate' in predicate) return Number.isFinite(due) === predicate.hasDate;+ if (!Number.isFinite(due)) return false;+ const { start, end } = predicate.dateRange;+ return (+ (!start || due >= Date.parse(start)) && (!end || due < Date.parse(end))+ );+}++export function taskDueDateBucket(+ value: string | undefined,+ calendar: DateBucketBoundaries+): TaskDueDateBucket {+ if (!value || !Number.isFinite(Date.parse(value))) return 'no_due_date';+ const due = Date.parse(value);+ const b = calendar.boundaries;+ if (due < Date.parse(b.today)) return 'overdue';+ if (due < Date.parse(b.tomorrow)) return 'today';+ if (due < Date.parse(b.day_two)) return 'tomorrow';+ if (due < Date.parse(b.day_eight)) return 'next_7_days';+ return 'later';+}++/** Presentation urgency for an open task, based on viewer-local calendar days. */+export function taskDueDateUrgency(+ value: string | undefined,+ closed: boolean,+ calendar: DateBucketBoundaries+): 'danger' | 'warning' | undefined {+ if (closed || !value) return;+ const due = Date.parse(value);+ if (!Number.isFinite(due)) return;+ const b = calendar.boundaries;+ if (due < Date.parse(b.today)) return 'danger';+ if (due < Date.parse(b.day_two)) return 'warning';+}++/** Hide deadline columns that cannot contain a task matching the current filter. */+export function taskDueDateBucketMatchesFilter(+ bucket: TaskDueDateBucket,+ predicate: TaskDatePredicate | undefined,+ calendar: DateBucketBoundaries+): boolean {+ if (!predicate) return true;+ if ('hasDate' in predicate)+ return (bucket !== 'no_due_date') === predicate.hasDate;+ if (bucket === 'no_due_date') return false;+ const bounds = taskDueDatePredicate({ type: bucket }, calendar);+ if (!bounds || !('dateRange' in bounds)) return false;+ const start = (value?: string) => (value ? Date.parse(value) : -Infinity);+ const end = (value?: string) => (value ? Date.parse(value) : Infinity);+ return (+ start(bounds.dateRange.start) < end(predicate.dateRange.end) &&+ start(predicate.dateRange.start) < end(bounds.dateRange.end)+ );+}++/** Inclusive picker bounds for a broad deadline bucket. */+export function taskDueDatePickerBounds(+ bucket: TaskDueDateBucket,+ calendar: DateBucketBoundaries+): { min?: string; max?: string } {+ const day = (offset: number) =>+ format(+ addDays(new TZDate(calendar.boundaries.today, calendar.timeZone), offset),+ 'yyyy-MM-dd'+ );+ return match(bucket)+ .with('overdue', () => ({ max: day(-1) }))+ .with('today', () => ({ min: day(0), max: day(0) }))+ .with('tomorrow', () => ({ min: day(1), max: day(1) }))+ .with('next_7_days', () => ({ min: day(2), max: day(7) }))+ .with('later', () => ({ min: day(8) }))+ .with('no_due_date', () => ({}))+ .exhaustive();+}++export function isTaskDueDateBucket(value: string): value is TaskDueDateBucket {+ return TASK_DUE_DATE_BUCKETS.some((bucket) => bucket.id === value);+}diff --git a/apps/web/src/features/tasks-view/filters/task-predicates.ts b/apps/web/src/features/tasks-view/filters/task-predicates.tsindex 4bc77a9b8b..9bdaf681a1 100644--- a/apps/web/src/features/tasks-view/filters/task-predicates.ts+++ b/apps/web/src/features/tasks-view/filters/task-predicates.ts@@ -1,5 +1,10 @@import { testFacets } from '@app/features/soup';import { getTaskAssigneeIds, type TaskEntityWithProperties } from '@entity';+import { getTaskDueDate } from '@entity/utils/task-properties';+import {+ type TaskDatePredicate,+ taskMatchesDueDate,+} from '../core/task-due-date';import type { TaskTab } from '../types';import {EMPTY_TASK_FACET_CONTEXT,@@ -12,6 +17,7 @@ export type TaskViewContext = {userId: string | undefined;facets: Record<string, string[]>;facetContext?: TaskFacetContext;+ dueDate?: TaskDatePredicate;};export function taskMatchesTab(@@ -40,6 +46,7 @@ export function taskMatchesView(context: TaskViewContext) {if (!taskMatchesTab(task, context.tab, context.userId)) return false;+ if (!taskMatchesDueDate(getTaskDueDate(task), context.dueDate)) return false;return testFacets(context.facets, TASK_FACETS, task, {...(context.facetContext ?? EMPTY_TASK_FACET_CONTEXT),diff --git a/apps/web/src/features/tasks-view/filters/task-saved-view.ts b/apps/web/src/features/tasks-view/filters/task-saved-view.tsindex 412b07c172..095ada817e 100644--- a/apps/web/src/features/tasks-view/filters/task-saved-view.ts+++ b/apps/web/src/features/tasks-view/filters/task-saved-view.ts@@ -2,6 +2,7 @@ import type { FacetSelection } from '@app/features/soup/filters/facets/types';import { err, ok, type Result } from 'neverthrow';import { z } from 'zod';import { TASK_DEFAULT_GROUP_BY } from '../constants';+import { TASK_DUE_DATE_BUCKETS } from '../core/task-due-date';import { isProjectTab } from '../core/task-navigation';import type { TasksViewState, TaskTab } from '../types';import {@@ -48,6 +49,27 @@ const filtersSchema = z.max(100),}).strict();+const dueDateSchema = z.union([+ z+ .object({+ type: z.enum([+ ...TASK_DUE_DATE_BUCKETS.map((bucket) => bucket.id),+ 'has_due_date',+ ]),+ })+ .strict(),+ z+ .object({+ type: z.literal('range'),+ start: z.iso.date().optional(),+ end: z.iso.date().optional(),+ })+ .strict()+ .refine(+ ({ start, end }) =>+ Boolean(start || end) && (!start || !end || start <= end)+ ),+]);const layoutSchema = z.enum(['list', 'board', 'gantt']);const groupBySchema = z.enum(['none',@@ -56,10 +78,19 @@ const groupBySchema = z.enum(['assignee','project','date',+ 'due_date',]);const sortItemSchema = z.object({- id: z.enum(['updated_at', 'created_at', 'viewed_at']),+ id: z.enum([+ 'updated_at',+ 'created_at',+ 'viewed_at',+ 'status',+ 'priority',+ 'due_date_earliest',+ 'due_date_latest',+ ]),reversed: z.boolean().default(false),}).strict();@@ -69,6 +100,7 @@ const taskSavedViewSchema = zkind: z.literal('tasks'),version: z.literal(1),filters: filtersSchema,+ dueDate: dueDateSchema.optional(),layout: layoutSchema.default('list'),groupBy: groupBySchema.default(TASK_DEFAULT_GROUP_BY['team-tasks']),sort: sortSchema.default([{ id: 'updated_at', reversed: false }]),@@ -102,6 +134,7 @@ function canonical(config: TaskSavedViewConfig): TaskSavedViewConfig {return {kind: 'tasks',version: 1,+ ...(config.dueDate && { dueDate: { ...config.dueDate } }),layout: config.layout,groupBy: config.groupBy,sort: config.sort.map((item) => ({ ...item, reversed: !!item.reversed })),@@ -183,6 +216,7 @@ export function readTaskSavedView(value: unknown): TaskSavedViewRead {? [{ id: 'updated_at' as const, reversed: false }]: readSort(readable.data.sort);const filters = readable.data.filters;+ const dueDate = dueDateSchema.safeParse(readable.data.dueDate);function readSort(value: unknown) {if (!Array.isArray(value))@@ -245,6 +279,7 @@ export function readTaskSavedView(value: unknown): TaskSavedViewRead {? groupBy.data: TASK_DEFAULT_GROUP_BY['team-tasks'],sort,+ ...(dueDate.success && dueDate.data && { dueDate: dueDate.data }),filters: {statusOptionIds: readEntries(filters.statusOptionIds,@@ -296,6 +331,7 @@ export function captureTaskSavedView(input: {layout?: TasksViewState['layout'];groupBy?: TasksViewState['groupBy'];sort?: TasksViewState['sort'];+ dueDate?: TasksViewState['dueDate'];context: TaskFacetContext;}): Result<TaskSavedViewConfig, string> {if (isProjectTab(input.tab))@@ -324,6 +360,7 @@ export function captureTaskSavedView(input: {layout: input.layout,groupBy: input.groupBy,sort: input.sort,+ ...(input.dueDate && { dueDate: input.dueDate }),filters: {statusOptionIds: (input.facets.status ?? []).map((id) =>optionId(id, TASK_STATUS_OPTIONS)@@ -345,6 +382,7 @@ export function materializeTaskSavedView(config: TaskSavedViewConfig): {layout: TasksViewState['layout'];groupBy: TasksViewState['groupBy'];sort: TasksViewState['sort'];+ dueDate?: TasksViewState['dueDate'];} {const filters = config.filters;const selectionId = (id: string, options: typeof TASK_STATUS_OPTIONS) =>@@ -356,6 +394,7 @@ export function materializeTaskSavedView(config: TaskSavedViewConfig): {layout: config.layout,groupBy: config.groupBy,sort: config.sort.map((item) => ({ ...item })),+ dueDate: config.dueDate ? { ...config.dueDate } : undefined,facets: {status: filters.statusOptionIds.map((id) =>selectionId(id, TASK_STATUS_OPTIONS)diff --git a/apps/web/src/features/tasks-view/filters/use-task-filters.tsx b/apps/web/src/features/tasks-view/filters/use-task-filters.tsxindex 442705e748..ffaf23f2a4 100644--- a/apps/web/src/features/tasks-view/filters/use-task-filters.tsx+++ b/apps/web/src/features/tasks-view/filters/use-task-filters.tsx@@ -10,8 +10,13 @@ import { PropertyValueIcon } from '@property/component/propertyValue';import { useTagFilterGroup } from '@property/tags/use-tag-filter-group';import { useContacts } from '@queries/contacts/contacts';import { Tooltip } from '@ui';-import { batch, createMemo } from 'solid-js';+import { batch, createMemo, createSignal } from 'solid-js';import { match } from 'ts-pattern';+import type { TaskDateRangeDraft } from '../components/task-due-date-range-dialog';+import {+ isTaskDueDateBucket,+ TASK_DUE_DATE_BUCKETS,+} from '../core/task-due-date';import { requestAiTaskFilterPlan } from '../queries/ai-task-filter-plan';import { useTasksView } from '../tasks-view-context';import type { AiTaskFilterCatalog } from './ai-task-filter';@@ -33,13 +38,15 @@ export type TaskFilterGroupId =| 'priority'| 'assignees'| 'created-by'- | 'tags';+ | 'tags'+ | 'due_date';export function useTaskFilters() {const { state, setFacets, setState, savedViews } = useTasksView();const contacts = useContacts();const currentUserId = useUserId();const tagGroup = useTagFilterGroup();+ const [customRange, setCustomRange] = createSignal<TaskDateRangeDraft>();const peopleOptions = createMemo(() => {const me = currentUserId();@@ -140,6 +147,24 @@ export function useTaskFilters() {}))),},+ {+ id: 'due_date',+ label: 'Due date',+ selectionMode: 'single',+ defaultOptionId: 'any',+ options: [+ { id: 'any', label: 'Any due date' },+ ...TASK_DUE_DATE_BUCKETS,+ { id: 'has_due_date', label: 'Has due date' },+ {+ id: 'range',+ label:+ state.dueDate?.type === 'range'+ ? `Custom range (${state.dueDate.start ?? 'Any'} – ${state.dueDate.end ?? 'Any'})`+ : 'Custom range…',+ },+ ],+ },{id: 'assignees',label: 'Assignee',@@ -164,13 +189,29 @@ export function useTaskFilters() {);const isSelected = (groupId: TaskFilterGroupId, optionId: string) =>- (state.facets[groupId] ?? []).includes(optionId);+ groupId === 'due_date'+ ? (state.dueDate?.type ?? 'any') === optionId+ : (state.facets[groupId] ?? []).includes(optionId);const setSelected = (groupId: TaskFilterGroupId,optionId: string,selected: boolean) => {+ if (groupId === 'due_date') {+ if (optionId === 'range') {+ const current = state.dueDate;+ setCustomRange({+ start: current?.type === 'range' ? (current.start ?? '') : '',+ end: current?.type === 'range' ? (current.end ?? '') : '',+ });+ } else if (!selected || optionId === 'any') {+ setState('dueDate', undefined);+ } else if (isTaskDueDateBucket(optionId) || optionId === 'has_due_date') {+ setState('dueDate', { type: optionId });+ }+ return;+ }const update = selected ? addUnique(optionId) : removeValue(optionId);setFacets({...state.facets,@@ -181,7 +222,7 @@ export function useTaskFilters() {const activeCount = () =>Object.values(state.facets).reduce((count, optionIds) => count + optionIds.length,- 0+ state.dueDate ? 1 : 0);const aiCatalog = (): AiTaskFilterCatalog => ({@@ -217,7 +258,28 @@ export function useTaskFilters() {return {activeCount,applyDescription,- clear: () => setFacets({}),+ clear: () =>+ batch(() => {+ setFacets({});+ setState('dueDate', undefined);+ }),+ customRange,+ setCustomRange,+ applyCustomRange: () => {+ const range = customRange();+ if (+ !range ||+ !(range.start || range.end) ||+ (range.start && range.end && range.start > range.end)+ )+ return;+ setState('dueDate', {+ type: 'range',+ start: range.start || undefined,+ end: range.end || undefined,+ });+ setCustomRange(undefined);+ },groups,isSelected,selectedIds: (groupId: TaskFilterGroupId) => state.facets[groupId] ?? [],diff --git a/apps/web/src/features/tasks-view/persistence.ts b/apps/web/src/features/tasks-view/persistence.tsindex a5a2253926..fe20f9c088 100644--- a/apps/web/src/features/tasks-view/persistence.ts+++ b/apps/web/src/features/tasks-view/persistence.ts@@ -26,17 +26,51 @@ const taskGroupBySchema = z.enum(['assignee','project','date',+ 'due_date',]);const taskSortSchema = z.array(z.object({- id: z.enum(['updated_at', 'created_at', 'viewed_at']),+ id: z.enum([+ 'updated_at',+ 'created_at',+ 'viewed_at',+ 'status',+ 'priority',+ 'due_date_earliest',+ 'due_date_latest',+ ]),reversed: z.boolean().optional(),}));const taskFacetsSchema = z.record(z.string(), z.array(z.string()));+const taskDueDateFilterSchema = z.union([+ z.object({+ type: z.enum([+ 'overdue',+ 'today',+ 'tomorrow',+ 'next_7_days',+ 'later',+ 'has_due_date',+ 'no_due_date',+ ]),+ }),+ z+ .object({+ type: z.literal('range'),+ start: z.iso.date().optional(),+ end: z.iso.date().optional(),+ })+ .refine(+ (range) =>+ Boolean(range.start || range.end) &&+ (!range.start || !range.end || range.start <= range.end)+ ),+]);+const tasksEntryStateSchemaWithDefaults = z.object({version: z.literal(1).default(1),layout: z.enum(['list', 'board', 'gantt']).catch('list').default('list'),@@ -47,6 +81,7 @@ const tasksEntryStateSchemaWithDefaults = z.object({facets: taskFacetsSchema.default(normalizeFacetSelection(DEFAULT_TASK_FACET_SELECTION)),+ dueDate: taskDueDateFilterSchema.optional().catch(undefined),collapsedGroupIds: z.array(z.string()).default([]),});@@ -61,6 +96,7 @@ const DEFAULT_TASKS_ENTRY_STATE = {sort: [{ id: 'updated_at' }],facets: normalizeFacetSelection(DEFAULT_TASK_FACET_SELECTION),collapsedGroupIds: [],+ dueDate: undefined,} satisfies TasksEntryState;const tasksListStateSchemaWithDefaults = z.object({@@ -93,6 +129,10 @@ function selectEntryState(state: TasksViewState): TasksEntryState {state.savedViewActive ? DEFAULT_TASK_FACET_SELECTION : state.facets),collapsedGroupIds: [...state.collapsedGroupIds],+ dueDate:+ !state.savedViewActive && state.dueDate+ ? { ...state.dueDate }+ : undefined,};}@@ -119,6 +159,7 @@ function createTasksEntryStorage(options: {groupBy: restored.groupBy,sort: restored.sort.map((item) => ({ ...item })),facets: normalizeFacetSelection(restored.facets),+ dueDate: restored.dueDate,collapsedGroupIds: [...restored.collapsedGroupIds],};},diff --git a/apps/web/src/features/tasks-view/primitives/create-date-bucket-boundaries.ts b/apps/web/src/features/tasks-view/primitives/create-date-bucket-boundaries.tsnew file mode 100644index 0000000000..ae486d5976--- /dev/null+++ b/apps/web/src/features/tasks-view/primitives/create-date-bucket-boundaries.ts@@ -0,0 +1,40 @@+import { type Accessor, createSignal, onCleanup } from 'solid-js';+import { createDateBucketBoundaries } from '../core/task-due-date';++/** Refresh relative dates after midnight, timezone changes, and app resume. */+export function createDateBucketBoundariesSignal(+ options: { timeZone?: Accessor<string> } = {}+) {+ const current = () =>+ createDateBucketBoundaries(+ new Date(),+ options.timeZone?.() ?? Intl.DateTimeFormat().resolvedOptions().timeZone+ );+ const [calendar, setCalendar] = createSignal(current());+ let midnight: ReturnType<typeof setTimeout>;+ const refresh = () => {+ const next = current();+ const previous = calendar();+ if (next.today !== previous.today || next.timeZone !== previous.timeZone)+ setCalendar(next);+ clearTimeout(midnight);+ midnight = setTimeout(+ refresh,+ Math.max(1, Date.parse(next.boundaries.tomorrow) - Date.now())+ );+ };+ refresh();+ // Browsers expose no timezone-change event; also check while the app stays open.+ const zoneCheck = setInterval(refresh, 60_000);+ window.addEventListener('focus', refresh);+ document.addEventListener('visibilitychange', refresh);+ window.addEventListener('pageshow', refresh);+ onCleanup(() => {+ clearTimeout(midnight);+ clearInterval(zoneCheck);+ window.removeEventListener('focus', refresh);+ document.removeEventListener('visibilitychange', refresh);+ window.removeEventListener('pageshow', refresh);+ });+ return calendar;+}diff --git a/apps/web/src/features/tasks-view/primitives/create-task-board.ts b/apps/web/src/features/tasks-view/primitives/create-task-board.tsindex d79b0b15f6..8227de4868 100644--- a/apps/web/src/features/tasks-view/primitives/create-task-board.ts+++ b/apps/web/src/features/tasks-view/primitives/create-task-board.ts@@ -30,7 +30,12 @@ export function createTaskBoard(options: {columns: Accessor<readonly TaskBoardColumn[]>;task(id: string): TaskBoardTask | undefined;actions: TaskBoardActions;- compareTasks?: (left: string, right: string) => number;+ compareTasks?: (left: TaskBoardTask, right: TaskBoardTask) => number;+ /** Resolve a restricted date picker before changing placement or writing. */+ prepareMove?: (+ move: TaskBoardMove,+ grouping: TaskBoardGrouping+ ) => Promise<TaskBoardMove | undefined>;}) {const [pending, setPending] = createSignal<string[]>([]);const [error, setError] = createSignal<{ scope: string; text: string }>();@@ -111,63 +116,59 @@ export function createTaskBoard(options: {};const move = async (request: TaskBoardMove): Promise<boolean> => {- if (!canMove(request)) {- return false;- }-+ if (!canMove(request)) return false;const grouping = options.grouping();const scope = options.scope();const task =currentPlacements().find((placement) => placement.task.id === request.id)?.task ?? options.task(request.id);-- if (!task) {- return false;- }-+ if (!task) return false;const previous = currentPlacements().find((item) => item.task.id === request.id);- const placement: Placement = {- task: movedTask(task, grouping, request),- previousGroupKeys: taskBoardGroupKeys(task, grouping),- grouping,- scope,- confirmed: false,- };- setPlacements((items) => [- ...items.filter((item) => item.task.id !== request.id),- placement,- ]);-+ let placement: Placement | undefined;setPending((ids) => [...ids, request.id]);setError(undefined);-try {- await options.actions.save(request, grouping);+ const resolved = options.prepareMove+ ? await options.prepareMove(request, grouping)+ : request;+ if (+ !resolved ||+ scope !== options.scope() ||+ !options.actions.canEditTask(request.id) ||+ !options.actions.canMoveTo(grouping, resolved.toLane)+ )+ return false;+ placement = {+ task: movedTask(task, grouping, resolved),+ previousGroupKeys: taskBoardGroupKeys(task, grouping),+ grouping,+ scope,+ confirmed: false,+ };+ const pendingPlacement = placement;+ setPlacements((items) => [+ ...items.filter((item) => item.task.id !== request.id),+ pendingPlacement,+ ]);+ await options.actions.save(resolved, grouping);setPlacements((items) =>items.map((item) =>- item === placement+ item === pendingPlacement? { ...item, confirmed: true, confirmedColumns: options.columns() }: item));-return true;} catch {- setPlacements((items) => {- const retained = items.filter((item) => item !== placement);-- if (previous) {- retained.push(previous);- }-- return retained;- });- setError({- scope,- text: 'Could not move task. Refresh or try again.',- });+ if (placement)+ setPlacements((items) => {+ const retained = items.filter((item) => item !== placement);+ if (previous) retained.push(previous);+ return retained;+ });+ setError({ scope, text: 'Could not move task. Refresh or try again.' });return false;} finally {setPending((ids) => ids.filter((id) => id !== request.id));diff --git a/apps/web/src/features/tasks-view/primitives/create-task-deadline-move.ts b/apps/web/src/features/tasks-view/primitives/create-task-deadline-move.tsnew file mode 100644index 0000000000..43295bfefb--- /dev/null+++ b/apps/web/src/features/tasks-view/primitives/create-task-deadline-move.ts@@ -0,0 +1,104 @@+import {+ type Accessor,+ createEffect,+ createSignal,+ on,+ onCleanup,+} from 'solid-js';+import type { TaskBoardGrouping, TaskBoardMove } from '../core/task-board';+import {+ type DateBucketBoundaries,+ isTaskDueDateBucket,+ TASK_DUE_DATE_BUCKETS,+ taskDateOnlyToIso,+ taskDueDateBucket,+ taskDueDatePickerBounds,+} from '../core/task-due-date';++type PendingDate = {+ move: TaskBoardMove;+ scope: string;+ calendar: DateBucketBoundaries;+ value: string;+ finish(value: TaskBoardMove | undefined): void;+};++/** Resolves bucket drops before the board changes placement or saves a property. */+export function createTaskDeadlineMove(options: {+ calendar: Accessor<DateBucketBoundaries>;+ scope: Accessor<string>;+}) {+ const [pending, setPending] = createSignal<PendingDate>();+ const cancel = () => {+ pending()?.finish(undefined);+ setPending(undefined);+ };+ createEffect(+ on(+ () => [options.scope(), options.calendar()] as const,+ ([scope, calendar]) => {+ const current = pending();+ if (+ current &&+ (scope !== current.scope || calendar !== current.calendar)+ )+ cancel();+ }+ )+ );+ onCleanup(cancel);+ const prepare = async (+ move: TaskBoardMove,+ grouping: TaskBoardGrouping+ ): Promise<TaskBoardMove | undefined> => {+ if (grouping !== 'due_date') return move;+ if (!isTaskDueDateBucket(move.toLane)) return;+ const calendar = options.calendar();+ if (move.toLane === 'no_due_date') return { ...move, dueDate: null };+ if (move.toLane === 'today' || move.toLane === 'tomorrow')+ return { ...move, dueDate: calendar.boundaries[move.toLane] };+ cancel();+ const bounds = taskDueDatePickerBounds(move.toLane, calendar);+ return new Promise((finish) =>+ setPending({+ move,+ calendar,+ scope: options.scope(),+ value: bounds.min ?? bounds.max ?? calendar.today,+ finish,+ })+ );+ };+ const picker = () => {+ const current = pending();+ if (!current || !isTaskDueDateBucket(current.move.toLane)) return;+ return {+ label:+ TASK_DUE_DATE_BUCKETS.find(+ (bucket) => bucket.id === current.move.toLane+ )?.label ?? '',+ ...taskDueDatePickerBounds(current.move.toLane, current.calendar),+ value: current.value,+ };+ };+ const apply = () => {+ const current = pending();+ if (!current) return;+ const dueDate = taskDateOnlyToIso(current.value, current.calendar.timeZone);+ if (+ !dueDate ||+ taskDueDateBucket(dueDate, current.calendar) !== current.move.toLane+ )+ return;+ current.finish({ ...current.move, dueDate });+ setPending(undefined);+ };+ return {+ prepare,+ picker,+ cancel,+ apply,+ select: (value: string) =>+ setPending((current) => (current ? { ...current, value } : undefined)),+ };+}diff --git a/apps/web/src/features/tasks-view/primitives/create-task-saved-view-draft.ts b/apps/web/src/features/tasks-view/primitives/create-task-saved-view-draft.tsindex b90e032612..36948ec7dd 100644--- a/apps/web/src/features/tasks-view/primitives/create-task-saved-view-draft.ts+++ b/apps/web/src/features/tasks-view/primitives/create-task-saved-view-draft.ts@@ -53,10 +53,16 @@ export function createTaskSavedViewDraft(options: {selectedId: Accessor<string | undefined>;viewerId: Accessor<string | undefined>;creating: Accessor<boolean>;- state: Pick<TasksViewState, 'tab' | 'facets' | 'layout' | 'groupBy' | 'sort'>;+ state: Pick<+ TasksViewState,+ 'tab' | 'facets' | 'layout' | 'groupBy' | 'sort' | 'dueDate'+ >;facetContext: Accessor<TaskFacetContext>;apply: (- settings: Pick<TasksViewState, 'facets' | 'layout' | 'groupBy' | 'sort'>+ settings: Pick<+ TasksViewState,+ 'facets' | 'layout' | 'groupBy' | 'sort' | 'dueDate'+ >) => void;}) {const [confirmed, setConfirmed] = createSignal<ConfirmedTaskSavedView>();@@ -86,6 +92,7 @@ export function createTaskSavedViewDraft(options: {layout: options.state.layout,groupBy: options.state.groupBy,sort: options.state.sort,+ dueDate: options.state.dueDate,context: options.facetContext(),});const current = createMemo(() => {@@ -174,6 +181,7 @@ export function createTaskSavedViewDraft(options: {tab: options.state.tab,facets: DEFAULT_TASK_FACET_SELECTION,groupBy: TASK_DEFAULT_GROUP_BY[options.state.tab],+ dueDate: undefined,context: options.facetContext(),});const definition = current();@@ -219,6 +227,7 @@ export function createTaskSavedViewDraft(options: {layout: 'list',groupBy: TASK_DEFAULT_GROUP_BY['team-tasks'],sort: [{ id: 'updated_at' }],+ dueDate: undefined,});return;}diff --git a/apps/web/src/features/tasks-view/primitives/create-tasks-view-search.test.ts b/apps/web/src/features/tasks-view/primitives/create-tasks-view-search.test.tsindex eb444c57ea..c36de64ce4 100644--- a/apps/web/src/features/tasks-view/primitives/create-tasks-view-search.test.ts+++ b/apps/web/src/features/tasks-view/primitives/create-tasks-view-search.test.ts@@ -4,6 +4,17 @@ import { afterEach, expect, it, vi } from 'vitest';import type { SavedView } from '../../saved-views/core/saved-view';import { TASK_DEFAULT_GROUP_BY } from '../constants';import { DEFAULT_TASK_FACET_SELECTION } from '../filters/task-facets';+import {+ captureTaskSavedView,+ decodeTaskSavedView,+ materializeTaskSavedView,+ readTaskSavedView,+ taskSavedViewsEqual,+} from '../filters/task-saved-view';+import {+ createTasksViewPersistence,+ TASKS_ENTRY_STATE_KEY,+} from '../persistence';import type { TasksTabSearchParams } from '../tasks-tab-search';import type { TasksTab, TasksViewState } from '../types';import { createTaskSavedViewDraft } from './create-task-saved-view-draft';@@ -224,6 +235,69 @@ it('falls back from restored board entries and from desktop boards when mobile aexpect(desktop.state.layout).toBe('board');});+it('restores the original date filter when URL controls disappear', () => {+ const view = setup({+ state: {+ dueDate: { type: 'range', start: '2026-10-21', end: '2026-10-28' },+ },+ });+ view.setState('dueDate', { type: 'overdue' });+ view.setSearch({+ dueDate: undefined,+ dueStart: undefined,+ dueEnd: undefined,+ });+ expect(view.state.dueDate).toEqual({+ type: 'range',+ start: '2026-10-21',+ end: '2026-10-28',+ });++ view.setSearch('dueDate', 'any');+ expect(view.state.dueDate).toBeUndefined();+ view.setSearch('dueDate', 'range');+ expect(view.state.dueDate).toBeUndefined();+ view.setSearch({+ dueDate: 'range',+ dueStart: '2026-10-28',+ dueEnd: '2026-10-21',+ });+ expect(view.state.dueDate).toBeUndefined();+});++it('round-trips custom date ranges and due sorts without reversed null placement', () => {+ const view = setup({+ search: {+ dueDate: 'range',+ dueStart: '2026-10-21',+ dueEnd: '2026-10-28',+ sort: 'due_date_earliest',+ sortReversed: 'true',+ },+ });+ expect(view.state.dueDate).toEqual({+ type: 'range',+ start: '2026-10-21',+ end: '2026-10-28',+ });+ expect(view.state.sort).toEqual([+ { id: 'due_date_earliest', reversed: false },+ ]);+ view.setState('dueDate', { type: 'overdue' });+ expect(view.search.dueDate).toBe('overdue');+ expect(view.search.dueStart).toBeUndefined();+ view.setState('dueDate', undefined);+ expect(view.search.dueDate).toBe('any');+ view.setPrimarySort('due_date_latest');+ view.setPrimarySort('due_date_latest');+ expect(view.state.sort).toEqual([{ id: 'due_date_latest', reversed: false }]);+ view.setSearch({+ dueDate: 'range',+ dueStart: '2026-10-28',+ dueEnd: '2026-10-21',+ });+ expect(view.state.dueDate).toBeUndefined();+});it.each(['board', 'gantt'] as const)('keeps saved %s layout in raw state and URL during mobile fallback',(layout) => {@@ -323,6 +397,7 @@ it('keeps edits reverted during a save until confirmed presentation is explicitlversion: 1,layout: 'list',sort: [{ id: 'updated_at', reversed: false }],+ dueDate: { type: 'overdue' },filters: {statusOptionIds: [],priorityOptionIds: [],@@ -360,11 +435,14 @@ it('keeps edits reverted during a save until confirmed presentation is explicitl});return { state, setState, draft, record, setSource };});+ expect(fixture.state.dueDate).toEqual({ type: 'overdue' });+ fixture.setState('dueDate', { type: 'range', start: '2026-10-21' });fixture.setState('layout', 'board');fixture.setState('groupBy', 'assignee');const submitted = fixture.draft.capture();if (submitted.isErr()) throw new Error(submitted.error);const release = fixture.draft.retain();+ fixture.setState('dueDate', { type: 'today' });fixture.setState('layout', 'list');fixture.setState('groupBy', 'priority');const confirmed = { ...fixture.record, revision: 2, config: submitted.value };@@ -378,6 +456,7 @@ it('keeps edits reverted during a save until confirmed presentation is explicitlfixture.draft.reset();expect(fixture.state.layout).toBe('board');expect(fixture.state.groupBy).toBe('assignee');+ expect(fixture.state.dueDate).toEqual({ type: 'range', start: '2026-10-21' });expect(fixture.draft.view()).toMatchObject({ kind: 'saved', dirty: false });});@@ -422,7 +501,108 @@ it.each(['my-tasks', 'created-by-me', 'team-tasks'] as const)(expect(fixture.draft.view()).toEqual({ kind: 'default', changed: true });fixture.setState('sort', [{ id: 'updated_at' }]);expect(fixture.draft.view()).toEqual({ kind: 'default', changed: false });+ fixture.setState('dueDate', { type: 'tomorrow' });+ expect(fixture.draft.view()).toEqual({ kind: 'default', changed: true });+ fixture.setState('dueDate', undefined);+ expect(fixture.draft.view()).toEqual({ kind: 'default', changed: false });fixture.setState('layout', 'board');expect(fixture.draft.view()).toEqual({ kind: 'default', changed: true });});++it('captures relative due dates and property sorts without losing the saved definition', () => {+ const captured = captureTaskSavedView({+ tab: 'my-tasks',+ facets: { status: ['not-started'] },+ dueDate: { type: 'overdue' },+ groupBy: 'due_date',+ sort: [{ id: 'due_date_earliest' }, { id: 'priority', reversed: true }],+ context: { tagPropertyDefinitionByOptionId: new Map() },+ });+ expect(captured.isOk()).toBe(true);+ if (captured.isErr()) return;+ const restored = materializeTaskSavedView(captured.value);+ expect(restored.dueDate).toEqual({ type: 'overdue' });+ expect(restored.groupBy).toBe('due_date');+ expect(restored.sort).toEqual([+ { id: 'due_date_earliest', reversed: false },+ { id: 'priority', reversed: true },+ ]);+ expect(restored.facets.assignees).toEqual(['@viewer']);+ expect(readTaskSavedView(captured.value).issues).toEqual([]);+ const decoded = decodeTaskSavedView(captured.value);+ expect(decoded.isOk()).toBe(true);+ if (decoded.isOk())+ expect(taskSavedViewsEqual(captured.value, decoded.value)).toBe(true);+});++it('rejects invalid saved ranges but keeps other supported settings on read', () => {+ const captured = captureTaskSavedView({+ tab: 'team-tasks',+ facets: {},+ dueDate: { type: 'range', start: '2026-11-02', end: '2026-11-01' },+ context: { tagPropertyDefinitionByOptionId: new Map() },+ });+ expect(captured.isErr()).toBe(true);+ const valid = captureTaskSavedView({+ tab: 'team-tasks',+ facets: {},+ dueDate: { type: 'range', start: '2026-10-21', end: '2026-10-28' },+ context: { tagPropertyDefinitionByOptionId: new Map() },+ });+ expect(valid.isOk()).toBe(true);+ if (valid.isErr()) return;+ expect(materializeTaskSavedView(valid.value).dueDate).toEqual({+ type: 'range',+ start: '2026-10-21',+ end: '2026-10-28',+ });+ const { config, issues } = readTaskSavedView({+ ...valid.value,+ dueDate: { type: 'range', start: 'invalid', end: '2026-10-28' },+ groupBy: 'due_date',+ sort: [{ id: 'status', reversed: true }],+ });+ expect(issues.map(({ path }) => path.join('.'))).toContain('dueDate');+ expect(materializeTaskSavedView(config)).toMatchObject({+ dueDate: undefined,+ groupBy: 'due_date',+ sort: [{ id: 'status', reversed: true }],+ });+ expect(+ decodeTaskSavedView({ ...valid.value, dueDate: undefined }).isOk()+ ).toBe(true);+ expect(taskSavedViewsEqual(valid.value, config)).toBe(false);+});++it('keeps saved-view date filters out of built-in entry snapshots', () => {+ const { state, setState } = setup({+ state: { savedViewActive: true, dueDate: { type: 'overdue' } },+ });+ const captors = new Map<string, () => unknown>();+ const persistence = createTasksViewPersistence({+ handle: {+ currentEntryState: () => undefined,+ registerEntryStateCaptor: (key, capture) => {+ captors.set(key, capture);+ return () => captors.delete(key);+ },+ },+ userId: () => undefined,+ });+ const storages = Array.isArray(persistence.storages)+ ? persistence.storages+ : [persistence.storages];+ for (const storage of storages) storage.write(state);+ expect(captors.get(TASKS_ENTRY_STATE_KEY)?.()).toMatchObject({+ tab: 'my-tasks',+ dueDate: undefined,+ });++ setState('savedViewActive', false);+ for (const storage of storages) storage.write(state);+ expect(captors.get(TASKS_ENTRY_STATE_KEY)?.()).toMatchObject({+ dueDate: { type: 'overdue' },+ });+ for (const storage of storages) storage.dispose?.();+});diff --git a/apps/web/src/features/tasks-view/primitives/create-tasks-view-search.ts b/apps/web/src/features/tasks-view/primitives/create-tasks-view-search.tsindex 50e9928fb0..c0dcacd51a 100644--- a/apps/web/src/features/tasks-view/primitives/create-tasks-view-search.ts+++ b/apps/web/src/features/tasks-view/primitives/create-tasks-view-search.ts@@ -25,6 +25,7 @@ export function createTasksViewSearch(options: {const entryTab = state.tab;const entryGroupBy = state.groupBy;const entryLayout = state.layout;+ const entryDueDate = state.dueDate ? { ...state.dueDate } : undefined;createEffect(on(@@ -35,11 +36,24 @@ export function createTasksViewSearch(options: {search.sort,search.sortReversed,search.groupBy,+ search.dueDate,+ search.dueStart,+ search.dueEnd,options.nonListLayoutsEnabled?.() ?? true,search.savedView,state.savedViewActive,] as const,- ([tab, layout, sort, sortReversed, groupBy, nonListLayoutsEnabled]) => {+ ([+ tab,+ layout,+ sort,+ sortReversed,+ groupBy,+ dueDate,+ dueStart,+ dueEnd,+ nonListLayoutsEnabled,+ ]) => {if (!options.enabled) return;const savedViewActive = Boolean(search.savedView || state.savedViewActive@@ -59,6 +73,7 @@ export function createTasksViewSearch(options: {DEFAULT_TASK_FACET_SELECTION);draft.collapsedGroupIds = [];+ draft.dueDate = undefined;}draft.layout =@@ -72,16 +87,36 @@ export function createTasksViewSearch(options: {: tab === entryTab? entryGroupBy: TASK_DEFAULT_GROUP_BY[tab]);+ const reversed =+ !sort?.startsWith('due_date_') && sortReversed === 'true';if (!savedViewActive) {draft.sort = sort- ? [{ id: sort, reversed: sortReversed === 'true' }]+ ? [{ id: sort, reversed }]: entrySort.map((item) => ({ ...item }));} else if (sort &&(draft.sort[0]?.id !== sort ||- !!draft.sort[0]?.reversed !== (sortReversed === 'true'))+ !!draft.sort[0]?.reversed !== reversed)) {- draft.sort = [{ id: sort, reversed: sortReversed === 'true' }];+ draft.sort = [{ id: sort, reversed }];+ }+ if (!savedViewActive) {+ if (dueDate === 'range') {+ const validRange =+ (dueStart || dueEnd) &&+ (!dueStart || !dueEnd || dueStart <= dueEnd);+ draft.dueDate = validRange+ ? { type: 'range', start: dueStart, end: dueEnd }+ : undefined;+ } else if (dueDate === 'any') {+ draft.dueDate = undefined;+ } else if (dueDate) {+ draft.dueDate = { type: dueDate };+ } else if (tab === entryTab && entryDueDate) {+ draft.dueDate = { ...entryDueDate };+ } else {+ draft.dueDate = undefined;+ }}}));@@ -112,12 +147,24 @@ export function createTasksViewSearch(options: {if (args[0] === 'groupBy') {options.setSearch({ groupBy: state.groupBy });}++ if (args[0] === 'dueDate') {+ const filter = state.dueDate;+ options.setSearch({+ dueDate: filter?.type ?? 'any',+ dueStart: filter?.type === 'range' ? filter.start : undefined,+ dueEnd: filter?.type === 'range' ? filter.end : undefined,+ });+ }},});const setPrimarySort = (id: TaskSortId) => {const current = state.sort[0];- const reversed = current?.id === id ? !current.reversed : false;+ const reversed =+ !id.startsWith('due_date_') && current?.id === id+ ? !current.reversed+ : false;options.setState('sort', [{ id, reversed }]);if (!options.enabled) return;diff --git a/apps/web/src/features/tasks-view/queries/task-board-queries.test.ts b/apps/web/src/features/tasks-view/queries/task-board-queries.test.tsindex 82d74d9c9f..2ebd06c1ac 100644--- a/apps/web/src/features/tasks-view/queries/task-board-queries.test.ts+++ b/apps/web/src/features/tasks-view/queries/task-board-queries.test.ts@@ -3,6 +3,7 @@ import { PROPERTY_OPTION_IDS } from '@property/constants';import { SYSTEM_PROPERTY_IDS } from '@property/identifiers';import { createRoot } from 'solid-js';import { afterEach, beforeEach, expect, it, vi } from 'vitest';+import { createDateBucketBoundaries } from '../core/task-due-date';import { boardEntity, boardProperty } from '../tests/task-board-fixture';import { createTaskBoardQueries } from './task-board-queries';@@ -189,6 +190,66 @@ it('releases the property lock after a server rejects a project write', async ()expect(fixture.save).toHaveBeenCalledTimes(2);});+it('saves deadline moves through the shared DATE mutation and rejects mismatched buckets', async () => {+ fixture.definitions = {+ isSuccess: true,+ data: [+ boardProperty(SYSTEM_PROPERTY_IDS.DUE_DATE, null, 'DATE').definition,+ ],+ };+ const calendar = createDateBucketBoundaries(+ new Date('2026-10-21T18:00:00Z'),+ 'America/New_York'+ );+ const source = setup({+ grouping: () => 'due_date',+ calendar: () => calendar,+ });+ await expect(+ source.actions.save(+ {+ id: 'one',+ fromLane: 'no_due_date',+ toLane: 'tomorrow',+ dueDate: calendar.boundaries.today,+ },+ 'due_date'+ )+ ).rejects.toThrow('outside the destination bucket');+ expect(fixture.save).not.toHaveBeenCalled();+ await source.actions.save(+ {+ id: 'one',+ fromLane: 'no_due_date',+ toLane: 'tomorrow',+ dueDate: calendar.boundaries.tomorrow,+ },+ 'due_date'+ );+ expect(fixture.save).toHaveBeenLastCalledWith({+ properties: [+ expect.objectContaining({+ entityId: 'one',+ entityType: 'TASK',+ apiValues: {+ valueType: 'DATE',+ value: new Date('2026-10-22T04:00:00.000Z'),+ },+ }),+ ],+ });+ await source.actions.save(+ { id: 'one', fromLane: 'today', toLane: 'no_due_date', dueDate: null },+ 'due_date'+ );+ expect(fixture.save).toHaveBeenLastCalledWith({+ properties: [+ expect.objectContaining({+ apiValues: { valueType: 'DATE', value: null },+ }),+ ],+ });+});it('orders project columns by name with No Project last, even from search results', () => {fixture.projectQueries = [{ isSuccess: true, data: { id: 'zeta', name: 'Zeta', access: 'view' } },diff --git a/apps/web/src/features/tasks-view/queries/task-board-queries.ts b/apps/web/src/features/tasks-view/queries/task-board-queries.tsindex 38cfc9a199..97acab494c 100644--- a/apps/web/src/features/tasks-view/queries/task-board-queries.ts+++ b/apps/web/src/features/tasks-view/queries/task-board-queries.ts@@ -1,8 +1,8 @@import { createProjectIdentityQuery } from '@app/features/projects/queries/project-identity';import type { FacetSelection, SortSelection } from '@app/features/soup';-import { sortItems } from '@app/features/soup/collection/transforms';import { soupPropertyToProperty } from '@entity/extractors-property/property-helpers';import type { TaskEntityWithProperties } from '@entity/types/entity';+import { Telemetry } from '@macro-inc/observability';import { SYSTEM_PROPERTY_IDS } from '@property/identifiers';import type { Property, PropertyApiValues } from '@property/types';import { toPropertyDefinitionDomain } from '@property/utils/transforms';@@ -10,9 +10,19 @@ import { useListPropertiesQuery } from '@queries/properties/definitions';import { useBulkSaveEntityPropertiesMutation } from '@queries/properties/entity';import { getGraphqlSoupClient } from '@service-storage/graphql-soup';import { type Accessor, createMemo, createSignal, mapArray } from 'solid-js';-import { TASK_SORT_DEFINITIONS } from '../constants';+import { sortTasks } from '../constants';import type { TaskBoardActions } from '../context/task-board';-import type { TaskBoardColumn, TaskBoardGrouping } from '../core/task-board';+import type {+ TaskBoardColumn,+ TaskBoardGrouping,+ TaskBoardTask,+} from '../core/task-board';+import {+ type DateBucketBoundaries,+ isTaskDueDateBucket,+ type TaskDatePredicate,+ taskDueDateBucket,+} from '../core/task-due-date';import type { TaskSortId } from '../types';import {filterTaskBoardColumns,@@ -32,6 +42,8 @@ export function createTaskBoardQueries(options: {projectsEnabled: Accessor<boolean>;facets?: Accessor<FacetSelection>;sort?: Accessor<SortSelection<TaskSortId>[]>;+ calendar?: Accessor<DateBucketBoundaries>;+ dueDate?: Accessor<TaskDatePredicate | undefined>;}) {const [propertySaving, setPropertySaving] = createSignal<string[]>([]);@@ -49,19 +61,6 @@ export function createTaskBoardQueries(options: {return result;});- const ranks = createMemo(() => {- const values = [...entities().values()];- const ordered = options.searching()- ? values- : sortItems(- values,- options.sort?.() ?? [{ id: 'updated_at' }],- TASK_SORT_DEFINITIONS- );-- return new Map(ordered.map((entity, index) => [entity.id, index]));- });-const definitions = useListPropertiesQuery(() => ({scope: 'system',includeOptions: true,@@ -84,14 +83,33 @@ export function createTaskBoardQueries(options: {);});+ const ranks = createMemo(() => {+ const values = [...entities().values()];+ const ordered = options.searching()+ ? values+ : sortTasks(+ values,+ options.sort?.() ?? [{ id: 'updated_at' }],+ properties()+ );+ return new Map(ordered.map((entity, index) => [entity.id, index]));+ });+const allColumns = createMemo(() =>- taskBoardColumns(options.rows(), options.grouping(), options.searching())+ taskBoardColumns(+ options.rows(),+ options.grouping(),+ options.searching(),+ options.calendar?.()+ ));const rawColumns = createMemo(() =>filterTaskBoardColumns(allColumns(),options.grouping(),- options.facets?.() ?? {}+ options.facets?.() ?? {},+ options.dueDate?.(),+ options.calendar?.()));@@ -168,6 +186,7 @@ export function createTaskBoardQueries(options: {return !id || !!property.options?.some((option) => option.id === id);}+ if (grouping === 'due_date') return isTaskDueDateBucket(id);return grouping !== 'project' || options.projectsEnabled();},async save(move, grouping) {@@ -184,16 +203,30 @@ export function createTaskBoardQueries(options: {if (!canMove) {throw new Error('Task or destination is no longer editable');}+ if (grouping === 'due_date') {+ const calendar = options.calendar?.();+ if (+ !calendar ||+ move.dueDate === undefined ||+ taskDueDateBucket(move.dueDate ?? undefined, calendar) !== move.toLane+ )+ throw new Error('Date is outside the destination bucket');+ }- await save.mutateAsync({- properties: [- {- entityId: entity.id,- entityType: 'TASK',- property,- apiValues: taskBoardMoveValue(entity, grouping, move),- },- ],+ await Telemetry.span('task.board.move', async (span) => {+ span.setAttr('task.id', entity.id);+ span.setAttr('task.grouping', grouping);+ span.setAttr('task.destination', move.toLane);+ await save.mutateAsync({+ properties: [+ {+ entityId: entity.id,+ entityType: 'TASK',+ property,+ apiValues: taskBoardMoveValue(entity, grouping, move),+ },+ ],+ });});},};@@ -275,13 +308,16 @@ export function createTaskBoardQueries(options: {return {actions,columns,- compareTasks: (left: string, right: string) =>- (ranks().get(left) ?? Infinity) - (ranks().get(right) ?? Infinity),+ compareTasks: (left: TaskBoardTask, right: TaskBoardTask) => {+ return (+ (ranks().get(left.id) ?? Infinity) - (ranks().get(right.id) ?? Infinity)+ );+ },hiddenColumnCount: () => allColumns().length - rawColumns().length,task: (id: string) => {const entity = entities().get(id);- return entity ? toBoardTask(entity) : undefined;+ return entity ? toBoardTask(entity, options.calendar?.()) : undefined;},entity: (id: string) => entities().get(id),property,diff --git a/apps/web/src/features/tasks-view/queries/task-board.test.ts b/apps/web/src/features/tasks-view/queries/task-board.test.tsindex dee8a355a9..2011fd67a5 100644--- a/apps/web/src/features/tasks-view/queries/task-board.test.ts+++ b/apps/web/src/features/tasks-view/queries/task-board.test.ts@@ -5,12 +5,25 @@ import {} from '@app/features/soup/collection/rows';import { PROPERTY_OPTION_IDS } from '@property/constants';import { SYSTEM_PROPERTY_IDS } from '@property/identifiers';+import { propertySortKey } from '@property/utils/sort';+import { toPropertyDefinitionDomain } from '@property/utils/transforms';+import { makeGroupComparator } from '@queries/soup/grouped/api';+import type { GroupMeta } from '@queries/soup/grouped/types';import { describe, expect, it } from 'vitest';+import { sortTasks } from '../constants';+import {+ createDateBucketBoundaries,+ TASK_DUE_DATE_BUCKETS,+ taskDueDateBucket,+ taskDueDateUrgency,+} from '../core/task-due-date';+import { taskBoardComposerContext } from '../task-composer';import { boardEntity, boardProperty } from '../tests/task-board-fixture';import {filterTaskBoardColumns,taskBoardColumns,taskBoardMoveValue,+ toBoardTask,} from './task-board';describe('board query projection', () => {@@ -50,6 +63,76 @@ describe('board query projection', () => {});});+ it('places the undated column first even when grouped rows arrive later', () => {+ const columns = taskBoardColumns(+ [+ createSoupGroupHeaderRow({ id: 'overdue', label: 'Overdue', count: 1 }),+ createSoupEntityRow(boardEntity('task'), { groupId: 'overdue' }),+ ],+ 'due_date',+ false+ );+ expect(columns.map((column) => column.id)).toEqual([+ 'no_due_date',+ 'overdue',+ 'today',+ 'tomorrow',+ 'next_7_days',+ 'later',+ ]);+ });++ it('uses local calendar boundaries and ignores urgency for closed tasks', () => {+ const calendar = createDateBucketBoundaries(+ new Date('2025-03-09T12:00:00Z'),+ 'America/New_York'+ );+ expect(taskDueDateUrgency('2025-03-09T04:59:59Z', false, calendar)).toBe(+ 'danger'+ );+ expect(taskDueDateUrgency('2025-03-09T05:00:00Z', false, calendar)).toBe(+ 'warning'+ );+ expect(taskDueDateUrgency('2025-03-10T04:00:00Z', false, calendar)).toBe(+ 'warning'+ );+ expect(taskDueDateUrgency('2025-03-11T03:59:59Z', false, calendar)).toBe(+ 'warning'+ );+ expect(+ taskDueDateUrgency('2025-03-11T04:00:00Z', false, calendar)+ ).toBeUndefined();+ expect(+ taskDueDateUrgency('2025-03-17T03:59:59Z', false, calendar)+ ).toBeUndefined();+ expect(+ taskDueDateUrgency('2025-03-09T04:59:59Z', true, calendar)+ ).toBeUndefined();+ expect(taskDueDateUrgency(undefined, false, calendar)).toBeUndefined();+ });++ it('keeps completed and canceled board tasks neutral', () => {+ for (const status of [+ PROPERTY_OPTION_IDS.STATUS.COMPLETED,+ PROPERTY_OPTION_IDS.STATUS.CANCELED,+ ]) {+ const task = boardEntity('closed', [+ boardProperty(+ SYSTEM_PROPERTY_IDS.STATUS,+ { type: 'SelectOption', value: [status] },+ 'SELECT_STRING'+ ),+ boardProperty(+ SYSTEM_PROPERTY_IDS.DUE_DATE,+ { type: 'Date', value: '2025-03-08T12:00:00Z' },+ 'DATE'+ ),+ ]);+ const projected = toBoardTask(task);+ expect(projected.closed).toBe(true);+ }+ });+it('deduplicates multi-assignee search placements and preserves hit order when filtering', () => {const first = boardEntity('first', [boardProperty(SYSTEM_PROPERTY_IDS.ASSIGNEES, {@@ -116,3 +199,245 @@ describe('board property writes', () => {});});});++describe('board task drafts', () => {+ it('keeps host presets and seeds dates within the chosen bucket across DST', () => {+ const calendar = createDateBucketBoundaries(+ new Date('2025-03-09T12:00:00Z'),+ 'America/New_York'+ );+ const project = {+ valueType: 'ENTITY' as const,+ refs: [{ entity_id: 'project', entity_type: 'INITIATIVE' as const }],+ };+ for (const { id } of TASK_DUE_DATE_BUCKETS) {+ const draft = taskBoardComposerContext({+ grouping: 'due_date',+ columnId: id,+ calendar,+ context: {+ key: 'project-view',+ visiblePropertyIds: [SYSTEM_PROPERTY_IDS.PROJECT],+ initialPropertyValues: {+ [SYSTEM_PROPERTY_IDS.PROJECT]: project,+ [SYSTEM_PROPERTY_IDS.DUE_DATE]: {+ valueType: 'DATE',+ value: new Date('2025-03-01T05:00:00Z'),+ },+ },+ },+ });+ const dueDate =+ draft.initialPropertyValues?.[SYSTEM_PROPERTY_IDS.DUE_DATE];+ expect(dueDate?.valueType).toBe('DATE');+ if (dueDate?.valueType !== 'DATE') throw new Error('Missing date preset');+ expect(taskDueDateBucket(dueDate.value?.toISOString(), calendar)).toBe(+ id+ );+ expect(+ draft.initialPropertyValues?.[SYSTEM_PROPERTY_IDS.PROJECT]+ ).toEqual(project);+ expect(draft.visiblePropertyIds).toContain(SYSTEM_PROPERTY_IDS.DUE_DATE);+ if (id === 'tomorrow') {+ expect(dueDate.value?.toISOString()).toBe('2025-03-10T04:00:00.000Z');+ }+ if (id === 'no_due_date') expect(dueDate.value).toBeNull();+ }+ });++ it('scopes dated drafts to their local day and timezone', () => {+ const before = createDateBucketBoundaries(+ new Date('2025-03-09T04:59:59Z'),+ 'America/New_York'+ );+ const after = createDateBucketBoundaries(+ new Date('2025-03-09T05:00:00Z'),+ 'America/New_York'+ );+ const later = createDateBucketBoundaries(+ new Date('2025-03-09T18:00:00Z'),+ 'America/New_York'+ );+ const utc = createDateBucketBoundaries(+ new Date('2025-03-09T18:00:00Z'),+ 'UTC'+ );+ for (const { id } of TASK_DUE_DATE_BUCKETS) {+ if (id === 'no_due_date') continue;+ const draft = (calendar: typeof before) =>+ taskBoardComposerContext({+ grouping: 'due_date',+ columnId: id,+ scopeKey: 'project-view',+ calendar,+ });+ expect(draft(after).key).not.toBe(draft(before).key);+ expect(draft(after).key).toBe(draft(later).key);+ expect(draft(utc).key).not.toBe(draft(later).key);+ }+ for (const grouping of ['due_date', 'status', 'assignee'] as const) {+ const draft = (calendar: typeof before) =>+ taskBoardComposerContext({+ grouping,+ columnId: grouping === 'due_date' ? 'no_due_date' : '',+ scopeKey: 'project-view',+ calendar,+ });+ expect(draft(after).key).toBe(draft(before).key);+ expect(draft(utc).key).toBe(draft(later).key);+ }+ });+});++describe('property sorting', () => {+ it('keeps missing and wrong-type dates last and breaks date ties by update then descending id', () => {+ const property = (date: string) =>+ boardProperty(+ SYSTEM_PROPERTY_IDS.DUE_DATE,+ { type: 'Date', value: date },+ 'DATE'+ );+ const older = {+ ...boardEntity('a', [property('2026-10-28T00:00:00Z')]),+ updatedAt: '2026-10-01T00:00:00Z',+ };+ const newer = {+ ...boardEntity('b', older.properties),+ updatedAt: '2026-10-02T00:00:00Z',+ };+ const tied = { ...newer, id: 'c' };+ const later = {+ ...boardEntity('later', [property('2026-10-29T00:00:00Z')]),+ updatedAt: '2026-10-03T00:00:00Z',+ };+ const absent = {+ ...boardEntity('missing'),+ updatedAt: '2026-10-02T00:00:00Z',+ };+ const wrongType = {+ ...boardEntity('wrong', [+ boardProperty(+ SYSTEM_PROPERTY_IDS.DUE_DATE,+ { type: 'Number', value: 0 },+ 'DATE'+ ),+ ]),+ updatedAt: '2026-10-01T00:00:00Z',+ };+ const rows = [absent, older, wrongType, later, newer, tied];+ expect(+ sortTasks(rows, [{ id: 'due_date_earliest' }]).map((row) => row.id)+ ).toEqual(['c', 'b', 'a', 'later', 'missing', 'wrong']);+ expect(+ sortTasks(rows, [{ id: 'due_date_latest' }]).map((row) => row.id)+ ).toEqual(['later', 'c', 'b', 'a', 'missing', 'wrong']);+ expect(propertySortKey(property('2026-10-28T00:00:00.000001Z'))).toBe(+ 1793145600000001+ );+ expect(propertySortKey(property('1969-12-31T23:59:59.999999Z'))).toBe(-1);+ expect(propertySortKey(property('2026-02-30T00:00:00Z'))).toBeUndefined();+ });++ it('uses cached option display order rather than option labels or identifiers', () => {+ const id = SYSTEM_PROPERTY_IDS.PRIORITY;+ const high = boardProperty(+ id,+ { type: 'SelectOption', value: ['custom-first', 'custom-second'] },+ 'SELECT_STRING'+ );+ const low = boardProperty(+ id,+ { type: 'SelectOption', value: ['custom-first'] },+ 'SELECT_STRING'+ );+ const definition = toPropertyDefinitionDomain(high.definition, [+ {+ id: 'custom-first',+ property_definition_id: id,+ display_order: 0,+ value: { type: 'string', value: 'Urgent' },+ color: null,+ created_at: '',+ updated_at: '',+ },+ {+ id: 'custom-second',+ property_definition_id: id,+ display_order: 3,+ value: { type: 'string', value: 'Low' },+ color: null,+ created_at: '',+ updated_at: '',+ },+ ]);+ // Multi-select uses the lowest option order, not the highest.+ expect(propertySortKey(high, definition.options)).toBe(0);+ expect(+ propertySortKey(+ high,+ definition.options?.map((option) => ({+ ...option,+ property_definition_id: 'another-definition',+ }))+ )+ ).toBeUndefined();+ const second = boardProperty(+ id,+ { type: 'SelectOption', value: ['custom-second'] },+ 'SELECT_STRING'+ );+ const rows = [+ boardEntity('a', [low]),+ boardEntity('b', [second]),+ boardEntity('missing'),+ ];+ const definitions = new Map([[id, definition]]);+ expect(+ sortTasks(rows, [{ id: 'priority' }], definitions).map((row) => row.id)+ ).toEqual(['b', 'a', 'missing']);+ expect(+ sortTasks(rows, [{ id: 'priority', reversed: true }], definitions).map(+ (row) => row.id+ )+ ).toEqual(['a', 'b', 'missing']);+ });++ it('uses server option display order for groups and leaves missing values last', () => {+ for (const propertyDefinitionId of [+ SYSTEM_PROPERTY_IDS.STATUS,+ SYSTEM_PROPERTY_IDS.PRIORITY,+ ]) {+ const groups: GroupMeta[] = [+ {+ key: '',+ label: 'Not Set',+ displayOrder: null,+ itemIds: [],+ totalCount: 0,+ nextCursor: null,+ },+ {+ key: 'later',+ label: 'A',+ displayOrder: 3,+ itemIds: [],+ totalCount: 0,+ nextCursor: null,+ },+ {+ key: 'earlier',+ label: 'Z',+ displayOrder: 0,+ itemIds: [],+ totalCount: 0,+ nextCursor: null,+ },+ ];+ expect(+ groups+ .sort(makeGroupComparator({ type: 'property', propertyDefinitionId }))+ .map((group) => group.key)+ ).toEqual(['earlier', 'later', '']);+ }+ });+});diff --git a/apps/web/src/features/tasks-view/queries/task-board.ts b/apps/web/src/features/tasks-view/queries/task-board.tsindex 086db33e62..e1682f208e 100644--- a/apps/web/src/features/tasks-view/queries/task-board.ts+++ b/apps/web/src/features/tasks-view/queries/task-board.ts@@ -1,9 +1,11 @@import type { FacetSelection } from '@app/features/soup';import type { TaskEntityWithProperties } from '@entity/types/entity';import {+ getTaskDueDate,getTaskPriorityOptionId,getTaskReferencedEntityIds,getTaskStatusOptionId,+ isTaskClosed,TASK_PRIORITY_OPTIONS,TASK_STATUS_OPTIONS,} from '@entity/utils/task-properties';@@ -17,6 +19,14 @@ import {type TaskBoardTask,taskBoardGroupKeys,} from '../core/task-board';+import {+ type DateBucketBoundaries,+ isTaskDueDateBucket,+ TASK_DUE_DATE_BUCKETS,+ type TaskDatePredicate,+ taskDueDateBucket,+ taskDueDateBucketMatchesFilter,+} from '../core/task-due-date';import {EMPTY_TASK_FACET_CONTEXT,getTaskFacetOption,@@ -28,16 +38,27 @@ const BOARD_PROPERTY_IDS = {priority: SYSTEM_PROPERTY_IDS.PRIORITY,assignee: SYSTEM_PROPERTY_IDS.ASSIGNEES,project: SYSTEM_PROPERTY_IDS.PROJECT,+ due_date: SYSTEM_PROPERTY_IDS.DUE_DATE,};export function taskBoardPropertyId(grouping: TaskBoardGrouping): string {return BOARD_PROPERTY_IDS[grouping];}-export function toBoardTask(task: TaskEntityWithProperties): TaskBoardTask {+export function toBoardTask(+ task: TaskEntityWithProperties,+ calendar?: DateBucketBoundaries+): TaskBoardTask {return {id: task.id,name: task.name,+ dueDate: getTaskDueDate(task),+ closed: isTaskClosed(task),+ subtypeCompleted:+ task.subType?.type === 'task' && task.subType.is_completed,+ deadline: calendar+ ? taskDueDateBucket(getTaskDueDate(task), calendar)+ : undefined,statusId: getTaskStatusOptionId(task),priorityId: getTaskPriorityOptionId(task),// Include both people and agent assignees. Their original reference types are retained on writes.@@ -83,11 +104,15 @@ function allowedBoardColumns(export function filterTaskBoardColumns(columns: readonly TaskBoardColumn[],grouping: TaskBoardGrouping,- facets: FacetSelection+ facets: FacetSelection,+ dueDate?: TaskDatePredicate,+ calendar?: DateBucketBoundaries): TaskBoardColumn[] {const allowedColumnIds = allowedBoardColumns(grouping, facets);return columns.filter((column) => {+ if (grouping === 'due_date' && calendar && isTaskDueDateBucket(column.id))+ return taskDueDateBucketMatchesFilter(column.id, dueDate, calendar);return (allowedColumnIds.length === 0 || allowedColumnIds.includes(column.id));@@ -98,7 +123,8 @@ export function filterTaskBoardColumns(export function taskBoardColumns(rows: readonly TasksDataSourceItem[],grouping: TaskBoardGrouping,- searching: boolean+ searching: boolean,+ calendar?: DateBucketBoundaries): TaskBoardColumn[] {const columns = new Map<string,@@ -130,21 +156,30 @@ export function taskBoardColumns(priority: TASK_PRIORITY_OPTIONS,assignee: [],project: [],+ due_date: [+ { value: 'no_due_date', label: 'No due date' },+ ...TASK_DUE_DATE_BUCKETS.filter(+ (bucket) => bucket.id !== 'no_due_date'+ ).map((bucket) => ({ value: bucket.id, label: bucket.label })),+ ],}[grouping];for (const option of options) {addColumn(option.value, option.label);}- addColumn(- '',- {- status: 'No status',- priority: 'No priority',- assignee: 'Unassigned',- project: 'No Project',- }[grouping]- );+ if (grouping !== 'due_date') {+ addColumn(+ '',+ {+ status: 'No status',+ priority: 'No priority',+ assignee: 'Unassigned',+ project: 'No Project',+ due_date: 'No due date',+ }[grouping]+ );+ }for (const row of rows) {if (row.kind !== 'group-header') {@@ -172,7 +207,7 @@ export function taskBoardColumns(continue;}- const task = toBoardTask(row.entity);+ const task = toBoardTask(row.entity, calendar);const keys =searching || row.groupId === undefined? taskBoardGroupKeys(task, grouping)@@ -208,6 +243,14 @@ export function taskBoardMoveValue(grouping: TaskBoardGrouping,move: TaskBoardMove): PropertyApiValues {+ if (grouping === 'due_date') {+ if (move.dueDate === undefined)+ throw new Error('Deadline move requires a resolved date');+ return {+ valueType: 'DATE',+ value: move.dueDate === null ? null : new Date(move.dueDate),+ };+ }if (grouping === 'status' || grouping === 'priority') {return {valueType: 'SELECT_STRING',diff --git a/apps/web/src/features/tasks-view/queries/task-query.test.ts b/apps/web/src/features/tasks-view/queries/task-query.test.tsindex b3a51ca016..95d2d8caca 100644--- a/apps/web/src/features/tasks-view/queries/task-query.test.ts+++ b/apps/web/src/features/tasks-view/queries/task-query.test.ts@@ -1,10 +1,16 @@+import { SYSTEM_PROPERTY_IDS } from '@property/identifiers';import { describe, expect, it, vi } from 'vitest';+import {+ createDateBucketBoundaries,+ taskDueDatePredicate,+} from '../core/task-due-date';import {captureTaskSavedView,decodeTaskSavedView,materializeTaskSavedView,readTaskSavedView,} from '../filters/task-saved-view';+import { type BuildTaskQueryOptions, buildTaskQuery } from './task-query';import { buildTaskSearchRequest } from './task-search';@@ -154,6 +160,128 @@ it('uses explicit Project property grouping for board editing and Project groupi});});+const calendar = createDateBucketBoundaries(+ new Date('2026-11-01T18:00:00Z'),+ 'America/New_York'+);++it('combines an exclusive overdue bound with status independently and freezes deadline grouping', () => {+ const dueDate = taskDueDatePredicate({ type: 'overdue' }, calendar);+ const query = buildTaskQuery({+ ...options,+ groupBy: 'due_date',+ sort: [{ id: 'due_date_earliest' }],+ dueDate,+ calendar,+ });+ expect(query.params.sort_method).toBe('property');+ expect(query.params.sort_direction).toBe('asc');+ expect(query.params.sort_property_definition_id).toBe(+ '00000001-0000-0000-0000-000000000004'+ );+ expect(query.groupBy).toMatchObject({+ type: 'property',+ propertyDefinitionId: '00000001-0000-0000-0000-000000000004',+ bucketing: {+ type: 'date_ranges',+ missingValueBucketKey: 'no_due_date',+ ranges: [+ { key: 'overdue', start: null, end: calendar.boundaries.today },+ {+ key: 'today',+ start: calendar.boundaries.today,+ end: calendar.boundaries.tomorrow,+ },+ {+ key: 'tomorrow',+ start: calendar.boundaries.tomorrow,+ end: calendar.boundaries.day_two,+ },+ {+ key: 'next_7_days',+ start: calendar.boundaries.day_two,+ end: calendar.boundaries.day_eight,+ },+ { key: 'later', start: calendar.boundaries.day_eight, end: null },+ ],+ },+ });+ expect(JSON.stringify(query.body.propf)).toContain(+ '2026-11-01T04:00:00.000Z'+ );+ expect(JSON.stringify(query.body.propf)).toContain(+ '00000001-0000-0000-0002-000000000002'+ );+ expect(JSON.stringify(query.body.propf)).toContain('"end"');+ expect(JSON.stringify(query.body.propf)).toContain('"et":"TASK"');+ expect(JSON.stringify(query.body.propf)).not.toContain('"start"');+});++it('negates date presence and keeps due sorting out of scoped text search', () => {+ const query = buildTaskQuery({+ ...options,+ facets: {},+ dueDate: { hasDate: false },+ sort: [{ id: 'due_date_latest' }],+ searching: true,+ nameContains: 'renewal',+ });+ expect(query.body.propf).toEqual({+ '!': {+ l: {+ pd: '00000001-0000-0000-0000-000000000004',+ et: 'TASK',+ v: { dr: {} },+ },+ },+ });+ expect(query.params.sort_method).toBe('updated_at');+});++it.each(['due_date_earliest', 'due_date_latest'] as const)(+ 'uses the supported %s wire contract for flat and grouped task requests',+ (sort) => {+ for (const groupBy of ['none', 'due_date'] as const) {+ const query = buildTaskQuery({+ ...options,+ groupBy,+ calendar,+ sort: [{ id: sort }],+ });+ expect(query.params).toEqual({+ expand: true,+ limit: 100,+ sort_method: 'property',+ sort_property_definition_id: '00000001-0000-0000-0000-000000000004',+ sort_direction: sort === 'due_date_earliest' ? 'asc' : 'desc',+ });+ // Exclude the project entity itself, not children of a nil parent.+ expect(query.body.pf).toEqual({+ l: { pids: '00000000-0000-0000-0000-000000000000' },+ });+ }+ }+);++it.each([+ ['status', SYSTEM_PROPERTY_IDS.STATUS, 'asc', 'desc'],+ ['priority', SYSTEM_PROPERTY_IDS.PRIORITY, 'desc', 'asc'],+] as const)(+ 'uses stored option order and reversible default direction for %s',+ (id, property, direction, reversed) => {+ expect(buildTaskQuery({ ...options, sort: [{ id }] }).params).toMatchObject(+ {+ sort_method: 'property',+ sort_property_definition_id: property,+ sort_direction: direction,+ }+ );+ expect(+ buildTaskQuery({ ...options, sort: [{ id, reversed: true }] }).params+ .sort_direction+ ).toBe(reversed);+ }+);describe('saved task presentation', () => {it('round-trips layout, grouping, and ordered sorts through capture, read, and materialization', () => {const captured = captureTaskSavedView({@@ -181,15 +309,98 @@ describe('saved task presentation', () => {const restored = materializeTaskSavedView(config);expect(restored.layout).toBe('gantt');expect(restored.groupBy).toBe('project');- expect(buildTaskQuery({ ...options, ...restored }).groupBy).toEqual({+ expect(+ buildTaskQuery({+ ...options,+ ...restored,+ dueDate: taskDueDatePredicate(restored.dueDate, calendar),+ }).groupBy+ ).toEqual({type: 'project',});expect(restored.sort).toEqual(config.sort);expect(- buildTaskQuery({ ...options, ...restored, groupBy: 'none' }).params+ buildTaskQuery({+ ...options,+ ...restored,+ dueDate: taskDueDatePredicate(restored.dueDate, calendar),+ groupBy: 'none',+ }).params).toMatchObject({ sort_method: 'created_at', sort_direction: 'asc' });});+ it.each([+ { type: 'overdue' as const },+ { type: 'no_due_date' as const },+ { type: 'range' as const, start: '2026-10-21', end: '2026-10-28' },+ ])(+ 'restores saved due-date filter %j with due grouping and property sorts',+ (dueDate) => {+ const captured = captureTaskSavedView({+ tab: 'team-tasks',+ facets: { status: ['in-progress'] },+ dueDate,+ groupBy: 'due_date',+ sort: [{ id: 'due_date_earliest' }, { id: 'priority', reversed: true }],+ context: { tagPropertyDefinitionByOptionId: new Map() },+ });+ expect(captured.isOk()).toBe(true);+ if (captured.isErr()) return;+ const { config, issues } = readTaskSavedView(captured.value);+ expect(issues).toEqual([]);+ const restored = materializeTaskSavedView(config);+ expect(restored.dueDate).toEqual(dueDate);+ expect(restored.groupBy).toBe('due_date');+ expect(restored.sort).toEqual([+ { id: 'due_date_earliest', reversed: false },+ { id: 'priority', reversed: true },+ ]);+ const query = buildTaskQuery({+ ...options,+ ...restored,+ dueDate: taskDueDatePredicate(restored.dueDate, calendar),+ calendar,+ });+ expect(query.params).toMatchObject({+ sort_method: 'property',+ sort_property_definition_id: SYSTEM_PROPERTY_IDS.DUE_DATE,+ sort_direction: 'asc',+ });+ expect(query.body.propf).toBeDefined();+ expect(query.groupBy).toMatchObject({ type: 'property' });+ }+ );++ it('skips invalid dates without dropping supported filters and presentation', () => {+ const captured = captureTaskSavedView({+ tab: 'team-tasks',+ facets: {},+ dueDate: { type: 'range', start: '2026-11-02', end: '2026-11-01' },+ context: { tagPropertyDefinitionByOptionId: new Map() },+ });+ expect(captured.isErr()).toBe(true);+ const { config, issues } = readTaskSavedView({+ kind: 'tasks',+ version: 1,+ filters: {+ statusOptionIds: [],+ priorityOptionIds: [],+ assignees: [],+ creators: [],+ tags: [],+ },+ dueDate: { type: 'range', start: 'invalid', end: '2026-10-28' },+ groupBy: 'due_date',+ sort: [{ id: 'status', reversed: true }],+ });+ expect(issues.map(({ path }) => path.join('.'))).toContain('dueDate');+ expect(materializeTaskSavedView(config)).toMatchObject({+ dueDate: undefined,+ groupBy: 'due_date',+ sort: [{ id: 'status', reversed: true }],+ });+ });+it('uses the first saved sort and its direction rather than later sorts', () => {const { config } = readTaskSavedView({kind: 'tasks',@@ -210,7 +421,12 @@ describe('saved task presentation', () => {const restored = materializeTaskSavedView(config);expect(restored.layout).toBe('board');expect(- buildTaskQuery({ ...options, ...restored, groupBy: 'none' }).params+ buildTaskQuery({+ ...options,+ ...restored,+ dueDate: taskDueDatePredicate(restored.dueDate, calendar),+ groupBy: 'none',+ }).params).toMatchObject({ sort_method: 'viewed_at', sort_direction: 'desc' });});@@ -247,7 +463,12 @@ describe('saved task presentation', () => {expect(restored.groupBy).toBe('priority');expect(restored.sort).toEqual([{ id: 'created_at', reversed: true }]);expect(restored.facets.status).toEqual([status]);- const query = buildTaskQuery({ ...options, ...restored, groupBy: 'none' });+ const query = buildTaskQuery({+ ...options,+ ...restored,+ dueDate: taskDueDatePredicate(restored.dueDate, calendar),+ groupBy: 'none',+ });expect(JSON.stringify(query.body.propf)).toContain(status);expect(query.params).toMatchObject({sort_method: 'created_at',@@ -306,10 +527,12 @@ describe('saved task filter execution', () => {const query = buildTaskQuery({...options,...restored,+ dueDate: taskDueDatePredicate(restored.dueDate, calendar),userId: viewer,});const search = buildTaskSearchRequest({...restored,+ dueDate: taskDueDatePredicate(restored.dueDate, calendar),query: 'review',matchType: 'partial',userId: viewer,@@ -378,9 +601,14 @@ describe('saved task filter execution', () => {},});const restored = materializeTaskSavedView(config);- const query = buildTaskQuery({ ...options, ...restored });+ const query = buildTaskQuery({+ ...options,+ ...restored,+ dueDate: taskDueDatePredicate(restored.dueDate, calendar),+ });const search = buildTaskSearchRequest({...restored,+ dueDate: taskDueDatePredicate(restored.dueDate, calendar),userId: 'user',query: 'review',matchType: 'partial',@@ -427,7 +655,11 @@ describe('saved task filter execution', () => {(value) => {const { config, issues } = readTaskSavedView(value);const restored = materializeTaskSavedView(config);- const query = buildTaskQuery({ ...options, ...restored });+ const query = buildTaskQuery({+ ...options,+ ...restored,+ dueDate: taskDueDatePredicate(restored.dueDate, calendar),+ });expect(query.body.df).toEqual({ l: { dst: 'task' } });expect(query.body.propf).toBeUndefined();expect(Object.values(restored.facets).flat()).toEqual([]);diff --git a/apps/web/src/features/tasks-view/queries/task-query.ts b/apps/web/src/features/tasks-view/queries/task-query.tsindex 200692ad2f..d8dc8a5278 100644--- a/apps/web/src/features/tasks-view/queries/task-query.ts+++ b/apps/web/src/features/tasks-view/queries/task-query.ts@@ -11,6 +11,11 @@ import { SYSTEM_PROPERTY_IDS } from '@property/constants';import type { GroupByField } from '@queries/soup/grouped/types';import type { SoupAstBody, SoupAstItemsQueryArgs } from '@queries/soup/items';import { match } from 'ts-pattern';+import { taskPropertySort } from '../constants';+import type {+ DateBucketBoundaries,+ TaskDatePredicate,+} from '../core/task-due-date';import {EMPTY_TASK_FACET_CONTEXT,TASK_FACETS,@@ -49,10 +54,23 @@ const propertyScope = (tab: TaskTab,userId: string | undefined,compiledFacets: TaskAst | undefined,- reference: TaskReferenceScope | undefined+ reference: TaskReferenceScope | undefined,+ dueDate?: TaskDatePredicate): TaskAst | undefined => {const groups: TaskAst[] = [];if (compiledFacets) groups.push(compiledFacets);+ if (dueDate) {+ const value: TaskAst = {+ l: {+ pd: SYSTEM_PROPERTY_IDS.DUE_DATE,+ et: 'TASK',+ v: { dr: 'dateRange' in dueDate ? dueDate.dateRange : {} },+ },+ };+ groups.push(+ 'hasDate' in dueDate && !dueDate.hasDate ? { '!': value } : value+ );+ }if (tab === 'my-tasks' && userId) {groups.push(entityPropertyLiteral(SYSTEM_PROPERTY_IDS.ASSIGNEES, userId));@@ -75,17 +93,48 @@ const nonTaskTargets = {cthf: literal('ThreadId', NIL_UUID),ef: literal('ThreadId', NIL_UUID),fef: literal('id', NIL_UUID),- pf: literal('pid', NIL_UUID),+ pf: literal('pids', NIL_UUID),};export const taskGroupByField = (- groupBy: TaskGroupBy+ groupBy: TaskGroupBy,+ calendar?: DateBucketBoundaries): GroupByField | undefined => {switch (groupBy) {case 'none':return undefined;case 'date':return { type: 'date' };+ case 'due_date':+ if (!calendar)+ throw new Error('Due-date grouping requires date-bucket boundaries');+ return {+ type: 'property',+ propertyDefinitionId: SYSTEM_PROPERTY_IDS.DUE_DATE,+ bucketing: {+ type: 'date_ranges',+ ranges: [+ { key: 'overdue', start: null, end: calendar.boundaries.today },+ {+ key: 'today',+ start: calendar.boundaries.today,+ end: calendar.boundaries.tomorrow,+ },+ {+ key: 'tomorrow',+ start: calendar.boundaries.tomorrow,+ end: calendar.boundaries.day_two,+ },+ {+ key: 'next_7_days',+ start: calendar.boundaries.day_two,+ end: calendar.boundaries.day_eight,+ },+ { key: 'later', start: calendar.boundaries.day_eight, end: null },+ ],+ missingValueBucketKey: 'no_due_date',+ },+ };case 'project':return { type: 'project' };case 'status':@@ -113,6 +162,9 @@ export type BuildTaskQueryOptions = {facetContext?: TaskFacetContext;groupBy: TaskGroupBy;sort: SortSelection<TaskSortId>[];+ dueDate?: TaskDatePredicate;+ calendar?: DateBucketBoundaries;+ searching?: boolean;/** Only tasks whose property references this entity. */reference?: TaskReferenceScope;/** Only tasks associated with this CRM record, resolved by the server. */@@ -138,12 +190,20 @@ export function buildTaskQuery(options: BuildTaskQueryOptions): SoupAstItemsQueryArgs {const primarySort = options.sort[0];- const serverSort = primarySort?.id ?? 'updated_at';-- let sortDirection: 'asc' | 'desc' = 'desc';-- if (primarySort?.reversed) sortDirection = 'asc';-+ const requestedSort = primarySort?.id ?? 'updated_at';+ const featureSort =+ (options.searching || options.nameContains) &&+ requestedSort.startsWith('due_date_')+ ? 'updated_at'+ : requestedSort;+ const propertySort = taskPropertySort(featureSort);+ let sortDirection: 'asc' | 'desc' = propertySort?.direction ?? 'desc';+ if (primarySort?.reversed && !featureSort.startsWith('due_date_')) {+ sortDirection = sortDirection === 'asc' ? 'desc' : 'asc';+ }+ const sortMethod = match(featureSort)+ .with('updated_at', 'created_at', 'viewed_at', (sort) => sort)+ .otherwise(() => 'property' as const);const compiledFacets = compileFacets(options.facets, TASK_FACETS, {...(options.facetContext ?? EMPTY_TASK_FACET_CONTEXT),viewerId: options.userId,@@ -153,7 +213,8 @@ export function buildTaskQuery(options.tab,options.userId,compiledFacets.propf,- options.reference+ options.reference,+ options.dueDate);const taskDocuments = documentScope(options.tab, options.userId);@@ -180,7 +241,8 @@ export function buildTaskQuery(params: {expand: true,limit: 100,- sort_method: serverSort,+ sort_method: sortMethod,+ sort_property_definition_id: propertySort?.propertyDefinitionId,sort_direction: sortDirection,},body,@@ -190,6 +252,6 @@ export function buildTaskQuery(type: 'property',propertyDefinitionId: SYSTEM_PROPERTY_IDS.PROJECT,}- : taskGroupByField(options.groupBy),+ : taskGroupByField(options.groupBy, options.calendar),};}diff --git a/apps/web/src/features/tasks-view/queries/task-search.test.ts b/apps/web/src/features/tasks-view/queries/task-search.test.tsindex c04f8e1164..3a574393ae 100644--- a/apps/web/src/features/tasks-view/queries/task-search.test.ts+++ b/apps/web/src/features/tasks-view/queries/task-search.test.ts@@ -1,6 +1,12 @@import { createTagFacetContext } from '@app/features/soup';import type { TagSetResponse } from '@service-properties/generated/schemas/tagSetResponse';import { describe, expect, it, vi } from 'vitest';+import {+ createDateBucketBoundaries,+ taskDueDatePredicate,+} from '../core/task-due-date';+import { taskMatchesView } from '../filters/task-predicates';+import { boardEntity, boardProperty } from '../tests/task-board-fixture';import { buildTaskSearchRequest } from './task-search';vi.mock('@app/features/soup', async () => ({@@ -74,3 +80,79 @@ describe('buildTaskSearchRequest', () => {expect(unresolved.tag_filter_mode).toBeUndefined();});});++it('compiles the same DST range for remote and local search without changing text ordering', () => {+ const calendar = createDateBucketBoundaries(+ new Date('2026-03-08T17:00:00Z'),+ 'America/New_York'+ );+ const dueDate = taskDueDatePredicate({ type: 'today' }, calendar);+ const request = buildTaskSearchRequest({+ query: 'launch',+ matchType: 'partial',+ tab: 'team-tasks',+ userId: 'user',+ facets: {},+ dueDate,+ });+ expect(request.body.filters?.property_filters).toEqual([+ {+ property_definition_id: '00000001-0000-0000-0000-000000000004',+ entity_type: 'TASK',+ date_range: {+ start: '2026-03-08T05:00:00.000Z',+ end: '2026-03-09T04:00:00.000Z',+ },+ },+ ]);+ expect(request.body).not.toHaveProperty('sort');+ const context = {+ tab: 'team-tasks' as const,+ userId: 'user',+ facets: {},+ dueDate,+ };+ expect(taskMatchesView(boardEntity('missing'), context)).toBe(false);+ expect(+ taskMatchesView(+ boardEntity('today', [+ boardProperty(+ '00000001-0000-0000-0000-000000000004',+ { type: 'Date', value: '2026-03-09T03:59:59Z' },+ 'DATE'+ ),+ ]),+ context+ )+ ).toBe(true);+ expect(+ taskMatchesView(+ boardEntity('tomorrow', [+ boardProperty(+ '00000001-0000-0000-0000-000000000004',+ { type: 'Date', value: '2026-03-09T04:00:00Z' },+ 'DATE'+ ),+ ]),+ context+ )+ ).toBe(false);+});++it('sends explicit false presence rather than omitting the no-date filter', () => {+ const request = buildTaskSearchRequest({+ query: 'launch',+ matchType: 'partial',+ tab: 'team-tasks',+ userId: 'user',+ facets: {},+ dueDate: { hasDate: false },+ });+ expect(request.body.filters?.property_filters).toEqual([+ {+ property_definition_id: '00000001-0000-0000-0000-000000000004',+ entity_type: 'TASK',+ has_date: false,+ },+ ]);+});diff --git a/apps/web/src/features/tasks-view/queries/task-search.ts b/apps/web/src/features/tasks-view/queries/task-search.tsindex 9951162228..97eff14c4d 100644--- a/apps/web/src/features/tasks-view/queries/task-search.ts+++ b/apps/web/src/features/tasks-view/queries/task-search.ts@@ -9,6 +9,7 @@ import type {EntityFilters,PropertyFilter as SearchPropertyFilter,} from '@service-search/generated/models';+import type { TaskDatePredicate } from '../core/task-due-date';import {EMPTY_TASK_FACET_CONTEXT,getTaskFacetOption,@@ -95,12 +96,23 @@ export function buildTaskSearchRequest(options: {facets: FacetSelection;facetContext?: TaskFacetContext;reference?: TaskReferenceScope;+ dueDate?: TaskDatePredicate;}): SearchSoupQueryArgs {const facetContext = {...(options.facetContext ?? EMPTY_TASK_FACET_CONTEXT),viewerId: options.userId,};const propertyFilters = selectedPropertyFilters(options.facets, facetContext);+ if (options.dueDate) {+ const value = options.dueDate;+ propertyFilters.push({+ property_definition_id: SYSTEM_PROPERTY_IDS.DUE_DATE,+ entity_type: 'TASK',+ ...('dateRange' in value+ ? { date_range: value.dateRange }+ : { has_date: value.hasDate }),+ });+ }if (options.tab === 'my-tasks') {propertyFilters.push({diff --git a/apps/web/src/features/tasks-view/queries/use-tasks-query.test.ts b/apps/web/src/features/tasks-view/queries/use-tasks-query.test.tsindex e18a850acb..f96e994bc4 100644--- a/apps/web/src/features/tasks-view/queries/use-tasks-query.test.ts+++ b/apps/web/src/features/tasks-view/queries/use-tasks-query.test.ts@@ -12,6 +12,9 @@ const fixture = vi.hoisted(() => ({searchState: vi.fn(),mapItem: vi.fn(),}));+vi.mock('@queries/properties/definitions', () => ({+ useListPropertiesQuery: () => ({ isSuccess: false, data: [] }),+}));vi.mock('@app/features/soup', async () => ({...(await import('@app/features/soup/filters')),...(await import('@app/features/soup/collection/rows')),diff --git a/apps/web/src/features/tasks-view/queries/use-tasks-query.ts b/apps/web/src/features/tasks-view/queries/use-tasks-query.tsindex c4309cb09a..1a59780c2e 100644--- a/apps/web/src/features/tasks-view/queries/use-tasks-query.ts+++ b/apps/web/src/features/tasks-view/queries/use-tasks-query.ts@@ -9,7 +9,6 @@ import {isSoupRowVisible,type SoupGroup,type SoupRow,- sortItems,tagFacetReady,useSearchContext,} from '@app/features/soup';@@ -22,6 +21,8 @@ import {type TaskEntityWithProperties,} from '@entity';import { SYSTEM_PROPERTY_IDS } from '@property/constants';+import { toPropertyDefinitionDomain } from '@property/utils/transforms';+import { useListPropertiesQuery } from '@queries/properties/definitions';import { createGroupedSoupQueries } from '@queries/soup/grouped/create-grouped-soup-queries';import {type SoupApiItemFilter,@@ -30,13 +31,19 @@ import {import { mapApiSoupItemToEntity } from '@queries/soup/transform-utils';import type { TagSetResponse } from '@service-properties/generated/schemas/tagSetResponse';import { type Accessor, createMemo } from 'solid-js';-import { TASK_SORT_DEFINITIONS } from '../constants';+import { sortTasks } from '../constants';+import {+ type DateBucketBoundaries,+ TASK_DUE_DATE_BUCKETS,+ taskDueDatePredicate,+} from '../core/task-due-date';import { isProjectTab } from '../core/task-navigation';import type { TaskFacetContext } from '../filters/task-facets';import {type TaskViewContext,taskMatchesView,} from '../filters/task-predicates';+import { createDateBucketBoundariesSignal } from '../primitives/create-date-bucket-boundaries';import type {TaskCrmScope,TaskReferenceScope,@@ -48,7 +55,13 @@ import { buildTaskSearchRequest } from './task-search';export type TasksDataSourceInput = Pick<TasksViewState,- 'tab' | 'search' | 'groupBy' | 'sort' | 'facets' | 'savedViewActive'+ | 'tab'+ | 'search'+ | 'groupBy'+ | 'sort'+ | 'facets'+ | 'dueDate'+ | 'savedViewActive'>;export type UseTasksDataSourceOptions = {@@ -68,6 +81,7 @@ export type UseTasksDataSourceOptions = {enabled?: Accessor<boolean>;networkPaused?: Accessor<boolean>;board?: Accessor<boolean>;+ calendar?: Accessor<DateBucketBoundaries>;};export type TasksDataSourceItem = SoupRow<TaskEntityWithProperties>;@@ -145,6 +159,8 @@ export function useTasksDataSource(options: UseTasksDataSourceOptions): TasksDataSource {const notificationSource = useGlobalNotificationSource();+ const calendar = options.calendar ?? createDateBucketBoundariesSignal();+ const dueDate = () => taskDueDatePredicate(state.dueDate, calendar());const attachNotifications = (entity: TaskEntityWithProperties) =>withEntityNotifications(entity, notificationSource);@@ -174,6 +190,9 @@ export function useTasksDataSource(crm: options.crm?.(),nameContains,board: options.board?.(),+ dueDate: dueDate(),+ calendar: calendar(),+ searching: !!state.search.trim(),});const queryArgs = () => queryArgsFor();@@ -183,12 +202,14 @@ export function useTasksDataSource(userId: options.userId(),facets: state.facets,facetContext: facetContext(),+ dueDate: dueDate(),});const query = useSoupAstItemsQuery(queryArgs, () => ({enabled: facetOptionsReady(),networkPaused: options.networkPaused?.(),keepPreviousData: scoped,+ onBeforeGraphqlRefresh: () => groupedQueries.resetToInitialPage(),meta: scoped? {insertFilter: taskInsertFilter(@@ -213,15 +234,33 @@ export function useTasksDataSource(}return selected;};+ const definitions = useListPropertiesQuery(+ () => ({ scope: 'system', includeOptions: true }),+ () =>+ facetOptionsReady() && ['status', 'priority'].includes(state.sort[0]?.id)+ );+ const propertyDefinitions = createMemo(+ () =>+ new Map(+ (definitions.isSuccess ? definitions.data : []).map((item) => {+ const definition = 'definition' in item ? item.definition : item;+ const options =+ 'property_options' in item ? item.property_options : [];+ return [+ definition.id,+ toPropertyDefinitionDomain(definition, options),+ ];+ })+ )+ );const baseTasks = createMemo<TaskEntityWithProperties[]>((previous) => {if (query.isLoading) return previous;if (query.isPlaceholderData && previous.length > 0) return previous;-- return sortItems(+ return sortTasks(transformEntities(query.data?.entities ?? []),state.sort,- TASK_SORT_DEFINITIONS+ propertyDefinitions());}, []);@@ -259,6 +298,7 @@ export function useTasksDataSource(facets: state.facets,facetContext: facetContext(),reference: options.reference?.(),+ dueDate: dueDate(),}),});@@ -344,14 +384,18 @@ export function useTasksDataSource((!reference || referencesEntity(task, reference)) &&taskMatchesView(task, viewContext()));- const entities = sortItems(+ const entities = sortTasks(deduplicateSoupEntities([...initialTasks, ...continuationTasks]),state.sort,- TASK_SORT_DEFINITIONS+ propertyDefinitions());const taskGroup: SoupGroup<TaskEntityWithProperties> = {id: group.key,- label: group.label,+ label:+ state.groupBy === 'due_date'+ ? (TASK_DUE_DATE_BUCKETS.find((bucket) => bucket.id === group.key)+ ?.label ?? group.label)+ : group.label,entities,count: group.totalCount,};diff --git a/apps/web/src/features/tasks-view/task-composer.ts b/apps/web/src/features/tasks-view/task-composer.tsindex 688608d2c3..444502121f 100644--- a/apps/web/src/features/tasks-view/task-composer.ts+++ b/apps/web/src/features/tasks-view/task-composer.ts@@ -3,12 +3,19 @@ import type { PropertyApiValues } from '@property/types';import { match } from 'ts-pattern';import type { TaskComposerContext } from '../task-composer/core/context';import type { TaskBoardGrouping } from './core/task-board';+import {+ type DateBucketBoundaries,+ isTaskDueDateBucket,+ taskDateOnlyToIso,+ taskDueDatePickerBounds,+} from './core/task-due-date';import { taskBoardPropertyId } from './queries/task-board';/** Keep host presets while selecting the originating board column. */export function taskBoardComposerContext(options: {grouping: TaskBoardGrouping;columnId: string;+ calendar: DateBucketBoundaries;scopeKey?: string;context?: TaskComposerContext;}): TaskComposerContext {@@ -35,8 +42,22 @@ export function taskBoardComposerContext(options: {]: null,}))+ .with('due_date', () => {+ if (!isTaskDueDateBucket(columnId)) {+ throw new Error('Invalid due-date column');+ }+ const bounds = taskDueDatePickerBounds(columnId, options.calendar);+ const day = bounds.min ?? bounds.max;+ const iso = day && taskDateOnlyToIso(day, options.calendar.timeZone);+ return { valueType: 'DATE', value: iso ? new Date(iso) : null };+ }).exhaustive();+ const calendarScope =+ grouping === 'due_date' && columnId !== 'no_due_date'+ ? [options.calendar.today, options.calendar.timeZone]+ : [];+return {key: JSON.stringify(['tasks-board',@@ -44,6 +65,7 @@ export function taskBoardComposerContext(options: {context?.key,grouping,columnId,+ ...calendarScope,]),visiblePropertyIds: context?.visiblePropertyIds? [...new Set([...context.visiblePropertyIds, propertyId])]diff --git a/apps/web/src/features/tasks-view/tasks-board.test.tsx b/apps/web/src/features/tasks-view/tasks-board.test.tsxindex f88495cda7..f00c12ec13 100644--- a/apps/web/src/features/tasks-view/tasks-board.test.tsx+++ b/apps/web/src/features/tasks-view/tasks-board.test.tsx@@ -13,6 +13,7 @@ import {import type { Accessor } from 'solid-js';import { afterEach, beforeEach, expect, it, vi } from 'vitest';import type { TaskBoardColumn, TaskBoardTask } from './core/task-board';+import { createDateBucketBoundaries } from './core/task-due-date';import { TasksBoard } from './tasks-board';import { boardEntity } from './tests/task-board-fixture';@@ -59,6 +60,8 @@ vi.mock('./tasks-view-context', () => ({openTask: mocks.openTask,projectsEnabled: () => false,showTaskProject: () => false,+ calendar: () =>+ createDateBucketBoundaries(new Date('2026-10-01T12:00:00Z'), 'UTC'),setFacets: vi.fn(),}),}));diff --git a/apps/web/src/features/tasks-view/tasks-board.tsx b/apps/web/src/features/tasks-view/tasks-board.tsxindex 78e104dcc3..1dbcd0444a 100644--- a/apps/web/src/features/tasks-view/tasks-board.tsx+++ b/apps/web/src/features/tasks-view/tasks-board.tsx@@ -12,6 +12,7 @@ import { fireAndForget } from '@core/util/fireAndForget';import { usePropertyUserDisplay } from '@property/hooks/usePropertyUserDisplay';import { type Accessor, type JSX, Show } from 'solid-js';import { type TaskBoardTask, toTaskBoardGrouping } from './core/task-board';+import { taskDueDatePredicate } from './core/task-due-date';import { createTaskBoardQueries } from './queries/task-board-queries';import { taskBoardComposerContext } from './task-composer';import { useTasksView } from './tasks-view-context';@@ -20,7 +21,7 @@ import { TaskBoardView } from './views/task-board-view';/** Connects the task view to query adapters and app navigation. */export function TasksBoard(props: { ref?: (element: HTMLDivElement) => void }) {const context = useTasksView();- const { state, source, openTask, projectsEnabled } = context;+ const { state, source, openTask, projectsEnabled, calendar } = context;const panel = useSplitPanelOrThrow();const layout = useSplitLayout();const createContext = useCreateContext();@@ -32,6 +33,8 @@ export function TasksBoard(props: { ref?: (element: HTMLDivElement) => void }) {projectsEnabled,facets: () => state.facets,sort: () => state.sort,+ calendar,+ dueDate: () => taskDueDatePredicate(state.dueDate, calendar()),});const data = {...queries,@@ -66,10 +69,12 @@ export function TasksBoard(props: { ref?: (element: HTMLDivElement) => void }) {const canCreate = () => !!context.createTask || !context.scopeKey;const createTask = (columnId: string) => {+ const grouping = toTaskBoardGrouping(state.groupBy);if (!canCreate()) return;const composerContext = taskBoardComposerContext({- grouping: toTaskBoardGrouping(state.groupBy),+ grouping,columnId,+ calendar: calendar(),scopeKey: context.scopeKey ?? panel.handle.id,context: createContext.snapshot('task', panel.handle.id),});diff --git a/apps/web/src/features/tasks-view/tasks-tab-search.ts b/apps/web/src/features/tasks-view/tasks-tab-search.tsindex 48179ebe6d..1ee935496f 100644--- a/apps/web/src/features/tasks-view/tasks-tab-search.ts+++ b/apps/web/src/features/tasks-view/tasks-tab-search.ts@@ -18,11 +18,44 @@ export const tasksTabSearch = {.transform((id) => id.toLowerCase()).optional(),layout: z.enum(['list', 'board', 'gantt']).optional(),- sort: z.enum(['updated_at', 'created_at', 'viewed_at']).optional(),+ sort: z+ .enum([+ 'updated_at',+ 'created_at',+ 'viewed_at',+ 'status',+ 'priority',+ 'due_date_earliest',+ 'due_date_latest',+ ])+ .optional(),sortReversed: z.enum(['true', 'false']).optional(),groupBy: z- .enum(['none', 'status', 'priority', 'assignee', 'project', 'date'])+ .enum([+ 'none',+ 'status',+ 'priority',+ 'assignee',+ 'project',+ 'date',+ 'due_date',+ ])+ .optional(),+ dueDate: z+ .enum([+ 'any',+ 'overdue',+ 'today',+ 'tomorrow',+ 'next_7_days',+ 'later',+ 'has_due_date',+ 'no_due_date',+ 'range',+ ]).optional(),+ dueStart: z.iso.date().optional(),+ dueEnd: z.iso.date().optional(),}),defaults: {tab: 'my-tasks' as TasksTab,@@ -31,6 +64,9 @@ export const tasksTabSearch = {sort: undefined as TaskSortId | undefined,sortReversed: undefined as 'true' | 'false' | undefined,groupBy: undefined as TaskGroupBy | undefined,+ dueDate: undefined,+ dueStart: undefined,+ dueEnd: undefined,},};diff --git a/apps/web/src/features/tasks-view/tasks-view-context.tsx b/apps/web/src/features/tasks-view/tasks-view-context.tsxindex 943570518e..4a325c0889 100644--- a/apps/web/src/features/tasks-view/tasks-view-context.tsx+++ b/apps/web/src/features/tasks-view/tasks-view-context.tsx@@ -58,10 +58,12 @@ import {} from 'solid-js/store';import { TASK_DEFAULT_GROUP_BY } from './constants';import { toTaskBoardGrouping } from './core/task-board';+import type { DateBucketBoundaries } from './core/task-due-date';import { isProjectTab } from './core/task-navigation';import type { TaskFacetContext } from './filters/task-facets';import { DEFAULT_TASK_FACET_SELECTION } from './filters/task-facets';import { createTasksViewPersistence } from './persistence';+import { createDateBucketBoundariesSignal } from './primitives/create-date-bucket-boundaries';import {createTaskSavedViewDraft,type TaskSavedViewDraft,@@ -123,6 +125,7 @@ type TasksListController = ListController<export type TasksViewContext = {scopeKey?: string;state: Store<TasksViewState>;+ calendar: Accessor<DateBucketBoundaries>;savedViews?: TaskSavedViewDraft;savedViewsList?: SavedViewsSource;savedViewSource?: SavedViewSource;@@ -197,6 +200,7 @@ export const [TasksViewProvider, useTasksView] = createAssertedContextProvider<const showTaskProject = () => projectsEnabled() && !props.hideTaskProject;const ganttFlag = useFeatureFlag(enableGantt);const ganttEnabled = () => ganttFlag().enabled;+ const calendar = createDateBucketBoundariesSignal();const initial = props.initialState ?? {};const initialTab = initial.tab ?? 'my-tasks';@@ -216,6 +220,7 @@ export const [TasksViewProvider, useTasksView] = createAssertedContextProvider<facets: normalizeFacetSelection(initial.facets ?? DEFAULT_TASK_FACET_SELECTION),+ dueDate: initial.dueDate,collapsedGroupIds: [...(initial.collapsedGroupIds ?? [])],collapsedSidebarSectionIds: [...(initial.collapsedSidebarSectionIds ?? []),@@ -300,6 +305,10 @@ export const [TasksViewProvider, useTasksView] = createAssertedContextProvider<: undefined,// Layout and rollout fallbacks must not overwrite the selected grouping.groupBy: persistedState.groupBy,+ dueDate: state.dueDate?.type ?? 'any',+ dueStart:+ state.dueDate?.type === 'range' ? state.dueDate.start : undefined,+ dueEnd: state.dueDate?.type === 'range' ? state.dueDate.end : undefined,});const isGroupExpanded = (groupId: string) =>!state.collapsedGroupIds.includes(groupId);@@ -333,6 +342,15 @@ export const [TasksViewProvider, useTasksView] = createAssertedContextProvider<groupBy: persistedState.groupBy,sort: persistedState.sort[0]?.id,sortReversed: persistedState.sort[0]?.reversed ? 'true' : 'false',+ dueDate: persistedState.dueDate?.type ?? 'any',+ dueStart:+ persistedState.dueDate?.type === 'range'+ ? persistedState.dueDate.start+ : undefined,+ dueEnd:+ persistedState.dueDate?.type === 'range'+ ? persistedState.dueDate.end+ : undefined,},{ history: 'replace' });@@ -353,6 +371,7 @@ export const [TasksViewProvider, useTasksView] = createAssertedContextProvider<batch(() => {setNewSavedView(true);applyTaskFacets('team-tasks', DEFAULT_TASK_FACET_SELECTION);+ setState('dueDate', undefined);setState('search', '');navigateSavedView(undefined);});@@ -361,6 +380,7 @@ export const [TasksViewProvider, useTasksView] = createAssertedContextProvider<savedViews?.reset();setNewSavedView(false);applyTaskFacets('my-tasks', DEFAULT_TASK_FACET_SELECTION);+ setState('dueDate', undefined);navigateSavedView(undefined);});if (savedView) {@@ -371,9 +391,10 @@ export const [TasksViewProvider, useTasksView] = createAssertedContextProvider<creating: () => Boolean(newSavedView()),state: persistedState,facetContext,- apply: ({ facets, layout, groupBy, sort }) =>+ apply: ({ facets, layout, groupBy, sort, dueDate }) =>batch(() => {applyTaskFacets('team-tasks', facets);+ setState('dueDate', dueDate);setState('layout', layout);setState('groupBy', groupBy);setState(@@ -386,6 +407,9 @@ export const [TasksViewProvider, useTasksView] = createAssertedContextProvider<groupBy,sort: sort[0]?.id,sortReversed: sort[0]?.reversed ? 'true' : 'false',+ dueDate: dueDate?.type ?? 'any',+ dueStart: dueDate?.type === 'range' ? dueDate.start : undefined,+ dueEnd: dueDate?.type === 'range' ? dueDate.end : undefined,},{ history: 'replace' });@@ -429,6 +453,7 @@ export const [TasksViewProvider, useTasksView] = createAssertedContextProvider<accountChanged ? 'my-tasks' : state.tab,DEFAULT_TASK_FACET_SELECTION);+ setState('dueDate', undefined);}})@@ -457,6 +482,7 @@ export const [TasksViewProvider, useTasksView] = createAssertedContextProvider<return kind !== 'loading' && kind !== 'unavailable';},board: () => state.layout === 'board',+ calendar,}));type ActivationHandler = (@@ -602,6 +628,7 @@ export const [TasksViewProvider, useTasksView] = createAssertedContextProvider<draft.tab = tab;draft.groupBy = TASK_DEFAULT_GROUP_BY[tab];draft.facets = normalizeFacetSelection(DEFAULT_TASK_FACET_SELECTION);+ draft.dueDate = undefined;draft.collapsedGroupIds = [];}));@@ -648,6 +675,7 @@ export const [TasksViewProvider, useTasksView] = createAssertedContextProvider<return props.onCreateTask;},state,+ calendar,projectsEnabled,showTaskProject,ganttEnabled,diff --git a/apps/web/src/features/tasks-view/tests/task-board-fixture.ts b/apps/web/src/features/tasks-view/tests/task-board-fixture.tsindex 307bd01170..b46db018bc 100644--- a/apps/web/src/features/tasks-view/tests/task-board-fixture.ts+++ b/apps/web/src/features/tasks-view/tests/task-board-fixture.ts@@ -19,7 +19,7 @@ export function boardEntity(export function boardProperty(id: string,value: SoupProperty['value'],- dataType: 'ENTITY' | 'SELECT_STRING' = 'ENTITY'+ dataType: 'ENTITY' | 'SELECT_STRING' | 'DATE' = 'ENTITY'): SoupProperty {return {id: `assignment:${id}`,diff --git a/apps/web/src/features/tasks-view/types.ts b/apps/web/src/features/tasks-view/types.tsindex 3b61409e10..bed629e3ae 100644--- a/apps/web/src/features/tasks-view/types.ts+++ b/apps/web/src/features/tasks-view/types.ts@@ -1,5 +1,6 @@import type { FacetSelection, SortSelection } from '@app/features/soup';import type { TaskComposerContext } from '../task-composer/core/context';+import type { TaskDueDateFilter } from './core/task-due-date';export type TaskCreateOptions = {dueDate?: Date;@@ -16,9 +17,17 @@ export type TaskGroupBy =| 'priority'| 'assignee'| 'project'- | 'date';+ | 'date'+ | 'due_date';-export type TaskSortId = 'updated_at' | 'created_at' | 'viewed_at';+export type TaskSortId =+ | 'updated_at'+ | 'created_at'+ | 'viewed_at'+ | 'status'+ | 'priority'+ | 'due_date_earliest'+ | 'due_date_latest';/** Scopes a task list to tasks whose entity-reference property points at an entity. */export type TaskReferenceScope = {@@ -47,6 +56,7 @@ export type TasksViewState = {groupBy: TaskGroupBy;sort: SortSelection<TaskSortId>[];facets: FacetSelection;+ dueDate?: TaskDueDateFilter;collapsedGroupIds: string[];collapsedSidebarSectionIds: string[];/** Transient marker: never persist saved-view filter drafts in entry history. */diff --git a/apps/web/src/features/tasks-view/views/task-board-view.tsx b/apps/web/src/features/tasks-view/views/task-board-view.tsxindex efa10637dc..8ca38f3714 100644--- a/apps/web/src/features/tasks-view/views/task-board-view.tsx+++ b/apps/web/src/features/tasks-view/views/task-board-view.tsx@@ -21,6 +21,7 @@ import {TaskBoardColumnIcon,TaskBoardProperty,} from '../components/task-board-property';+import { TaskDeadlineMoveDialog } from '../components/task-deadline-move-dialog';import { TASK_SORT_OPTIONS } from '../constants';import type { TaskBoardData } from '../context/task-board';import {@@ -29,7 +30,9 @@ import {type TaskBoardTask,toTaskBoardGrouping,} from '../core/task-board';+import { taskDueDateUrgency } from '../core/task-due-date';import { createTaskBoard } from '../primitives/create-task-board';+import { createTaskDeadlineMove } from '../primitives/create-task-deadline-move';import { taskBoardFacetId, taskBoardPropertyId } from '../queries/task-board';import { useTasksView } from '../tasks-view-context';@@ -50,7 +53,8 @@ export function TaskBoardView(props: {) => JSX.Element;ref?: (element: HTMLDivElement) => void;}) {- const { state, source, showTaskProject, setFacets } = useTasksView();+ const { state, source, showTaskProject, setFacets, setState, calendar } =+ useTasksView();const grouping = () => toTaskBoardGrouping(state.groupBy);const scope = () =>JSON.stringify([@@ -59,7 +63,11 @@ export function TaskBoardView(props: {state.search,state.facets,state.sort,+ state.dueDate,+ calendar().today,+ calendar().timeZone,]);+ const deadlineMove = createTaskDeadlineMove({ calendar, scope });const board = createTaskBoard({grouping,scope,@@ -67,16 +75,22 @@ export function TaskBoardView(props: {task: props.data.task,actions: props.data.actions,compareTasks: props.data.compareTasks,+ prepareMove: deadlineMove.prepare,});const [readError, setReadError] = createSignal<string>();const loading = source.boardLoading ?? source.isLoading;const sortLabel = () =>- TASK_SORT_OPTIONS.find(- (option) => option.id === (state.sort[0]?.id ?? 'updated_at')- )?.label ?? 'Updated';+ state.search.trim()+ ? 'search order'+ : (TASK_SORT_OPTIONS.find(+ (option) => option.id === (state.sort[0]?.id ?? 'updated_at')+ )?.label ?? 'Updated');const cardPropertyIds = () =>CARD_PROPERTY_IDS.filter((id) => {- if (id === taskBoardPropertyId(grouping())) {+ if (+ id !== SYSTEM_PROPERTY_IDS.DUE_DATE &&+ id === taskBoardPropertyId(grouping())+ ) {return false;}@@ -84,6 +98,10 @@ export function TaskBoardView(props: {});const revealHiddenColumns = () => {+ if (grouping() === 'due_date') {+ setState('dueDate', undefined);+ return;+ }const facets = { ...state.facets };delete facets[taskBoardFacetId(grouping())];setFacets(facets);@@ -115,6 +133,15 @@ export function TaskBoardView(props: {taskId={task().id}canEdit={!readOnly() && props.data.canEditProperty(task().id, id)}iconOnly={iconOnly}+ dueDateUrgency={+ id === SYSTEM_PROPERTY_IDS.DUE_DATE+ ? taskDueDateUrgency(+ task().dueDate,+ task().closed ?? true,+ calendar()+ )+ : undefined+ }onSave={async (value, apiValues) => {try {if (readOnly()) {@@ -324,6 +351,12 @@ export function TaskBoardView(props: {)}</TaskBoard.Columns></TaskBoard.Root>+ <TaskDeadlineMoveDialog+ picker={deadlineMove.picker()}+ onChange={deadlineMove.select}+ onApply={deadlineMove.apply}+ onCancel={deadlineMove.cancel}+ /></div>);}diff --git a/apps/web/src/features/tasks-view/views/task-saved-views.tsx b/apps/web/src/features/tasks-view/views/task-saved-views.tsxindex c19d1d2ace..e3d9eb8687 100644--- a/apps/web/src/features/tasks-view/views/task-saved-views.tsx+++ b/apps/web/src/features/tasks-view/views/task-saved-views.tsx@@ -38,6 +38,7 @@ import {SavedViewDialog,} from '../../saved-views/views/saved-view-dialogs';import { TASK_GROUP_OPTIONS, TASK_SORT_OPTIONS } from '../constants';+import { TASK_DUE_DATE_BUCKETS } from '../core/task-due-date';import {decodeTaskSavedView,materializeTaskSavedView,@@ -60,6 +61,15 @@ function TaskSavedViewSummary(props: {const { state } = useTasksView();const filters = useTaskFilters();const selection = () => materializeTaskSavedView(props.config);+ const dueDateLabel = () => {+ const filter = props.config.dueDate;+ if (!filter) return;+ if (filter.type === 'range')+ return `Custom range (${filter.start ?? 'Any'} – ${filter.end ?? 'Any'})`;+ if (filter.type === 'has_due_date') return 'Has due date';+ return TASK_DUE_DATE_BUCKETS.find((bucket) => bucket.id === filter.type)+ ?.label;+ };return (<><Show when={props.omittedFilters?.length}>@@ -85,6 +95,7 @@ function TaskSavedViewSummary(props: {</Show>)}</For>+ <Show when={dueDateLabel()}>{(label) => <p>Due date: {label()}</p>}</Show><p>Layout: {LAYOUT_LABELS[props.config.layout]}</p><p>Group by:{' '}@@ -99,7 +110,7 @@ function TaskSavedViewSummary(props: {{props.config.sort.map((sort) =>- `${TASK_SORT_OPTIONS.find((option) => option.id === sort.id)?.label} (${sort.reversed ? 'oldest first' : 'newest first'})`+ `${TASK_SORT_OPTIONS.find((option) => option.id === sort.id)?.label} (${sort.id.startsWith('due_date_') ? 'missing last' : sort.id === 'status' || sort.id === 'priority' ? (sort.reversed ? 'reverse order' : 'option order') : sort.reversed ? 'oldest first' : 'newest first'})`).join(', ') || 'Default'}</p>@@ -208,6 +219,7 @@ function useCreateTaskSavedViewDialog(owner = getOwner()) {layout: restored.layout,groupBy: restored.groupBy,sort: restored.sort,+ dueDate: restored.dueDate,});}selectCreatedSavedView(created.id);diff --git a/apps/web/src/lib/core/component/LexicalMarkdown/component/task-list/TaskListControls.tsx b/apps/web/src/lib/core/component/LexicalMarkdown/component/task-list/TaskListControls.tsxindex ca80eea1e0..2b09d370da 100644--- a/apps/web/src/lib/core/component/LexicalMarkdown/component/task-list/TaskListControls.tsx+++ b/apps/web/src/lib/core/component/LexicalMarkdown/component/task-list/TaskListControls.tsx@@ -17,6 +17,7 @@ import { combine, literal, NIL_UUID } from '@app/features/soup';import { UserIcon } from '@core/component/UserIcon';import {getTaskAssigneeIds,+ getTaskDueDate,getTaskPriorityOptionId,getTaskStatusOptionId,isTaskEntity,@@ -25,7 +26,6 @@ import {import CalendarBlank from '@icon/system/regular/calendar-blank.svg';import Flag from '@icon/system/regular/flag.svg';import { PropertyValueIcon } from '@property/component/propertyValue/PropertyValueIcon';-import { SYSTEM_PROPERTY_IDS } from '@property/constants';import { useContacts } from '@queries/contacts/contacts';import { useSoupAstItemsQuery } from '@queries/soup/items';import { cn } from '@ui';@@ -131,7 +131,7 @@ export function TaskListControlsRenderer(props: {statusOptionId: getTaskStatusOptionId(task) ?? null,priorityOptionId: getTaskPriorityOptionId(task) ?? null,assigneeIds: getTaskAssigneeIds(task),- due: getTaskDueDate(task),+ due: getTaskDueDate(task) ?? null,};}return map;@@ -158,15 +158,6 @@ export function TaskListControlsRenderer(props: {);}-function getTaskDueDate(task: TaskEntityWithProperties): string | null {- const property = task.properties?.find(- (p) => p.definition.id === SYSTEM_PROPERTY_IDS.DUE_DATE- );- const value = property?.value;- if (!value || value.type !== 'Date') return null;- return typeof value.value === 'string' ? value.value : null;-}-function TaskListEntryControls(props: {editor: LexicalEditor;data: ChecklistControlsData;diff --git a/apps/web/src/lib/queries/database-sql/graphql-source.test.ts b/apps/web/src/lib/queries/database-sql/graphql-source.test.tsindex 6227c283f6..373579fcfe 100644--- a/apps/web/src/lib/queries/database-sql/graphql-source.test.ts+++ b/apps/web/src/lib/queries/database-sql/graphql-source.test.ts@@ -256,6 +256,7 @@ describe('the GraphQL row source', () => {bins: [{key: WON,+ displayOrder: null,label: null,totalCount: 2,nextCursor: null,@@ -263,6 +264,7 @@ describe('the GraphQL row source', () => {},{key: LEAD,+ displayOrder: null,label: null,totalCount: 1,nextCursor: null,@@ -270,6 +272,7 @@ describe('the GraphQL row source', () => {},{key: '',+ displayOrder: null,label: null,totalCount: 4,nextCursor: null,diff --git a/apps/web/src/lib/queries/properties/entity.test.tsx b/apps/web/src/lib/queries/properties/entity.test.tsxindex 1a2885f4fb..438b7c80af 100644--- a/apps/web/src/lib/queries/properties/entity.test.tsx+++ b/apps/web/src/lib/queries/properties/entity.test.tsx@@ -68,6 +68,10 @@ const soupPropertyToPropertyMock = vi.hoisted(() => vi.fn());const rollbackMock = vi.hoisted(() => vi.fn());const optimisticUpdateSoupEntityMock = vi.hoisted(() => vi.fn());const invalidateSoupEntityMock = vi.hoisted(() => vi.fn());+const refreshPropertyQueriesMock = vi.hoisted(() => vi.fn(async () => {}));+vi.mock('../soup/property-queries', () => ({+ refreshPropertyQueries: refreshPropertyQueriesMock,+}));const graphqlSoupEnabledMock = vi.hoisted(() => vi.fn(() => true));const toastFailureMock = vi.hoisted(() => vi.fn());const trackMock = vi.hoisted(() => vi.fn());@@ -777,6 +781,7 @@ describe('useBulkSaveEntityPropertiesMutation dispositions', () => {expect(rollbackMock).not.toHaveBeenCalled();expect(invalidateSoupEntityMock).toHaveBeenCalledWith('task-1');expect(testQueryClient.invalidateQueries).toHaveBeenCalled();+ expect(refreshPropertyQueriesMock).toHaveBeenCalledWith('status-def');expect(toastFailureMock).not.toHaveBeenCalled();});@@ -820,6 +825,7 @@ describe('useBulkSaveEntityPropertiesMutation dispositions', () => {{ input: buildGraphqlEntitySoupInput('INITIATIVE', 'initiative-1')! },{ requestPolicy: 'network-only' });+ expect(refreshPropertyQueriesMock).toHaveBeenCalledOnce();});it('invalidates REST projections after delete and option writes', async () => {@@ -837,6 +843,9 @@ describe('useBulkSaveEntityPropertiesMutation dispositions', () => {});expect(testQueryClient.invalidateQueries).toHaveBeenCalledTimes(2);+ expect(invalidateSoupEntityMock).toHaveBeenCalledWith('task-1');+ expect(refreshPropertyQueriesMock).toHaveBeenCalledTimes(2);+ expect(refreshPropertyQueriesMock).toHaveBeenCalledWith('status-def');});it('invalidates REST after a failed attachment write', async () => {diff --git a/apps/web/src/lib/queries/properties/entity.ts b/apps/web/src/lib/queries/properties/entity.tsindex eb082e17b9..a539800d4a 100644--- a/apps/web/src/lib/queries/properties/entity.ts+++ b/apps/web/src/lib/queries/properties/entity.ts@@ -37,6 +37,7 @@ import {optimisticUpdateSoupEntity,type SoupTransaction,} from '../soup/cache';+import { refreshPropertyQueries } from '../soup/property-queries';import { type MutationCallbacks, withCallbacks } from '../utils';import {type AddEntityPropertyInput,@@ -435,6 +436,9 @@ export function useDeleteEntityPropertyMutation(onSuccess: (_data, variables) => {// The removed row may have been a Companies or Contacts value.fireAndForget(refreshCrmAssociatedSoupQueries(), 'entity-properties');+ invalidateSoupEntity(variables.entityId);+ // Deletion carries an assignment ID, not its definition; refresh property-dependent lists.+ fireAndForget(refreshPropertyQueries(), 'entity-properties');return invalidatePropertiesForEntity(variables.entityType,variables.entityId@@ -618,6 +622,10 @@ function entityPropertyOptionCallbacks(},onSuccess: (_data, variables) => {invalidateSoupEntity(variables.entityId);+ fireAndForget(+ refreshPropertyQueries(getPropertyDefinitionId(variables.property)),+ 'entity-properties'+ );return invalidatePropertiesForEntity(variables.entityType,variables.entityId@@ -835,6 +843,12 @@ export function useBulkUpdateEntityPropertyOptionsMutation(}));invalidateSoupEntity(variables.entityId);+ for (const selection of selections) {+ fireAndForget(+ refreshPropertyQueries(selection.propertyDefinitionId),+ 'entity-properties'+ );+ }return invalidatePropertiesForEntity(variables.entityType,variables.entityId@@ -948,6 +962,10 @@ function invalidatePropertySaveCaches('entity-properties');invalidateSoupEntity(item.entityId);+ fireAndForget(+ refreshPropertyQueries(getPropertyDefinitionId(item.property)),+ 'entity-properties'+ );// CRM record lists resolve membership on the server, not from these rows.if (CRM_ASSOCIATION_PROPERTY_IDS.includes(diff --git a/apps/web/src/lib/queries/properties/graphql/entity.ts b/apps/web/src/lib/queries/properties/graphql/entity.tsindex 6a5dadf579..bf48dd77ed 100644--- a/apps/web/src/lib/queries/properties/graphql/entity.ts+++ b/apps/web/src/lib/queries/properties/graphql/entity.ts@@ -292,6 +292,17 @@ async function prepareMutationArgs(}const oldGroupKeys = groupedPropertyKeys(input.property);const newGroupKeys = groupedPropertyKeys(input.apiValues);+ const dateChange =+ input.apiValues.valueType === 'DATE'+ ? {+ from:+ 'value' in input.property &&+ input.property.value instanceof Date+ ? input.property.value+ : null,+ to: input.apiValues.value,+ }+ : undefined;const grouped = await (prepareGrouped ?? createGroupedPropertyPreparation(host))({@@ -299,6 +310,7 @@ async function prepareMutationArgs(propertyDefinitionId,oldGroupKeys: oldGroupKeys ?? [],newGroupKeys: newGroupKeys ?? [],+ ...(dateChange && { dateChange }),revalidateOnly:oldGroupKeys === undefined || newGroupKeys === undefined,});diff --git a/apps/web/src/lib/queries/soup/graphql/active-queries.test.ts b/apps/web/src/lib/queries/soup/graphql/active-queries.test.tsindex a506a0cf2e..9fc24b5d90 100644--- a/apps/web/src/lib/queries/soup/graphql/active-queries.test.ts+++ b/apps/web/src/lib/queries/soup/graphql/active-queries.test.ts@@ -1,6 +1,11 @@import type { QueryRevalidation } from '@graphql-cache/exchange/optimistic';+import { SYSTEM_PROPERTY_IDS } from '@property/identifiers';+import { queryClient } from '@queries/client';import { type Client, gql } from '@urql/core';import { describe, expect, it, onTestFinished, vi } from 'vitest';+import { soupKeys } from '../keys';+import { refreshPropertyQueries } from '../property-queries';+import {getActiveGraphqlSoupRevalidations,refreshActiveGraphqlSoupQueries,@@ -8,6 +13,11 @@ import {registerGraphqlSoupRevalidations,} from './active-queries';+vi.mock('@queries/client', async () => {+ const { QueryClient } = await import('@tanstack/solid-query');+ return { queryClient: new QueryClient() };+});+function register(query: Parameters<typeof registerActiveGraphqlSoupQuery>[0]) {const unregister = registerActiveGraphqlSoupQuery(query);onTestFinished(unregister);@@ -338,3 +348,97 @@ describe('active GraphQL Soup queries', () => {expect(getActiveGraphqlSoupRevalidations()).toEqual([mail, grouped]);});});++it.each([undefined, SYSTEM_PROPERTY_IDS.DUE_DATE])(+ 'refreshes due-date sorting without a property filter after a date edit (%s)',+ async (definitionId) => {+ onTestFinished(() => queryClient.clear());+ const dueKey = soupKeys.astItems({+ params: {+ sort_method: 'property',+ sort_property_definition_id: SYSTEM_PROPERTY_IDS.DUE_DATE,+ },+ body: { df: { l: { dst: 'task' } } },+ }).queryKey;+ const ordinaryKey = soupKeys.astItems({+ params: { sort_method: 'updated_at' },+ body: { df: { l: { dst: 'task' } } },+ }).queryKey;+ queryClient.setQueryData(dueKey, []);+ queryClient.setQueryData(ordinaryKey, []);+ const dueRefresh = vi.fn(async () => {});+ const ordinaryRefresh = vi.fn(async () => {});+ register({+ isEnabled: () => true,+ refresh: dueRefresh,+ body: () => ({+ params: {+ sort_method: 'property',+ sort_property_definition_id: SYSTEM_PROPERTY_IDS.DUE_DATE,+ },+ }),+ });+ register({+ isEnabled: () => true,+ refresh: ordinaryRefresh,+ body: () => ({ params: { sort_method: 'updated_at' } }),+ });++ await refreshPropertyQueries(definitionId);++ expect(queryClient.getQueryState(dueKey)?.isInvalidated).toBe(true);+ expect(queryClient.getQueryState(ordinaryKey)?.isInvalidated).toBe(false);+ expect(dueRefresh).toHaveBeenCalledOnce();+ expect(ordinaryRefresh).not.toHaveBeenCalled();+ }+);++it('matches selected sort/group definitions and date predicates, not ordinary option filters', async () => {+ onTestFinished(() => queryClient.clear());+ const id = SYSTEM_PROPERTY_IDS.STATUS;+ const matching = [+ { params: { sort_method: 'property', sort_property_definition_id: id } },+ { initial: { sortMethod: 'PROPERTY', sortPropertyDefinitionId: id } },+ { groupBy: { type: 'property', propertyDefinitionId: id } },+ { initial: { groupBy: { field: 'PROPERTY', propertyDefinitionId: id } } },+ { params: { group_by: { property: { property_definition_id: id } } } },+ { propf: { '!': { l: { pd: id, v: { dr: {} } } } } },+ { propf: { l: { pd: id, v: { dr: { start: '2026-01-01T00:00:00Z' } } } } },+ {+ filters: {+ propertiesFilter: {+ not: {+ literal: { propertyDefinitionId: id, value: { dateRange: {} } },+ },+ },+ },+ },+ ].map((body) => {+ const refresh = vi.fn(async () => {});+ register({ isEnabled: () => true, refresh, body: () => body });+ return refresh;+ });+ const unrelated = [+ { propf: { l: { pd: id, v: { so: 'option' } } } },+ { propf: { l: { pd: id, v: { er: 'user' } } } },+ {+ params: {+ sort_method: 'property',+ sort_property_definition_id: `${id}-other`,+ },+ },+ { groupBy: { type: 'property', propertyDefinitionId: `${id}-other` } },+ ].map((body) => {+ const refresh = vi.fn(async () => {});+ register({ isEnabled: () => true, refresh, body: () => body });+ return refresh;+ });+ await refreshPropertyQueries(id);+ for (const refresh of matching) expect(refresh).toHaveBeenCalledOnce();+ for (const refresh of unrelated) expect(refresh).not.toHaveBeenCalled();+ await refreshPropertyQueries();+ expect(unrelated[2]).toHaveBeenCalledOnce();+ expect(unrelated[3]).toHaveBeenCalledOnce();+ expect(unrelated[0]).not.toHaveBeenCalled();+ expect(unrelated[1]).not.toHaveBeenCalled();+});diff --git a/apps/web/src/lib/queries/soup/graphql/active-queries.ts b/apps/web/src/lib/queries/soup/graphql/active-queries.tsindex 83c112c334..2f73633b33 100644--- a/apps/web/src/lib/queries/soup/graphql/active-queries.ts+++ b/apps/web/src/lib/queries/soup/graphql/active-queries.ts@@ -12,7 +12,7 @@ type ActiveGraphqlSoupQuery = {refresh: () => Promise<void>;/** Only refresh this reader for its matching mutation, never for broad Soup work. */target?: () => GraphqlSoupRefreshTarget;- /** The REST-shaped filter body, for refreshes scoped to matching lists. */+ /** REST-shaped filters with optional sort/group inputs for scoped list refreshes. */body?: () => unknown;/** The normalized cache keeps this list's rows and membership current. */cacheMaintained?: () => boolean;@@ -121,7 +121,7 @@ export async function refreshActiveGraphqlSoupQueries(options: {throwOnError?: boolean;target?: GraphqlSoupRefreshTarget;- /** Only refresh list readers whose filter body matches. */+ /** Only refresh list readers whose filters or sort/group inputs match. */where?: (body: unknown) => boolean;/** Skip lists the cache keeps current: the write already updated them. */unmaintainedOnly?: boolean;diff --git a/apps/web/src/lib/queries/soup/graphql/ast.test.ts b/apps/web/src/lib/queries/soup/graphql/ast.test.tsindex 41f8dc9e31..0f6dcef1de 100644--- a/apps/web/src/lib/queries/soup/graphql/ast.test.ts+++ b/apps/web/src/lib/queries/soup/graphql/ast.test.ts@@ -554,3 +554,107 @@ describe('makeGraphqlSoupInput', () => {).toThrow('Unsupported GraphQL Soup AST');});});++it('maps open-ended property date ranges and explicit no-date negation', () => {+ const propertyDefinitionId = '00000001-0000-0000-0000-000000000004';+ const range = makeGraphqlSoupInput({+ params: {+ sort_method: 'property',+ sort_direction: 'asc',+ sort_property_definition_id: propertyDefinitionId,+ },+ body: {+ propf: {+ l: {+ pd: propertyDefinitionId,+ et: 'TASK',+ v: { dr: { end: UPDATED_AT } },+ },+ },+ },+ });+ expect(range).toMatchObject({+ initial: {+ sortMethod: 'PROPERTY',+ sortDirection: 'ASC',+ sortPropertyDefinitionId: propertyDefinitionId,+ filters: {+ propertiesFilter: {+ literal: {+ propertyDefinitionId,+ entityType: 'TASK',+ value: { dateRange: { end: UPDATED_AT } },+ },+ },+ },+ },+ });+ const missing = makeGraphqlSoupInput({+ params: {},+ body: {+ propf: {+ '!': { l: { pd: propertyDefinitionId, et: 'TASK', v: { dr: {} } } },+ },+ },+ });+ expect(missing).toMatchObject({+ initial: {+ filters: {+ propertiesFilter: {+ not: {+ literal: {+ propertyDefinitionId,+ entityType: 'TASK',+ value: { dateRange: {} },+ },+ },+ },+ },+ },+ });+ expect(+ makeGraphqlSoupInput({+ params: {},+ body: { propf: { l: { pd: propertyDefinitionId, v: { dr: {} } } } },+ })+ ).toMatchObject({+ initial: {+ filters: {+ propertiesFilter: { literal: { value: { dateRange: {} } } },+ },+ },+ });+});++it.each([+ ['asc', 'ASC'],+ ['desc', 'DESC'],+] as const)(+ 'maps property sort %s consistently for flat and grouped requests',+ (direction, expected) => {+ const propertyDefinitionId = '00000001-0000-0000-0000-000000000004';+ const params = {+ sort_method: 'property' as const,+ sort_direction: direction,+ sort_property_definition_id: propertyDefinitionId,+ };+ const body = { df: { l: { dst: 'task' } } };+ const flat = makeGraphqlSoupInput({ params, body });+ const grouped = makeGraphqlGroupedSoupInput({+ params,+ body,+ groupBy: {+ type: 'property',+ propertyDefinitionId: '00000001-0000-0000-0000-000000000002',+ },+ });+ expect(flat.initial?.sortMethod).toBe('PROPERTY');+ expect(grouped.initial?.sortMethod).toBe('PROPERTY');+ expect(flat.initial?.sortDirection).toBe(expected);+ expect(grouped.initial?.sortDirection).toBe(expected);+ expect(flat.initial?.sortPropertyDefinitionId).toBe(propertyDefinitionId);+ expect(grouped.initial?.sortPropertyDefinitionId).toBe(+ propertyDefinitionId+ );+ }+);diff --git a/apps/web/src/lib/queries/soup/graphql/ast.ts b/apps/web/src/lib/queries/soup/graphql/ast.tsindex ef52bbf932..a2fb1e8cbe 100644--- a/apps/web/src/lib/queries/soup/graphql/ast.ts+++ b/apps/web/src/lib/queries/soup/graphql/ast.ts@@ -714,17 +714,50 @@ function mapGithubPullRequestLiteral(function mapPropertiesLiteral(literal: unknown): GraphqlPropertiesLiteralInput {if (!isRecord(literal)) unsupported('expected property literal object');const propertyDefinitionId = mapString(literal.pd, 'propertyDefinitionId');+ const propertyEntityTypes = [+ 'CALENDAR_EVENT',+ 'CHANNEL',+ 'CHAT',+ 'COMPANY',+ 'DATABASE_ROW',+ 'DOCUMENT',+ 'INITIATIVE',+ 'PROJECT',+ 'TASK',+ 'THREAD',+ 'USER',+ ] as const satisfies readonly NonNullable<+ GraphqlPropertiesLiteralInput['entityType']+ >[];+ const entityType =+ literal.et === undefined+ ? undefined+ : propertyEntityTypes.find((type) => type === literal.et);+ if (literal.et !== undefined && !entityType)+ unsupported(`property entity type ${literal.et}`);+ const property = { propertyDefinitionId, ...(entityType && { entityType }) };const value = literal.v;if (!isRecord(value)) unsupported('expected property value matcher object');if (typeof value.so === 'string') {- return { propertyDefinitionId, value: { selectOption: value.so } };+ return { ...property, value: { selectOption: value.so } };}if (typeof value.er === 'string') {- return { propertyDefinitionId, value: { entityRef: value.er } };+ return { ...property, value: { entityRef: value.er } };+ }+ if (isRecord(value.dr)) {+ const start =+ value.dr.start == null+ ? undefined+ : mapString(value.dr.start, 'dateRange.start');+ const end =+ value.dr.end == null+ ? undefined+ : mapString(value.dr.end, 'dateRange.end');+ return { ...property, value: { dateRange: { start, end } } };}- unsupported('expected property value so or er');+ unsupported('expected property value so, er, or dr');}function mapSortDirection(@@ -758,6 +791,8 @@ function mapSortMethod(return unsupported('sort_method touched_by_me');case 'notified_at':return unsupported('sort_method notified_at');+ case 'property':+ return 'PROPERTY';case undefined:return undefined;}@@ -901,6 +936,7 @@ export function makeGraphqlSoupInput(args: {limit: args.params.limit ?? undefined,expand: true,sortMethod: mapSortMethod(args.params.sort_method),+ sortPropertyDefinitionId: args.params.sort_property_definition_id,sortDirection,emailView,filters: makeGraphqlFilters(body),@@ -919,6 +955,13 @@ function makeGraphqlGroupByInput(groupBy: GroupByField): GraphqlGroupByInput {field: 'PROPERTY' as const,propertyDefinitionId: field.propertyDefinitionId,entityType: field.entityType,+ ...(field.bucketing && {+ bucketing: {+ type: 'DATE_RANGES' as const,+ ranges: field.bucketing.ranges,+ missingValueBucketKey: field.bucketing.missingValueBucketKey,+ },+ }),})).exhaustive(() => ({ field: 'ENTITY_TYPE' as const }));}@@ -940,6 +983,8 @@ export function makeGraphqlGroupedSoupInput(args: {groupBy: makeGraphqlGroupByInput(args.groupBy),limit: args.params.limit ?? undefined,sortMethod: mapSortMethod(args.params.sort_method),+ sortPropertyDefinitionId: args.params.sort_property_definition_id,+ sortDirection: mapSortDirection(args.params.sort_direction),filters: makeGraphqlFilters(body),},};diff --git a/apps/web/src/lib/queries/soup/graphql/create-grouped-soup-live-query.test.ts b/apps/web/src/lib/queries/soup/graphql/create-grouped-soup-live-query.test.tsindex 18b2834694..94621e3768 100644--- a/apps/web/src/lib/queries/soup/graphql/create-grouped-soup-live-query.test.ts+++ b/apps/web/src/lib/queries/soup/graphql/create-grouped-soup-live-query.test.ts@@ -191,8 +191,9 @@ function page(bins: [{key: 'todo',- label: null,items,+ displayOrder: null,+ label: null,totalCount: 20,nextCursor: cursor,},@@ -578,6 +579,7 @@ describe('grouped Soup live ownership', () => {key: 'done',label: null,items: [],+ displayOrder: null,totalCount: 12,nextCursor: 'done-next',});diff --git a/apps/web/src/lib/queries/soup/graphql/create-soup-live-query.ts b/apps/web/src/lib/queries/soup/graphql/create-soup-live-query.tsindex 9ff27db1ba..efc232b34f 100644--- a/apps/web/src/lib/queries/soup/graphql/create-soup-live-query.ts+++ b/apps/web/src/lib/queries/soup/graphql/create-soup-live-query.ts@@ -1047,26 +1047,22 @@ export function createSoupLiveQuery(}if (!local.mail.nextCursor || fetchingMailPage()) return;const generation = pagingGeneration;+ const definition = localSource();const initial ='initial' in local.input ? local.input.initial : undefined;- fetchServerPagesInStep(local.displayedKeys.size + (initial?.limit ?? 20));const host = getGraphqlSoupCacheHost();- if (- !initial ||- !host ||- !isCachedMailView(initial.emailView) ||- initial.sortMethod === 'NOTIFIED_AT'- )+ if (!definition?.mailView || !host || definition.input !== local.input)return;- const mailView = initial.emailView;+ fetchServerPagesInStep(local.displayedKeys.size + (initial?.limit ?? 20));+ const { source, mailView } = definition;setFetchingMailPage(true);try {let result = await host.entityFilter({- filters: initial.filters ?? {},- sortMethod: initial.sortMethod ?? 'UPDATED_AT',- sortDirection: initial.sortDirection ?? 'DESC',- limit: initial.limit ?? 20,- mail: { view: initial.emailView, cursor: local.mail.nextCursor },+ filters: source.filters,+ sortMethod: source.sortMethod,+ sortDirection: source.sortDirection,+ limit: source.limit,+ mail: { view: mailView, cursor: local.mail.nextCursor },});if (displayLocalProjection() !== local) return;if (result.kind === 'stale-cursor') {diff --git a/apps/web/src/lib/queries/soup/graphql/grouped-local-projection.benchmark.ts b/apps/web/src/lib/queries/soup/graphql/grouped-local-projection.benchmark.tsindex ce7d2f8131..b3b7441846 100644--- a/apps/web/src/lib/queries/soup/graphql/grouped-local-projection.benchmark.ts+++ b/apps/web/src/lib/queries/soup/graphql/grouped-local-projection.benchmark.ts@@ -77,6 +77,7 @@ function scenario(const bin = {key,items: items.slice(offset, offset + 10),+ displayOrder: null,totalCount: items.length + 100,label: null,nextCursor: `${key}:${offset + 10}`,diff --git a/apps/web/src/lib/queries/soup/graphql/grouped-local-projection.test.ts b/apps/web/src/lib/queries/soup/graphql/grouped-local-projection.test.tsindex 1b36fff818..8546993c4a 100644--- a/apps/web/src/lib/queries/soup/graphql/grouped-local-projection.test.ts+++ b/apps/web/src/lib/queries/soup/graphql/grouped-local-projection.test.ts@@ -58,6 +58,7 @@ describe('loaded grouped pages', () => {bins: [{key: 'todo',+ displayOrder: null,label: null,totalCount: 300 - index * 10,nextCursor: `page-${index + 1}`,@@ -74,6 +75,7 @@ describe('loaded grouped pages', () => {bins: [{key: 'todo',+ displayOrder: null,label: null,totalCount: 0,nextCursor: null,@@ -96,6 +98,96 @@ describe('loaded grouped pages', () => {});describe('local grouped Soup projection', () => {+ it('moves loaded date values between half-open ranges while preserving unloaded counts', () => {+ const dateInput: GroupedSoupInitialInput = {+ groupBy: {+ field: 'PROPERTY',+ propertyDefinitionId: 'review-date',+ bucketing: {+ type: 'DATE_RANGES',+ ranges: [+ { key: 'review_soon', start: null, end: '2026-11-01T00:00:00Z' },+ { key: 'review_later', start: '2026-11-01T00:00:00Z', end: null },+ ],+ missingValueBucketKey: 'no_review_date',+ },+ },+ sortMethod: 'UPDATED_AT',+ };+ const a = groupedDocument('a');+ a.properties[0] = {+ ...a.properties[0],+ propertyDefinitionId: 'review-date',+ dataType: 'DATE',+ isMultiSelect: false,+ value: {+ __typename: 'GraphqlDatePropertyValue',+ dateValue: '2026-10-31T23:59:59Z',+ },+ };+ const b = { ...a, id: 'b' };+ const moved = {+ ...a,+ properties: [+ {+ ...a.properties[0],+ value: {+ __typename: 'GraphqlDatePropertyValue' as const,+ dateValue: '2026-11-01T00:00:00Z',+ },+ },+ ],+ };+ expect(localSoupGroupKeys(a, dateInput, now)).toEqual(['review_soon']);+ expect(localSoupGroupKeys(moved, dateInput, now)).toEqual(['review_later']);+ expect(+ localSoupGroupKeys({ ...a, properties: [] }, dateInput, now)+ ).toEqual(['no_review_date']);+ expect(+ projectLocalGroupedSoup(+ [+ {+ key: 'review_soon',+ items: [a, b],+ displayOrder: null,+ label: null,+ totalCount: 30,+ nextCursor: 'more',+ },+ {+ key: 'review_later',+ items: [],+ displayOrder: null,+ label: null,+ totalCount: 4,+ nextCursor: 'later',+ },+ ],+ new Map(),+ snapshot([moved, b]),+ dateInput,+ now+ )+ ).toEqual([+ {+ key: 'review_soon',+ items: [b],+ displayOrder: null,+ label: null,+ totalCount: 29,+ nextCursor: 'more',+ },+ {+ key: 'review_later',+ items: [moved],+ displayOrder: null,+ label: null,+ totalCount: 5,+ nextCursor: 'later',+ },+ ]);+ });+it('retains server membership for an unfamiliar grouping while refreshing rows', () => {const before = groupedDocument('a');const next = { ...groupedDocument('a', ['done']), displayName: 'Updated' };@@ -108,6 +200,7 @@ describe('local grouped Soup projection', () => {key: 'server-group',label: null,items: [before],+ displayOrder: null,totalCount: 30,nextCursor: 'more',},@@ -122,6 +215,7 @@ describe('local grouped Soup projection', () => {key: 'server-group',label: null,items: [next],+ displayOrder: null,totalCount: 30,nextCursor: 'more',},@@ -137,6 +231,7 @@ describe('local grouped Soup projection', () => {key: 'todo',label: null,items: [a, b, unknown],+ displayOrder: null,totalCount: 30,nextCursor: 'more',},@@ -153,6 +248,7 @@ describe('local grouped Soup projection', () => {{key: 'todo',items: [unknown],+ displayOrder: null,label: null,totalCount: 28,nextCursor: 'more',@@ -160,6 +256,7 @@ describe('local grouped Soup projection', () => {{key: 'done',items: [next],+ displayOrder: null,label: null,totalCount: 1,nextCursor: null,@@ -194,6 +291,7 @@ describe('local grouped Soup projection', () => {key: 'todo',label: null,items: [selectedBefore, retained, missing, excluded],+ displayOrder: null,totalCount: 30,nextCursor: 'more',},@@ -208,6 +306,7 @@ describe('local grouped Soup projection', () => {key: 'todo',label: null,items: [selected, current, missing],+ displayOrder: null,totalCount: 29,nextCursor: 'more',},@@ -224,12 +323,14 @@ describe('local grouped Soup projection', () => {key: 'todo',label: null,items: [before],+ displayOrder: null,totalCount: 30,nextCursor: 'todo-more',},{key: 'done',items: [],+ displayOrder: null,label: null,totalCount: 20,nextCursor: 'done-more',@@ -244,6 +345,7 @@ describe('local grouped Soup projection', () => {{key: 'todo',items: [],+ displayOrder: null,label: null,totalCount: 29,nextCursor: 'todo-more',@@ -251,6 +353,7 @@ describe('local grouped Soup projection', () => {{key: 'done',items: [after],+ displayOrder: null,label: null,totalCount: 20,nextCursor: 'done-more',@@ -278,6 +381,7 @@ describe('local grouped Soup projection', () => {{key: 'today',items: [row],+ displayOrder: null,label: null,totalCount: 8,nextCursor: 'more',@@ -292,6 +396,7 @@ describe('local grouped Soup projection', () => {{key: 'today',items: [],+ displayOrder: null,label: null,totalCount: 7,nextCursor: 'more',@@ -299,6 +404,7 @@ describe('local grouped Soup projection', () => {{key: 'yesterday',items: [row],+ displayOrder: null,label: null,totalCount: 1,nextCursor: null,@@ -392,6 +498,7 @@ describe('local grouped Soup projection', () => {key: 'initiative-1',items: [task],label: 'Project One',+ displayOrder: null,totalCount: 1,nextCursor: null,},diff --git a/apps/web/src/lib/queries/soup/graphql/grouped-local-projection.ts b/apps/web/src/lib/queries/soup/graphql/grouped-local-projection.tsindex 9e0a89d68e..0faf01c9f0 100644--- a/apps/web/src/lib/queries/soup/graphql/grouped-local-projection.ts+++ b/apps/web/src/lib/queries/soup/graphql/grouped-local-projection.ts@@ -5,6 +5,7 @@ import type {GroupSoupQuery,SoupItemFieldsFragment,} from '../../../service-clients/service-storage/graphql/generated/graphql';+import { propertyDateGroupKey } from '../grouped/date-ranges';import { reconcileGroupedSoup } from '../grouped/reconciliation';import type { LiveQuerySnapshot } from './create-predicate-query';import { soupItemKey } from './reconciliation';@@ -48,12 +49,22 @@ export function localSoupGroupKeys(.with({ __typename: 'GraphqlSoupCall' }, () => 'CALL_RECORD').otherwise((item) => item.entityType);if (input.groupBy.entityType && input.groupBy.entityType !== entityType)- return [''];+ return input.groupBy.bucketing ? [] : [''];const property = item.properties.find((property) =>property.propertyDefinitionId === input.groupBy.propertyDefinitionId);const value = property?.value;+ if (input.groupBy.bucketing) {+ return [+ propertyDateGroupKey(+ value?.__typename === 'GraphqlDatePropertyValue'+ ? value.dateValue+ : undefined,+ input.groupBy.bucketing+ ),+ ];+ }if (!value) return [''];const keys = match(value).with(@@ -154,6 +165,9 @@ export function projectLocalGroupedSoup(now: Date,untrustedKeys: ReadonlySet<string> = new Set()): GroupedSoupBin[] {+ const displayOrders = new Map(+ baseline.map((bin) => [bin.key, bin.displayOrder])+ );const original = new Map(baseline.flatMap((bin) =>bin.items.map((item) => [soupItemKey(item), item] as const)@@ -166,7 +180,7 @@ export function projectLocalGroupedSoup(oldKeys.set(key, [...(oldKeys.get(key) ?? []), bin.key]);}const previousKeys = (key: string, item: SoupItemFieldsFragment) =>- input.groupBy.field === 'PROPERTY'+ input.groupBy.field === 'PROPERTY' && !input.groupBy.bucketing? untrustedKeys.has(key)? undefined: localSoupGroupKeys(item, input, now)@@ -203,6 +217,7 @@ export function projectLocalGroupedSoup();return bins.map((bin) => ({key: bin.key,+ displayOrder: displayOrders.get(bin.key) ?? null,label: bin.label ?? null,totalCount: bin.totalCount,nextCursor: bin.nextCursor,diff --git a/apps/web/src/lib/queries/soup/graphql/grouped-projection.test.ts b/apps/web/src/lib/queries/soup/graphql/grouped-projection.test.tsindex d8aba77b4d..618d99475a 100644--- a/apps/web/src/lib/queries/soup/graphql/grouped-projection.test.ts+++ b/apps/web/src/lib/queries/soup/graphql/grouped-projection.test.ts@@ -84,12 +84,20 @@ function page(count: number): GroupSoupQuery {bins: [{key: 'a',+ displayOrder: null,label: null,totalCount: count,nextCursor: null,items: Array.from({ length: count }, (_, id) => row(id)),},- { key: 'b', label: null, totalCount: 0, nextCursor: null, items: [] },+ {+ key: 'b',+ displayOrder: null,+ label: null,+ totalCount: 0,+ nextCursor: null,+ items: [],+ },],},},diff --git a/apps/web/src/lib/queries/soup/graphql/grouped-projection.ts b/apps/web/src/lib/queries/soup/graphql/grouped-projection.tsindex 75e815964d..ac7e81006d 100644--- a/apps/web/src/lib/queries/soup/graphql/grouped-projection.ts+++ b/apps/web/src/lib/queries/soup/graphql/grouped-projection.ts@@ -60,7 +60,7 @@ export function createGraphqlGroupedSoupProjection(return {key: bin.key,label: resolved?.label ?? bin.label ?? bin.key,- displayOrder: resolved?.displayOrder ?? null,+ displayOrder: bin.displayOrder ?? resolved?.displayOrder ?? null,totalCount: bin.totalCount,itemIds,nextCursor: bin.nextCursor ?? null,diff --git a/apps/web/src/lib/queries/soup/grouped/api.ts b/apps/web/src/lib/queries/soup/grouped/api.tsindex 5ca367dbd4..5a34a4dc53 100644--- a/apps/web/src/lib/queries/soup/grouped/api.ts+++ b/apps/web/src/lib/queries/soup/grouped/api.ts@@ -5,6 +5,7 @@ import type { ApiGroupMeta } from '@service-storage/generated/schemas/apiGroupMeimport type { Params } from '@service-storage/generated/schemas/params';import type { SoupApiItem } from '@service-storage/generated/schemas/soupApiItem';import { match } from 'ts-pattern';+import { propertyDateGroupKey } from './date-ranges';import { type GroupByField, type GroupMeta, NOT_SET_GROUP_KEY } from './types';export const DATE_GROUP_BUCKETS = [@@ -72,6 +73,13 @@ export function serializeGroupByField(property: {property_definition_id: field.propertyDefinitionId,...(field.entityType && { entity_type: field.entityType }),+ ...(field.bucketing && {+ bucketing: {+ type: field.bucketing.type,+ ranges: field.bucketing.ranges,+ missing_value_bucket_key: field.bucketing.missingValueBucketKey,+ },+ }),},};}@@ -130,6 +138,16 @@ export function resolveGroupMetaForKey(return;}).with({ type: 'property' }, (propertyGroupBy) => {+ if (propertyGroupBy.bucketing) {+ const { ranges, missingValueBucketKey } = propertyGroupBy.bucketing;+ const order = ranges.findIndex((range) => range.key === key);+ if (order === -1 && key !== missingValueBucketKey) return;+ return {+ key,+ label: key,+ displayOrder: order === -1 ? ranges.length : order,+ };+ }if (key === NOT_SET_GROUP_KEY) {return { key, label: 'Not Set', displayOrder: Number.MAX_SAFE_INTEGER };}@@ -178,25 +196,6 @@ function getGroupedPropertyValueType(return value?.type;}-// Stable UUIDs from migrations/20251128000001_seed_system_properties.sql.-// Custom (user-created) options fall through to displayOrder.-const STATUS_OPTION_ORDER: readonly string[] = [- '00000001-0000-0000-0002-000000000001', // Not Started- '00000001-0000-0000-0002-000000000002', // In Progress- '00000001-0000-0000-0002-000000000003', // In Review- NOT_SET_GROUP_KEY,- '00000001-0000-0000-0002-000000000004', // Completed- '00000001-0000-0000-0002-000000000005', // Canceled-];--const PRIORITY_OPTION_ORDER: readonly string[] = [- '00000001-0000-0000-0003-000000000004', // Urgent- '00000001-0000-0000-0003-000000000003', // High- '00000001-0000-0000-0003-000000000002', // Medium- '00000001-0000-0000-0003-000000000001', // Low- NOT_SET_GROUP_KEY,-];-function keyRank(order: readonly string[], key: string): number {const i = order.indexOf(key);return i === -1 ? order.length : i;@@ -214,21 +213,13 @@ export function makeGroupComparator(groupBy: GroupByField | undefined): (a: GroupMeta, b: GroupMeta) => number {if (groupBy?.type === 'property') {- if (groupBy.propertyDefinitionId === SYSTEM_PROPERTY_IDS.STATUS) {- return (a, b) => {- const diff =- keyRank(STATUS_OPTION_ORDER, a.key) -- keyRank(STATUS_OPTION_ORDER, b.key);- return diff !== 0 ? diff : defaultOrder(a, b);- };- }- if (groupBy.propertyDefinitionId === SYSTEM_PROPERTY_IDS.PRIORITY) {- return (a, b) => {- const diff =- keyRank(PRIORITY_OPTION_ORDER, a.key) -- keyRank(PRIORITY_OPTION_ORDER, b.key);- return diff !== 0 ? diff : defaultOrder(a, b);- };+ if (groupBy.bucketing) {+ const { ranges, missingValueBucketKey } = groupBy.bucketing;+ const order = [+ ...ranges.map((range) => range.key),+ missingValueBucketKey,+ ];+ return (a, b) => keyRank(order, a.key) - keyRank(order, b.key);}if (groupBy.propertyDefinitionId === SYSTEM_PROPERTY_IDS.ASSIGNEES ||@@ -236,6 +227,15 @@ export function makeGroupComparator() {return notSetLastByLabel;}+ return (a, b) => {+ const aNotSet = a.key === NOT_SET_GROUP_KEY;+ const bNotSet = b.key === NOT_SET_GROUP_KEY;+ if (aNotSet && bNotSet) return 0;+ if (aNotSet) return 1;+ if (bNotSet) return -1;+ // Server metadata uses the definition's option display_order, also used by item sorting.+ return defaultOrder(a, b);+ };}if (groupBy?.type === 'project') return notSetLastByLabel;return defaultOrder;@@ -253,8 +253,7 @@ function notSetLastByLabel(a: GroupMeta, b: GroupMeta): number {/*** Compute the group keys an item belongs to under the given grouping.- * Returns `undefined` when bucketing can't be reproduced client-side- * (date, non-categorical property) — caller should invalidate.+ * Returns `undefined` when membership cannot be reproduced from loaded values.*/export function computeGroupKeysForItem(item: SoupApiItem,@@ -274,6 +273,20 @@ export function computeGroupKeysForItem(if (!hasProperties(item)) return;const properties = item.data.properties;+ if (propertyGroupBy.bucketing) {+ if (!properties) return;+ const property = properties.find(+ (property) =>+ property.definition.id === propertyGroupBy.propertyDefinitionId+ );+ const value = property?.value;+ return [+ propertyDateGroupKey(+ value?.type === 'Date' ? value.value : undefined,+ propertyGroupBy.bucketing+ ),+ ];+ }if (!properties) return [NOT_SET_GROUP_KEY];diff --git a/apps/web/src/lib/queries/soup/grouped/create-grouped-soup-queries.ts b/apps/web/src/lib/queries/soup/grouped/create-grouped-soup-queries.tsindex 158bdef3a6..51e34591fd 100644--- a/apps/web/src/lib/queries/soup/grouped/create-grouped-soup-queries.ts+++ b/apps/web/src/lib/queries/soup/grouped/create-grouped-soup-queries.ts@@ -93,6 +93,9 @@ function groupPageQueryFn(input: {group_key: input.groupKey,limit: input.soupParams.limit,sort_method: groupedSortMethod(input.soupParams.sort_method),+ sort_property_definition_id:+ input.soupParams.sort_property_definition_id,+ sort_direction: input.soupParams.sort_direction,},body: input.soupBody,})diff --git a/apps/web/src/lib/queries/soup/grouped/date-ranges.ts b/apps/web/src/lib/queries/soup/grouped/date-ranges.tsnew file mode 100644index 0000000000..c61ff47764--- /dev/null+++ b/apps/web/src/lib/queries/soup/grouped/date-ranges.ts@@ -0,0 +1,26 @@+import { propertyDateSortKey } from '@property/utils/sort';++/** Match the server's half-open ranges; absent or invalid dates use the missing bucket. */+export function propertyDateGroupKey(+ value: string | Date | null | undefined,+ bucketing: {+ ranges: readonly {+ key: string;+ start?: string | null;+ end?: string | null;+ }[];+ missingValueBucketKey: string;+ }+): string {+ const timestamp = propertyDateSortKey(value);+ if (timestamp === undefined) return bucketing.missingValueBucketKey;+ const date = timestamp;+ const range = bucketing.ranges.find(+ (range) =>+ (range.start == null ||+ date >= (propertyDateSortKey(range.start) ?? Infinity)) &&+ (range.end == null ||+ date < (propertyDateSortKey(range.end) ?? -Infinity))+ );+ return range?.key ?? bucketing.missingValueBucketKey;+}diff --git a/apps/web/src/lib/queries/soup/grouped/graphql-optimistic.test.ts b/apps/web/src/lib/queries/soup/grouped/graphql-optimistic.test.tsindex 4fd05e9149..8d42fdb934 100644--- a/apps/web/src/lib/queries/soup/grouped/graphql-optimistic.test.ts+++ b/apps/web/src/lib/queries/soup/grouped/graphql-optimistic.test.ts@@ -4,6 +4,7 @@ import type {InspectQueryVariantsArgs,} from '@graphql-cache/host/types';import {+ type GroupedSoupInitialInput,GroupSoupDocument,SoupDocument,} from '@service-storage/graphql/generated/graphql';@@ -15,12 +16,16 @@ import {createGroupedPropertyPreparation,} from './graphql-optimistic';-function initialInput(propertyDefinitionId: string) {+function initialInput(+ propertyDefinitionId: string,+ bucketing?: GroupedSoupInitialInput['groupBy']['bucketing']+) {return {initial: {groupBy: {field: 'PROPERTY' as const,propertyDefinitionId,+ ...(bucketing && { bucketing }),},limit: 20,},@@ -58,6 +63,7 @@ function host(args?: {entityIds?: string[];typename?: 'GraphqlSoupCall' | 'GraphqlSoupDocument';unrelatedPropertyDefinitionIds?: readonly string[];+ bucketing?: GroupedSoupInitialInput['groupBy']['bucketing'];}): CacheHost {const value = (containsItem: boolean) => ({bins: [@@ -86,7 +92,10 @@ function host(args?: {});const relevantPropertyDefinitionId =args?.relevantPropertyDefinitionId ?? 'status-def';- const relevantInput = initialInput(relevantPropertyDefinitionId);+ const relevantInput = initialInput(+ relevantPropertyDefinitionId,+ args?.bucketing+ );const relevantContinuation = continuationInput(relevantPropertyDefinitionId);const instances: Array<{variables: {@@ -155,6 +164,39 @@ function host(args?: {}describe('buildOptimisticGroupedPropertyUpdates', () => {+ it("moves a date property across each mounted query's range boundary before refetch", async () => {+ const result = await buildOptimisticGroupedPropertyUpdates({+ host: host({+ bucketing: {+ type: 'DATE_RANGES',+ ranges: [+ { key: 'in-progress', start: null, end: '2026-11-01T00:00:00Z' },+ { key: 'completed', start: '2026-11-01T00:00:00Z', end: null },+ ],+ missingValueBucketKey: 'no-date',+ },+ }),+ entityId: 'task-1',+ propertyDefinitionId: 'status-def',+ oldGroupKeys: [],+ newGroupKeys: [],+ revalidateOnly: true,+ dateChange: {+ from: new Date('2026-10-31T23:59:59Z'),+ to: new Date('2026-11-01T00:00:00Z'),+ },+ });+ expect(result.updates).toHaveLength(2);+ expect(result.updates[0].operation).toMatchObject({+ kind: 'removeEmbeddedLink',+ listItem: { equals: 'in-progress' },+ });+ expect(result.updates[1].operation).toMatchObject({+ kind: 'upsertEmbeddedLink',+ listItem: { equals: 'completed' },+ });+ expect(result.revalidations).toHaveLength(1);+ });it('builds source removal then destination prepend for a status move', async () => {const onInspect = vi.fn();const onRead = vi.fn();diff --git a/apps/web/src/lib/queries/soup/grouped/graphql-optimistic.ts b/apps/web/src/lib/queries/soup/grouped/graphql-optimistic.tsindex 73466482d8..bb73cce098 100644--- a/apps/web/src/lib/queries/soup/grouped/graphql-optimistic.ts+++ b/apps/web/src/lib/queries/soup/grouped/graphql-optimistic.ts@@ -15,6 +15,7 @@ import {type GroupSoupQueryVariables,} from '../../../service-clients/service-storage/graphql/generated/graphql';import { getActiveGraphqlSoupRevalidations } from '../graphql/active-queries';+import { propertyDateGroupKey } from './date-ranges';import {groupedSoupInputKey,groupedSoupLogicalViewKey,@@ -27,7 +28,9 @@ type BuildArgs = {propertyDefinitionId: string;oldGroupKeys: readonly string[];newGroupKeys: readonly string[];- /** Unsupported/date values still revalidate relevant active fields. */+ /** Date buckets are computed independently for each mounted query's ranges. */+ dateChange?: { from: Date | null; to: Date | null };+ /** Unsupported values still revalidate relevant active fields. */revalidateOnly?: boolean;};@@ -173,7 +176,7 @@ async function prepareGroupedPropertyUpdates(readPage: ReadGroupPage): Promise<OptimisticGroupedPropertyUpdates> {const changes = diffGroupKeys(args.oldGroupKeys, args.newGroupKeys);- if (!changes && !args.revalidateOnly) {+ if (!changes && !args.revalidateOnly && !args.dateChange) {return { updates: [], revalidations: [] };}@@ -182,7 +185,7 @@ async function prepareGroupedPropertyUpdates(document: GroupSoupMembershipDocument,variables: { input },}));- if (args.revalidateOnly || !changes) {+ if (args.revalidateOnly && !args.dateChange) {return { updates: [], revalidations };}@@ -190,10 +193,25 @@ async function prepareGroupedPropertyUpdates(const views = groupPagesByLogicalView(loadedPages.filter((page): page is GroupPage => page !== null));- const { removed, added } = changes;const updates: OptimisticUpdate[] = [];for (const pages of views.values()) {- const sourceGroupKeys = removed.length > 0 ? removed : args.oldGroupKeys;+ const groupBy = (pages[0].input.initial ?? pages[0].input.continuation)+ .groupBy;+ let oldGroupKeys = args.oldGroupKeys;+ let newGroupKeys = args.newGroupKeys;+ if (args.dateChange) {+ if (!groupBy.bucketing) continue;+ oldGroupKeys = [+ propertyDateGroupKey(args.dateChange.from, groupBy.bucketing),+ ];+ newGroupKeys = [+ propertyDateGroupKey(args.dateChange.to, groupBy.bucketing),+ ];+ }+ const changes = diffGroupKeys(oldGroupKeys, newGroupKeys);+ if (!changes) continue;+ const { removed, added } = changes;+ const sourceGroupKeys = removed.length > 0 ? removed : oldGroupKeys;const sourcePages = pages.filter((page) =>sourceGroupKeys.some((key) =>page.binsdiff --git a/apps/web/src/lib/queries/soup/grouped/graphql/create-graphql-grouped-soup-queries.test.ts b/apps/web/src/lib/queries/soup/grouped/graphql/create-graphql-grouped-soup-queries.test.tsindex 21f1952715..74a3261313 100644--- a/apps/web/src/lib/queries/soup/grouped/graphql/create-graphql-grouped-soup-queries.test.ts+++ b/apps/web/src/lib/queries/soup/grouped/graphql/create-graphql-grouped-soup-queries.test.ts@@ -6,7 +6,7 @@ import {type OperationContext,type OperationResult,} from '@urql/core';-import { createMemo, createRoot } from 'solid-js';+import { type Accessor, createMemo, createRoot, createSignal } from 'solid-js';import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';import { makeSubject, onEnd, pipe } from 'wonka';@@ -58,7 +58,7 @@ import {groupedSoupInputKey,groupedSoupLogicalViewKey,} from '@queries/soup/grouped/graphql-operation-registry';-import type { GroupMeta } from '@queries/soup/grouped/types';+import type { GroupByField, GroupMeta } from '@queries/soup/grouped/types';import type { GroupSoupQueryVariables } from '@service-storage/graphql/generated/graphql';import { createGraphqlGroupedSoupQueries } from './create-graphql-grouped-soup-queries';@@ -166,7 +166,7 @@ beforeEach(() => {vi.clearAllMocks();});-function setup() {+function setup(options: { groupByField?: Accessor<GroupByField> } = {}) {const fake = makeFakeClient();getGraphqlSoupClientMock.mockReturnValue(fake.client);@@ -176,7 +176,7 @@ function setup() {() => ({params: { limit: 2, sort_method: 'updated_at' },body: {},- groupBy: {+ groupBy: options.groupByField?.() ?? {type: 'property',propertyDefinitionId: 'status-definition',},@@ -452,3 +452,70 @@ describe('createGraphqlGroupedSoupQueries', () => {expect(fake.executions[0]?.unsubscribed).toBe(false);});});++it('discards loaded cursors when date ranges change with the same bucket keys', async () => {+ const [field, setField] = createSignal<GroupByField>({+ type: 'property',+ propertyDefinitionId: 'review-date-property',+ bucketing: {+ type: 'date_ranges',+ ranges: [+ { key: 'a', start: null, end: '2026-10-22T00:00:00Z' },+ { key: 'b', start: '2026-10-22T00:00:00Z', end: null },+ ],+ missingValueBucketKey: 'no_review_date',+ },+ });+ const { fake, grouped } = setup({ groupByField: field });+ fake.executions[0].next(+ page([group('a', ['a-1'], 'old-cursor')], [item('a-1')])+ );+ const a = grouped.map().get('a')!;+ const load = a.fetchNextPage();+ fake.executions[1].next(+ page([group('a', ['a-2'], 'next-old-cursor')], [item('a-2')])+ );+ await load;+ expect(entityIds(a)).toEqual(['a-1', 'a-2']);+ setField({+ type: 'property',+ propertyDefinitionId: 'review-date-property',+ bucketing: {+ type: 'date_ranges',+ ranges: [+ { key: 'a', start: null, end: '2026-10-23T00:00:00Z' },+ { key: 'b', start: '2026-10-23T00:00:00Z', end: null },+ ],+ missingValueBucketKey: 'no_review_date',+ },+ });+ expect(fake.executions[1].unsubscribed).toBe(true);+ expect(fake.executions[2].variables.input).toMatchObject({+ initial: {+ groupBy: {+ field: 'PROPERTY',+ propertyDefinitionId: 'review-date-property',+ bucketing: {+ type: 'DATE_RANGES',+ ranges: [+ { key: 'a', start: null, end: '2026-10-23T00:00:00Z' },+ { key: 'b', start: '2026-10-23T00:00:00Z', end: null },+ ],+ missingValueBucketKey: 'no_review_date',+ },+ },+ },+ });+ fake.executions[2].next(+ page([group('a', ['a-3'], 'new-cursor')], [item('a-3')])+ );+ const refreshed = grouped.map().get('a')!;+ expect(entityIds(refreshed)).toEqual(['a-3']);+ const next = refreshed.fetchNextPage();+ expect(fake.executions[3].variables.input).toMatchObject({+ continuation: { cursor: 'new-cursor' },+ });+ fake.executions[3].next(page([group('a', ['a-4'], null)], [item('a-4')]));+ await next;+ expect(entityIds(refreshed)).toEqual(['a-3', 'a-4']);+});diff --git a/apps/web/src/lib/queries/soup/grouped/types.ts b/apps/web/src/lib/queries/soup/grouped/types.tsindex 3bb8d6cb0e..555565bb07 100644--- a/apps/web/src/lib/queries/soup/grouped/types.ts+++ b/apps/web/src/lib/queries/soup/grouped/types.ts@@ -1,4 +1,5 @@import type { SoupApiItem } from '@service-storage/generated/schemas';+import type { ApiGroupByField } from '@service-storage/generated/schemas/apiGroupByField';/*** Empty group key emitted by the backend@@ -7,6 +8,18 @@ import type { SoupApiItem } from '@service-storage/generated/schemas';*/export const NOT_SET_GROUP_KEY = '';+type ApiDatePropertyBucketing = NonNullable<+ Extract<ApiGroupByField, { property: unknown }>['property']['bucketing']+>;++/** Date ranges belong to a view, not to a property definition. */+export type DatePropertyBucketing = Omit<+ ApiDatePropertyBucketing,+ 'missing_value_bucket_key'+> & {+ missingValueBucketKey: ApiDatePropertyBucketing['missing_value_bucket_key'];+};+export type GroupByField =| { type: 'date' }| { type: 'entity_type' }@@ -15,6 +28,7 @@ export type GroupByField =type: 'property';propertyDefinitionId: string;entityType?: PropertyEntityType;+ bucketing?: DatePropertyBucketing;};export const GROUP_BY_TYPES: readonly GroupByField['type'][] = [diff --git a/apps/web/src/lib/queries/soup/items.ts b/apps/web/src/lib/queries/soup/items.tsindex df57c443dd..c2e4c3d3d4 100644--- a/apps/web/src/lib/queries/soup/items.ts+++ b/apps/web/src/lib/queries/soup/items.ts@@ -186,6 +186,8 @@ async function fetchRestSoupAstItemsPage(group_by: serializeGroupByField(groupBy),per_group_limit: params.limit,sort_method,+ sort_property_definition_id: params.sort_property_definition_id,+ sort_direction: params.sort_direction,},body,signal,@@ -447,7 +449,11 @@ export function useSoupAstItemsQuery(options?.().onBeforeGraphqlRefresh?.();await activeGraphqlQuery().refresh();},- body: () => args().body,+ body: () => ({+ ...args().body,+ params: args().params,+ groupBy: args().groupBy,+ }),// Grouped lists don't report it yet, so writes still read them again.cacheMaintained: () => activeGraphqlQuery().cacheMaintained?.() ?? false,})diff --git a/apps/web/src/lib/queries/soup/normalized-cache/grouped-operations.ts b/apps/web/src/lib/queries/soup/normalized-cache/grouped-operations.tsindex fb88f17ac8..f2260ea586 100644--- a/apps/web/src/lib/queries/soup/normalized-cache/grouped-operations.ts+++ b/apps/web/src/lib/queries/soup/normalized-cache/grouped-operations.ts@@ -204,6 +204,9 @@ export function syncGroupQueries(entityId: string, entity: SoupApiItem) {continue;}+ const existing = prev.pages.some((page) =>+ page.group.itemIds.includes(entityId)+ );const shouldHave = nextGroupKeys.includes(meta.groupKey);let changed = false;@@ -213,7 +216,7 @@ export function syncGroupQueries(entityId: string, entity: SoupApiItem) {for (const page of prev.pages) {const hasEntity = page.group.itemIds.includes(entityId);- if (shouldHave && index === 0 && !hasEntity) {+ if (shouldHave && index === 0 && !existing) {changed = true;pages.push({...page,diff --git a/apps/web/src/lib/queries/soup/normalized-cache/operations.test.ts b/apps/web/src/lib/queries/soup/normalized-cache/operations.test.tsindex d97f6eec4f..3bab4036f5 100644--- a/apps/web/src/lib/queries/soup/normalized-cache/operations.test.ts+++ b/apps/web/src/lib/queries/soup/normalized-cache/operations.test.ts@@ -956,6 +956,86 @@ describe('removeSoupEntities — grouped cache', () => {});describe('optimisticUpdateSoupEntity — cross-group move', () => {+ it.each([+ ['2026-11-01T00:00:00Z', 'later'],+ [null, 'missing'],+ ])(+ 'moves a loaded date property to %s before refetch',+ (value, destination) => {+ const initial = mockTaskItem('date-item', 'unused');+ if (initial.tag !== 'document')+ throw new Error('Expected document fixture');+ const property = initial.data.properties?.[0];+ if (!property) throw new Error('Expected property fixture');+ const item: SoupApiItem = {+ ...initial,+ data: {+ ...initial.data,+ properties: [+ {+ ...property,+ value: { type: 'Date', value: '2026-10-31T23:59:59Z' },+ },+ ],+ },+ };+ const groupBy: GroupByField = {+ type: 'property',+ propertyDefinitionId: STATUS_DEF,+ bucketing: {+ type: 'date_ranges',+ ranges: [+ { key: 'soon', start: null, end: '2026-11-01T00:00:00Z' },+ { key: 'later', start: '2026-11-01T00:00:00Z', end: null },+ ],+ missingValueBucketKey: 'missing',+ },+ };+ const key = [...soupKeys.astItems._def, {}, {}, groupBy];+ const data = mockGroupedParentCache(+ [item],+ [+ buildGroup('soon', ['date-item'], 8),+ buildGroup('later', [], 5),+ buildGroup('missing', [], 2),+ ]+ );+ testQueryClient.setQueryDefaults(key, { meta: { groupBy } });+ testQueryClient.setQueryData(key, data);+ const updated: SoupApiItem = {+ ...item,+ data: {+ ...item.data,+ properties: [+ {+ ...property,+ value: value === null ? null : { type: 'Date', value },+ },+ ],+ },+ };+ mockNormalizer.getObjectById.mockReturnValue(updated);+ testQueryClient.setQueryData(key, {+ ...data,+ pages: [{ ...data.pages[0], items: { 'date-item': updated } }],+ });+ optimisticUpdateSoupEntity(updated);+ const page =+ testQueryClient.getQueryData<+ InfiniteData<SoupAstItemsGroupedPage, unknown>+ >(key)!.pages[0];+ expect(page.groups.find((group) => group.key === 'soon')).toMatchObject({+ itemIds: [],+ totalCount: 7,+ });+ expect(+ page.groups.find((group) => group.key === destination)+ ).toMatchObject({+ itemIds: ['date-item'],+ totalCount: destination === 'later' ? 6 : 3,+ });+ }+ );it('moves item id between groups via itemIds mutations only', () => {const items = [mockTaskItem('a-1', 'in_progress'),@@ -1786,3 +1866,82 @@ describe('insert gate (meta.insertFilter) — grouped cache', () => {]);});});++describe('raw grouped entity IDs', () => {+ it('updates and removes memberships using entity IDs without changing pool keys', () => {+ const item = mockTaskItem('a-1', 'in_progress');+ const key = seedGroupedAstQuery({+ pages: [+ {+ kind: 'grouped',+ items: { 'a-1': item },+ groups: [+ buildGroup('in_progress', ['a-1'], 4),+ buildGroup('done', [], 2),+ ],+ nextCursor: null,+ },+ ],+ pageParams: [null],+ });+ const updated = mockTaskItem('a-1', 'done');+ mockNormalizer.getObjectById.mockReturnValue(updated);+ optimisticUpdateSoupEntity(updated);+ const moved =+ testQueryClient.getQueryData<InfiniteData<SoupAstItemsGroupedPage>>(key)!+ .pages[0];+ expect(Object.keys(moved.items)).toEqual(['a-1']);+ expect(moved.items['a-1']).toEqual(updated);+ expect(+ moved.groups.map((group) => [group.key, group.itemIds, group.totalCount])+ ).toEqual([+ ['in_progress', [], 3],+ ['done', ['a-1'], 3],+ ]);+ const transaction = removeSoupEntities(new Set(['a-1']));+ const removed =+ testQueryClient.getQueryData<InfiniteData<SoupAstItemsGroupedPage>>(key)!+ .pages[0];+ expect(removed.items).toEqual({});+ expect(removed.groups[1].itemIds).toEqual([]);+ expect(removed.groups[1].totalCount).toBe(2);+ transaction.rollback();+ expect(+ testQueryClient.getQueryData<InfiniteData<SoupAstItemsGroupedPage>>(key)!+ .pages[0]+ ).toEqual(moved);+ });++ it('does not duplicate an entity from a later expanded-group page', () => {+ const key = [...soupKeys.groupedGroup._def, 'raw-continuation'];+ const item = mockTaskItem('a-1', 'in_progress');+ type Page = { items: Record<string, SoupApiItem>; group: GroupMeta };+ testQueryClient.setQueryDefaults(key, {+ meta: { groupBy: STATUS_GROUP_BY, groupKey: 'in_progress' },+ });+ testQueryClient.setQueryData<InfiniteData<Page>>(key, {+ pages: [+ {+ items: { 'a-2': mockTaskItem('a-2', 'in_progress') },+ group: buildGroup('in_progress', ['a-2'], 5),+ },+ {+ items: { 'a-1': item },+ group: buildGroup('in_progress', ['a-1'], 5),+ },+ ],+ pageParams: [null, 'cursor'],+ });+ mockNormalizer.getObjectById.mockReturnValue(item);+ optimisticUpdateSoupEntity(item);+ insertSoupEntity(item);+ const pages = testQueryClient.getQueryData<InfiniteData<Page>>(key)!.pages;+ expect(pages.map((page) => page.group.itemIds)).toEqual([['a-2'], ['a-1']]);+ removeSoupEntities(new Set(['a-1']));+ const removed =+ testQueryClient.getQueryData<InfiniteData<Page>>(key)!.pages;+ expect(removed[1].items).toEqual({});+ expect(removed[1].group.itemIds).toEqual([]);+ expect(removed[1].group.totalCount).toBe(4);+ });+});diff --git a/apps/web/src/lib/queries/soup/normalized-cache/operations.ts b/apps/web/src/lib/queries/soup/normalized-cache/operations.tsindex 294f383654..b2b4ba703e 100644--- a/apps/web/src/lib/queries/soup/normalized-cache/operations.ts+++ b/apps/web/src/lib/queries/soup/normalized-cache/operations.ts@@ -580,10 +580,7 @@ export function restoreSoupEntityToDoneFilteredQueries(}// Grouped parents keep membership entirely on the first page.- if (- entityId in firstPage.items ||- firstPage.groups.some((group) => group.itemIds.includes(entityId))- ) {+ if (containsEntity(Object.values(firstPage.items))) {continue;}diff --git a/apps/web/src/lib/queries/soup/property-queries.ts b/apps/web/src/lib/queries/soup/property-queries.tsnew file mode 100644index 0000000000..c3b61cb3d3--- /dev/null+++ b/apps/web/src/lib/queries/soup/property-queries.ts@@ -0,0 +1,77 @@+import { queryClient } from '@queries/client';+import { partialMatchKey, type Query } from '@tanstack/solid-query';+import { refreshActiveGraphqlSoupQueries } from './graphql/active-queries';+import { soupKeys } from './keys';++function isRecord(value: unknown): value is Record<string, unknown> {+ return typeof value === 'object' && value !== null && !Array.isArray(value);+}++function isDateFilter(input: Record<string, unknown>): boolean {+ const value = input.v ?? input.value ?? input;+ return (+ isRecord(value) &&+ (value.dr !== undefined ||+ value.dateRange !== undefined ||+ value.date_range !== undefined ||+ typeof value.has_date === 'boolean')+ );+}+/** Match request fields, not property IDs occurring in unrelated option filters. */+function dependsOnProperty(input: unknown, definitionId?: string): boolean {+ if (Array.isArray(input))+ return input.some((value) => dependsOnProperty(value, definitionId));+ if (!isRecord(input)) return false;++ const matches = (id: unknown) =>+ typeof id === 'string' &&+ (definitionId === undefined || id === definitionId);+ if (+ (input.sort_method === 'property' &&+ matches(input.sort_property_definition_id)) ||+ (input.sortMethod === 'PROPERTY' && matches(input.sortPropertyDefinitionId))+ )+ return true;++ if (+ (input.type === 'property' || input.field === 'PROPERTY') &&+ matches(input.propertyDefinitionId)+ )+ return true;+ const groupBy = input.group_by;+ if (+ isRecord(groupBy) &&+ isRecord(groupBy.property) &&+ matches(groupBy.property.property_definition_id)+ )+ return true;++ const propertyId =+ input.pd ?? input.propertyDefinitionId ?? input.property_definition_id;+ if (matches(propertyId) && isDateFilter(input)) return true;++ return Object.values(input).some((value) =>+ dependsOnProperty(value, definitionId)+ );+}++/** Property edits can reorder pages, admit filtered items, and change group counts. */+export async function refreshPropertyQueries(+ propertyDefinitionId?: string+): Promise<void> {+ const prefixes = [+ soupKeys.items._def,+ soupKeys.astItems._def,+ soupKeys.groupedGroup._def,+ soupKeys.search._def,+ ];+ const where = (input: unknown) =>+ dependsOnProperty(input, propertyDefinitionId);+ const predicate = (query: Query) =>+ prefixes.some((prefix) => partialMatchKey(query.queryKey, prefix)) &&+ where(query.queryKey);+ await Promise.all([+ queryClient.invalidateQueries({ predicate }),+ refreshActiveGraphqlSoupQueries({ where }),+ ]);+}diff --git a/apps/web/src/lib/service-clients/service-search/generated/models/index.ts b/apps/web/src/lib/service-clients/service-search/generated/models/index.tsindex 7e424c689b..de3f3fdfa5 100644--- a/apps/web/src/lib/service-clients/service-search/generated/models/index.ts+++ b/apps/web/src/lib/service-clients/service-search/generated/models/index.ts@@ -222,10 +222,15 @@ export * from './projectSearchResponseItemWithMetadataAllOfMetadata';export * from './projectSearchResponseItemWithMetadataAllOfProperties';export * from './projectSearchResult';export * from './projectSearchResultScore';+export * from './propertyDateFilterRange';+export * from './propertyDateFilterRangeEnd';+export * from './propertyDateFilterRangeStart';export * from './propertyDefinition';export * from './propertyDefinitionSpecificEntityType';export * from './propertyFilter';+export * from './propertyFilterDateRange';export * from './propertyFilterEntityType';+export * from './propertyFilterHasDate';export * from './propertyOwner';export * from './propertyOwnerOneOf';export * from './propertyOwnerOneOfFive';diff --git a/apps/web/src/lib/service-clients/service-search/generated/models/propertyDateFilterRange.ts b/apps/web/src/lib/service-clients/service-search/generated/models/propertyDateFilterRange.tsnew file mode 100644index 0000000000..a9057d3035--- /dev/null+++ b/apps/web/src/lib/service-clients/service-search/generated/models/propertyDateFilterRange.ts@@ -0,0 +1,18 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * search_service+ * OpenAPI spec version: 0.1.0+ */+import type { PropertyDateFilterRangeEnd } from './propertyDateFilterRangeEnd';+import type { PropertyDateFilterRangeStart } from './propertyDateFilterRangeStart';++/**+ * UTC timestamp interval. Lower bounds are inclusive; upper bounds are exclusive.+ */+export interface PropertyDateFilterRange {+ /** Exclusive UTC upper bound, omitted for an open end. */+ end?: PropertyDateFilterRangeEnd;+ /** Inclusive UTC lower bound, omitted for an open start. */+ start?: PropertyDateFilterRangeStart;+}diff --git a/apps/web/src/lib/service-clients/service-search/generated/models/propertyDateFilterRangeEnd.ts b/apps/web/src/lib/service-clients/service-search/generated/models/propertyDateFilterRangeEnd.tsnew file mode 100644index 0000000000..74bb9d4497--- /dev/null+++ b/apps/web/src/lib/service-clients/service-search/generated/models/propertyDateFilterRangeEnd.ts@@ -0,0 +1,11 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * search_service+ * OpenAPI spec version: 0.1.0+ */++/**+ * Exclusive UTC upper bound, omitted for an open end.+ */+export type PropertyDateFilterRangeEnd = string | null;diff --git a/apps/web/src/lib/service-clients/service-search/generated/models/propertyDateFilterRangeStart.ts b/apps/web/src/lib/service-clients/service-search/generated/models/propertyDateFilterRangeStart.tsnew file mode 100644index 0000000000..caacf185f9--- /dev/null+++ b/apps/web/src/lib/service-clients/service-search/generated/models/propertyDateFilterRangeStart.ts@@ -0,0 +1,11 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * search_service+ * OpenAPI spec version: 0.1.0+ */++/**+ * Inclusive UTC lower bound, omitted for an open start.+ */+export type PropertyDateFilterRangeStart = string | null;diff --git a/apps/web/src/lib/service-clients/service-search/generated/models/propertyFilter.ts b/apps/web/src/lib/service-clients/service-search/generated/models/propertyFilter.tsindex ad63722d29..5d59a8fc6e 100644--- a/apps/web/src/lib/service-clients/service-search/generated/models/propertyFilter.ts+++ b/apps/web/src/lib/service-clients/service-search/generated/models/propertyFilter.ts@@ -4,7 +4,9 @@* search_service* OpenAPI spec version: 0.1.0*/+import type { PropertyFilterDateRange } from './propertyFilterDateRange';import type { PropertyFilterEntityType } from './propertyFilterEntityType';+import type { PropertyFilterHasDate } from './propertyFilterHasDate';/*** A single property-based filter condition.@@ -15,11 +17,14 @@ Multiple values within a single filter are OR'd together.Multiple filters are AND'd together.*/export interface PropertyFilter {+ date_range?: PropertyFilterDateRange;/** Entity reference IDs to match. Multiple values are OR'd together. */entity_ids?: string[];/** The entity type for the property lookup (e.g., "TASK", "DOCUMENT", "PROJECT").When None, matches across all entity types. */entity_type?: PropertyFilterEntityType;+ /** Flat Soup/search presence filter: true expands to an open date range, false to its negation. */+ has_date?: PropertyFilterHasDate;/** Select option UUIDs to match. Multiple values are OR'd together. */option_ids?: string[];/** The UUID of the property definition to filter on. */diff --git a/apps/web/src/lib/service-clients/service-search/generated/models/propertyFilterDateRange.ts b/apps/web/src/lib/service-clients/service-search/generated/models/propertyFilterDateRange.tsnew file mode 100644index 0000000000..8123c5a784--- /dev/null+++ b/apps/web/src/lib/service-clients/service-search/generated/models/propertyFilterDateRange.ts@@ -0,0 +1,9 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * search_service+ * OpenAPI spec version: 0.1.0+ */+import type { PropertyDateFilterRange } from './propertyDateFilterRange';++export type PropertyFilterDateRange = null | PropertyDateFilterRange;diff --git a/apps/web/src/lib/service-clients/service-search/generated/models/propertyFilterHasDate.ts b/apps/web/src/lib/service-clients/service-search/generated/models/propertyFilterHasDate.tsnew file mode 100644index 0000000000..4ee0448dcb--- /dev/null+++ b/apps/web/src/lib/service-clients/service-search/generated/models/propertyFilterHasDate.ts@@ -0,0 +1,11 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * search_service+ * OpenAPI spec version: 0.1.0+ */++/**+ * Flat Soup/search presence filter: true expands to an open date range, false to its negation.+ */+export type PropertyFilterHasDate = boolean | null;diff --git a/apps/web/src/lib/service-clients/service-search/openapi.json b/apps/web/src/lib/service-clients/service-search/openapi.jsonindex b1c5c04691..0fd06fda62 100644--- a/apps/web/src/lib/service-clients/service-search/openapi.json+++ b/apps/web/src/lib/service-clients/service-search/openapi.json@@ -3064,6 +3064,22 @@}}},+ "PropertyDateFilterRange": {+ "type": "object",+ "description": "UTC timestamp interval. Lower bounds are inclusive; upper bounds are exclusive.",+ "properties": {+ "end": {+ "type": ["string", "null"],+ "format": "date-time",+ "description": "Exclusive UTC upper bound, omitted for an open end."+ },+ "start": {+ "type": ["string", "null"],+ "format": "date-time",+ "description": "Inclusive UTC lower bound, omitted for an open start."+ }+ }+ },"PropertyDefinition": {"type": "object","description": "Property definition model (service representation).",@@ -3129,6 +3145,17 @@"description": "A single property-based filter condition.\n\nEach filter targets a specific property definition on entities of a given type,\nmatching against select option UUIDs or entity reference IDs.\nMultiple values within a single filter are OR'd together.\nMultiple filters are AND'd together.","required": ["property_definition_id"],"properties": {+ "date_range": {+ "oneOf": [+ {+ "type": "null"+ },+ {+ "$ref": "#/components/schemas/PropertyDateFilterRange",+ "description": "UTC range for Soup/search: inclusive start, exclusive end; both open matches any date."+ }+ ]+ },"entity_ids": {"type": "array","items": {@@ -3140,6 +3167,10 @@"type": ["string", "null"],"description": "The entity type for the property lookup (e.g., \"TASK\", \"DOCUMENT\", \"PROJECT\").\nWhen None, matches across all entity types."},+ "has_date": {+ "type": ["boolean", "null"],+ "description": "Flat Soup/search presence filter: true expands to an open date range, false to its negation."+ },"option_ids": {"type": "array","items": {diff --git a/apps/web/src/lib/service-clients/service-storage/client.ts b/apps/web/src/lib/service-clients/service-storage/client.tsindex 7f6dfe861d..7d781609c7 100644--- a/apps/web/src/lib/service-clients/service-storage/client.ts+++ b/apps/web/src/lib/service-clients/service-storage/client.ts@@ -691,6 +691,8 @@ export const storageServiceClient = {group_by: PostGroupedSoupAstInitialRequest['group_by'];per_group_limit?: number | null;sort_method?: GroupedSoupSort;+ sort_property_definition_id?: string | null;+ sort_direction?: PostGroupedSoupAstInitialRequest['sort_direction'];};body: PostSoupAstRequest;signal?: AbortSignal;@@ -701,6 +703,8 @@ export const storageServiceClient = {mode: 'initial',group_by: args.params.group_by,sort_method: args.params.sort_method,+ sort_property_definition_id: args.params.sort_property_definition_id,+ sort_direction: args.params.sort_direction,...(args.params.per_group_limit != null && {per_group_limit: args.params.per_group_limit,}),@@ -720,6 +724,8 @@ export const storageServiceClient = {group_key: string;limit?: number | null;sort_method?: GroupedSoupSort;+ sort_property_definition_id?: string | null;+ sort_direction?: PostGroupedSoupAstGroupPageRequest['sort_direction'];};body: PostSoupAstRequest;}) {@@ -733,6 +739,8 @@ export const storageServiceClient = {mode: 'group_page',group_by: args.params.group_by,sort_method: args.params.sort_method,+ sort_property_definition_id: args.params.sort_property_definition_id,+ sort_direction: args.params.sort_direction,group_key: args.params.group_key,...(args.params.limit != null && { limit: args.params.limit }),} satisfies PostGroupedSoupAstRequest;diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/apiGroupByFieldOneOfProperty.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/apiGroupByFieldOneOfProperty.tsindex 598ad30070..bee4c753c6 100644--- a/apps/web/src/lib/service-clients/service-storage/generated/schemas/apiGroupByFieldOneOfProperty.ts+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/apiGroupByFieldOneOfProperty.ts@@ -4,12 +4,14 @@* document_storage_service* OpenAPI spec version: 0.1.0*/+import type { ApiGroupByFieldOneOfPropertyBucketing } from './apiGroupByFieldOneOfPropertyBucketing';import type { ApiGroupByFieldOneOfPropertyEntityType } from './apiGroupByFieldOneOfPropertyEntityType';/*** Group by a property value (e.g., status, priority, or custom properties)*/export type ApiGroupByFieldOneOfProperty = {+ bucketing?: ApiGroupByFieldOneOfPropertyBucketing;entity_type?: ApiGroupByFieldOneOfPropertyEntityType;/** The property definition UUID to group by */property_definition_id: string;diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/apiGroupByFieldOneOfPropertyBucketing.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/apiGroupByFieldOneOfPropertyBucketing.tsnew file mode 100644index 0000000000..30d5dfe3bf--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/apiGroupByFieldOneOfPropertyBucketing.ts@@ -0,0 +1,9 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */+import type { PropertyBucketing } from './propertyBucketing';++export type ApiGroupByFieldOneOfPropertyBucketing = null | PropertyBucketing;diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/apiPropertyEntityType.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/apiPropertyEntityType.tsindex d573ee1e4d..d4c77db782 100644--- a/apps/web/src/lib/service-clients/service-storage/generated/schemas/apiPropertyEntityType.ts+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/apiPropertyEntityType.ts@@ -13,6 +13,10 @@ export type ApiPropertyEntityType =// eslint-disable-next-line @typescript-eslint/no-redeclareexport const ApiPropertyEntityType = {+ CALL_RECORD: 'CALL_RECORD',+ CALENDAR_EVENT: 'CALENDAR_EVENT',+ DATABASE_ROW: 'DATABASE_ROW',+ INITIATIVE: 'INITIATIVE',CHANNEL: 'CHANNEL',CHAT: 'CHAT',COMPANY: 'COMPANY',diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/getItemsSoupParams.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/getItemsSoupParams.tsindex a1aa849691..d5d7bc1eb2 100644--- a/apps/web/src/lib/service-clients/service-storage/generated/schemas/getItemsSoupParams.ts+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/getItemsSoupParams.ts@@ -18,20 +18,22 @@ export type GetItemsSoupParams = {*/limit?: number;/**- * Sort method. Options are viewed_at, created_at, updated_at,-viewed_updated, frecency, touched_by_me, notified_at. Defaults to-viewed_at.+ * Sort method. Property ordering supports DATE, NUMBER, BOOLEAN, SELECT and TAG.+Missing definitions, unsupported types, and mismatched values sort as missing.+Flat property sorts omit calendar events, email, channels, calls, companies, and agent sessions.+Defaults to viewed_at.*/sort_method?: SoupApiSort;+ /**+ * Property definition selected for numeric property sorting.+ */+ sort_property_definition_id?: string;/*** Sort direction. Options are asc, desc. Defaults to desc.-Re-send this with every page: it is not carried in the cursor.--Applies to the timestamp sort methods only. `asc` combined with-`frecency` is rejected rather than ignored: frecency pages are ordered-by relevance score and the cursor comparison assumes descending, so-there is no ascending frecency order to give.+Timestamp sorts require this parameter again on each page. Property+cursors preserve their direction and always put missing values last.+Ascending frecency, touched-by-me, and notified-at sorts are unsupported.*/sort_direction?: SoupApiSortDirection;/**diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/groupedInitialParams.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/groupedInitialParams.tsindex 6af4364d51..27695d7606 100644--- a/apps/web/src/lib/service-clients/service-storage/generated/schemas/groupedInitialParams.ts+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/groupedInitialParams.ts@@ -6,7 +6,9 @@*/import type { ApiGroupByField } from './apiGroupByField';import type { GroupedInitialParamsPerGroupLimit } from './groupedInitialParamsPerGroupLimit';+import type { GroupedInitialParamsSortDirection } from './groupedInitialParamsSortDirection';import type { GroupedInitialParamsSortMethod } from './groupedInitialParamsSortMethod';+import type { GroupedInitialParamsSortPropertyDefinitionId } from './groupedInitialParamsSortPropertyDefinitionId';/*** Parameters for the initial grouped soup query.@@ -19,5 +21,8 @@ export interface GroupedInitialParams {* @minimum 0*/per_group_limit?: GroupedInitialParamsPerGroupLimit;+ sort_direction?: GroupedInitialParamsSortDirection;sort_method?: GroupedInitialParamsSortMethod;+ /** Property definition selected for numeric property sorting. */+ sort_property_definition_id?: GroupedInitialParamsSortPropertyDefinitionId;}diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/groupedInitialParamsSortDirection.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/groupedInitialParamsSortDirection.tsnew file mode 100644index 0000000000..5be7104f10--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/groupedInitialParamsSortDirection.ts@@ -0,0 +1,9 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */+import type { SoupApiSortDirection } from './soupApiSortDirection';++export type GroupedInitialParamsSortDirection = null | SoupApiSortDirection;diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/groupedInitialParamsSortPropertyDefinitionId.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/groupedInitialParamsSortPropertyDefinitionId.tsnew file mode 100644index 0000000000..3aa6ce08c8--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/groupedInitialParamsSortPropertyDefinitionId.ts@@ -0,0 +1,11 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */++/**+ * Property definition selected for numeric property sorting.+ */+export type GroupedInitialParamsSortPropertyDefinitionId = string | null;diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/groupedPageParams.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/groupedPageParams.tsindex 9461616e03..24d3b4bda0 100644--- a/apps/web/src/lib/service-clients/service-storage/generated/schemas/groupedPageParams.ts+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/groupedPageParams.ts@@ -6,7 +6,9 @@*/import type { ApiGroupByField } from './apiGroupByField';import type { GroupedPageParamsLimit } from './groupedPageParamsLimit';+import type { GroupedPageParamsSortDirection } from './groupedPageParamsSortDirection';import type { GroupedPageParamsSortMethod } from './groupedPageParamsSortMethod';+import type { GroupedPageParamsSortPropertyDefinitionId } from './groupedPageParamsSortPropertyDefinitionId';/*** Parameters for fetching one page within a specific group.@@ -21,5 +23,8 @@ export interface GroupedPageParams {* @minimum 0*/limit?: GroupedPageParamsLimit;+ sort_direction?: GroupedPageParamsSortDirection;sort_method?: GroupedPageParamsSortMethod;+ /** Property definition selected for numeric property sorting. */+ sort_property_definition_id?: GroupedPageParamsSortPropertyDefinitionId;}diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/groupedPageParamsSortDirection.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/groupedPageParamsSortDirection.tsnew file mode 100644index 0000000000..4db06cc085--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/groupedPageParamsSortDirection.ts@@ -0,0 +1,9 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */+import type { SoupApiSortDirection } from './soupApiSortDirection';++export type GroupedPageParamsSortDirection = null | SoupApiSortDirection;diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/groupedPageParamsSortPropertyDefinitionId.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/groupedPageParamsSortPropertyDefinitionId.tsnew file mode 100644index 0000000000..e5b5049446--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/groupedPageParamsSortPropertyDefinitionId.ts@@ -0,0 +1,11 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */++/**+ * Property definition selected for numeric property sorting.+ */+export type GroupedPageParamsSortPropertyDefinitionId = string | null;diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/groupedSoupSort.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/groupedSoupSort.tsindex 570dfea019..de33c5c285 100644--- a/apps/web/src/lib/service-clients/service-storage/generated/schemas/groupedSoupSort.ts+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/groupedSoupSort.ts@@ -17,4 +17,5 @@ export const GroupedSoupSort = {created_at: 'created_at',updated_at: 'updated_at',viewed_updated: 'viewed_updated',+ property: 'property',} as const;diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/index.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/index.tsindex ca068cc5a7..582967d91b 100644--- a/apps/web/src/lib/service-clients/service-storage/generated/schemas/index.ts+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/index.ts@@ -139,6 +139,7 @@ export * from './apiEntityFilterAstFavoritesOnly';export * from './apiGroupByField';export * from './apiGroupByFieldOneOf';export * from './apiGroupByFieldOneOfProperty';+export * from './apiGroupByFieldOneOfPropertyBucketing';export * from './apiGroupByFieldOneOfPropertyEntityType';export * from './apiGroupMeta';export * from './apiGroupMetaDisplayOrder';@@ -1211,10 +1212,14 @@ export * from './gitRefDtoName';export * from './gitRefDtoSha';export * from './groupedInitialParams';export * from './groupedInitialParamsPerGroupLimit';+export * from './groupedInitialParamsSortDirection';export * from './groupedInitialParamsSortMethod';+export * from './groupedInitialParamsSortPropertyDefinitionId';export * from './groupedPageParams';export * from './groupedPageParamsLimit';+export * from './groupedPageParamsSortDirection';export * from './groupedPageParamsSortMethod';+export * from './groupedPageParamsSortPropertyDefinitionId';export * from './groupedSoupGroupPage';export * from './groupedSoupGroupPageItems';export * from './groupedSoupInitialPage';@@ -1485,6 +1490,7 @@ export * from './paramsExpand';export * from './paramsLimit';export * from './paramsSortDirection';export * from './paramsSortMethod';+export * from './paramsSortPropertyDefinitionId';export * from './participantRole';export * from './patchBotRequest';export * from './patchBotRequestAvatarUrl';@@ -1590,11 +1596,24 @@ export * from './projectPreviewOneOfSevenAllOf';export * from './projectPreviewOneOfSevenAllOfAccess';export * from './projectType';export * from './projectUpdatedAt';+export * from './propertyBucketing';+export * from './propertyBucketingOneOf';+export * from './propertyBucketingOneOfAllOf';+export * from './propertyBucketingOneOfAllOfType';+export * from './propertyDateFilterRange';+export * from './propertyDateFilterRangeEnd';+export * from './propertyDateFilterRangeStart';+export * from './propertyDateRange';+export * from './propertyDateRangeEnd';+export * from './propertyDateRangeStart';+export * from './propertyDateRanges';export * from './propertyDefinition';export * from './propertyDefinitionSpecificEntityType';export * from './propertyDefinitionWithOptions';export * from './propertyFilter';+export * from './propertyFilterDateRange';export * from './propertyFilterEntityType';+export * from './propertyFilterHasDate';export * from './propertyInput';export * from './propertyOption';export * from './propertyOptionColor';diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/params.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/params.tsindex c19b68db3c..1566ffe27b 100644--- a/apps/web/src/lib/service-clients/service-storage/generated/schemas/params.ts+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/params.ts@@ -8,6 +8,7 @@ import type { ParamsExpand } from './paramsExpand';import type { ParamsLimit } from './paramsLimit';import type { ParamsSortDirection } from './paramsSortDirection';import type { ParamsSortMethod } from './paramsSortMethod';+import type { ParamsSortPropertyDefinitionId } from './paramsSortPropertyDefinitionId';/*** Query parameters shared by soup endpoints.@@ -22,4 +23,6 @@ export interface Params {limit?: ParamsLimit;sort_direction?: ParamsSortDirection;sort_method?: ParamsSortMethod;+ /** Property definition selected for numeric property sorting. */+ sort_property_definition_id?: ParamsSortPropertyDefinitionId;}diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/paramsSortPropertyDefinitionId.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/paramsSortPropertyDefinitionId.tsnew file mode 100644index 0000000000..87f1feb8b4--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/paramsSortPropertyDefinitionId.ts@@ -0,0 +1,11 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */++/**+ * Property definition selected for numeric property sorting.+ */+export type ParamsSortPropertyDefinitionId = string | null;diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/propertyBucketing.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/propertyBucketing.tsnew file mode 100644index 0000000000..a0002f9560--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/propertyBucketing.ts@@ -0,0 +1,12 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */+import type { PropertyBucketingOneOf } from './propertyBucketingOneOf';++/**+ * Optional transformation of a selected property's stored value into group keys.+ */+export type PropertyBucketing = PropertyBucketingOneOf;diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/propertyBucketingOneOf.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/propertyBucketingOneOf.tsnew file mode 100644index 0000000000..169911d0d2--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/propertyBucketingOneOf.ts@@ -0,0 +1,15 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */++import type { PropertyBucketingOneOfAllOf } from './propertyBucketingOneOfAllOf';+import type { PropertyDateRanges } from './propertyDateRanges';++/**+ * Caller-defined, ordered UTC date ranges and a separate missing-value key.+ */+export type PropertyBucketingOneOf = PropertyDateRanges &+ PropertyBucketingOneOfAllOf;diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/propertyBucketingOneOfAllOf.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/propertyBucketingOneOfAllOf.tsnew file mode 100644index 0000000000..007a58608c--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/propertyBucketingOneOfAllOf.ts@@ -0,0 +1,11 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */+import type { PropertyBucketingOneOfAllOfType } from './propertyBucketingOneOfAllOfType';++export type PropertyBucketingOneOfAllOf = {+ type: PropertyBucketingOneOfAllOfType;+};diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/propertyBucketingOneOfAllOfType.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/propertyBucketingOneOfAllOfType.tsnew file mode 100644index 0000000000..ca518bc688--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/propertyBucketingOneOfAllOfType.ts@@ -0,0 +1,14 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */++export type PropertyBucketingOneOfAllOfType =+ (typeof PropertyBucketingOneOfAllOfType)[keyof typeof PropertyBucketingOneOfAllOfType];++// eslint-disable-next-line @typescript-eslint/no-redeclare+export const PropertyBucketingOneOfAllOfType = {+ date_ranges: 'date_ranges',+} as const;diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/propertyDateFilterRange.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/propertyDateFilterRange.tsnew file mode 100644index 0000000000..80f9265886--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/propertyDateFilterRange.ts@@ -0,0 +1,18 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */+import type { PropertyDateFilterRangeEnd } from './propertyDateFilterRangeEnd';+import type { PropertyDateFilterRangeStart } from './propertyDateFilterRangeStart';++/**+ * UTC timestamp interval. Lower bounds are inclusive; upper bounds are exclusive.+ */+export interface PropertyDateFilterRange {+ /** Exclusive UTC upper bound, omitted for an open end. */+ end?: PropertyDateFilterRangeEnd;+ /** Inclusive UTC lower bound, omitted for an open start. */+ start?: PropertyDateFilterRangeStart;+}diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/propertyDateFilterRangeEnd.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/propertyDateFilterRangeEnd.tsnew file mode 100644index 0000000000..eea8d0b2a6--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/propertyDateFilterRangeEnd.ts@@ -0,0 +1,11 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */++/**+ * Exclusive UTC upper bound, omitted for an open end.+ */+export type PropertyDateFilterRangeEnd = string | null;diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/propertyDateFilterRangeStart.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/propertyDateFilterRangeStart.tsnew file mode 100644index 0000000000..15cac0ed6b--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/propertyDateFilterRangeStart.ts@@ -0,0 +1,11 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */++/**+ * Inclusive UTC lower bound, omitted for an open start.+ */+export type PropertyDateFilterRangeStart = string | null;diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/propertyDateRange.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/propertyDateRange.tsnew file mode 100644index 0000000000..8476748c17--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/propertyDateRange.ts@@ -0,0 +1,20 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */+import type { PropertyDateRangeEnd } from './propertyDateRangeEnd';+import type { PropertyDateRangeStart } from './propertyDateRangeStart';++/**+ * A half-open UTC interval. An absent start or end extends to infinity.+ */+export interface PropertyDateRange {+ /** Exclusive end, or positive infinity. */+ end?: PropertyDateRangeEnd;+ /** Unique caller-supplied group key. */+ key: string;+ /** Inclusive start, or negative infinity. */+ start?: PropertyDateRangeStart;+}diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/propertyDateRangeEnd.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/propertyDateRangeEnd.tsnew file mode 100644index 0000000000..a5d38272bd--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/propertyDateRangeEnd.ts@@ -0,0 +1,11 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */++/**+ * Exclusive end, or positive infinity.+ */+export type PropertyDateRangeEnd = string | null;diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/propertyDateRangeStart.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/propertyDateRangeStart.tsnew file mode 100644index 0000000000..87f5eb7fa8--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/propertyDateRangeStart.ts@@ -0,0 +1,11 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */++/**+ * Inclusive start, or negative infinity.+ */+export type PropertyDateRangeStart = string | null;diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/propertyDateRanges.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/propertyDateRanges.tsnew file mode 100644index 0000000000..d1fc29390b--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/propertyDateRanges.ts@@ -0,0 +1,17 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */+import type { PropertyDateRange } from './propertyDateRange';++/**+ * A complete partition of present dates plus one bucket for absent values.+ */+export interface PropertyDateRanges {+ /** Caller-supplied group key for entities with no date value. */+ missing_value_bucket_key: string;+ /** Ordered, contiguous ranges covering every present date. */+ ranges: PropertyDateRange[];+}diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/propertyFilter.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/propertyFilter.tsindex d215b0f3de..8a3df3a8d9 100644--- a/apps/web/src/lib/service-clients/service-storage/generated/schemas/propertyFilter.ts+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/propertyFilter.ts@@ -4,7 +4,9 @@* document_storage_service* OpenAPI spec version: 0.1.0*/+import type { PropertyFilterDateRange } from './propertyFilterDateRange';import type { PropertyFilterEntityType } from './propertyFilterEntityType';+import type { PropertyFilterHasDate } from './propertyFilterHasDate';/*** A single property-based filter condition.@@ -15,11 +17,14 @@ Multiple values within a single filter are OR'd together.Multiple filters are AND'd together.*/export interface PropertyFilter {+ date_range?: PropertyFilterDateRange;/** Entity reference IDs to match. Multiple values are OR'd together. */entity_ids?: string[];/** The entity type for the property lookup (e.g., "TASK", "DOCUMENT", "PROJECT").When None, matches across all entity types. */entity_type?: PropertyFilterEntityType;+ /** Flat Soup/search presence filter: true expands to an open date range, false to its negation. */+ has_date?: PropertyFilterHasDate;/** Select option UUIDs to match. Multiple values are OR'd together. */option_ids?: string[];/** The UUID of the property definition to filter on. */diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/propertyFilterDateRange.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/propertyFilterDateRange.tsnew file mode 100644index 0000000000..ea52758ec6--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/propertyFilterDateRange.ts@@ -0,0 +1,9 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */+import type { PropertyDateFilterRange } from './propertyDateFilterRange';++export type PropertyFilterDateRange = null | PropertyDateFilterRange;diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/propertyFilterHasDate.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/propertyFilterHasDate.tsnew file mode 100644index 0000000000..c3e44bd1a6--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/propertyFilterHasDate.ts@@ -0,0 +1,11 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */++/**+ * Flat Soup/search presence filter: true expands to an open date range, false to its negation.+ */+export type PropertyFilterHasDate = boolean | null;diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupApiSort.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupApiSort.tsindex 93a691888f..31a41fe378 100644--- a/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupApiSort.ts+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/soupApiSort.ts@@ -19,4 +19,5 @@ export const SoupApiSort = {frecency: 'frecency',touched_by_me: 'touched_by_me',notified_at: 'notified_at',+ property: 'property',} as const;diff --git a/apps/web/src/lib/service-clients/service-storage/generated/zod.ts b/apps/web/src/lib/service-clients/service-storage/generated/zod.tsindex 04fcc35769..c6bde8be67 100644--- a/apps/web/src/lib/service-clients/service-storage/generated/zod.ts+++ b/apps/web/src/lib/service-clients/service-storage/generated/zod.ts@@ -27424,16 +27424,21 @@ export const getItemsSoupQueryParams = zod.object({'frecency','touched_by_me','notified_at',+ 'property',]).optional().describe(- 'Sort method. Options are viewed_at, created_at, updated_at,\nviewed_updated, frecency, touched_by_me, notified_at. Defaults to\nviewed_at.'+ 'Sort method. Property ordering supports DATE, NUMBER, BOOLEAN, SELECT and TAG.\nMissing definitions, unsupported types, and mismatched values sort as missing.\nFlat property sorts omit calendar events, email, channels, calls, companies, and agent sessions.\nDefaults to viewed_at.'),+ sort_property_definition_id: zod+ .uuid()+ .optional()+ .describe('Property definition selected for numeric property sorting.'),sort_direction: zod.enum(['asc', 'desc']).optional().describe(- 'Sort direction. Options are asc, desc. Defaults to desc.\n\nRe-send this with every page: it is not carried in the cursor.\n\nApplies to the timestamp sort methods only. `asc` combined with\n`frecency` is rejected rather than ignored: frecency pages are ordered\nby relevance score and the cursor comparison assumes descending, so\nthere is no ascending frecency order to give.'+ 'Sort direction. Options are asc, desc. Defaults to desc.\n\nTimestamp sorts require this parameter again on each page. Property\ncursors preserve their direction and always put missing values last.\nAscending frecency, touched-by-me, and notified-at sorts are unsupported.'),cursor: zod.string().optional().describe('Base64 encoded cursor value.'),});@@ -32257,6 +32262,29 @@ export const postItemsSoupBody = zod.array(zod.object({+ date_range: zod+ .union([+ zod.null(),+ zod+ .object({+ end: zod.iso+ .datetime({})+ .nullish()+ .describe(+ 'Exclusive UTC upper bound, omitted for an open end.'+ ),+ start: zod.iso+ .datetime({})+ .nullish()+ .describe(+ 'Inclusive UTC lower bound, omitted for an open start.'+ ),+ })+ .describe(+ 'UTC timestamp interval. Lower bounds are inclusive; upper bounds are exclusive.'+ ),+ ])+ .optional(),entity_ids: zod.array(zod.string()).optional()@@ -32269,6 +32297,12 @@ export const postItemsSoupBody = zod.describe('The entity type for the property lookup (e.g., \"TASK\", \"DOCUMENT\", \"PROJECT\").\nWhen None, matches across all entity types.'),+ has_date: zod+ .boolean()+ .nullish()+ .describe(+ 'Flat Soup\/search presence filter: true expands to an open date range, false to its negation.'+ ),option_ids: zod.array(zod.string()).optional()@@ -32333,12 +32367,19 @@ export const postItemsSoupBody = zod'frecency','touched_by_me','notified_at',+ 'property',]).describe('Sort options accepted by non-grouped soup API endpoints.'),]).optional(),+ sort_property_definition_id: zod+ .uuid()+ .nullish()+ .describe(+ 'Property definition selected for numeric property sorting.'+ ),}).describe('Query parameters shared by soup endpoints.'))@@ -36715,12 +36756,19 @@ export const postItemsSoupAstBody = zod'frecency','touched_by_me','notified_at',+ 'property',]).describe('Sort options accepted by non-grouped soup API endpoints.'),]).optional(),+ sort_property_definition_id: zod+ .uuid()+ .nullish()+ .describe(+ 'Property definition selected for numeric property sorting.'+ ),}).describe('Query parameters shared by soup endpoints.'))@@ -41091,11 +41139,71 @@ export const postItemsSoupAstGroupedBody = zod.object({property: zod.object({+ bucketing: zod+ .union([+ zod.null(),+ zod+ .object({+ missing_value_bucket_key: zod+ .string()+ .describe(+ 'Caller-supplied group key for entities with no date value.'+ ),+ ranges: zod+ .array(+ zod+ .object({+ end: zod.iso+ .datetime({})+ .nullish()+ .describe(+ 'Exclusive end, or positive infinity.'+ ),+ key: zod+ .string()+ .describe(+ 'Unique caller-supplied group key.'+ ),+ start: zod.iso+ .datetime({})+ .nullish()+ .describe(+ 'Inclusive start, or negative infinity.'+ ),+ })+ .describe(+ 'A half-open UTC interval. An absent start or end extends to infinity.'+ )+ )+ .describe(+ 'Ordered, contiguous ranges covering every present date.'+ ),+ })+ .describe(+ 'A complete partition of present dates plus one bucket for absent values.'+ )+ .and(+ zod.object({+ type: zod.enum(['date_ranges']),+ })+ )+ .describe(+ 'Caller-defined, ordered UTC date ranges and a separate missing-value key.'+ )+ .describe(+ "Optional transformation of a selected property's stored value into group keys."+ ),+ ])+ .optional(),entity_type: zod.union([zod.null(),zod.enum([+ 'CALL_RECORD',+ 'CALENDAR_EVENT',+ 'DATABASE_ROW',+ 'INITIATIVE','CHANNEL','CHAT','COMPANY',@@ -41130,6 +41238,16 @@ export const postItemsSoupAstGroupedBody = zod.describe('Limit the number of items returned per group. Defaults to 20. Max 500.'),+ sort_direction: zod+ .union([+ zod.null(),+ zod+ .enum(['asc', 'desc'])+ .describe(+ 'Sort direction accepted by non-grouped soup API endpoints.'+ ),+ ])+ .optional(),sort_method: zod.union([zod.null(),@@ -41139,12 +41257,19 @@ export const postItemsSoupAstGroupedBody = zod'created_at','updated_at','viewed_updated',+ 'property',]).describe('Sort method for grouped queries (frecency not supported).'),]).optional(),+ sort_property_definition_id: zod+ .uuid()+ .nullish()+ .describe(+ 'Property definition selected for numeric property sorting.'+ ),}).describe('Parameters for the initial grouped soup query.'))@@ -41309,11 +41434,71 @@ export const postItemsSoupAstGroupedBody = zod.object({property: zod.object({+ bucketing: zod+ .union([+ zod.null(),+ zod+ .object({+ missing_value_bucket_key: zod+ .string()+ .describe(+ 'Caller-supplied group key for entities with no date value.'+ ),+ ranges: zod+ .array(+ zod+ .object({+ end: zod.iso+ .datetime({})+ .nullish()+ .describe(+ 'Exclusive end, or positive infinity.'+ ),+ key: zod+ .string()+ .describe(+ 'Unique caller-supplied group key.'+ ),+ start: zod.iso+ .datetime({})+ .nullish()+ .describe(+ 'Inclusive start, or negative infinity.'+ ),+ })+ .describe(+ 'A half-open UTC interval. An absent start or end extends to infinity.'+ )+ )+ .describe(+ 'Ordered, contiguous ranges covering every present date.'+ ),+ })+ .describe(+ 'A complete partition of present dates plus one bucket for absent values.'+ )+ .and(+ zod.object({+ type: zod.enum(['date_ranges']),+ })+ )+ .describe(+ 'Caller-defined, ordered UTC date ranges and a separate missing-value key.'+ )+ .describe(+ "Optional transformation of a selected property's stored value into group keys."+ ),+ ])+ .optional(),entity_type: zod.union([zod.null(),zod.enum([+ 'CALL_RECORD',+ 'CALENDAR_EVENT',+ 'DATABASE_ROW',+ 'INITIATIVE','CHANNEL','CHAT','COMPANY',@@ -41349,6 +41534,16 @@ export const postItemsSoupAstGroupedBody = zod.describe('Limit the number of items returned. Defaults to 20. Max 500.'),+ sort_direction: zod+ .union([+ zod.null(),+ zod+ .enum(['asc', 'desc'])+ .describe(+ 'Sort direction accepted by non-grouped soup API endpoints.'+ ),+ ])+ .optional(),sort_method: zod.union([zod.null(),@@ -41358,12 +41553,19 @@ export const postItemsSoupAstGroupedBody = zod'created_at','updated_at','viewed_updated',+ 'property',]).describe('Sort method for grouped queries (frecency not supported).'),]).optional(),+ sort_property_definition_id: zod+ .uuid()+ .nullish()+ .describe(+ 'Property definition selected for numeric property sorting.'+ ),}).describe('Parameters for fetching one page within a specific group.'))diff --git a/apps/web/src/lib/service-clients/service-storage/graphql/generated/graphql.ts b/apps/web/src/lib/service-clients/service-storage/graphql/generated/graphql.tsindex 4e57602fb1..dc425bc64e 100644--- a/apps/web/src/lib/service-clients/service-storage/graphql/generated/graphql.ts+++ b/apps/web/src/lib/service-clients/service-storage/graphql/generated/graphql.ts@@ -945,6 +945,16 @@ export type GraphqlDatabaseRowLiteral =| { id?: never; include?: never; /** Match the rows of a table. */tableId: string | number; };+/** One named half-open UTC interval. */+export type GraphqlDateBucketRange = {+ /** Exclusive RFC 3339 UTC end; null means positive infinity. */+ end?: string | null | undefined;+ /** Unique group key. */+ key: string;+ /** Inclusive RFC 3339 UTC start; null means negative infinity. */+ start?: string | null | undefined;+};+/** GraphQL input representing the date literal. */export type GraphqlDateLiteral ={ /** The gt option. */@@ -989,8 +999,8 @@ export type GraphqlDocumentLiteral =createdAt: GraphqlDateLiteral; crmAssociated?: never; emailAttachmentParticipant?: never; fileAssoc?: never; fileType?: never; id?: never; importance?: never; includeCbmAtmNc?: never; isEmailAttachment?: never; nameContains?: never; notificationState?: never; owner?: never; projectId?: never; property?: never; subType?: never; updatedAt?: never; }| { createdAt?: never; /*** Associated with a CRM record through its Companies or Contacts- * property or a reference to the record. Requires an expanded,- * timestamp-sorted query.+ * property or a reference to the record. Requires an expanded query+ * sorted by a timestamp or task due date.*/crmAssociated: GraphqlCrmAssociation; emailAttachmentParticipant?: never; fileAssoc?: never; fileType?: never; id?: never; importance?: never; includeCbmAtmNc?: never; isEmailAttachment?: never; nameContains?: never; notificationState?: never; owner?: never; projectId?: never; property?: never; subType?: never; updatedAt?: never; }| { createdAt?: never; crmAssociated?: never; /** Uploaded from an email attachment sent by, or to, a matching address. */@@ -1159,7 +1169,7 @@ export type GraphqlEntityFilterAst = {/*** Restrict every entity type to items associated with this CRM record,* or to activity across visible CRM-enabled teams.- * Requires an expanded, timestamp-sorted query.+ * Requires an expanded query sorted by a timestamp or selected property.*/crmAssociation?: GraphqlCrmAssociation | null | undefined;/** The crm company filter to apply. */@@ -1306,9 +1316,11 @@ export type GraphqlFilterPropertiesLiteral = {/** GraphQL input value used when matching a property. */export type GraphqlFilterPropertyMatchValue =- { /** Entity reference id to match. */+ { /** Match a DATE property in a UTC range. */+ dateRange: GraphqlPropertyDateRange; entityRef?: never; selectOption?: never; }+ | { dateRange?: never; /** Entity reference id to match. */entityRef: string | number; selectOption?: never; }- | { entityRef?: never; /** Select option id to match. */+ | { dateRange?: never; entityRef?: never; /** Select option id to match. */selectOption: string | number; };/** The two operands of a recursive `ForeignEntityFilterExpr` binary expression. */@@ -1470,6 +1482,8 @@ export type GraphqlGroupByField =/** GraphQL representation of a field used to group Soup items. */export type GraphqlGroupByInput = {+ /** Optional caller-defined date ranges; requires PROPERTY grouping. */+ bucketing?: GraphqlPropertyBucketing | null | undefined;/** Optional property entity type restriction. */entityType?: GraphqlPropertyEntityType | null | undefined;/** The kind of grouping to perform. */@@ -1593,6 +1607,24 @@ export type GraphqlProjectLiteral =| { createdAt?: never; importance?: never; notificationState?: never; owner?: never; projectId?: never; projectIdSelf?: never; /** The updated at option. */updatedAt: GraphqlDateLiteral; };+/**+ * Transform the selected DATE property into caller-defined ranges.+ * Non-DATE values use the missing-value bucket.+ */+export type GraphqlPropertyBucketing = {+ /** Key for entities whose selected property is absent or cleared. */+ missingValueBucketKey: string;+ /** Ordered, contiguous UTC ranges covering every present date. */+ ranges: Array<GraphqlDateBucketRange>;+ /** Bucketing transformation. */+ type: GraphqlPropertyBucketingType;+};++/** Supported property-value transformations. */+export type GraphqlPropertyBucketingType =+ /** Caller-defined half-open UTC date ranges. */+ | 'DATE_RANGES';+/** A property definition's supported value type. */export type GraphqlPropertyDataType =/** Boolean true/false values. */@@ -1616,6 +1648,14 @@ export type GraphqlPropertyDataType =/** User- or team-scoped colored labels. */| 'TAG';+/** Explicit UTC bounds for a DATE property. */+export type GraphqlPropertyDateRange = {+ /** Exclusive UTC end, or no upper bound. */+ end?: string | null | undefined;+ /** Inclusive UTC start, or no lower bound. */+ start?: string | null | undefined;+};+/** An entity type supported by the properties domain. */export type GraphqlPropertyEntityType =/** Calendar event entity. */@@ -1757,7 +1797,7 @@ export type GraphqlSharedEmailFilter =/** The only option. */| 'ONLY';-/** GraphQL representation of supported Soup sorts. */+/** GraphQL representation of Soup timestamp, notification, and selected-property sorts. */export type GraphqlSimpleSortMethod =/** Sort by creation timestamp. */| 'CREATED_AT'@@ -1766,6 +1806,12 @@ export type GraphqlSimpleSortMethod =* notified first. Descending `soup` only; not supported by `groupSoup`.*/| 'NOTIFIED_AT'+ /**+ * Sort by the selected property key, missing last, then newest update and ID.+ * Missing definitions and unsupported types use update-time ordering.+ * Email, channels, calls, companies, and agent sessions never appear.+ */+ | 'PROPERTY'/** Sort by update timestamp. */| 'UPDATED_AT'/** Sort by most recently viewed. */@@ -1829,8 +1875,15 @@ export type GroupedSoupInitialInput = {groupBy: GraphqlGroupByInput;/** Maximum number of items to return per bin. Defaults to 20, max 500. */limit?: number | null | undefined;- /** Sort order within each bin. Defaults to `VIEWED_UPDATED`. */+ /** Direction of property values. Defaults to DESC. */+ sortDirection?: GraphqlSortDirection | null | undefined;+ /**+ * Sort order within each bin. Defaults to `VIEWED_UPDATED`.+ * Grouped PROPERTY reads retain calendar events; flat PROPERTY reads do not.+ */sortMethod?: GraphqlSimpleSortMethod | null | undefined;+ /** Property definition selected for numeric property sorting. */+ sortPropertyDefinitionId?: string | number | null | undefined;};/** Input for `Query.groupSoup`. */@@ -2168,10 +2221,13 @@ export type SoupInitialInput = {/** Direction to order the page in. Defaults to DESC. */sortDirection?: GraphqlSortDirection | null | undefined;/**- * Simple timestamp sort. Defaults to VIEWED_AT. Frecency is intentionally- * not supported by this initial GraphQL adapter.+ * Timestamp or selected numeric property sort. Defaults to VIEWED_AT.+ * Frecency is not supported by this GraphQL adapter.+ * Flat PROPERTY reads omit calendar events, email, channels, calls, companies, and agent sessions.*/sortMethod?: GraphqlSimpleSortMethod | null | undefined;+ /** Property definition selected for numeric property sorting. */+ sortPropertyDefinitionId?: string | number | null | undefined;};/** Input for `Query.soup`. */@@ -11853,7 +11909,7 @@ export type GroupSoupQueryVariables = Exact<{}>;-export type GroupSoupQuery = { user: { id: string, groupSoup: { bins: Array<{ key: string, label: string | null, totalCount: number, nextCursor: string | null, items: Array<+export type GroupSoupQuery = { user: { id: string, groupSoup: { bins: Array<{ key: string, displayOrder: number | null, label: string | null, totalCount: number, nextCursor: string | null, items: Array<| { __typename: 'GraphqlSoupAgentSession', cacheProjection: string | null, frecencyScore: number | null, id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, isArchived: boolean, ownerId: string, botId: string, harness: string, repoUrl: string | null, repoBranch: string | null, pullRequestUrl: string | null, workingBranch: string | null, pullRequestState: GraphqlAgentPullRequestState | null, pullRequestId: string | null, turnState: string | null, threadId: string | null, source: GraphqlAgentSessionSource, visibility: GraphqlAgentSessionVisibility, status: string, createdAt: string, updatedAt: string, viewedAt: string | null, sessionName: string, notifications: Array<{ __typename: 'GraphqlNotification', id: string, eventType: string, entityType: GraphqlSoupEntityType, targetEntityType: GraphqlEntityType, entityId: string, sent: boolean, state: NotificationState, createdAt: string, viewedAt: string | null, updatedAt: string, senderId: string | null, metadata:| { __typename: 'GraphqlAgentSessionMentionedMetadata', agentSessionMentionedMentionedBy: string | null, agentSessionMentionedActionId: string, agentSessionMentionedSession: { sessionId: string, sessionName: string, botId: string, botName: string, channelId: string | null, threadId: string | null, announcementMessageId: string | null } }| { __typename: 'GraphqlAgentSessionSettledMetadata', agentSessionSettledTurn: number, agentSessionSettledActor: string | null, agentSessionSettledStopReason: string, agentSessionSettledExcerpt: string | null, agentSessionSettledSession: { sessionId: string, sessionName: string, botId: string, botName: string, channelId: string | null, threadId: string | null, announcementMessageId: string | null } }@@ -21329,7 +21385,7 @@ export const DriveFoldersDocument = {"kind":"Document","definitions":[{"kind":"Oexport const RenameFormDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"RenameForm"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"displayName"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"renameEntities"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"inputs"},"value":{"kind":"ListValue","values":[{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"entity"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"type"},"value":{"kind":"EnumValue","value":"FORM"}},{"kind":"ObjectField","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}]}},{"kind":"ObjectField","name":{"kind":"Name","value":"displayName"},"value":{"kind":"Variable","name":{"kind":"Name","value":"displayName"}}}]}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"results"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"FormEntityMutationResultFields"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"FormEntityMutationResultFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlEntityMutationResult"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlMutationError"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"errorCode"}},{"kind":"Field","name":{"kind":"Name","value":"message"}}]}}]}}]} as unknown as DocumentNode<RenameFormMutation, RenameFormMutationVariables>;export const TrashFormDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"TrashForm"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"trashEntities"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"entities"},"value":{"kind":"ListValue","values":[{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"type"},"value":{"kind":"EnumValue","value":"FORM"}},{"kind":"ObjectField","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}]}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"results"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"FormEntityMutationResultFields"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"FormEntityMutationResultFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlEntityMutationResult"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlMutationError"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"errorCode"}},{"kind":"Field","name":{"kind":"Name","value":"message"}}]}}]}}]} as unknown as DocumentNode<TrashFormMutation, TrashFormMutationVariables>;export const GroupSoupMembershipDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GroupSoupMembership"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"GroupedSoupInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"groupSoup"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"bins"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"totalCount"}},{"kind":"Field","name":{"kind":"Name","value":"nextCursor"}},{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode<GroupSoupMembershipQuery, GroupSoupMembershipQueryVariables>;-export const GroupSoupDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GroupSoup"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"GroupedSoupInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"groupSoup"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"bins"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"totalCount"}},{"kind":"Field","name":{"kind":"Name","value":"nextCursor"}},{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupItemFields"}}]}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupEntityIdentityFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"isFavorited"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupPropertyValueFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlBooleanPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"boolValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNumberPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"numberValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlStringPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"stringValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlDatePropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"dateValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlDateRangePropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"rangeStart"},"name":{"kind":"Name","value":"start"}},{"kind":"Field","alias":{"kind":"Name","value":"rangeEnd"},"name":{"kind":"Name","value":"end"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSelectOptionPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"optionIds"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlEntityReferencePropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"references"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"entityId"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"specificMessageId"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlLinkPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"urls"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupPropertyFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlProperty"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"propertyDefinitionId"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"dataType"}},{"kind":"Field","name":{"kind":"Name","value":"isMultiSelect"}},{"kind":"Field","name":{"kind":"Name","value":"specificEntityType"}},{"kind":"Field","name":{"kind":"Name","value":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"isMetadata"}},{"kind":"Field","name":{"kind":"Name","value":"value"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyValueFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupAgentSessionFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupAgentSession"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"sessionName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"isArchived"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"botId"}},{"kind":"Field","name":{"kind":"Name","value":"harness"}},{"kind":"Field","name":{"kind":"Name","value":"repoUrl"}},{"kind":"Field","name":{"kind":"Name","value":"repoBranch"}},{"kind":"Field","name":{"kind":"Name","value":"pullRequestUrl"}},{"kind":"Field","name":{"kind":"Name","value":"workingBranch"}},{"kind":"Field","name":{"kind":"Name","value":"pullRequestState"}},{"kind":"Field","name":{"kind":"Name","value":"pullRequestId"}},{"kind":"Field","name":{"kind":"Name","value":"turnState"}},{"kind":"Field","name":{"kind":"Name","value":"bot"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"source"}},{"kind":"Field","name":{"kind":"Name","value":"visibility"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"MailPreviewFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlMailPreviewMessage"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"subject"}},{"kind":"Field","name":{"kind":"Name","value":"snippet"}},{"kind":"Field","name":{"kind":"Name","value":"isDraft"}},{"kind":"Field","name":{"kind":"Name","value":"senderEmail"}},{"kind":"Field","name":{"kind":"Name","value":"senderName"}},{"kind":"Field","name":{"kind":"Name","value":"senderPhotoUrl"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"EmailDraftAggregateFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlMailDraftAggregate"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"messageCount"}},{"kind":"Field","name":{"kind":"Name","value":"inboxVisible"}},{"kind":"Field","name":{"kind":"Name","value":"isRead"}},{"kind":"Field","name":{"kind":"Name","value":"isSignal"}},{"kind":"Field","name":{"kind":"Name","value":"hasCalendarAttachment"}},{"kind":"Field","name":{"kind":"Name","value":"latestInboundMessageTs"}},{"kind":"Field","name":{"kind":"Name","value":"latestNonSpamMessageTs"}},{"kind":"Field","name":{"kind":"Name","value":"latestOutboundMessageTs"}},{"kind":"Field","name":{"kind":"Name","value":"previewTs"}},{"kind":"Field","name":{"kind":"Name","value":"preview"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"MailPreviewFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"EmailDraftStateFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlMailDraftState"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"baseline"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"EmailDraftAggregateFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"drafts"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"macroDraft"}},{"kind":"Field","name":{"kind":"Name","value":"facts"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"EmailDraftAggregateFields"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupChannelMessageFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannelMessagePreview"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"messageId"}},{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"senderId"}},{"kind":"Field","name":{"kind":"Name","value":"content"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"mentions"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"GraphqlCrmContactFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupCrmContact"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","alias":{"kind":"Name","value":"contactTeamId"},"name":{"kind":"Name","value":"teamId"}},{"kind":"Field","name":{"kind":"Name","value":"companyId"}},{"kind":"Field","name":{"kind":"Name","value":"companyName"}},{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","alias":{"kind":"Name","value":"crmContactName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"hidden"}},{"kind":"Field","name":{"kind":"Name","value":"firstInteraction"}},{"kind":"Field","name":{"kind":"Name","value":"lastInteraction"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupItemPreviewFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"cacheProjection"},"directives":[{"kind":"Directive","name":{"kind":"Name","value":"cacheOnly"}}]},{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupEntityIdentityFields"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupAgentSessionFields"}},{"kind":"Field","name":{"kind":"Name","value":"frecencyScore"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupDatabaseRow"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"tableId"}},{"kind":"Field","name":{"kind":"Name","value":"databaseId"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"creatorId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupInitiative"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"viewerPermission"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlAccessLevelPermission"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"accessLevel"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupDocument"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"documentName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"fileType"}},{"kind":"Field","name":{"kind":"Name","value":"projectId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"subType"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlTaskSubType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"isCompleted"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChat"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"chatName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"model"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"projectId"}},{"kind":"Field","name":{"kind":"Name","value":"isPersistent"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupProject"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"projectName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"parentId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEmailThread"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"providerId"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"inboxVisible"}},{"kind":"Field","name":{"kind":"Name","value":"hasReceivedMail"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","name":{"kind":"Name","value":"latestInboundMessageTs"}},{"kind":"Field","name":{"kind":"Name","value":"latestOutboundMessageTs"}},{"kind":"Field","name":{"kind":"Name","value":"latestNonSpamMessageTs"}},{"kind":"Field","name":{"kind":"Name","value":"reminderReturnedAt"}},{"kind":"Field","name":{"kind":"Name","value":"mailDraftState"},"directives":[{"kind":"Directive","name":{"kind":"Name","value":"cacheOnly"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"EmailDraftStateFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"mailAllPreview"},"directives":[{"kind":"Directive","name":{"kind":"Name","value":"cacheOnly"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"MailPreviewFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"mailDraftPreview"},"directives":[{"kind":"Directive","name":{"kind":"Name","value":"cacheOnly"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"MailPreviewFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"mailSentPreview"},"directives":[{"kind":"Directive","name":{"kind":"Name","value":"cacheOnly"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"MailPreviewFields"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"emailName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"snippet"}},{"kind":"Field","name":{"kind":"Name","value":"senderEmail"}},{"kind":"Field","name":{"kind":"Name","value":"senderName"}},{"kind":"Field","name":{"kind":"Name","value":"senderPhotoUrl"}},{"kind":"Field","name":{"kind":"Name","value":"isRead"}},{"kind":"Field","name":{"kind":"Name","value":"isDraft"}},{"kind":"Field","name":{"kind":"Name","value":"isImportant"}},{"kind":"Field","name":{"kind":"Name","value":"isSignal"}},{"kind":"Field","name":{"kind":"Name","value":"projectId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","alias":{"kind":"Name","value":"participants"},"name":{"kind":"Name","value":"senders"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"contactId"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"sfsPhotoUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"attachments"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"messageId"}},{"kind":"Field","name":{"kind":"Name","value":"providerAttachmentId"}},{"kind":"Field","name":{"kind":"Name","value":"filename"}},{"kind":"Field","name":{"kind":"Name","value":"mimeType"}},{"kind":"Field","name":{"kind":"Name","value":"sizeBytes"}},{"kind":"Field","name":{"kind":"Name","value":"contentId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"labels"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","name":{"kind":"Name","value":"providerLabelId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"messageListVisibility"}},{"kind":"Field","name":{"kind":"Name","value":"labelListVisibility"}},{"kind":"Field","name":{"kind":"Name","value":"type"}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannel"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"channelType"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"organizationId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelTeamId"},"name":{"kind":"Name","value":"teamId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"interactedAt"}},{"kind":"Field","name":{"kind":"Name","value":"isParticipant"}},{"kind":"Field","name":{"kind":"Name","value":"participants"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"userId"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"joinedAt"}},{"kind":"Field","name":{"kind":"Name","value":"leftAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"latestMessage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupChannelMessageFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"latestNonThreadMessage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupChannelMessageFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannelMessage"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"senderId"}},{"kind":"Field","name":{"kind":"Name","value":"content"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"effectiveUpdatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"replyCount"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupCall"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"callChannelId"},"name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"channelName"}},{"kind":"Field","name":{"kind":"Name","value":"createdBy"}},{"kind":"Field","name":{"kind":"Name","value":"customName"}},{"kind":"Field","name":{"kind":"Name","value":"summary"}},{"kind":"Field","name":{"kind":"Name","value":"startedAt"}},{"kind":"Field","name":{"kind":"Name","value":"endedAt"}},{"kind":"Field","name":{"kind":"Name","value":"durationMs"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"attended"}},{"kind":"Field","name":{"kind":"Name","value":"participants"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"userId"}},{"kind":"Field","name":{"kind":"Name","value":"joinedAt"}},{"kind":"Field","name":{"kind":"Name","value":"leftAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"guests"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"joinedAt"}},{"kind":"Field","name":{"kind":"Name","value":"leftAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"GraphqlCrmContactFields"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupCrmCompany"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"crmTeamId"},"name":{"kind":"Name","value":"teamId"}},{"kind":"Field","alias":{"kind":"Name","value":"crmCompanyName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"emailSync"}},{"kind":"Field","name":{"kind":"Name","value":"hidden"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"domains"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupForeignEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","name":{"kind":"Name","value":"foreignEntitySource"}},{"kind":"Field","name":{"kind":"Name","value":"storedForId"}},{"kind":"Field","name":{"kind":"Name","value":"storedForAuthEntity"}},{"kind":"Field","name":{"kind":"Name","value":"sourceMetadata"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupCalendarEvent"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"calendarEventTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventStatus"},"name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"time"}},{"kind":"Field","name":{"kind":"Name","value":"conferenceUrl"}},{"kind":"Field","name":{"kind":"Name","value":"isReadOnly"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupNotificationStateFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNotification"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"eventType"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"targetEntityType"}},{"kind":"Field","name":{"kind":"Name","value":"entityId"}},{"kind":"Field","name":{"kind":"Name","value":"sent"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"senderId"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupNotificationNavigationMetadataFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNotifEvent"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlExternalChatMessageMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"externalChatProvider"},"name":{"kind":"Name","value":"provider"}},{"kind":"Field","alias":{"kind":"Name","value":"externalChatName"},"name":{"kind":"Name","value":"chatName"}},{"kind":"Field","alias":{"kind":"Name","value":"externalChatMessageId"},"name":{"kind":"Name","value":"messageId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelMentionMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelMentionMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMentionMessageContent"},"name":{"kind":"Name","value":"messageContent"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMentionThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMentionChannelType"},"name":{"kind":"Name","value":"channelType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlDocumentMentionMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"documentMentionDocumentName"},"name":{"kind":"Name","value":"documentName"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionFileType"},"name":{"kind":"Name","value":"fileType"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionSubType"},"name":{"kind":"Name","value":"subType"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionMessageContent"},"name":{"kind":"Name","value":"messageContent"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionHasAttachments"},"name":{"kind":"Name","value":"hasAttachments"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionChannelType"},"name":{"kind":"Name","value":"channelType"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionChannelName"},"name":{"kind":"Name","value":"channelName"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlMentionedInDocumentCommentMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentDocumentName"},"name":{"kind":"Name","value":"documentName"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentFileType"},"name":{"kind":"Name","value":"fileType"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentSubType"},"name":{"kind":"Name","value":"subType"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentMentionId"},"name":{"kind":"Name","value":"mentionId"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentCommentId"},"name":{"kind":"Name","value":"commentId"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentText"},"name":{"kind":"Name","value":"text"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlRepliedToDocumentCommentThreadMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadDocumentName"},"name":{"kind":"Name","value":"documentName"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadFileType"},"name":{"kind":"Name","value":"fileType"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadSubType"},"name":{"kind":"Name","value":"subType"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadCommentId"},"name":{"kind":"Name","value":"commentId"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadText"},"name":{"kind":"Name","value":"text"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlEntityAccessRequestedMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"entityAccessRequestedRequestId"},"name":{"kind":"Name","value":"requestId"}},{"kind":"Field","alias":{"kind":"Name","value":"entityAccessRequestedRevision"},"name":{"kind":"Name","value":"revision"}},{"kind":"Field","alias":{"kind":"Name","value":"entityAccessRequestedEntityName"},"name":{"kind":"Name","value":"entityName"}},{"kind":"Field","alias":{"kind":"Name","value":"entityAccessRequestedFileType"},"name":{"kind":"Name","value":"fileType"}},{"kind":"Field","alias":{"kind":"Name","value":"entityAccessRequestedAccessLevel"},"name":{"kind":"Name","value":"accessLevel"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlEntityAccessGrantedMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"entityAccessGrantedRequestId"},"name":{"kind":"Name","value":"requestId"}},{"kind":"Field","alias":{"kind":"Name","value":"entityAccessGrantedRevision"},"name":{"kind":"Name","value":"revision"}},{"kind":"Field","alias":{"kind":"Name","value":"entityAccessGrantedEntityName"},"name":{"kind":"Name","value":"entityName"}},{"kind":"Field","alias":{"kind":"Name","value":"entityAccessGrantedFileType"},"name":{"kind":"Name","value":"fileType"}},{"kind":"Field","alias":{"kind":"Name","value":"entityAccessGrantedAccessLevel"},"name":{"kind":"Name","value":"accessLevel"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlCommentedOnDocumentMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentDocumentName"},"name":{"kind":"Name","value":"documentName"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentFileType"},"name":{"kind":"Name","value":"fileType"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentSubType"},"name":{"kind":"Name","value":"subType"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentCommentId"},"name":{"kind":"Name","value":"commentId"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentText"},"name":{"kind":"Name","value":"text"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlInitiativeDiscussionMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionProjectName"},"name":{"kind":"Name","value":"projectName"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionReason"},"name":{"kind":"Name","value":"reason"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionText"},"name":{"kind":"Name","value":"text"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlCrmDiscussionMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionRecordName"},"name":{"kind":"Name","value":"recordName"}},{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionReason"},"name":{"kind":"Name","value":"reason"}},{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionText"},"name":{"kind":"Name","value":"text"}},{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}},{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelInviteMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelInviteInvitedBy"},"name":{"kind":"Name","value":"invitedBy"}},{"kind":"Field","alias":{"kind":"Name","value":"channelInviteChannelName"},"name":{"kind":"Name","value":"channelName"}},{"kind":"Field","alias":{"kind":"Name","value":"channelInviteMessageContent"},"name":{"kind":"Name","value":"messageContent"}},{"kind":"Field","alias":{"kind":"Name","value":"channelInviteSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelMessageSendMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelMessageSendSender"},"name":{"kind":"Name","value":"sender"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageSendMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageSendChannelType"},"name":{"kind":"Name","value":"channelType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelMessageReactionMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionMessageContent"},"name":{"kind":"Name","value":"messageContent"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionEmoji"},"name":{"kind":"Name","value":"emoji"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionChannelType"},"name":{"kind":"Name","value":"channelType"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionChannelName"},"name":{"kind":"Name","value":"channelName"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelReplyMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelReplyThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplyMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplyUserId"},"name":{"kind":"Name","value":"userId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplyMessageContent"},"name":{"kind":"Name","value":"messageContent"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplyThreadParentSenderId"},"name":{"kind":"Name","value":"threadParentSenderId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplyChannelType"},"name":{"kind":"Name","value":"channelType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlCallStartedMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"callStartedChannelName"},"name":{"kind":"Name","value":"channelName"}},{"kind":"Field","alias":{"kind":"Name","value":"callStartedSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNewEmailMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"newEmailSender"},"name":{"kind":"Name","value":"sender"}},{"kind":"Field","alias":{"kind":"Name","value":"newEmailToEmail"},"name":{"kind":"Name","value":"toEmail"}},{"kind":"Field","alias":{"kind":"Name","value":"newEmailThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"newEmailSubject"},"name":{"kind":"Name","value":"subject"}},{"kind":"Field","alias":{"kind":"Name","value":"newEmailSnippet"},"name":{"kind":"Name","value":"snippet"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlInboxReauthRequiredMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"inboxReauthRequiredEmailAddress"},"name":{"kind":"Name","value":"emailAddress"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlInviteToTeamMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"inviteToTeamTeamName"},"name":{"kind":"Name","value":"teamName"}},{"kind":"Field","alias":{"kind":"Name","value":"inviteToTeamTeamId"},"name":{"kind":"Name","value":"teamId"}},{"kind":"Field","alias":{"kind":"Name","value":"inviteToTeamTeamInviteId"},"name":{"kind":"Name","value":"teamInviteId"}},{"kind":"Field","alias":{"kind":"Name","value":"inviteToTeamInvitedBy"},"name":{"kind":"Name","value":"invitedBy"}},{"kind":"Field","alias":{"kind":"Name","value":"inviteToTeamRole"},"name":{"kind":"Name","value":"role"}},{"kind":"Field","alias":{"kind":"Name","value":"inviteToTeamSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlTaskAssignedMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"taskAssignedTaskId"},"name":{"kind":"Name","value":"taskId"}},{"kind":"Field","alias":{"kind":"Name","value":"taskAssignedTaskName"},"name":{"kind":"Name","value":"taskName"}},{"kind":"Field","alias":{"kind":"Name","value":"taskAssignedSubType"},"name":{"kind":"Name","value":"subType"}},{"kind":"Field","alias":{"kind":"Name","value":"taskAssignedAssignedBy"},"name":{"kind":"Name","value":"assignedBy"}},{"kind":"Field","alias":{"kind":"Name","value":"taskAssignedSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlReminderMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"reminderReminderId"},"name":{"kind":"Name","value":"reminderId"}},{"kind":"Field","alias":{"kind":"Name","value":"reminderDescription"},"name":{"kind":"Name","value":"description"}},{"kind":"Field","alias":{"kind":"Name","value":"reminderScheduledFor"},"name":{"kind":"Name","value":"scheduledFor"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlCalendarEventReminderMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderEventId"},"name":{"kind":"Name","value":"eventId"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderOccurrenceKey"},"name":{"kind":"Name","value":"occurrenceKey"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderStartsAt"},"name":{"kind":"Name","value":"startsAt"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderEndsAt"},"name":{"kind":"Name","value":"endsAt"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderStartDate"},"name":{"kind":"Name","value":"startDate"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderTimeZone"},"name":{"kind":"Name","value":"timeZone"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderMinutesBefore"},"name":{"kind":"Name","value":"minutesBefore"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlCalendarEventJoinRequestMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"calendarEventJoinRequestRequestId"},"name":{"kind":"Name","value":"requestId"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventJoinRequestEventId"},"name":{"kind":"Name","value":"eventId"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventJoinRequestTitle"},"name":{"kind":"Name","value":"title"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlAiResponseMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"aiResponseSummary"},"name":{"kind":"Name","value":"summary"}},{"kind":"Field","alias":{"kind":"Name","value":"aiResponseMessageId"},"name":{"kind":"Name","value":"messageId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlGithubPrStatusChangedMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedForeignEntityId"},"name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedGithubKey"},"name":{"kind":"Name","value":"githubKey"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedRepo"},"name":{"kind":"Name","value":"repo"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedNumber"},"name":{"kind":"Name","value":"number"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedUrl"},"name":{"kind":"Name","value":"url"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedDisplayName"},"name":{"kind":"Name","value":"displayName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedSenderGithubLogin"},"name":{"kind":"Name","value":"senderGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedSenderGithubUserId"},"name":{"kind":"Name","value":"senderGithubUserId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedSenderGithubAvatarUrl"},"name":{"kind":"Name","value":"senderGithubAvatarUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedStatus"},"name":{"kind":"Name","value":"status"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedAction"},"name":{"kind":"Name","value":"action"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedPreviousStatus"},"name":{"kind":"Name","value":"previousStatus"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedHeadBranch"},"name":{"kind":"Name","value":"headBranch"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedBaseBranch"},"name":{"kind":"Name","value":"baseBranch"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedMergedAt"},"name":{"kind":"Name","value":"mergedAt"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlGithubPrCheckRunMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunForeignEntityId"},"name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunGithubKey"},"name":{"kind":"Name","value":"githubKey"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunRepo"},"name":{"kind":"Name","value":"repo"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunNumber"},"name":{"kind":"Name","value":"number"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunUrl"},"name":{"kind":"Name","value":"url"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunDisplayName"},"name":{"kind":"Name","value":"displayName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunSenderGithubLogin"},"name":{"kind":"Name","value":"senderGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunSenderGithubUserId"},"name":{"kind":"Name","value":"senderGithubUserId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunSenderGithubAvatarUrl"},"name":{"kind":"Name","value":"senderGithubAvatarUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunCheckRunGithubId"},"name":{"kind":"Name","value":"checkRunGithubId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunCheckName"},"name":{"kind":"Name","value":"checkName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunCheckStatus"},"name":{"kind":"Name","value":"checkStatus"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunConclusion"},"name":{"kind":"Name","value":"conclusion"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunState"},"name":{"kind":"Name","value":"state"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunCheckUrl"},"name":{"kind":"Name","value":"checkUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunCompletedAt"},"name":{"kind":"Name","value":"completedAt"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlGithubReviewRequestedMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedForeignEntityId"},"name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedGithubKey"},"name":{"kind":"Name","value":"githubKey"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedRepo"},"name":{"kind":"Name","value":"repo"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedNumber"},"name":{"kind":"Name","value":"number"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedUrl"},"name":{"kind":"Name","value":"url"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedDisplayName"},"name":{"kind":"Name","value":"displayName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedSenderGithubLogin"},"name":{"kind":"Name","value":"senderGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedSenderGithubUserId"},"name":{"kind":"Name","value":"senderGithubUserId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedSenderGithubAvatarUrl"},"name":{"kind":"Name","value":"senderGithubAvatarUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedRequestedReviewerGithubLogin"},"name":{"kind":"Name","value":"requestedReviewerGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedRequestedReviewerGithubUserId"},"name":{"kind":"Name","value":"requestedReviewerGithubUserId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlGithubPrCommentMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentForeignEntityId"},"name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentGithubKey"},"name":{"kind":"Name","value":"githubKey"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentRepo"},"name":{"kind":"Name","value":"repo"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentNumber"},"name":{"kind":"Name","value":"number"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentUrl"},"name":{"kind":"Name","value":"url"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentDisplayName"},"name":{"kind":"Name","value":"displayName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentSenderGithubLogin"},"name":{"kind":"Name","value":"senderGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentSenderGithubUserId"},"name":{"kind":"Name","value":"senderGithubUserId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentSenderGithubAvatarUrl"},"name":{"kind":"Name","value":"senderGithubAvatarUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentCommentKind"},"name":{"kind":"Name","value":"commentKind"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentCommentGithubId"},"name":{"kind":"Name","value":"commentGithubId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentCommentUrl"},"name":{"kind":"Name","value":"commentUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentCommentSnippet"},"name":{"kind":"Name","value":"commentSnippet"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlGithubPrMentionMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionForeignEntityId"},"name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionGithubKey"},"name":{"kind":"Name","value":"githubKey"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionRepo"},"name":{"kind":"Name","value":"repo"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionNumber"},"name":{"kind":"Name","value":"number"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionUrl"},"name":{"kind":"Name","value":"url"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionDisplayName"},"name":{"kind":"Name","value":"displayName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionSenderGithubLogin"},"name":{"kind":"Name","value":"senderGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionSenderGithubUserId"},"name":{"kind":"Name","value":"senderGithubUserId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionSenderGithubAvatarUrl"},"name":{"kind":"Name","value":"senderGithubAvatarUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionLocation"},"name":{"kind":"Name","value":"location"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionCommentGithubId"},"name":{"kind":"Name","value":"commentGithubId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionCommentUrl"},"name":{"kind":"Name","value":"commentUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionTextSnippet"},"name":{"kind":"Name","value":"textSnippet"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlGithubPrReviewMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewForeignEntityId"},"name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewGithubKey"},"name":{"kind":"Name","value":"githubKey"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewRepo"},"name":{"kind":"Name","value":"repo"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewNumber"},"name":{"kind":"Name","value":"number"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewUrl"},"name":{"kind":"Name","value":"url"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewDisplayName"},"name":{"kind":"Name","value":"displayName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewSenderGithubLogin"},"name":{"kind":"Name","value":"senderGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewSenderGithubUserId"},"name":{"kind":"Name","value":"senderGithubUserId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewSenderGithubAvatarUrl"},"name":{"kind":"Name","value":"senderGithubAvatarUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewReviewGithubId"},"name":{"kind":"Name","value":"reviewGithubId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewReviewUrl"},"name":{"kind":"Name","value":"reviewUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewState"},"name":{"kind":"Name","value":"state"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewReviewSnippet"},"name":{"kind":"Name","value":"reviewSnippet"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlAgentSessionSettledMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"agentSessionSettledSession"},"name":{"kind":"Name","value":"session"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"sessionId"}},{"kind":"Field","name":{"kind":"Name","value":"sessionName"}},{"kind":"Field","name":{"kind":"Name","value":"botId"}},{"kind":"Field","name":{"kind":"Name","value":"botName"}},{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"announcementMessageId"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionSettledTurn"},"name":{"kind":"Name","value":"turn"}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionSettledActor"},"name":{"kind":"Name","value":"actor"}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionSettledStopReason"},"name":{"kind":"Name","value":"stopReason"}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionSettledExcerpt"},"name":{"kind":"Name","value":"excerpt"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlAgentSessionWaitingForInputMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"agentSessionWaitingForInputSession"},"name":{"kind":"Name","value":"session"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"sessionId"}},{"kind":"Field","name":{"kind":"Name","value":"sessionName"}},{"kind":"Field","name":{"kind":"Name","value":"botId"}},{"kind":"Field","name":{"kind":"Name","value":"botName"}},{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"announcementMessageId"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionWaitingForInputTurn"},"name":{"kind":"Name","value":"turn"}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionWaitingForInputQuestion"},"name":{"kind":"Name","value":"question"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlAgentSessionMentionedMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"agentSessionMentionedSession"},"name":{"kind":"Name","value":"session"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"sessionId"}},{"kind":"Field","name":{"kind":"Name","value":"sessionName"}},{"kind":"Field","name":{"kind":"Name","value":"botId"}},{"kind":"Field","name":{"kind":"Name","value":"botName"}},{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"announcementMessageId"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionMentionedMentionedBy"},"name":{"kind":"Name","value":"mentionedBy"}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionMentionedActionId"},"name":{"kind":"Name","value":"actionId"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupNotificationMetadataFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNotifEvent"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupNotificationNavigationMetadataFields"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelMentionMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelMentionHasAttachments"},"name":{"kind":"Name","value":"hasAttachments"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMentionSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMentionChannelName"},"name":{"kind":"Name","value":"channelName"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMentionSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelMessageSendMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelMessageSendMessageContent"},"name":{"kind":"Name","value":"messageContent"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageSendHasAttachments"},"name":{"kind":"Name","value":"hasAttachments"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageSendSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageSendChannelName"},"name":{"kind":"Name","value":"channelName"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageSendSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelReplyMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelReplyHasAttachments"},"name":{"kind":"Name","value":"hasAttachments"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplySenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplyChannelName"},"name":{"kind":"Name","value":"channelName"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplySenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupNotificationFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNotification"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupNotificationStateFields"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupNotificationMetadataFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupItemFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupItemPreviewFields"}},{"kind":"Field","name":{"kind":"Name","value":"notifications"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupNotificationFields"}}]}}]}}]} as unknown as DocumentNode<GroupSoupQuery, GroupSoupQueryVariables>;+export const GroupSoupDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GroupSoup"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"GroupedSoupInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"groupSoup"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"bins"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"displayOrder"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"totalCount"}},{"kind":"Field","name":{"kind":"Name","value":"nextCursor"}},{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupItemFields"}}]}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupEntityIdentityFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"isFavorited"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupPropertyValueFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlBooleanPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"boolValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNumberPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"numberValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlStringPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"stringValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlDatePropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"dateValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlDateRangePropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"rangeStart"},"name":{"kind":"Name","value":"start"}},{"kind":"Field","alias":{"kind":"Name","value":"rangeEnd"},"name":{"kind":"Name","value":"end"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSelectOptionPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"optionIds"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlEntityReferencePropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"references"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"entityId"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"specificMessageId"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlLinkPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"urls"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupPropertyFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlProperty"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"propertyDefinitionId"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"dataType"}},{"kind":"Field","name":{"kind":"Name","value":"isMultiSelect"}},{"kind":"Field","name":{"kind":"Name","value":"specificEntityType"}},{"kind":"Field","name":{"kind":"Name","value":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"isMetadata"}},{"kind":"Field","name":{"kind":"Name","value":"value"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyValueFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupAgentSessionFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupAgentSession"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"sessionName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"isArchived"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"botId"}},{"kind":"Field","name":{"kind":"Name","value":"harness"}},{"kind":"Field","name":{"kind":"Name","value":"repoUrl"}},{"kind":"Field","name":{"kind":"Name","value":"repoBranch"}},{"kind":"Field","name":{"kind":"Name","value":"pullRequestUrl"}},{"kind":"Field","name":{"kind":"Name","value":"workingBranch"}},{"kind":"Field","name":{"kind":"Name","value":"pullRequestState"}},{"kind":"Field","name":{"kind":"Name","value":"pullRequestId"}},{"kind":"Field","name":{"kind":"Name","value":"turnState"}},{"kind":"Field","name":{"kind":"Name","value":"bot"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"source"}},{"kind":"Field","name":{"kind":"Name","value":"visibility"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"MailPreviewFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlMailPreviewMessage"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"subject"}},{"kind":"Field","name":{"kind":"Name","value":"snippet"}},{"kind":"Field","name":{"kind":"Name","value":"isDraft"}},{"kind":"Field","name":{"kind":"Name","value":"senderEmail"}},{"kind":"Field","name":{"kind":"Name","value":"senderName"}},{"kind":"Field","name":{"kind":"Name","value":"senderPhotoUrl"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"EmailDraftAggregateFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlMailDraftAggregate"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"messageCount"}},{"kind":"Field","name":{"kind":"Name","value":"inboxVisible"}},{"kind":"Field","name":{"kind":"Name","value":"isRead"}},{"kind":"Field","name":{"kind":"Name","value":"isSignal"}},{"kind":"Field","name":{"kind":"Name","value":"hasCalendarAttachment"}},{"kind":"Field","name":{"kind":"Name","value":"latestInboundMessageTs"}},{"kind":"Field","name":{"kind":"Name","value":"latestNonSpamMessageTs"}},{"kind":"Field","name":{"kind":"Name","value":"latestOutboundMessageTs"}},{"kind":"Field","name":{"kind":"Name","value":"previewTs"}},{"kind":"Field","name":{"kind":"Name","value":"preview"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"MailPreviewFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"EmailDraftStateFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlMailDraftState"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"baseline"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"EmailDraftAggregateFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"drafts"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"macroDraft"}},{"kind":"Field","name":{"kind":"Name","value":"facts"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"EmailDraftAggregateFields"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupChannelMessageFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannelMessagePreview"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"messageId"}},{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"senderId"}},{"kind":"Field","name":{"kind":"Name","value":"content"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"mentions"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"GraphqlCrmContactFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupCrmContact"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","alias":{"kind":"Name","value":"contactTeamId"},"name":{"kind":"Name","value":"teamId"}},{"kind":"Field","name":{"kind":"Name","value":"companyId"}},{"kind":"Field","name":{"kind":"Name","value":"companyName"}},{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","alias":{"kind":"Name","value":"crmContactName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"hidden"}},{"kind":"Field","name":{"kind":"Name","value":"firstInteraction"}},{"kind":"Field","name":{"kind":"Name","value":"lastInteraction"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupItemPreviewFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"cacheProjection"},"directives":[{"kind":"Directive","name":{"kind":"Name","value":"cacheOnly"}}]},{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupEntityIdentityFields"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupAgentSessionFields"}},{"kind":"Field","name":{"kind":"Name","value":"frecencyScore"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupDatabaseRow"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"tableId"}},{"kind":"Field","name":{"kind":"Name","value":"databaseId"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"creatorId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupInitiative"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"viewerPermission"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlAccessLevelPermission"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"accessLevel"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupDocument"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"documentName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"fileType"}},{"kind":"Field","name":{"kind":"Name","value":"projectId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"subType"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlTaskSubType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"isCompleted"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChat"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"chatName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"model"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"projectId"}},{"kind":"Field","name":{"kind":"Name","value":"isPersistent"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupProject"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"projectName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"parentId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEmailThread"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"providerId"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"inboxVisible"}},{"kind":"Field","name":{"kind":"Name","value":"hasReceivedMail"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","name":{"kind":"Name","value":"latestInboundMessageTs"}},{"kind":"Field","name":{"kind":"Name","value":"latestOutboundMessageTs"}},{"kind":"Field","name":{"kind":"Name","value":"latestNonSpamMessageTs"}},{"kind":"Field","name":{"kind":"Name","value":"reminderReturnedAt"}},{"kind":"Field","name":{"kind":"Name","value":"mailDraftState"},"directives":[{"kind":"Directive","name":{"kind":"Name","value":"cacheOnly"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"EmailDraftStateFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"mailAllPreview"},"directives":[{"kind":"Directive","name":{"kind":"Name","value":"cacheOnly"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"MailPreviewFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"mailDraftPreview"},"directives":[{"kind":"Directive","name":{"kind":"Name","value":"cacheOnly"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"MailPreviewFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"mailSentPreview"},"directives":[{"kind":"Directive","name":{"kind":"Name","value":"cacheOnly"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"MailPreviewFields"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"emailName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"snippet"}},{"kind":"Field","name":{"kind":"Name","value":"senderEmail"}},{"kind":"Field","name":{"kind":"Name","value":"senderName"}},{"kind":"Field","name":{"kind":"Name","value":"senderPhotoUrl"}},{"kind":"Field","name":{"kind":"Name","value":"isRead"}},{"kind":"Field","name":{"kind":"Name","value":"isDraft"}},{"kind":"Field","name":{"kind":"Name","value":"isImportant"}},{"kind":"Field","name":{"kind":"Name","value":"isSignal"}},{"kind":"Field","name":{"kind":"Name","value":"projectId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","alias":{"kind":"Name","value":"participants"},"name":{"kind":"Name","value":"senders"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"contactId"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"sfsPhotoUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"attachments"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"messageId"}},{"kind":"Field","name":{"kind":"Name","value":"providerAttachmentId"}},{"kind":"Field","name":{"kind":"Name","value":"filename"}},{"kind":"Field","name":{"kind":"Name","value":"mimeType"}},{"kind":"Field","name":{"kind":"Name","value":"sizeBytes"}},{"kind":"Field","name":{"kind":"Name","value":"contentId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"labels"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","name":{"kind":"Name","value":"providerLabelId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"messageListVisibility"}},{"kind":"Field","name":{"kind":"Name","value":"labelListVisibility"}},{"kind":"Field","name":{"kind":"Name","value":"type"}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannel"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"channelType"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"organizationId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelTeamId"},"name":{"kind":"Name","value":"teamId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"interactedAt"}},{"kind":"Field","name":{"kind":"Name","value":"isParticipant"}},{"kind":"Field","name":{"kind":"Name","value":"participants"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"userId"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"joinedAt"}},{"kind":"Field","name":{"kind":"Name","value":"leftAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"latestMessage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupChannelMessageFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"latestNonThreadMessage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupChannelMessageFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannelMessage"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"senderId"}},{"kind":"Field","name":{"kind":"Name","value":"content"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"effectiveUpdatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"replyCount"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupCall"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"callChannelId"},"name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"channelName"}},{"kind":"Field","name":{"kind":"Name","value":"createdBy"}},{"kind":"Field","name":{"kind":"Name","value":"customName"}},{"kind":"Field","name":{"kind":"Name","value":"summary"}},{"kind":"Field","name":{"kind":"Name","value":"startedAt"}},{"kind":"Field","name":{"kind":"Name","value":"endedAt"}},{"kind":"Field","name":{"kind":"Name","value":"durationMs"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"attended"}},{"kind":"Field","name":{"kind":"Name","value":"participants"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"userId"}},{"kind":"Field","name":{"kind":"Name","value":"joinedAt"}},{"kind":"Field","name":{"kind":"Name","value":"leftAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"guests"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"joinedAt"}},{"kind":"Field","name":{"kind":"Name","value":"leftAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"GraphqlCrmContactFields"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupCrmCompany"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"crmTeamId"},"name":{"kind":"Name","value":"teamId"}},{"kind":"Field","alias":{"kind":"Name","value":"crmCompanyName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"emailSync"}},{"kind":"Field","name":{"kind":"Name","value":"hidden"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"domains"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupForeignEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","name":{"kind":"Name","value":"foreignEntitySource"}},{"kind":"Field","name":{"kind":"Name","value":"storedForId"}},{"kind":"Field","name":{"kind":"Name","value":"storedForAuthEntity"}},{"kind":"Field","name":{"kind":"Name","value":"sourceMetadata"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupCalendarEvent"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"calendarEventTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventStatus"},"name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"time"}},{"kind":"Field","name":{"kind":"Name","value":"conferenceUrl"}},{"kind":"Field","name":{"kind":"Name","value":"isReadOnly"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupNotificationStateFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNotification"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"eventType"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"targetEntityType"}},{"kind":"Field","name":{"kind":"Name","value":"entityId"}},{"kind":"Field","name":{"kind":"Name","value":"sent"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"senderId"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupNotificationNavigationMetadataFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNotifEvent"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlExternalChatMessageMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"externalChatProvider"},"name":{"kind":"Name","value":"provider"}},{"kind":"Field","alias":{"kind":"Name","value":"externalChatName"},"name":{"kind":"Name","value":"chatName"}},{"kind":"Field","alias":{"kind":"Name","value":"externalChatMessageId"},"name":{"kind":"Name","value":"messageId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelMentionMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelMentionMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMentionMessageContent"},"name":{"kind":"Name","value":"messageContent"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMentionThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMentionChannelType"},"name":{"kind":"Name","value":"channelType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlDocumentMentionMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"documentMentionDocumentName"},"name":{"kind":"Name","value":"documentName"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionFileType"},"name":{"kind":"Name","value":"fileType"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionSubType"},"name":{"kind":"Name","value":"subType"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionMessageContent"},"name":{"kind":"Name","value":"messageContent"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionHasAttachments"},"name":{"kind":"Name","value":"hasAttachments"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionChannelType"},"name":{"kind":"Name","value":"channelType"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionChannelName"},"name":{"kind":"Name","value":"channelName"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlMentionedInDocumentCommentMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentDocumentName"},"name":{"kind":"Name","value":"documentName"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentFileType"},"name":{"kind":"Name","value":"fileType"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentSubType"},"name":{"kind":"Name","value":"subType"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentMentionId"},"name":{"kind":"Name","value":"mentionId"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentCommentId"},"name":{"kind":"Name","value":"commentId"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentText"},"name":{"kind":"Name","value":"text"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlRepliedToDocumentCommentThreadMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadDocumentName"},"name":{"kind":"Name","value":"documentName"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadFileType"},"name":{"kind":"Name","value":"fileType"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadSubType"},"name":{"kind":"Name","value":"subType"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadCommentId"},"name":{"kind":"Name","value":"commentId"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadText"},"name":{"kind":"Name","value":"text"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlEntityAccessRequestedMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"entityAccessRequestedRequestId"},"name":{"kind":"Name","value":"requestId"}},{"kind":"Field","alias":{"kind":"Name","value":"entityAccessRequestedRevision"},"name":{"kind":"Name","value":"revision"}},{"kind":"Field","alias":{"kind":"Name","value":"entityAccessRequestedEntityName"},"name":{"kind":"Name","value":"entityName"}},{"kind":"Field","alias":{"kind":"Name","value":"entityAccessRequestedFileType"},"name":{"kind":"Name","value":"fileType"}},{"kind":"Field","alias":{"kind":"Name","value":"entityAccessRequestedAccessLevel"},"name":{"kind":"Name","value":"accessLevel"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlEntityAccessGrantedMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"entityAccessGrantedRequestId"},"name":{"kind":"Name","value":"requestId"}},{"kind":"Field","alias":{"kind":"Name","value":"entityAccessGrantedRevision"},"name":{"kind":"Name","value":"revision"}},{"kind":"Field","alias":{"kind":"Name","value":"entityAccessGrantedEntityName"},"name":{"kind":"Name","value":"entityName"}},{"kind":"Field","alias":{"kind":"Name","value":"entityAccessGrantedFileType"},"name":{"kind":"Name","value":"fileType"}},{"kind":"Field","alias":{"kind":"Name","value":"entityAccessGrantedAccessLevel"},"name":{"kind":"Name","value":"accessLevel"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlCommentedOnDocumentMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentDocumentName"},"name":{"kind":"Name","value":"documentName"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentFileType"},"name":{"kind":"Name","value":"fileType"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentSubType"},"name":{"kind":"Name","value":"subType"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentCommentId"},"name":{"kind":"Name","value":"commentId"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentText"},"name":{"kind":"Name","value":"text"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlInitiativeDiscussionMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionProjectName"},"name":{"kind":"Name","value":"projectName"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionReason"},"name":{"kind":"Name","value":"reason"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionText"},"name":{"kind":"Name","value":"text"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlCrmDiscussionMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionRecordName"},"name":{"kind":"Name","value":"recordName"}},{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionReason"},"name":{"kind":"Name","value":"reason"}},{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionText"},"name":{"kind":"Name","value":"text"}},{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}},{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelInviteMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelInviteInvitedBy"},"name":{"kind":"Name","value":"invitedBy"}},{"kind":"Field","alias":{"kind":"Name","value":"channelInviteChannelName"},"name":{"kind":"Name","value":"channelName"}},{"kind":"Field","alias":{"kind":"Name","value":"channelInviteMessageContent"},"name":{"kind":"Name","value":"messageContent"}},{"kind":"Field","alias":{"kind":"Name","value":"channelInviteSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelMessageSendMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelMessageSendSender"},"name":{"kind":"Name","value":"sender"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageSendMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageSendChannelType"},"name":{"kind":"Name","value":"channelType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelMessageReactionMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionMessageContent"},"name":{"kind":"Name","value":"messageContent"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionEmoji"},"name":{"kind":"Name","value":"emoji"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionChannelType"},"name":{"kind":"Name","value":"channelType"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionChannelName"},"name":{"kind":"Name","value":"channelName"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelReplyMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelReplyThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplyMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplyUserId"},"name":{"kind":"Name","value":"userId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplyMessageContent"},"name":{"kind":"Name","value":"messageContent"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplyThreadParentSenderId"},"name":{"kind":"Name","value":"threadParentSenderId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplyChannelType"},"name":{"kind":"Name","value":"channelType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlCallStartedMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"callStartedChannelName"},"name":{"kind":"Name","value":"channelName"}},{"kind":"Field","alias":{"kind":"Name","value":"callStartedSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNewEmailMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"newEmailSender"},"name":{"kind":"Name","value":"sender"}},{"kind":"Field","alias":{"kind":"Name","value":"newEmailToEmail"},"name":{"kind":"Name","value":"toEmail"}},{"kind":"Field","alias":{"kind":"Name","value":"newEmailThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"newEmailSubject"},"name":{"kind":"Name","value":"subject"}},{"kind":"Field","alias":{"kind":"Name","value":"newEmailSnippet"},"name":{"kind":"Name","value":"snippet"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlInboxReauthRequiredMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"inboxReauthRequiredEmailAddress"},"name":{"kind":"Name","value":"emailAddress"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlInviteToTeamMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"inviteToTeamTeamName"},"name":{"kind":"Name","value":"teamName"}},{"kind":"Field","alias":{"kind":"Name","value":"inviteToTeamTeamId"},"name":{"kind":"Name","value":"teamId"}},{"kind":"Field","alias":{"kind":"Name","value":"inviteToTeamTeamInviteId"},"name":{"kind":"Name","value":"teamInviteId"}},{"kind":"Field","alias":{"kind":"Name","value":"inviteToTeamInvitedBy"},"name":{"kind":"Name","value":"invitedBy"}},{"kind":"Field","alias":{"kind":"Name","value":"inviteToTeamRole"},"name":{"kind":"Name","value":"role"}},{"kind":"Field","alias":{"kind":"Name","value":"inviteToTeamSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlTaskAssignedMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"taskAssignedTaskId"},"name":{"kind":"Name","value":"taskId"}},{"kind":"Field","alias":{"kind":"Name","value":"taskAssignedTaskName"},"name":{"kind":"Name","value":"taskName"}},{"kind":"Field","alias":{"kind":"Name","value":"taskAssignedSubType"},"name":{"kind":"Name","value":"subType"}},{"kind":"Field","alias":{"kind":"Name","value":"taskAssignedAssignedBy"},"name":{"kind":"Name","value":"assignedBy"}},{"kind":"Field","alias":{"kind":"Name","value":"taskAssignedSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlReminderMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"reminderReminderId"},"name":{"kind":"Name","value":"reminderId"}},{"kind":"Field","alias":{"kind":"Name","value":"reminderDescription"},"name":{"kind":"Name","value":"description"}},{"kind":"Field","alias":{"kind":"Name","value":"reminderScheduledFor"},"name":{"kind":"Name","value":"scheduledFor"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlCalendarEventReminderMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderEventId"},"name":{"kind":"Name","value":"eventId"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderOccurrenceKey"},"name":{"kind":"Name","value":"occurrenceKey"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderStartsAt"},"name":{"kind":"Name","value":"startsAt"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderEndsAt"},"name":{"kind":"Name","value":"endsAt"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderStartDate"},"name":{"kind":"Name","value":"startDate"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderTimeZone"},"name":{"kind":"Name","value":"timeZone"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderMinutesBefore"},"name":{"kind":"Name","value":"minutesBefore"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlCalendarEventJoinRequestMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"calendarEventJoinRequestRequestId"},"name":{"kind":"Name","value":"requestId"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventJoinRequestEventId"},"name":{"kind":"Name","value":"eventId"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventJoinRequestTitle"},"name":{"kind":"Name","value":"title"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlAiResponseMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"aiResponseSummary"},"name":{"kind":"Name","value":"summary"}},{"kind":"Field","alias":{"kind":"Name","value":"aiResponseMessageId"},"name":{"kind":"Name","value":"messageId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlGithubPrStatusChangedMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedForeignEntityId"},"name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedGithubKey"},"name":{"kind":"Name","value":"githubKey"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedRepo"},"name":{"kind":"Name","value":"repo"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedNumber"},"name":{"kind":"Name","value":"number"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedUrl"},"name":{"kind":"Name","value":"url"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedDisplayName"},"name":{"kind":"Name","value":"displayName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedSenderGithubLogin"},"name":{"kind":"Name","value":"senderGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedSenderGithubUserId"},"name":{"kind":"Name","value":"senderGithubUserId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedSenderGithubAvatarUrl"},"name":{"kind":"Name","value":"senderGithubAvatarUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedStatus"},"name":{"kind":"Name","value":"status"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedAction"},"name":{"kind":"Name","value":"action"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedPreviousStatus"},"name":{"kind":"Name","value":"previousStatus"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedHeadBranch"},"name":{"kind":"Name","value":"headBranch"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedBaseBranch"},"name":{"kind":"Name","value":"baseBranch"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedMergedAt"},"name":{"kind":"Name","value":"mergedAt"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlGithubPrCheckRunMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunForeignEntityId"},"name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunGithubKey"},"name":{"kind":"Name","value":"githubKey"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunRepo"},"name":{"kind":"Name","value":"repo"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunNumber"},"name":{"kind":"Name","value":"number"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunUrl"},"name":{"kind":"Name","value":"url"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunDisplayName"},"name":{"kind":"Name","value":"displayName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunSenderGithubLogin"},"name":{"kind":"Name","value":"senderGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunSenderGithubUserId"},"name":{"kind":"Name","value":"senderGithubUserId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunSenderGithubAvatarUrl"},"name":{"kind":"Name","value":"senderGithubAvatarUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunCheckRunGithubId"},"name":{"kind":"Name","value":"checkRunGithubId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunCheckName"},"name":{"kind":"Name","value":"checkName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunCheckStatus"},"name":{"kind":"Name","value":"checkStatus"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunConclusion"},"name":{"kind":"Name","value":"conclusion"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunState"},"name":{"kind":"Name","value":"state"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunCheckUrl"},"name":{"kind":"Name","value":"checkUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunCompletedAt"},"name":{"kind":"Name","value":"completedAt"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlGithubReviewRequestedMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedForeignEntityId"},"name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedGithubKey"},"name":{"kind":"Name","value":"githubKey"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedRepo"},"name":{"kind":"Name","value":"repo"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedNumber"},"name":{"kind":"Name","value":"number"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedUrl"},"name":{"kind":"Name","value":"url"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedDisplayName"},"name":{"kind":"Name","value":"displayName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedSenderGithubLogin"},"name":{"kind":"Name","value":"senderGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedSenderGithubUserId"},"name":{"kind":"Name","value":"senderGithubUserId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedSenderGithubAvatarUrl"},"name":{"kind":"Name","value":"senderGithubAvatarUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedRequestedReviewerGithubLogin"},"name":{"kind":"Name","value":"requestedReviewerGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedRequestedReviewerGithubUserId"},"name":{"kind":"Name","value":"requestedReviewerGithubUserId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlGithubPrCommentMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentForeignEntityId"},"name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentGithubKey"},"name":{"kind":"Name","value":"githubKey"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentRepo"},"name":{"kind":"Name","value":"repo"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentNumber"},"name":{"kind":"Name","value":"number"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentUrl"},"name":{"kind":"Name","value":"url"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentDisplayName"},"name":{"kind":"Name","value":"displayName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentSenderGithubLogin"},"name":{"kind":"Name","value":"senderGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentSenderGithubUserId"},"name":{"kind":"Name","value":"senderGithubUserId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentSenderGithubAvatarUrl"},"name":{"kind":"Name","value":"senderGithubAvatarUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentCommentKind"},"name":{"kind":"Name","value":"commentKind"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentCommentGithubId"},"name":{"kind":"Name","value":"commentGithubId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentCommentUrl"},"name":{"kind":"Name","value":"commentUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentCommentSnippet"},"name":{"kind":"Name","value":"commentSnippet"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlGithubPrMentionMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionForeignEntityId"},"name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionGithubKey"},"name":{"kind":"Name","value":"githubKey"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionRepo"},"name":{"kind":"Name","value":"repo"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionNumber"},"name":{"kind":"Name","value":"number"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionUrl"},"name":{"kind":"Name","value":"url"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionDisplayName"},"name":{"kind":"Name","value":"displayName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionSenderGithubLogin"},"name":{"kind":"Name","value":"senderGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionSenderGithubUserId"},"name":{"kind":"Name","value":"senderGithubUserId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionSenderGithubAvatarUrl"},"name":{"kind":"Name","value":"senderGithubAvatarUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionLocation"},"name":{"kind":"Name","value":"location"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionCommentGithubId"},"name":{"kind":"Name","value":"commentGithubId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionCommentUrl"},"name":{"kind":"Name","value":"commentUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionTextSnippet"},"name":{"kind":"Name","value":"textSnippet"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlGithubPrReviewMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewForeignEntityId"},"name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewGithubKey"},"name":{"kind":"Name","value":"githubKey"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewRepo"},"name":{"kind":"Name","value":"repo"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewNumber"},"name":{"kind":"Name","value":"number"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewUrl"},"name":{"kind":"Name","value":"url"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewDisplayName"},"name":{"kind":"Name","value":"displayName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewSenderGithubLogin"},"name":{"kind":"Name","value":"senderGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewSenderGithubUserId"},"name":{"kind":"Name","value":"senderGithubUserId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewSenderGithubAvatarUrl"},"name":{"kind":"Name","value":"senderGithubAvatarUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewReviewGithubId"},"name":{"kind":"Name","value":"reviewGithubId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewReviewUrl"},"name":{"kind":"Name","value":"reviewUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewState"},"name":{"kind":"Name","value":"state"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewReviewSnippet"},"name":{"kind":"Name","value":"reviewSnippet"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlAgentSessionSettledMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"agentSessionSettledSession"},"name":{"kind":"Name","value":"session"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"sessionId"}},{"kind":"Field","name":{"kind":"Name","value":"sessionName"}},{"kind":"Field","name":{"kind":"Name","value":"botId"}},{"kind":"Field","name":{"kind":"Name","value":"botName"}},{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"announcementMessageId"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionSettledTurn"},"name":{"kind":"Name","value":"turn"}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionSettledActor"},"name":{"kind":"Name","value":"actor"}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionSettledStopReason"},"name":{"kind":"Name","value":"stopReason"}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionSettledExcerpt"},"name":{"kind":"Name","value":"excerpt"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlAgentSessionWaitingForInputMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"agentSessionWaitingForInputSession"},"name":{"kind":"Name","value":"session"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"sessionId"}},{"kind":"Field","name":{"kind":"Name","value":"sessionName"}},{"kind":"Field","name":{"kind":"Name","value":"botId"}},{"kind":"Field","name":{"kind":"Name","value":"botName"}},{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"announcementMessageId"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionWaitingForInputTurn"},"name":{"kind":"Name","value":"turn"}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionWaitingForInputQuestion"},"name":{"kind":"Name","value":"question"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlAgentSessionMentionedMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"agentSessionMentionedSession"},"name":{"kind":"Name","value":"session"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"sessionId"}},{"kind":"Field","name":{"kind":"Name","value":"sessionName"}},{"kind":"Field","name":{"kind":"Name","value":"botId"}},{"kind":"Field","name":{"kind":"Name","value":"botName"}},{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"announcementMessageId"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionMentionedMentionedBy"},"name":{"kind":"Name","value":"mentionedBy"}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionMentionedActionId"},"name":{"kind":"Name","value":"actionId"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupNotificationMetadataFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNotifEvent"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupNotificationNavigationMetadataFields"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelMentionMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelMentionHasAttachments"},"name":{"kind":"Name","value":"hasAttachments"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMentionSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMentionChannelName"},"name":{"kind":"Name","value":"channelName"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMentionSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelMessageSendMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelMessageSendMessageContent"},"name":{"kind":"Name","value":"messageContent"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageSendHasAttachments"},"name":{"kind":"Name","value":"hasAttachments"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageSendSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageSendChannelName"},"name":{"kind":"Name","value":"channelName"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageSendSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelReplyMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelReplyHasAttachments"},"name":{"kind":"Name","value":"hasAttachments"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplySenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplyChannelName"},"name":{"kind":"Name","value":"channelName"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplySenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupNotificationFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNotification"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupNotificationStateFields"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupNotificationMetadataFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupItemFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupItemPreviewFields"}},{"kind":"Field","name":{"kind":"Name","value":"notifications"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupNotificationFields"}}]}}]}}]} as unknown as DocumentNode<GroupSoupQuery, GroupSoupQueryVariables>;export const HomeUnreadPresenceDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"HomeUnreadPresence"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"SoupInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"soup"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"unreadNotifications"},"name":{"kind":"Name","value":"notifications"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"states"},"value":{"kind":"ListValue","values":[{"kind":"EnumValue","value":"UNSEEN"}]}},{"kind":"ObjectField","name":{"kind":"Name","value":"channelFeedOnly"},"value":{"kind":"BooleanValue","value":true}}]}},{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"1"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"state"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupDocument"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"subType"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEmailThread"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"isRead"}},{"kind":"Field","name":{"kind":"Name","value":"inboxVisible"}},{"kind":"Field","name":{"kind":"Name","value":"isDraft"}},{"kind":"Field","name":{"kind":"Name","value":"sortTs"}},{"kind":"Field","name":{"kind":"Name","value":"labels"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"providerLabelId"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"unreadReminders"},"name":{"kind":"Name","value":"notifications"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"states"},"value":{"kind":"ListValue","values":[{"kind":"EnumValue","value":"UNSEEN"}]}},{"kind":"ObjectField","name":{"kind":"Name","value":"eventTypes"},"value":{"kind":"ListValue","values":[{"kind":"StringValue","value":"reminder","block":false}]}}]}},{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"1"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"state"}}]}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode<HomeUnreadPresenceQuery, HomeUnreadPresenceQueryVariables>;export const InitiativeDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"Initiative"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"initiativeId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"initiative"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"initiativeId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"initiativeId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"InitiativeDetailFields"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupPropertyValueFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlBooleanPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"boolValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNumberPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"numberValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlStringPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"stringValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlDatePropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"dateValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlDateRangePropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"rangeStart"},"name":{"kind":"Name","value":"start"}},{"kind":"Field","alias":{"kind":"Name","value":"rangeEnd"},"name":{"kind":"Name","value":"end"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSelectOptionPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"optionIds"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlEntityReferencePropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"references"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"entityId"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"specificMessageId"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlLinkPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"urls"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupPropertyFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlProperty"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"propertyDefinitionId"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"dataType"}},{"kind":"Field","name":{"kind":"Name","value":"isMultiSelect"}},{"kind":"Field","name":{"kind":"Name","value":"specificEntityType"}},{"kind":"Field","name":{"kind":"Name","value":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"isMetadata"}},{"kind":"Field","name":{"kind":"Name","value":"value"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyValueFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"InitiativeDetailFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupInitiative"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"viewerPermission"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlAccessLevelPermission"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"accessLevel"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"taskCount"}},{"kind":"Field","name":{"kind":"Name","value":"completedTaskCount"}},{"kind":"Field","name":{"kind":"Name","value":"memberIds"}},{"kind":"Field","name":{"kind":"Name","value":"taskIds"}},{"kind":"Field","name":{"kind":"Name","value":"sharePermission"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"owner"}},{"kind":"Field","name":{"kind":"Name","value":"linkShare"}},{"kind":"Field","name":{"kind":"Name","value":"linkShareAccessLevel"}},{"kind":"Field","name":{"kind":"Name","value":"teamShareAccessLevel"}},{"kind":"Field","name":{"kind":"Name","value":"channelSharePermissions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"accessLevel"}}]}}]}}]}}]} as unknown as DocumentNode<InitiativeQuery, InitiativeQueryVariables>;export const InitiativeIdentityDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"InitiativeIdentity"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"initiativeId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"initiative"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"initiativeId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"initiativeId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"InitiativeIdentityFields"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"InitiativeIdentityFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupInitiative"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"viewerPermission"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlAccessLevelPermission"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"accessLevel"}}]}}]}}]}}]} as unknown as DocumentNode<InitiativeIdentityQuery, InitiativeIdentityQueryVariables>;diff --git a/apps/web/src/lib/service-clients/service-storage/graphql/group-soup.graphql b/apps/web/src/lib/service-clients/service-storage/graphql/group-soup.graphqlindex 5ca0f1c677..47bd99fec7 100644--- a/apps/web/src/lib/service-clients/service-storage/graphql/group-soup.graphql+++ b/apps/web/src/lib/service-clients/service-storage/graphql/group-soup.graphql@@ -4,6 +4,7 @@ query GroupSoup($input: GroupedSoupInput!) {groupSoup(input: $input) {bins {key+ displayOrderlabeltotalCountnextCursordiff --git a/apps/web/src/lib/service-clients/service-storage/openapi.json b/apps/web/src/lib/service-clients/service-storage/openapi.jsonindex d0ea9c33ff..b377f726eb 100644--- a/apps/web/src/lib/service-clients/service-storage/openapi.json+++ b/apps/web/src/lib/service-clients/service-storage/openapi.json@@ -15729,16 +15729,26 @@{"name": "sort_method","in": "query",- "description": "Sort method. Options are viewed_at, created_at, updated_at,\nviewed_updated, frecency, touched_by_me, notified_at. Defaults to\nviewed_at.",+ "description": "Sort method. Property ordering supports DATE, NUMBER, BOOLEAN, SELECT and TAG.\nMissing definitions, unsupported types, and mismatched values sort as missing.\nFlat property sorts omit calendar events, email, channels, calls, companies, and agent sessions.\nDefaults to viewed_at.","required": false,"schema": {"$ref": "#/components/schemas/SoupApiSort"}},+ {+ "name": "sort_property_definition_id",+ "in": "query",+ "description": "Property definition selected for numeric property sorting.",+ "required": false,+ "schema": {+ "type": "string",+ "format": "uuid"+ }+ },{"name": "sort_direction","in": "query",- "description": "Sort direction. Options are asc, desc. Defaults to desc.\n\nRe-send this with every page: it is not carried in the cursor.\n\nApplies to the timestamp sort methods only. `asc` combined with\n`frecency` is rejected rather than ignored: frecency pages are ordered\nby relevance score and the cursor comparison assumes descending, so\nthere is no ascending frecency order to give.",+ "description": "Sort direction. Options are asc, desc. Defaults to desc.\n\nTimestamp sorts require this parameter again on each page. Property\ncursors preserve their direction and always put missing values last.\nAscending frecency, touched-by-me, and notified-at sorts are unsupported.","required": false,"schema": {"$ref": "#/components/schemas/SoupApiSortDirection"@@ -21091,7 +21101,7 @@},{"$ref": "#/components/schemas/CrmAssociation",- "description": "Restrict every entity type to items associated with this CRM record\n(wire key `crma`): its Companies or Contacts property names the\nrecord, or it references the record. A company also matches through\nits contacts. Unknown or inaccessible records answer 404; requests\nthat are not expanded or not timestamp-sorted answer 400."+ "description": "Restrict every entity type to items associated with this CRM record\n(wire key `crma`): its Companies or Contacts property names the\nrecord, or it references the record. A company also matches through\nits contacts. Unknown or inaccessible records answer 404; requests\nrequire expanded queries sorted by a timestamp or selected numeric property."}]},@@ -21169,6 +21179,17 @@"description": "Group by a property value (e.g., status, priority, or custom properties)","required": ["property_definition_id"],"properties": {+ "bucketing": {+ "oneOf": [+ {+ "type": "null"+ },+ {+ "$ref": "#/components/schemas/PropertyBucketing",+ "description": "Caller-defined date partition; non-DATE values enter the missing bucket."+ }+ ]+ },"entity_type": {"oneOf": [{@@ -21244,6 +21265,10 @@"type": "string","description": "Entity type for property lookups (API representation).","enum": [+ "CALL_RECORD",+ "CALENDAR_EVENT",+ "DATABASE_ROW",+ "INITIATIVE","CHANNEL","CHAT","COMPANY",@@ -33357,6 +33382,17 @@"description": "Limit the number of items returned per group. Defaults to 20. Max 500.","minimum": 0},+ "sort_direction": {+ "oneOf": [+ {+ "type": "null"+ },+ {+ "$ref": "#/components/schemas/SoupApiSortDirection",+ "description": "Direction of property values. Defaults to descending."+ }+ ]+ },"sort_method": {"oneOf": [{@@ -33367,6 +33403,11 @@"description": "Sort method. Defaults to viewed_updated."}]+ },+ "sort_property_definition_id": {+ "type": ["string", "null"],+ "format": "uuid",+ "description": "Property definition selected for numeric property sorting."}}},@@ -33389,6 +33430,17 @@"description": "Limit the number of items returned. Defaults to 20. Max 500.","minimum": 0},+ "sort_direction": {+ "oneOf": [+ {+ "type": "null"+ },+ {+ "$ref": "#/components/schemas/SoupApiSortDirection",+ "description": "Direction of property values. Defaults to descending."+ }+ ]+ },"sort_method": {"oneOf": [{@@ -33399,6 +33451,11 @@"description": "Sort method. Defaults to viewed_updated."}]+ },+ "sort_property_definition_id": {+ "type": ["string", "null"],+ "format": "uuid",+ "description": "Property definition selected for numeric property sorting."}}},@@ -33418,8 +33475,7 @@"$ref": "#/components/schemas/SoupApiItem"},"propertyNames": {- "type": "string",- "format": "uuid"+ "type": "string"}}}@@ -33443,8 +33499,7 @@"$ref": "#/components/schemas/SoupApiItem"},"propertyNames": {- "type": "string",- "format": "uuid"+ "type": "string"}}}@@ -33495,7 +33550,13 @@"GroupedSoupSort": {"type": "string","description": "Sort method for grouped queries (frecency not supported).",- "enum": ["viewed_at", "created_at", "updated_at", "viewed_updated"]+ "enum": [+ "viewed_at",+ "created_at",+ "updated_at",+ "viewed_updated",+ "property"+ ]},"GuestChatMessage": {"type": "object",@@ -36737,7 +36798,7 @@},{"$ref": "#/components/schemas/SoupApiSortDirection",- "description": "Sort direction. Options are asc, desc. Defaults to desc.\n\nRe-send this with every page: it is not carried in the cursor.\n\nApplies to the timestamp sort methods only. `asc` combined with\n`frecency` is rejected rather than ignored: frecency pages are ordered\nby relevance score and the cursor comparison assumes descending, so\nthere is no ascending frecency order to give."+ "description": "Sort direction. Options are asc, desc. Defaults to desc.\n\nTimestamp sorts require this parameter again on each page. Property\ncursors preserve their direction and always put missing values last.\nAscending frecency, touched-by-me, and notified-at sorts are unsupported."}]},@@ -36748,9 +36809,14 @@},{"$ref": "#/components/schemas/SoupApiSort",- "description": "Sort method. Options are viewed_at, created_at, updated_at,\nviewed_updated, frecency, touched_by_me, notified_at. Defaults to\nviewed_at."+ "description": "Sort method. Property ordering supports DATE, NUMBER, BOOLEAN, SELECT and TAG.\nMissing definitions, unsupported types, and mismatched values sort as missing.\nFlat property sorts omit calendar events, email, channels, calls, companies, and agent sessions.\nDefaults to viewed_at."}]+ },+ "sort_property_definition_id": {+ "type": ["string", "null"],+ "format": "uuid",+ "description": "Property definition selected for numeric property sorting."}}},@@ -37787,6 +37853,85 @@}}},+ "PropertyBucketing": {+ "oneOf": [+ {+ "allOf": [+ {+ "$ref": "#/components/schemas/PropertyDateRanges",+ "description": "Caller-defined, ordered UTC date ranges and a separate missing-value key."+ },+ {+ "type": "object",+ "required": ["type"],+ "properties": {+ "type": {+ "type": "string",+ "enum": ["date_ranges"]+ }+ }+ }+ ],+ "description": "Caller-defined, ordered UTC date ranges and a separate missing-value key."+ }+ ],+ "description": "Optional transformation of a selected property's stored value into group keys."+ },+ "PropertyDateFilterRange": {+ "type": "object",+ "description": "UTC timestamp interval. Lower bounds are inclusive; upper bounds are exclusive.",+ "properties": {+ "end": {+ "type": ["string", "null"],+ "format": "date-time",+ "description": "Exclusive UTC upper bound, omitted for an open end."+ },+ "start": {+ "type": ["string", "null"],+ "format": "date-time",+ "description": "Inclusive UTC lower bound, omitted for an open start."+ }+ }+ },+ "PropertyDateRange": {+ "type": "object",+ "description": "A half-open UTC interval. An absent start or end extends to infinity.",+ "required": ["key"],+ "properties": {+ "end": {+ "type": ["string", "null"],+ "format": "date-time",+ "description": "Exclusive end, or positive infinity."+ },+ "key": {+ "type": "string",+ "description": "Unique caller-supplied group key."+ },+ "start": {+ "type": ["string", "null"],+ "format": "date-time",+ "description": "Inclusive start, or negative infinity."+ }+ }+ },+ "PropertyDateRanges": {+ "type": "object",+ "description": "A complete partition of present dates plus one bucket for absent values.",+ "required": ["ranges", "missing_value_bucket_key"],+ "properties": {+ "missing_value_bucket_key": {+ "type": "string",+ "description": "Caller-supplied group key for entities with no date value."+ },+ "ranges": {+ "type": "array",+ "items": {+ "$ref": "#/components/schemas/PropertyDateRange"+ },+ "description": "Ordered, contiguous ranges covering every present date."+ }+ }+ },"PropertyDefinition": {"type": "object","description": "Property definition model (service representation).",@@ -37868,6 +38013,17 @@"description": "A single property-based filter condition.\n\nEach filter targets a specific property definition on entities of a given type,\nmatching against select option UUIDs or entity reference IDs.\nMultiple values within a single filter are OR'd together.\nMultiple filters are AND'd together.","required": ["property_definition_id"],"properties": {+ "date_range": {+ "oneOf": [+ {+ "type": "null"+ },+ {+ "$ref": "#/components/schemas/PropertyDateFilterRange",+ "description": "UTC range for Soup/search: inclusive start, exclusive end; both open matches any date."+ }+ ]+ },"entity_ids": {"type": "array","items": {@@ -37879,6 +38035,10 @@"type": ["string", "null"],"description": "The entity type for the property lookup (e.g., \"TASK\", \"DOCUMENT\", \"PROJECT\").\nWhen None, matches across all entity types."},+ "has_date": {+ "type": ["boolean", "null"],+ "description": "Flat Soup/search presence filter: true expands to an open date range, false to its negation."+ },"option_ids": {"type": "array","items": {@@ -40117,7 +40277,8 @@"viewed_updated","frecency","touched_by_me",- "notified_at"+ "notified_at",+ "property"]},"SoupApiSortDirection": {diff --git a/crates/agent_code_mode/src/domain/documentation.json b/crates/agent_code_mode/src/domain/documentation.jsonindex a2c7e8c12e..a178bac23d 100644--- a/crates/agent_code_mode/src/domain/documentation.json+++ b/crates/agent_code_mode/src/domain/documentation.json@@ -470,7 +470,8 @@"NotificationFilters": "# Type Alias: NotificationFilters\n\n> **NotificationFilters** = \\{ `states?`: `search.NotificationState`[]; \\}\n\nNotification-level filters that apply to an entity type.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-states\"></a> `states?` | `search.NotificationState`[] | Include entities with a non-deleted notification in any of these exact states. Empty means no notification restriction. Active means `[unseen, seen]`. |","search.NotificationState": "# Type Alias: NotificationState\n\n> **NotificationState** = `\"unseen\"` \\| `\"seen\"` \\| `\"done\"`\n\nThe mutually exclusive lifecycle states of a user's notification.","ProjectFilters": "# Type Alias: ProjectFilters\n\n> **ProjectFilters** = \\{ `importance?`: `boolean` \\| `null`; `include_root?`: `boolean`; `notification_filters?`: `NotificationFilters`; `owners?`: `string`[]; `project_ids?`: `string`[]; \\}\n\nThe project filters used to filter down what projects you search over.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-importance\"></a> `importance?` | `boolean` \\| `null` | Filter by project importance. None to ignore, true to pass through (no clause), false to short-circuit and return nothing. |\n| <a id=\"property-include_root\"></a> `include_root?` | `boolean` | When true, `project_ids` also matches the projects themselves in addition to their children. |\n| <a id=\"property-notification_filters\"></a> `notification_filters?` | `NotificationFilters` | Filter by project notification state. |\n| <a id=\"property-owners\"></a> `owners?` | `string`[] | Filter by project owner principal — a user ('macro\\|[email protected]'), a bot ('bot\\|<uuid>'), or a team (a bare hyphenated uuid). Examples: ['macro\\|[email protected]'], ['macro\\|[email protected]', 'bot\\|0199...']. Empty to search all owners. |\n| <a id=\"property-project_ids\"></a> `project_ids?` | `string`[] | Project IDs to search within. Examples: ['project1']. Empty to search all accessible projects. By default matches children of these projects; set `include_root` to also match the projects themselves. |",- "PropertyFilter": "# Type Alias: PropertyFilter\n\n> **PropertyFilter** = \\{ `entity_ids?`: `string`[]; `entity_type?`: `string` \\| `null`; `option_ids?`: `string`[]; `property_definition_id`: `string`; \\}\n\nA single property-based filter condition.\n\nEach filter targets a specific property definition on entities of a given type,\nmatching against select option UUIDs or entity reference IDs.\nMultiple values within a single filter are OR'd together.\nMultiple filters are AND'd together.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-entity_ids\"></a> `entity_ids?` | `string`[] | Entity reference IDs to match. Multiple values are OR'd together. |\n| <a id=\"property-entity_type\"></a> `entity_type?` | `string` \\| `null` | The entity type for the property lookup (e.g., \"TASK\", \"DOCUMENT\", \"PROJECT\"). When None, matches across all entity types. |\n| <a id=\"property-option_ids\"></a> `option_ids?` | `string`[] | Select option UUIDs to match. Multiple values are OR'd together. |\n| <a id=\"property-property_definition_id\"></a> `property_definition_id` | `string` | The UUID of the property definition to filter on. |",+ "PropertyDateFilterRange": "# Type Alias: PropertyDateFilterRange\n\n> **PropertyDateFilterRange** = \\{ `end?`: `string` \\| `null`; `start?`: `string` \\| `null`; \\}\n\nUTC timestamp interval. Lower bounds are inclusive; upper bounds are exclusive.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-end\"></a> `end?` | `string` \\| `null` | Exclusive UTC upper bound, omitted for an open end. |\n| <a id=\"property-start\"></a> `start?` | `string` \\| `null` | Inclusive UTC lower bound, omitted for an open start. |",+ "PropertyFilter": "# Type Alias: PropertyFilter\n\n> **PropertyFilter** = \\{ `date_range?`: `null` \\| `PropertyDateFilterRange`; `entity_ids?`: `string`[]; `entity_type?`: `string` \\| `null`; `has_date?`: `boolean` \\| `null`; `option_ids?`: `string`[]; `property_definition_id`: `string`; \\}\n\nA single property-based filter condition.\n\nEach filter targets a specific property definition on entities of a given type,\nmatching against select option UUIDs or entity reference IDs.\nMultiple values within a single filter are OR'd together.\nMultiple filters are AND'd together.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-date_range\"></a> `date_range?` | `null` \\| `PropertyDateFilterRange` | - |\n| <a id=\"property-entity_ids\"></a> `entity_ids?` | `string`[] | Entity reference IDs to match. Multiple values are OR'd together. |\n| <a id=\"property-entity_type\"></a> `entity_type?` | `string` \\| `null` | The entity type for the property lookup (e.g., \"TASK\", \"DOCUMENT\", \"PROJECT\"). When None, matches across all entity types. |\n| <a id=\"property-has_date\"></a> `has_date?` | `boolean` \\| `null` | Flat Soup/search presence filter: true expands to an open date range, false to its negation. |\n| <a id=\"property-option_ids\"></a> `option_ids?` | `string`[] | Select option UUIDs to match. Multiple values are OR'd together. |\n| <a id=\"property-property_definition_id\"></a> `property_definition_id` | `string` | The UUID of the property definition to filter on. |","SharedEmailFilter": "# Type Alias: SharedEmailFilter\n\n> **SharedEmailFilter** = `\"exclude\"` \\| `\"include\"` \\| `\"only\"`\n\nControls whether shared email threads are included in results.","TagFilterMode": "# Type Alias: TagFilterMode\n\n> **TagFilterMode** = `\"any\"` \\| `\"all\"`\n\nHow multiple `tag_option_ids` combine when filtering.","TaskFilters": "# Type Alias: TaskFilters\n\n> **TaskFilters** = \\{ `include_cbm_atm_nc?`: `boolean` \\| `null`; \\}\n\nTask-only filters nested under document filters.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-include_cbm_atm_nc\"></a> `include_cbm_atm_nc?` | `boolean` \\| `null` | Include tasks that are created by me, assigned to me, and not completed, even when they do not match other document filters. |",diff --git a/crates/call/AGENTS.md b/crates/call/AGENTS.mdindex 7cf3c275f8..367d188bbe 100644--- a/crates/call/AGENTS.md+++ b/crates/call/AGENTS.md@@ -54,6 +54,7 @@ in-call chat.a per-device signal.- The team-memory helper only compiles with the `ports` feature (#7912) — don'treintroduce an unconditional dependency on it.+- Treat DATE property literals as non-matches; apply ordinary boolean negation and keep non-date call filtering unchanged.- RTC tokens live 6h and can't be revoked, and LiveKit recreates a deleted roomwhen one connects. Only a room named after an archived `call_records` row isorphaned (call ids are never reused); meeting preparations and get-or-creatediff --git a/crates/call/src/outbound/pg_call_repo/property_clauses.rs b/crates/call/src/outbound/pg_call_repo/property_clauses.rsindex 6841bd0528..8f3c92ba79 100644--- a/crates/call/src/outbound/pg_call_repo/property_clauses.rs+++ b/crates/call/src/outbound/pg_call_repo/property_clauses.rs@@ -49,6 +49,7 @@ pub(super) struct PropertyClauseParams {/// other call filters, so here they are unconstrained (`Any`).enum Formula {Any,+ Never,Term(PropertyTerm),And(Box<Formula>, Box<Formula>),Or(Box<Formula>, Box<Formula>),@@ -102,6 +103,13 @@ fn formula(expr: &Expr<CallLiteral>, negated: bool) -> Formula {match expr {Expr::Literal(CallLiteral::Property(literal)) => {let condition = match &literal.value {+ PropertyMatchValue::DateRange(_) => {+ return if negated {+ Formula::Any+ } else {+ Formula::Never+ };+ }PropertyMatchValue::SelectOption(option_id) => {PropertyCondition::Tag(option_id.to_string())}@@ -123,6 +131,7 @@ fn formula(expr: &Expr<CallLiteral>, negated: bool) -> Formula {fn and(a: Formula, b: Formula) -> Formula {match (a, b) {+ (Formula::Never, _) | (_, Formula::Never) => Formula::Never,(Formula::Any, other) | (other, Formula::Any) => other,(a, b) => Formula::And(Box::new(a), Box::new(b)),}@@ -131,6 +140,7 @@ fn and(a: Formula, b: Formula) -> Formula {fn or(a: Formula, b: Formula) -> Formula {match (a, b) {(Formula::Any, _) | (_, Formula::Any) => Formula::Any,+ (Formula::Never, other) | (other, Formula::Never) => other,(a, b) => Formula::Or(Box::new(a), Box::new(b)),}}@@ -139,6 +149,7 @@ fn or(a: Formula, b: Formula) -> Formula {fn clauses(formula: &Formula) -> Option<Vec<Vec<PropertyTerm>>> {match formula {Formula::Any => Some(Vec::new()),+ Formula::Never => Some(vec![Vec::new()]),Formula::Term(term) => Some(vec![vec![term.clone()]]),Formula::And(a, b) => {let mut all = clauses(a)?;diff --git a/crates/call/src/outbound/pg_call_repo/property_clauses/test.rs b/crates/call/src/outbound/pg_call_repo/property_clauses/test.rsindex d5145a532d..f57aa825f0 100644--- a/crates/call/src/outbound/pg_call_repo/property_clauses/test.rs+++ b/crates/call/src/outbound/pg_call_repo/property_clauses/test.rs@@ -151,3 +151,29 @@ fn oversized_filters_drop_their_property_conditions() {});assert!(clauses_of(expr).is_empty());}++#[test]+fn date_literals_match_nothing_and_preserve_negation() {+ let date = Expr::Literal(CallLiteral::Property(PropertiesLiteral {+ property_definition_id: Uuid::from_u128(4),+ entity_type: None,+ value: PropertyMatchValue::DateRange(item_filters::ast::properties::DateRange {+ start: None,+ end: None,+ }),+ }));+ assert_eq!(clauses_of(date.clone()), vec![Vec::<PropertyTerm>::new()]);+ assert!(clauses_of(Expr::is_not(date.clone())).is_empty());+ assert_eq!(+ clauses_of(Expr::or(date.clone(), company("a"))),+ vec![vec![has("a")]]+ );+ assert_eq!(+ clauses_of(Expr::and(date.clone(), company("a"))),+ vec![Vec::<PropertyTerm>::new()]+ );+ assert_eq!(+ clauses_of(Expr::and(Expr::is_not(date), company("a"))),+ vec![vec![has("a")]]+ );+}diff --git a/crates/channels/src/outbound/pg_channels_repo.rs b/crates/channels/src/outbound/pg_channels_repo.rsindex c4aa93dc56..e1dda24e1e 100644--- a/crates/channels/src/outbound/pg_channels_repo.rs+++ b/crates/channels/src/outbound/pg_channels_repo.rs@@ -1,6 +1,7 @@/// Silent historical persistence and transaction-aware activity updates.pub mod historical;#[cfg(feature = "list")]+#[cfg(feature = "list")]mod references;#[cfg(test)]diff --git a/crates/complete_graph/src/schema/test.rs b/crates/complete_graph/src/schema/test.rsindex 97ca42c761..6f5c38e1a0 100644--- a/crates/complete_graph/src/schema/test.rs+++ b/crates/complete_graph/src/schema/test.rs@@ -241,6 +241,7 @@ impl SoupService for CountingSoupService {},);soup::domain::models::SoupProjectionHydration {+ sort_key: None,item,document_server_facts,}@@ -311,12 +312,22 @@ impl SoupService for CountingSoupService {self.grouped_calls.fetch_add(1, Ordering::SeqCst);Ok(vec![soup::domain::models::grouping::ItemGroupingInfo {+ sort_key: None,+ display_order: None,+ document_server_facts: Some(soup::domain::models::SoupDocumentServerFacts {+ is_email_attachment: false,+ is_important: true,+ status_option_ids: Vec::new(),+ }),key: "document".to_string(),total_group_count: 3,index_in_group: 1,item: grouped_document(Uuid::from_u128(1)),},soup::domain::models::grouping::ItemGroupingInfo {+ sort_key: None,+ display_order: None,+ document_server_facts: None,key: "document".to_string(),total_group_count: 3,index_in_group: 2,@@ -2258,7 +2269,7 @@ async fn group_soup_nests_items_in_bins_and_reuses_cached_authorization() {let response = harness.execute(- "{ user { id groupSoup(input: {initial: {groupBy: {field: ENTITY_TYPE}}}) { bins { key totalCount nextCursor items { id entityType } } } } }",+ "{ user { id groupSoup(input: {initial: {groupBy: {field: ENTITY_TYPE}}}) { bins { key totalCount displayOrder nextCursor items { id entityType cacheProjection } } } } }",).await;@@ -2270,6 +2281,18 @@ async fn group_soup_nests_items_in_bins_and_reuses_cached_authorization() {assert_eq!(harness.authorization_calls.load(Ordering::SeqCst), 1);let cursor = bin["nextCursor"].as_str().unwrap();assert_eq!(bin["items"].as_array().unwrap().len(), 2);+ assert_eq!(bin["displayOrder"], 0);+ let items = bin["items"].as_array().unwrap();+ let supplement = soup_filter_projection::decode_cache_projection_supplement(+ items[0]["cacheProjection"].as_str().unwrap(),+ )+ .unwrap();+ assert_eq!(+ supplement.record_key(),+ &predicate_index::RecordKey::new(format!("GraphqlSoupDocument:{}", Uuid::from_u128(1)))+ .unwrap()+ );+ assert!(items[1]["cacheProjection"].is_null());let continuation = format!("{{ user {{ groupSoup(input: {{continuation: {{groupBy: {{field: ENTITY_TYPE}}, groupKey: \"document\", cursor: \"{cursor}\"}}}}) {{ bins {{ key }} }} }} }}"diff --git a/crates/complete_graph/src/schema/test/work_feed.rs b/crates/complete_graph/src/schema/test/work_feed.rsindex 3f924a341c..b1452649a1 100644--- a/crates/complete_graph/src/schema/test/work_feed.rs+++ b/crates/complete_graph/src/schema/test/work_feed.rs@@ -67,6 +67,7 @@ fn doc_entry() -> WorkFeedEntry<SoupProjectionHydration> {item: WorkFeedItem {key: doc_key(),entity: SoupProjectionHydration {+ sort_key: None,item: soup_document(DOC_ID),document_server_facts: None,},diff --git a/crates/crm/Cargo.toml b/crates/crm/Cargo.tomlindex 1f94c0062d..23bf0031ff 100644--- a/crates/crm/Cargo.toml+++ b/crates/crm/Cargo.toml@@ -54,7 +54,7 @@ outbound = ["dep:unfurl","ports",]-ports = ["dep:bot_id", "dep:csv", "dep:databases", "dep:futures", "dep:models_databases", "dep:models_permissions", "dep:models_properties", "dep:macro_user_id", "dep:macro_uuid", "dep:rootcause", "dep:utoipa", "entity_access/ports"]+ports = ["dep:bot_id", "dep:csv", "dep:databases", "dep:futures", "dep:models_databases", "dep:models_permissions", "dep:models_properties", "dep:macro_user_id", "dep:macro_uuid", "dep:rootcause", "dep:utoipa", "dep:properties", "entity_access/ports"]# Read-only CRM search (name/domain). Pulls only sqlx + ports — no# reqwest/unfurl/axum — so search consumers stay lightweight.search = ["dep:sqlx", "ports"]@@ -77,6 +77,7 @@ thiserror = { workspace = true }tracing = { workspace = true }uuid = { workspace = true }+models_pagination = { path = "../models_pagination" }call = { path = "../call", default-features = false, features = ["ports"], optional = true }entity_access = { path = "../entity_access", default-features = false }kafka_util = { path = "../kafka_util", optional = true }diff --git a/crates/database_sql/examples/gql.rs b/crates/database_sql/examples/gql.rsindex 89fd0d2e16..d671521174 100644--- a/crates/database_sql/examples/gql.rs+++ b/crates/database_sql/examples/gql.rs@@ -286,6 +286,9 @@ fn property_filter_input(expr: &Expr<PropertiesLiteral>) -> Json {let value = match &literal.value {PropertyMatchValue::SelectOption(id) => json!({ "selectOption": id }),PropertyMatchValue::EntityRef(id) => json!({ "entityRef": id.to_string() }),+ PropertyMatchValue::DateRange(range) => {+ json!({ "dateRange": { "start": range.start, "end": range.end } })+ }};json!({ "literal": { "propertyDefinitionId": literal.property_definition_id, "value": value } })}diff --git a/crates/databases_sql/src/row_source.rs b/crates/databases_sql/src/row_source.rsindex 18944de615..f8745bdb27 100644--- a/crates/databases_sql/src/row_source.rs+++ b/crates/databases_sql/src/row_source.rs@@ -199,7 +199,7 @@ where// The bins' totals answer the count; one item each is enough.limit: 1,cursor: Query::Sort(- SimpleSortMethod::CreatedAt,+ SimpleSortMethod::CreatedAt.into(),rows_filter(*table, property_filter.as_ref(), None),),user_id: self.viewer.clone(),@@ -207,6 +207,7 @@ wherefield: GroupByField::Property {property_definition_id: *group_by,entity_type: Some(PropertyEntityType::DatabaseRow.to_string()),+ bucketing: None,},group_key: None,per_group_limit: Some(1),diff --git a/crates/databases_sql/src/row_source/test.rs b/crates/databases_sql/src/row_source/test.rsindex b4d2e773b5..f32ec0dcc8 100644--- a/crates/databases_sql/src/row_source/test.rs+++ b/crates/databases_sql/src/row_source/test.rs@@ -207,6 +207,9 @@ impl SoupService for ReplaySoup {Ok(bins.into_iter().map(|bin| ItemGroupingInfo {+ sort_key: None,+ display_order: None,+ document_server_facts: None,key: match bin.key {None => String::new(),Some(Cell::Options(ids)) => ids[0].to_string(),diff --git a/crates/databases_sql/src/test_support.rs b/crates/databases_sql/src/test_support.rsindex 6bdd2a9dc9..dd80e6e8ed 100644--- a/crates/databases_sql/src/test_support.rs+++ b/crates/databases_sql/src/test_support.rs@@ -631,6 +631,9 @@ impl SoupService for FakeSoup {.take(10).enumerate().map(move |(index, member)| ItemGroupingInfo {+ sort_key: None,+ display_order: None,+ document_server_facts: None,key: key.clone(),total_group_count,index_in_group: index + 1,diff --git a/crates/email/AGENTS.md b/crates/email/AGENTS.mdindex 3ec94f4fe6..faf23f8768 100644--- a/crates/email/AGENTS.md+++ b/crates/email/AGENTS.md@@ -54,6 +54,7 @@ tools — hexagonal, heavily feature-gated.## Gotchas+- Treat DATE property literals as non-matches; apply ordinary boolean negation and keep non-date email filtering unchanged.- All Mail excludes present messages in spam/junk or trash before pagination;canonical cached previews and non-draft baselines use the same rule for Gmaillabels and Outlook mailbox facts. Mixed threads show their latest eligible message.diff --git a/crates/email/src/outbound/email_pg_repo/dynamic/filters.rs b/crates/email/src/outbound/email_pg_repo/dynamic/filters.rsindex b55855384e..2ad8f10139 100644--- a/crates/email/src/outbound/email_pg_repo/dynamic/filters.rs+++ b/crates/email/src/outbound/email_pg_repo/dynamic/filters.rs@@ -887,6 +887,7 @@ fn build_thread_property_predicate(lit: &PropertiesLiteral, thread_alias: &str)));f.extend(SqlFragment::bind_uuid(lit.property_definition_id));match &lit.value {+ PropertyMatchValue::DateRange(_) => return SqlFragment::raw("FALSE"),PropertyMatchValue::SelectOption(option_id) => {f.push_raw(" AND ep_prop.values->'value' ? ");f.extend(SqlFragment::bind_string(option_id.to_string()));diff --git a/crates/email/src/outbound/email_pg_repo/dynamic/tests.rs b/crates/email/src/outbound/email_pg_repo/dynamic/tests.rsindex c00c706632..f219c38d47 100644--- a/crates/email/src/outbound/email_pg_repo/dynamic/tests.rs+++ b/crates/email/src/outbound/email_pg_repo/dynamic/tests.rs@@ -43,6 +43,32 @@ fn build_thread_email_filter(ast: &Expr<EmailLiteral>, sort_ts_field: &str) -> Ssuper::filters::build_thread_email_filter(ast, sort_ts_field, &ResolvedFilters::empty())}+#[sqlx::test(migrator = "macro_db_migrator::MACRO_DB_MIGRATIONS")]+async fn date_literals_match_nothing_and_preserve_negation(pool: sqlx::PgPool) {+ use item_filters::ast::properties::{DateRange, PropertiesLiteral, PropertyMatchValue};++ let literal = Expr::Literal(EmailLiteral::Property(PropertiesLiteral {+ property_definition_id: Uuid::from_u128(4),+ entity_type: None,+ value: PropertyMatchValue::DateRange(DateRange {+ start: None,+ end: None,+ }),+ }));+ for (filter, expected) in [(literal.clone(), false), (Expr::is_not(literal), true)] {+ let mut query = QueryBuilder::new("SELECT TRUE");+ build_thread_email_filter(&filter, "t.updated_at").push_into(&mut query, "unused");+ assert_eq!(+ query+ .build_query_scalar::<bool>()+ .fetch_one(&pool)+ .await+ .unwrap(),+ expected+ );+ }+}+#[test]fn unresolved_sender_short_circuits() {let expr = Expr::Literal(EmailLiteral::Sender(complete("[email protected]")));diff --git a/crates/frecency/AGENTS.md b/crates/frecency/AGENTS.mdindex 638ef033b8..f0450166f8 100644--- a/crates/frecency/AGENTS.md+++ b/crates/frecency/AGENTS.md@@ -38,6 +38,10 @@ soup, ai_tools, memory, channels, email, scheduled actions): frecency- `cargo test -p frecency --all-features` (`SQLX_OFFLINE` unset).- `just integration_test` (DynamoDB-backed cases, from this directory).+## Gotchas++- Treat DATE property literals as non-matches; keep DATE filtering on Soup or OpenSearch instead of frecency.+## Related- Rules: `.agents/rules/rust/db.md`diff --git a/crates/frecency/src/outbound/postgres/dynamic.rs b/crates/frecency/src/outbound/postgres/dynamic.rsindex f047b1c8a4..142ef6d7c0 100644--- a/crates/frecency/src/outbound/postgres/dynamic.rs+++ b/crates/frecency/src/outbound/postgres/dynamic.rs@@ -246,6 +246,7 @@ fn property_literal_predicate(literal: &PropertiesLiteral) -> String {value,} = literal;let value_predicate = match value {+ PropertyMatchValue::DateRange(_) => return "FALSE".to_owned(),PropertyMatchValue::SelectOption(option_id) => {format!("ep_prop.values->'value' ? '{option_id}'")}diff --git a/crates/frecency/src/outbound/postgres/dynamic_tests.rs b/crates/frecency/src/outbound/postgres/dynamic_tests.rsindex 603794bd67..d64b0c1606 100644--- a/crates/frecency/src/outbound/postgres/dynamic_tests.rs+++ b/crates/frecency/src/outbound/postgres/dynamic_tests.rs@@ -40,6 +40,59 @@ async fn pull_request_filters_fail_explicitly_before_database_access() {));}+#[sqlx::test(migrator = "MACRO_DB_MIGRATIONS")]+async fn date_literals_match_nothing_and_preserve_negation(pool: PgPool) {+ use item_filters::ast::properties::{DateRange, PropertiesLiteral, PropertyMatchValue};++ let storage = FrecencyPgStorage::new(pool.clone());+ let user = MacroUserIdStr::parse_from_str("macro|[email protected]").unwrap();+ let id = Uuid::from_u128(1);+ storage+ .set_aggregate(AggregateFrecency {+ id: AggregateId {+ entity: EntityType::Document.with_entity_string(id.to_string()),+ user_id: user.clone(),+ },+ data: FrecencyData {+ event_count: 1,+ frecency_score: 100.0,+ first_event: Utc::now(),+ recent_events: VecDeque::new(),+ },+ })+ .await+ .unwrap();+ sqlx::query!(+ "INSERT INTO entity_properties (id, entity_id, entity_type, property_definition_id, values) VALUES ($1, $2, 'DOCUMENT', '00000001-0000-0000-0000-000000000004', $3)",+ Uuid::from_u128(2),+ id.to_string(),+ serde_json::json!({"type": "Date", "value": "2026-10-20T12:00:00Z"})+ ).execute(&pool).await.unwrap();+ let literal = Expr::Literal(DocumentLiteral::Property(PropertiesLiteral {+ property_definition_id: Uuid::from_u128(0x00000001_0000_0000_0000_000000000004),+ entity_type: None,+ value: PropertyMatchValue::DateRange(DateRange {+ start: None,+ end: None,+ }),+ }));+ for (filter, count) in [(literal.clone(), 0), (Expr::is_not(literal), 1)] {+ let rows = storage+ .get_top_entities(FrecencyPageRequest {+ user_id: user.clone(),+ from_score: None,+ limit: 10,+ filters: Some(EntityFilterAst {+ document_filter: Some(Arc::new(filter)),+ ..Default::default()+ }),+ })+ .await+ .unwrap();+ assert_eq!(rows.len(), count);+ }+}+#[sqlx::test(migrator = "MACRO_DB_MIGRATIONS")]async fn test_dynamic_filter_by_document_ids(pool: PgPool) {let storage = FrecencyPgStorage::new(pool.clone());diff --git a/crates/graphql_common/AGENTS.md b/crates/graphql_common/AGENTS.mdindex eb69506fb1..a34649357e 100644--- a/crates/graphql_common/AGENTS.md+++ b/crates/graphql_common/AGENTS.md@@ -37,6 +37,8 @@ schema types (entity type, owner type, property filters).- Add a shared filter/input type: `src/property_filter.rs` or`src/filter_input.rs` → used from the domain crate's input types.+- Keep property DATE bounds nullable RFC3339 strings and normalize offsets to UTC; an open `dateRange` means present and outer `not` means absent.+- Translate `CALL_RECORD` property filters to their canonical scope; reference-only `CONTACT` values remain unsupported filter targets.- Change the request context: `src/request_context.rs` → `src/extract.rs` →every domain crate that reads a new field from it.diff --git a/crates/graphql_common/Cargo.toml b/crates/graphql_common/Cargo.tomlindex 06270ad6c3..c16a34c3e2 100644--- a/crates/graphql_common/Cargo.toml+++ b/crates/graphql_common/Cargo.toml@@ -8,6 +8,7 @@ version = "0.1.0"async-graphql = { workspace = true, features = ["dataloader"] }axum = { workspace = true }axum-extra = { workspace = true }+chrono = { workspace = true }filter_ast = { path = "../filter_ast" }item_filters = { path = "../item_filters" }macro_authorization = { path = "../macro_authorization", default-features = false, features = [diff --git a/crates/graphql_common/src/property_filter.rs b/crates/graphql_common/src/property_filter.rsindex 70a0886dcb..3e3c39c7a9 100644--- a/crates/graphql_common/src/property_filter.rs+++ b/crates/graphql_common/src/property_filter.rs@@ -37,7 +37,7 @@ pub struct GraphqlPropertiesLiteral {impl IntoFilterExpr<PropertiesLiteral> for GraphqlPropertiesLiteral {fn into_expr(self) -> async_graphql::Result<Expr<PropertiesLiteral>> {- Ok(Expr::val(PropertiesLiteral {+ let literal = PropertiesLiteral {property_definition_id: parse_id(self.property_definition_id, "propertyDefinitionId")?,entity_type: self.entity_type@@ -50,7 +50,8 @@ impl IntoFilterExpr<PropertiesLiteral> for GraphqlPropertiesLiteral {}).transpose()?,value: self.value.into_ast()?,- }))+ };+ Ok(Expr::val(literal))}}@@ -61,6 +62,17 @@ pub enum GraphqlPropertyMatchValue {SelectOption(ID),/// Entity reference id to match.EntityRef(String),+ /// Match a DATE property in a UTC interval.+ DateRange(GraphqlPropertyDateRange),+}++/// UTC interval for a DATE property.+#[derive(async_graphql::InputObject)]+pub struct GraphqlPropertyDateRange {+ /// Inclusive start, or no lower bound.+ start: Option<String>,+ /// Exclusive end, or no upper bound.+ end: Option<String>,}impl GraphqlPropertyMatchValue {@@ -75,6 +87,28 @@ impl GraphqlPropertyMatchValue {async_graphql::Error::new(format!("invalid entityRef: {err}"))})?)}+ Self::DateRange(range) => {+ PropertyMatchValue::DateRange(item_filters::ast::properties::DateRange {+ start: range+ .start+ .as_deref()+ .map(chrono::DateTime::parse_from_rfc3339)+ .transpose()+ .map_err(|err| {+ async_graphql::Error::new(format!("invalid dateRange.start: {err}"))+ })?+ .map(|value| value.with_timezone(&chrono::Utc)),+ end: range+ .end+ .as_deref()+ .map(chrono::DateTime::parse_from_rfc3339)+ .transpose()+ .map_err(|err| {+ async_graphql::Error::new(format!("invalid dateRange.end: {err}"))+ })?+ .map(|value| value.with_timezone(&chrono::Utc)),+ })+ }})}}@@ -157,6 +191,7 @@ impl TryFrom<GraphqlPropertyEntityType> for PropertyEntityType {fn try_from(value: GraphqlPropertyEntityType) -> Result<Self, Self::Error> {Ok(match value {GraphqlPropertyEntityType::CalendarEvent => Self::CalendarEvent,+ GraphqlPropertyEntityType::CallRecord => Self::CallRecord,GraphqlPropertyEntityType::Channel => Self::Channel,GraphqlPropertyEntityType::Chat => Self::Chat,GraphqlPropertyEntityType::Company => Self::Company,@@ -167,8 +202,7 @@ impl TryFrom<GraphqlPropertyEntityType> for PropertyEntityType {GraphqlPropertyEntityType::Thread => Self::Thread,GraphqlPropertyEntityType::User => Self::User,GraphqlPropertyEntityType::Initiative => Self::Initiative,- other- @ (GraphqlPropertyEntityType::CallRecord | GraphqlPropertyEntityType::Contact) => {+ other @ GraphqlPropertyEntityType::Contact => {return Err(other);}})diff --git a/crates/graphql_common/src/property_filter/test.rs b/crates/graphql_common/src/property_filter/test.rsindex 9f718725c8..0b0d1e8e94 100644--- a/crates/graphql_common/src/property_filter/test.rs+++ b/crates/graphql_common/src/property_filter/test.rs@@ -21,3 +21,23 @@ fn initiative_property_filter_preserves_its_scope() {models_properties::EntityType::Initiative,);}++#[test]+fn date_ranges_keep_open_bounds_and_normalize_offsets() {+ let value = GraphqlPropertyMatchValue::DateRange(GraphqlPropertyDateRange {+ start: None,+ end: Some("2026-10-21T00:00:00+05:30".to_owned()),+ })+ .into_ast()+ .unwrap();+ assert!(matches!(value, PropertyMatchValue::DateRange(range)+ if range.start.is_none() && range.end.unwrap().to_rfc3339() == "2026-10-20T18:30:00+00:00"));+ assert!(+ GraphqlPropertyMatchValue::DateRange(GraphqlPropertyDateRange {+ start: Some("not a timestamp".to_owned()),+ end: None,+ })+ .into_ast()+ .is_err()+ );+}diff --git a/crates/graphql_soup/AGENTS.md b/crates/graphql_soup/AGENTS.mdindex 8355347d7f..e40901151e 100644--- a/crates/graphql_soup/AGENTS.md+++ b/crates/graphql_soup/AGENTS.md@@ -18,7 +18,13 @@ viewer pattern), which apply to every type defined here.serves lists. A thread shared through a team's CRM, a project, or a sharetherefore opens through `emailThread` even though it lives in a teammate'sinbox.+- Property grouping accepts optional `groupBy.bucketing` with `type: DATE_RANGES`,+ caller-defined half-open UTC `ranges`, and `missingValueBucketKey`; client query+ keys restart pagination when ranges change.+- Use `PROPERTY`, `sortPropertyDefinitionId`, and `sortDirection` for numeric property sorting through ordinary Soup requests; preserve timestamp cursor decoding.+- Property sorts and date-range groups use source-owned item access gates without a separate property-definition check; validate ranges during input conversion.+- Build `groupSoup` through Soup's shared `build_grouped_response`; keep `document_server_facts` in `GroupedSoup::from_response` for cache projections.- `NOTIFIED_AT` maps to Soup's notified request, not a simple sort: `soup`accepts it descending only and `groupSoup` rejects it. Its continuation- cursors carry a different sort tag, so `inputs.rs` decodes both cursor shapes.+ cursors carry their own sort tag and string identifiers, separate from timestamp and selected-property cursors.- External chats are intentionally excluded from Soup hydration; use the `/external-chats` API.diff --git a/crates/graphql_soup/src/inputs.rs b/crates/graphql_soup/src/inputs.rsindex 6e0507a15e..879880b4c1 100644--- a/crates/graphql_soup/src/inputs.rs+++ b/crates/graphql_soup/src/inputs.rs@@ -4,9 +4,13 @@ use graphql_soup_filter_input::GraphqlEntityFilterAst;use item_filters::ast::{EntityFilterAst, properties::PropertyEntityType};use macro_user_id::user_id::MacroUserIdStr;use models_grouping::{GroupByField, GroupingConfig};-use models_pagination::{Base64Str, CursorWithValAndFilter, NotifiedAt, Query, SimpleSortMethod};++/// Caller-defined property date-range inputs.+mod date_ranges;+use date_ranges::GraphqlPropertyBucketing;+use models_pagination::{Base64Str, CursorWithValAndFilter, NotifiedAt, SimpleSortMethod};use soup::domain::models::{- GroupedSortRequest, SoupQuery, SoupRequest, SoupSortDirection, SoupType,+ DynamicSort, GroupedSortRequest, SoupQuery, SoupRequest, SoupSortDirection, SoupType,};use uuid::Uuid;@@ -26,9 +30,12 @@ pub struct SoupInitialInput {limit: Option<u16>,/// Whether to return expanded Soup items. Defaults to true.expand: Option<bool>,- /// Simple timestamp sort. Defaults to VIEWED_AT. Frecency is intentionally- /// not supported by this initial GraphQL adapter.+ /// Timestamp or selected numeric property sort. Defaults to VIEWED_AT.+ /// Frecency is not supported by this GraphQL adapter.+ /// Flat PROPERTY reads omit calendar events, email, channels, calls, companies, and agent sessions.sort_method: Option<GraphqlSimpleSortMethod>,+ /// Property definition selected for numeric property sorting.+ sort_property_definition_id: Option<ID>,/// Email preview view used when hydrating email Soup items.email_view: Option<GraphqlEmailView>,/// AST-shaped filters applied to each Soup entity type.@@ -89,7 +96,12 @@ pub struct GroupedSoupInitialInput {/// Maximum number of items to return per bin. Defaults to 20, max 500.limit: Option<u16>,/// Sort order within each bin. Defaults to `VIEWED_UPDATED`.+ /// Grouped PROPERTY reads retain calendar events; flat PROPERTY reads do not.sort_method: Option<GraphqlSimpleSortMethod>,+ /// Property definition selected for numeric property sorting.+ sort_property_definition_id: Option<ID>,+ /// Direction of property values. Defaults to DESC.+ sort_direction: Option<GraphqlSortDirection>,/// AST-shaped filters applied to each Soup entity type.filters: Option<GraphqlEntityFilterAst>,}@@ -129,23 +141,24 @@ impl GroupedSoupInitialInput {.map(GraphqlEntityFilterAst::into_ast).transpose()?.unwrap_or_default();- let sort_method = self- .sort_method- .map(GraphqlSimpleSortMethod::into_model)- .transpose()?- .unwrap_or(SimpleSortMethod::ViewedUpdated);- let limit = self.limit.unwrap_or(20).min(500);-- Ok(GroupedSortRequest {+ let sort_method = selected_sort(+ self.sort_method+ .unwrap_or(GraphqlSimpleSortMethod::ViewedUpdated),+ self.sort_property_definition_id,+ self.sort_direction,+ )?;+ let limit = self.limit.unwrap_or(20).clamp(1, 500);+ Ok(GroupedSortRequest::initial(+ macro_user_id,limit,- cursor: Query::Sort(sort_method, filters),- user_id: macro_user_id,- grouping: GroupingConfig {+ sort_method,+ filters,+ GroupingConfig {field: self.group_by.into_group_by_field()?,group_key: None,per_group_limit: Some(u32::from(limit)),},- })+ ))}}@@ -155,23 +168,16 @@ impl GroupedSoupContinuationInput {self,macro_user_id: MacroUserIdStr<'static>,) -> async_graphql::Result<GroupedSortRequest<'static>> {- let cursor = Base64Str::<- CursorWithValAndFilter<Uuid, SimpleSortMethod, EntityFilterAst>,- >::new_from_string(self.cursor)- .decode_json()- .map_err(|err| async_graphql::Error::new(format!("invalid cursor: {err}")))?;- let limit = u16::try_from(cursor.limit).unwrap_or(500).min(500);-- Ok(GroupedSortRequest {- limit,- cursor: Query::Cursor(cursor),- user_id: macro_user_id,- grouping: GroupingConfig {+ Ok(GroupedSortRequest::continue_from(+ macro_user_id,+ self.cursor,+ GroupingConfig {field: self.group_by.into_group_by_field()?,group_key: Some(self.group_key),per_group_limit: None,},- })+ None,+ )?)}}@@ -184,6 +190,8 @@ struct GraphqlGroupByInput {property_definition_id: Option<ID>,/// Optional property entity type restriction.entity_type: Option<GraphqlPropertyEntityType>,+ /// Optional caller-defined date ranges; requires PROPERTY grouping.+ bucketing: Option<GraphqlPropertyBucketing>,}impl GraphqlGroupByInput {@@ -217,6 +225,7 @@ impl GraphqlGroupByInput {Ok(GroupByField::Property {property_definition_id,entity_type,+ bucketing: self.bucketing.map(TryInto::try_into).transpose()?,})}}@@ -227,9 +236,12 @@ impl GraphqlGroupByInput {self,group_by: GroupByField,) -> async_graphql::Result<GroupByField> {- if self.property_definition_id.is_some() || self.entity_type.is_some() {+ if self.property_definition_id.is_some()+ || self.entity_type.is_some()+ || self.bucketing.is_some()+ {return Err(async_graphql::Error::new(- "propertyDefinitionId and entityType require PROPERTY grouping",+ "propertyDefinitionId, entityType and bucketing require PROPERTY grouping",));}Ok(group_by)@@ -275,12 +287,25 @@ impl SoupInitialInput {.map(GraphqlEntityFilterAst::into_ast).transpose()?.unwrap_or_default();- let cursor = match self+ let method = self.sort_method- .unwrap_or(GraphqlSimpleSortMethod::ViewedAt)- {- GraphqlSimpleSortMethod::NotifiedAt => SoupQuery::new_sort_notified(filter),- sort => SoupQuery::new_sort_simple(sort.into_model()?, filter),+ .unwrap_or(GraphqlSimpleSortMethod::ViewedAt);+ let cursor = if method == GraphqlSimpleSortMethod::Property {+ SoupQuery::Property(models_pagination::Query::Sort(+ selected_sort(+ method,+ self.sort_property_definition_id,+ self.sort_direction,+ )?,+ filter,+ ))+ } else {+ if self.sort_property_definition_id.is_some() {+ return Err(async_graphql::Error::new(+ "sortPropertyDefinitionId requires PROPERTY",+ ));+ }+ method.into_query(filter)?};Ok(SoupRequest {@@ -302,21 +327,20 @@ impl SoupContinuationInput {macro_user_id: MacroUserIdStr<'static>,link_ids: Vec<Uuid>,) -> async_graphql::Result<SoupRequest<EntityFilterAst>> {- // The sort tags never overlap, so at most one of these decodes.- let notified = Base64Str::<- CursorWithValAndFilter<String, NotifiedAt, EntityFilterAst>,- >::new_from_string(self.cursor.clone())- .decode_json();- let (limit, cursor) = match notified {- Ok(cursor) => (cursor.limit, SoupQuery::new_cursor_notified(cursor)),- Err(_) => {- let cursor = Base64Str::<- CursorWithValAndFilter<Uuid, SimpleSortMethod, EntityFilterAst>,- >::new_from_string(self.cursor)- .decode_json()- .map_err(|err| async_graphql::Error::new(format!("invalid cursor: {err}")))?;+ let cursor = Base64Str::<SoupContinuationCursor>::new_from_string(self.cursor)+ .decode_json()+ .map_err(|err| async_graphql::Error::new(format!("invalid cursor: {err}")))?;+ let (limit, cursor) = match cursor {+ SoupContinuationCursor::Property(cursor) => (+ cursor.limit,+ SoupQuery::Property(models_pagination::Query::Cursor(cursor)),+ ),+ SoupContinuationCursor::Simple(cursor) => {(cursor.limit, SoupQuery::new_cursor_simple(cursor))}+ SoupContinuationCursor::Notified(cursor) => {+ (cursor.limit, SoupQuery::new_cursor_notified(cursor))+ }};let limit = u16::try_from(limit).unwrap_or(500).min(500);@@ -332,6 +356,18 @@ impl SoupContinuationInput {}}+/// Decode ordinary timestamp, notification, and property position cursors.+#[derive(serde::Deserialize)]+#[serde(untagged)]+enum SoupContinuationCursor {+ /// An existing timestamp-sorted continuation.+ Simple(CursorWithValAndFilter<Uuid, SimpleSortMethod, EntityFilterAst>),+ /// A notification continuation, including channel-thread string identifiers.+ Notified(CursorWithValAndFilter<String, NotifiedAt, EntityFilterAst>),+ /// Selected-property position through the ordinary query.+ Property(CursorWithValAndFilter<Uuid, DynamicSort, EntityFilterAst>),+}+/// Convert the optional GraphQL sort direction into the domain representation./// Notified pages are keyset-ordered newest first, so ascending is rejected/// rather than silently ignored.@@ -406,7 +442,7 @@ impl GraphqlEmailView {// Filter input types and their authoritative materialization live in// `graphql_soup_filter_input`, shared with the browser cache composition root.-/// GraphQL representation of supported Soup sorts.+/// GraphQL representation of Soup timestamp, notification, and selected-property sorts.#[derive(Enum, Copy, Clone, Eq, PartialEq)]pub enum GraphqlSimpleSortMethod {/// Sort by most recently viewed.@@ -420,23 +456,68 @@ pub enum GraphqlSimpleSortMethod {/// Only entities the caller holds a live notification for, most recently/// notified first. Descending `soup` only; not supported by `groupSoup`.NotifiedAt,+ /// Sort by the selected property key, missing last, then newest update and ID.+ /// Missing definitions and unsupported types use update-time ordering.+ /// Email, channels, calls, companies, and agent sessions never appear.+ Property,}impl GraphqlSimpleSortMethod {- /// Convert this GraphQL sort method into a timestamp sort, rejecting- /// `NOTIFIED_AT`, which is not one.+ /// Convert into a grouped sort, rejecting the flat-only notification mode.pub fn into_model(self) -> async_graphql::Result<SimpleSortMethod> {- match self {- Self::ViewedAt => Ok(SimpleSortMethod::ViewedAt),- Self::CreatedAt => Ok(SimpleSortMethod::CreatedAt),- Self::UpdatedAt => Ok(SimpleSortMethod::UpdatedAt),- Self::ViewedUpdated => Ok(SimpleSortMethod::ViewedUpdated),- Self::NotifiedAt => Err(async_graphql::Error::new(- "NOTIFIED_AT is only supported by soup",- )),+ Ok(match self {+ Self::ViewedAt => SimpleSortMethod::ViewedAt,+ Self::CreatedAt => SimpleSortMethod::CreatedAt,+ Self::UpdatedAt => SimpleSortMethod::UpdatedAt,+ Self::ViewedUpdated => SimpleSortMethod::ViewedUpdated,+ Self::Property => {+ return Err(async_graphql::Error::new(+ "property sort requires sortPropertyDefinitionId",+ ));+ }+ Self::NotifiedAt => {+ return Err(async_graphql::Error::new(+ "NOTIFIED_AT is only supported by soup",+ ));+ }+ })+ }++ /// Build an ordinary timestamp or notification query.+ fn into_query<T>(self, filters: T) -> async_graphql::Result<SoupQuery<T>> {+ if matches!(self, Self::NotifiedAt) {+ return Ok(SoupQuery::new_sort_notified(filters));}+ Ok(SoupQuery::new_sort_simple(self.into_model()?, filters))}}#[cfg(test)]mod tests;++/// Select a numeric property or preserve the ordinary timestamp sort.+fn selected_sort(+ method: GraphqlSimpleSortMethod,+ property: Option<ID>,+ direction: Option<GraphqlSortDirection>,+) -> async_graphql::Result<DynamicSort> {+ if method == GraphqlSimpleSortMethod::Property {+ return Ok(DynamicSort::Property {+ property_definition_id: parse_id(+ property.ok_or_else(|| {+ async_graphql::Error::new("PROPERTY requires sortPropertyDefinitionId")+ })?,+ "sortPropertyDefinitionId",+ )?,+ direction: direction+ .map(GraphqlSortDirection::into_model)+ .unwrap_or_default(),+ });+ }+ if property.is_some() {+ return Err(async_graphql::Error::new(+ "sortPropertyDefinitionId requires PROPERTY",+ ));+ }+ method.into_model().map(Into::into)+}diff --git a/crates/graphql_soup/src/inputs/date_ranges.rs b/crates/graphql_soup/src/inputs/date_ranges.rsnew file mode 100644index 0000000000..15480d8011--- /dev/null+++ b/crates/graphql_soup/src/inputs/date_ranges.rs@@ -0,0 +1,75 @@+use models_grouping::{PropertyBucketing, PropertyDateRange, PropertyDateRanges};++/// Transform the selected DATE property into caller-defined ranges.+/// Non-DATE values use the missing-value bucket.+#[derive(async_graphql::InputObject, Clone)]+pub(super) struct GraphqlPropertyBucketing {+ /// Bucketing transformation.+ #[graphql(name = "type")]+ pub kind: GraphqlPropertyBucketingType,+ /// Ordered, contiguous UTC ranges covering every present date.+ pub ranges: Vec<GraphqlDateBucketRange>,+ /// Key for entities whose selected property is absent or cleared.+ pub missing_value_bucket_key: String,+}++/// Supported property-value transformations.+#[derive(async_graphql::Enum, Copy, Clone, Eq, PartialEq)]+pub(super) enum GraphqlPropertyBucketingType {+ /// Caller-defined half-open UTC date ranges.+ DateRanges,+}++/// One named half-open UTC interval.+#[derive(async_graphql::InputObject, Clone)]+pub(super) struct GraphqlDateBucketRange {+ /// Unique group key.+ pub key: String,+ /// Inclusive RFC 3339 UTC start; null means negative infinity.+ pub start: Option<String>,+ /// Exclusive RFC 3339 UTC end; null means positive infinity.+ pub end: Option<String>,+}++impl TryFrom<GraphqlPropertyBucketing> for PropertyBucketing {+ type Error = async_graphql::Error;++ fn try_from(value: GraphqlPropertyBucketing) -> Result<Self, Self::Error> {+ match value.kind {+ GraphqlPropertyBucketingType::DateRanges => {+ let ranges =+ value+ .ranges+ .into_iter()+ .map(|range| {+ Ok(PropertyDateRange {+ key: range.key,+ start: range.start.map(|start| start.parse()).transpose().map_err(+ |error| {+ async_graphql::Error::new(format!(+ "invalid date range start: {error}"+ ))+ },+ )?,+ end: range.end.map(|end| end.parse()).transpose().map_err(+ |error| {+ async_graphql::Error::new(format!(+ "invalid date range end: {error}"+ ))+ },+ )?,+ })+ })+ .collect::<async_graphql::Result<Vec<_>>>()?;+ let ranges = PropertyDateRanges {+ ranges,+ missing_value_bucket_key: value.missing_value_bucket_key,+ };+ ranges+ .validate()+ .map_err(|error| async_graphql::Error::new(format!("{error:?}")))?;+ Ok(Self::DateRanges(ranges))+ }+ }+ }+}diff --git a/crates/graphql_soup/src/inputs/tests.rs b/crates/graphql_soup/src/inputs/tests.rsindex 17f5d168a0..ac35c867c2 100644--- a/crates/graphql_soup/src/inputs/tests.rs+++ b/crates/graphql_soup/src/inputs/tests.rs@@ -1,6 +1,7 @@use macro_user_id::{cowlike::CowLike, user_id::MacroUserIdStr};use models_pagination::{CursorVal, Query};+use super::date_ranges::{GraphqlDateBucketRange, GraphqlPropertyBucketingType};use super::*;fn test_macro_user_id() -> MacroUserIdStr<'static> {@@ -12,6 +13,7 @@ fn test_macro_user_id() -> MacroUserIdStr<'static> {#[test]fn maps_email_view_to_soup_request() {let request = SoupInput::Initial(Box::new(SoupInitialInput {+ sort_property_definition_id: None,limit: None,expand: None,sort_method: None,@@ -28,6 +30,7 @@ fn maps_email_view_to_soup_request() {#[test]fn defaults_email_view_to_inbox() {let request = SoupInput::Initial(Box::new(SoupInitialInput {+ sort_property_definition_id: None,limit: None,expand: None,sort_method: None,@@ -70,6 +73,7 @@ fn maps_soup_cursor_continuation() {#[test]fn maps_notified_at_to_notified_soup_request() {let request = SoupInput::Initial(Box::new(SoupInitialInput {+ sort_property_definition_id: None,limit: Some(500),expand: None,sort_method: Some(GraphqlSimpleSortMethod::NotifiedAt),@@ -111,6 +115,7 @@ fn continues_a_notified_cursor_as_a_notified_request() {#[test]fn rejects_ascending_notified_at() {let result = SoupInput::Initial(Box::new(SoupInitialInput {+ sort_property_definition_id: None,limit: None,expand: None,sort_method: Some(GraphqlSimpleSortMethod::NotifiedAt),@@ -126,10 +131,13 @@ fn rejects_ascending_notified_at() {#[test]fn rejects_grouped_notified_at() {let result = GroupedSoupInput::Initial(Box::new(GroupedSoupInitialInput {+ sort_property_definition_id: None,+ sort_direction: None,group_by: GraphqlGroupByInput {field: GraphqlGroupByField::EntityType,property_definition_id: None,entity_type: None,+ bucketing: None,},limit: None,sort_method: Some(GraphqlSimpleSortMethod::NotifiedAt),@@ -143,10 +151,13 @@ fn rejects_grouped_notified_at() {#[test]fn maps_initial_grouped_input() {let request = GroupedSoupInput::Initial(Box::new(GroupedSoupInitialInput {+ sort_property_definition_id: None,+ sort_direction: None,group_by: GraphqlGroupByInput {field: GraphqlGroupByField::EntityType,property_definition_id: None,entity_type: None,+ bucketing: None,},limit: Some(42),sort_method: Some(GraphqlSimpleSortMethod::UpdatedAt),@@ -159,7 +170,7 @@ fn maps_initial_grouped_input() {assert!(request.grouping.group_key.is_none());assert!(matches!(request.cursor,- Query::Sort(SimpleSortMethod::UpdatedAt, _)+ Query::Sort(DynamicSort::Timestamp(SimpleSortMethod::UpdatedAt), _)));}@@ -179,6 +190,7 @@ fn maps_grouped_cursor_continuation() {field: GraphqlGroupByField::EntityType,property_definition_id: None,entity_type: None,+ bucketing: None,},group_key: "document".to_owned(),cursor: cursor.to_string(),@@ -190,3 +202,146 @@ fn maps_grouped_cursor_continuation() {assert_eq!(request.grouping.group_key.as_deref(), Some("document"));assert!(matches!(request.cursor, Query::Cursor(_)));}++fn date_range_input() -> GraphqlGroupByInput {+ GraphqlGroupByInput {+ field: GraphqlGroupByField::Property,+ property_definition_id: Some(ID::from("00000000-0000-0000-0000-000000000012")),+ entity_type: Some(GraphqlPropertyEntityType::Document),+ bucketing: Some(GraphqlPropertyBucketing {+ kind: GraphqlPropertyBucketingType::DateRanges,+ ranges: vec![+ GraphqlDateBucketRange {+ key: "before-review".to_owned(),+ start: None,+ end: Some("2026-03-08T05:00:00Z".to_owned()),+ },+ GraphqlDateBucketRange {+ key: "review-window".to_owned(),+ start: Some("2026-03-08T05:00:00Z".to_owned()),+ end: Some("2026-03-09T04:00:00Z".to_owned()),+ },+ GraphqlDateBucketRange {+ key: "after-review".to_owned(),+ start: Some("2026-03-09T04:00:00Z".to_owned()),+ end: None,+ },+ ],+ missing_value_bucket_key: "no-review-date".to_owned(),+ }),+ }+}++#[test]+fn date_ranges_require_a_selected_property() {+ for field in [+ GraphqlGroupByField::Date,+ GraphqlGroupByField::EntityType,+ GraphqlGroupByField::Project,+ ] {+ let mut input = date_range_input();+ input.field = field;+ input.property_definition_id = None;+ input.entity_type = None;+ assert!(input.into_group_by_field().is_err());+ }++ let mut input = date_range_input();+ input.property_definition_id = None;+ assert!(input.into_group_by_field().is_err());+}++#[test]+fn invalid_date_range_timestamps_are_rejected() {+ let mut input = date_range_input();+ input.bucketing.as_mut().unwrap().ranges[0].end = Some("not-a-timestamp".to_owned());+ assert!(input.into_group_by_field().is_err());+}++#[test]+fn invalid_date_buckets_are_rejected_during_input_conversion() {+ let mut empty = date_range_input();+ empty.bucketing.as_mut().unwrap().ranges.clear();+ assert!(empty.into_group_by_field().is_err());++ let mut overlapping = date_range_input();+ overlapping.bucketing.as_mut().unwrap().ranges[1].start =+ Some("2026-03-07T05:00:00Z".to_owned());+ assert!(overlapping.into_group_by_field().is_err());++ let mut duplicate_key = date_range_input();+ duplicate_key+ .bucketing+ .as_mut()+ .unwrap()+ .missing_value_bucket_key = "before-review".to_owned();+ assert!(duplicate_key.into_group_by_field().is_err());+}++#[test]+fn date_range_grouping_preserves_custom_keys_and_timestamp_sorting() {+ let request = GroupedSoupInput::Initial(Box::new(GroupedSoupInitialInput {+ sort_property_definition_id: None,+ sort_direction: None,+ group_by: date_range_input(),+ limit: Some(25),+ sort_method: Some(GraphqlSimpleSortMethod::UpdatedAt),+ filters: None,+ }))+ .into_request(test_macro_user_id())+ .unwrap();+ assert_eq!(request.limit, 25);+ let (property, ranges) = request.grouping.field.date_ranges().unwrap();+ assert_eq!(property, Uuid::from_u128(18));+ assert_eq!(ranges.missing_value_bucket_key, "no-review-date");+ assert_eq!(ranges.ranges[1].key, "review-window");+ assert_eq!(+ ranges.ranges[1].end.unwrap() - ranges.ranges[1].start.unwrap(),+ chrono::Duration::hours(23)+ );+}++#[test]+fn property_sort_keeps_null_position_without_a_query_context() {+ let definition = Uuid::from_u128(18);+ let request = SoupInput::Initial(Box::new(SoupInitialInput {+ limit: Some(10),+ expand: Some(false),+ sort_method: Some(GraphqlSimpleSortMethod::Property),+ sort_property_definition_id: Some(ID::from(definition.to_string())),+ email_view: None,+ filters: None,+ sort_direction: Some(GraphqlSortDirection::Asc),+ }))+ .into_request(test_macro_user_id(), vec![])+ .unwrap();+ let SoupQuery::Property(query) = request.cursor else {+ panic!("expected property sort")+ };+ let sort = *query.sort_method();+ let cursor = Base64Str::encode_json(CursorWithValAndFilter {+ id: Uuid::from_u128(1),+ limit: 10,+ val: models_pagination::CursorVal {+ sort_type: sort,+ last_val: sort.position(None, chrono::DateTime::default()),+ },+ filter: EntityFilterAst::default(),+ })+ .type_erase();+ let continued = SoupInput::Continuation(SoupContinuationInput {+ cursor,+ expand: None,+ email_view: None,+ sort_direction: None,+ })+ .into_request(test_macro_user_id(), vec![])+ .unwrap();+ let SoupQuery::Property(query) = continued.cursor else {+ panic!("expected property cursor")+ };+ assert!(+ matches!(query.sort_method(), DynamicSort::Property { property_definition_id, direction: SoupSortDirection::Asc } if *property_definition_id == definition)+ );+ assert_eq!(query.vals().1.unwrap().key(), None);+}diff --git a/crates/graphql_soup/src/loaders.rs b/crates/graphql_soup/src/loaders.rsindex 16d4ab418a..e9a8f2bf28 100644--- a/crates/graphql_soup/src/loaders.rs+++ b/crates/graphql_soup/src/loaders.rs@@ -250,6 +250,7 @@ where.map(|thread| SoupProjectionHydration {item: SoupItem::EmailThread(thread),document_server_facts: None,+ sort_key: None,}).chain(items);let mut loaded = HashMap::with_capacity(requested.len());diff --git a/crates/graphql_soup/src/objects.rs b/crates/graphql_soup/src/objects.rsindex 528cb17b11..695639974d 100644--- a/crates/graphql_soup/src/objects.rs+++ b/crates/graphql_soup/src/objects.rs@@ -30,10 +30,7 @@ use models_soup::{};use predicate_index::RecordKey;use serde_json::Value;-use soup::domain::models::{- EnrichedSoupItem, SoupProjectionHydration, SoupPropertiesField,- grouping::{GroupLabels, NestedSoupGroups},-};+use soup::domain::models::{EnrichedSoupItem, SoupProjectionHydration, grouping::GroupedResponse};use soup_filter_projection::{encode_cache_projection_supplement, project_soup_cache_supplement};use uuid::Uuid;@@ -219,20 +216,34 @@ pub struct GroupedSoup<E: SoupEntityEdges> {}impl<E: SoupEntityEdges> GroupedSoup<E> {- /// Construct grouped GraphQL Soup bins from the domain grouping model,- /// labeling the bins whose key the client cannot label on its own.- pub fn new(groups: NestedSoupGroups<SoupPropertiesField>, labels: &GroupLabels) -> Self {+ /// Construct GraphQL bins from the shared grouped response and cursor policy.+ pub fn from_response(response: GroupedResponse) -> Self {Self {- bins: groups- .into_bins()- .map(|(key, bin)| GraphqlSoupBin {- label: labels.get(&key).map(str::to_owned),- key,- total_count: bin.group_total_size(),- next_cursor: bin.next_cursor().map(ToOwned::to_owned),- items: bin- .into_items()- .map(|item| GraphqlSoupEntity::new(item.map_extra(|_| ())))+ bins: response+ .groups+ .into_iter()+ .map(|group| GraphqlSoupBin {+ label: (group.label != group.key).then_some(group.label),+ key: group.key,+ total_count: group.total_count as usize,+ display_order: group.display_order,+ next_cursor: group.next_cursor,+ items: group+ .item_ids+ .iter()+ .filter_map(|id| response.items.get(id).map(|item| (id, item)))+ .map(|(id, item)| {+ GraphqlSoupEntity::new_from_enriched_with_projection(+ SoupProjectionHydration {+ item: item.clone(),+ document_server_facts: response+ .document_server_facts+ .get(id)+ .cloned(),+ sort_key: None,+ },+ )+ }).collect(),}).collect(),@@ -251,6 +262,8 @@ pub struct GraphqlSoupBin<E: SoupEntityEdges> {label: Option<String>,/// Total number of items in this group across all pages.total_count: usize,+ /// Stored option order or calendar bucket order, when available.+ display_order: Option<i32>,/// Opaque cursor for the next page in this bin, if one exists.next_cursor: Option<String>,/// Items in this bin, ordered by their index within the group.diff --git a/crates/graphql_soup/src/resolvers.rs b/crates/graphql_soup/src/resolvers.rsindex 5103da929b..9606b77cbf 100644--- a/crates/graphql_soup/src/resolvers.rs+++ b/crates/graphql_soup/src/resolvers.rs@@ -18,7 +18,7 @@ use macro_authorization::{MacroAuthorizationService, MacroAuthorizationState};use macro_user_id::user_id::MacroUserIdStr;use model_entity::EntityType;use models_pagination::TypeEraseCursor;-use soup::domain::{models::grouping::NestedSoupGroups, ports::SoupService};+use soup::domain::{models::grouping::build_grouped_response, ports::SoupService};use soup_realtime::domain::{models::Patch, ports::SoupRealtimeSubscriptionService};use crate::{@@ -93,21 +93,27 @@ wherelet macro_user_id = require_authorized_user::<Auth, St>(ctx).await?;let viewer = macro_user_id.clone();let request = input.into_request(macro_user_id)?;- let sort_method = *request.cursor.sort_method();+ let sort = *request.cursor.sort_method();let filters = request.cursor.filter().clone();- let group_by = request.grouping.field.clone();- let items = service.get_user_soup_grouped(request).await?;- let groups: NestedSoupGroups<_, _> = items.collect();- let keys: Vec<String> = groups- .keys()+ let grouping = request.grouping.clone();+ let items: Vec<_> = service.get_user_soup_grouped(request).await?.collect();+ let mut keys: Vec<String> = items+ .iter()+ .map(|item| item.key.clone()).filter(|key| !key.is_empty())- .cloned().collect();- let labels = service.group_labels(viewer, &group_by, &keys).await?;- Ok(GroupedSoup::new(- groups.with_next_cursors(sort_method, filters),+ keys.sort_unstable();+ keys.dedup();+ let labels = service.group_labels(viewer, &grouping.field, &keys).await?;+ let response = build_grouped_response(+ items,+ &grouping.field,+ sort,+ grouping.group_key,+ filters,&labels,- ))+ );+ Ok(GroupedSoup::from_response(response))}/// Resolve one email thread through the Soup item loader, whose email@@ -270,8 +276,8 @@ wherelet macro_user_id = require_authorized_user::<Auth, St>(ctx).await?;let Cached(MultiEmailLinkExtractor(links, _)) =extract_part::<Cached<MultiEmailLinkExtractor<E, Auth>>, St>(ctx).await?;- let link_ids = links.into_iter().map(|link| link.id).collect();- let request = input.into_request(macro_user_id, link_ids)?;+ let link_ids: Vec<_> = links.into_iter().map(|link| link.id).collect();+ let request = input.into_request(macro_user_id.clone(), link_ids.clone())?;// Always forward the optional team receipt: Soup uses it for all// team-scoped foreign entities, not only CRM-scoped filters.diff --git a/crates/graphql_soup_filter_input/src/lib.rs b/crates/graphql_soup_filter_input/src/lib.rsindex b4c3e8aa6f..3cb28e9d88 100644--- a/crates/graphql_soup_filter_input/src/lib.rs+++ b/crates/graphql_soup_filter_input/src/lib.rs@@ -282,6 +282,19 @@ enum GraphqlFilterPropertyMatchValue {SelectOption(ID),/// Entity reference id to match.EntityRef(ID),+ /// Match a DATE property in a UTC range.+ DateRange(GraphqlPropertyDateRange),+}++/// Explicit UTC bounds for a DATE property.+#[cfg_attr(feature = "server", derive(async_graphql::InputObject))]+#[derive(Serialize, Deserialize)]+#[serde(rename_all = "camelCase")]+struct GraphqlPropertyDateRange {+ /// Inclusive UTC start, or no lower bound.+ start: Option<String>,+ /// Exclusive UTC end, or no upper bound.+ end: Option<String>,}impl GraphqlFilterPropertyMatchValue {@@ -295,6 +308,24 @@ impl GraphqlFilterPropertyMatchValue {EntityRefId::new(value.to_string()).map_err(|err| InputError::new(format!("invalid entityRef: {err}")))?,),+ Self::DateRange(range) => {+ PropertyMatchValue::DateRange(item_filters::ast::properties::DateRange {+ start: range+ .start+ .as_deref()+ .map(chrono::DateTime::parse_from_rfc3339)+ .transpose()+ .map_err(|err| InputError::new(format!("invalid dateRange.start: {err}")))?+ .map(|value| value.with_timezone(&Utc)),+ end: range+ .end+ .as_deref()+ .map(chrono::DateTime::parse_from_rfc3339)+ .transpose()+ .map_err(|err| InputError::new(format!("invalid dateRange.end: {err}")))?+ .map(|value| value.with_timezone(&Utc)),+ })+ }})}}@@ -339,6 +370,7 @@ impl TryFrom<GraphqlPropertyEntityType> for PropertyEntityType {fn try_from(value: GraphqlPropertyEntityType) -> Result<Self, Self::Error> {Ok(match value {GraphqlPropertyEntityType::CalendarEvent => Self::CalendarEvent,+ GraphqlPropertyEntityType::CallRecord => Self::CallRecord,GraphqlPropertyEntityType::Channel => Self::Channel,GraphqlPropertyEntityType::Chat => Self::Chat,GraphqlPropertyEntityType::Company => Self::Company,@@ -349,8 +381,7 @@ impl TryFrom<GraphqlPropertyEntityType> for PropertyEntityType {GraphqlPropertyEntityType::Thread => Self::Thread,GraphqlPropertyEntityType::User => Self::User,GraphqlPropertyEntityType::Initiative => Self::Initiative,- other- @ (GraphqlPropertyEntityType::CallRecord | GraphqlPropertyEntityType::Contact) => {+ other @ GraphqlPropertyEntityType::Contact => {return Err(other);}})@@ -366,7 +397,7 @@ pub struct GraphqlEntityFilterAst {favorites_only: Option<bool>,/// Restrict every entity type to items associated with this CRM record,/// or to activity across visible CRM-enabled teams.- /// Requires an expanded, timestamp-sorted query.+ /// Requires an expanded query sorted by a timestamp or selected property.crm_association: Option<GraphqlCrmAssociation>,/// The calendar event filter to apply.calendar_event_filter: Option<GraphqlCalendarEventExpr>,@@ -703,8 +734,8 @@ enum GraphqlDocumentLiteral {/// Uploaded from an email attachment sent by, or to, a matching address.EmailAttachmentParticipant(GraphqlEmailValue),/// Associated with a CRM record through its Companies or Contacts- /// property or a reference to the record. Requires an expanded,- /// timestamp-sorted query.+ /// property or a reference to the record. Requires an expanded query+ /// sorted by a timestamp or task due date.CrmAssociated(GraphqlCrmAssociation),/// Case-insensitive substring of the document name.NameContains(String),diff --git a/crates/graphql_soup_filter_input/src/test.rs b/crates/graphql_soup_filter_input/src/test.rsindex b8729e5845..3969c78f51 100644--- a/crates/graphql_soup_filter_input/src/test.rs+++ b/crates/graphql_soup_filter_input/src/test.rs@@ -6,6 +6,45 @@ use serde_json::{Value, json};use super::*;+#[test]+fn open_date_ranges_materialize_without_invented_boundaries() {+ let ast = materialize_graphql_filter(json!({"propertiesFilter": {"literal": {+ "propertyDefinitionId": "00000001-0000-0000-0000-000000000004",+ "value": {"dateRange": {"end": "2026-10-21T00:00:00+05:30"}}+ }}}))+ .unwrap();+ assert!(+ matches!(ast.properties_filter.as_deref(), Some(Expr::Literal(PropertiesLiteral {+ value: PropertyMatchValue::DateRange(range), ..+ })) if range.start.is_none() && range.end.unwrap().to_rfc3339() == "2026-10-20T18:30:00+00:00")+ );+ assert!(+ materialize_graphql_filter(json!({"propertiesFilter": {"literal": {+ "propertyDefinitionId": "00000001-0000-0000-0000-000000000004",+ "value": {"dateRange": {"start": "invalid"}}+ }}}))+ .is_err()+ );+}++#[test]+fn document_missing_dates_preserve_negation() {+ let ast =+ materialize_graphql_filter(json!({"documentFilter": {"not": {"literal": {"property": {+ "propertyDefinitionId": "00000001-0000-0000-0000-000000000004",+ "value": {"dateRange": {}}+ }}}}}))+ .unwrap();+ assert!(matches!(+ ast.document_filter.as_deref(),+ Some(Expr::Not(inner)) if matches!(inner.as_ref(),+ Expr::Literal(DocumentLiteral::Property(PropertiesLiteral {+ value: PropertyMatchValue::DateRange(item_filters::ast::properties::DateRange { start: None, end: None }), ..+ }))+ )+ ));+}+fn generated_filter_fixture() -> Value {serde_json::from_str(include_str!("../fixtures/generated-soup-filter.json")).unwrap()}@@ -122,9 +161,17 @@ fn property_entity_type_conversion_rejects_unsupported_variants() {})};- let error = materialize_graphql_filter(property_filter(json!("CALL_RECORD"))).unwrap_err();+ let error = materialize_graphql_filter(property_filter(json!("CONTACT"))).unwrap_err();assert!(matches!(error, MaterializeError::Conversion(_)));+ let calls = materialize_graphql_filter(property_filter(json!("CALL_RECORD"))).unwrap();+ assert!(matches!(+ calls.properties_filter.as_deref(),+ Some(Expr::Literal(PropertiesLiteral {+ entity_type: Some(PropertyEntityType::CallRecord),+ ..+ }))+ ));let ast = materialize_graphql_filter(property_filter(Value::Null)).unwrap();let Some(Expr::Literal(literal)) = ast.properties_filter.as_deref() else {panic!("expected property literal")diff --git a/crates/item_filter_index/AGENTS.md b/crates/item_filter_index/AGENTS.mdindex 2bf0d27b3c..1ab76bd857 100644--- a/crates/item_filter_index/AGENTS.md+++ b/crates/item_filter_index/AGENTS.md@@ -51,6 +51,8 @@ engine) — keep it free of native-only dependencies.- `STATUS_PROPERTY_DEFINITION_ID` hardcodes `SystemPropertyKey::STATUS_UUID`to avoid a native dependency on `system_properties` for wasm; a native testlocks the two values together, so don't drift them independently.+- Reject date-property ranges and presence filters as unsupported until the+ projection includes canonical dates; callers must use the server query.## Relateddiff --git a/crates/item_filter_index/src/properties.rs b/crates/item_filter_index/src/properties.rsindex 45a53a7671..90060966ff 100644--- a/crates/item_filter_index/src/properties.rs+++ b/crates/item_filter_index/src/properties.rs@@ -35,6 +35,10 @@ fn supported(ast: &EntityFilterAst) -> bool {// Current view selections are untyped. Typed property-row lookups need// association evidence not present in the GraphQL property snapshot.literal.entity_type.is_none()+ && matches!(+ &literal.value,+ PropertyMatchValue::SelectOption(_) | PropertyMatchValue::EntityRef(_)+ )})}@@ -56,6 +60,9 @@ fn property_predicate(entity_attribute(literal.property_definition_id),id.to_string(),)?,+ PropertyMatchValue::DateRange(_) => {+ unreachable!("date property literals are ineligible for the local index");+ }})})}diff --git a/crates/item_filter_index/src/test.rs b/crates/item_filter_index/src/test.rsindex 7f44ac84b9..301e0b7b11 100644--- a/crates/item_filter_index/src/test.rs+++ b/crates/item_filter_index/src/test.rs@@ -563,3 +563,41 @@ fn crm_associations_use_server_membership() {);}}++#[test]+fn date_property_filters_use_server_queries_instead_of_partial_local_matches() {+ use item_filters::ast::properties::DateRange;+ for value in [+ PropertyMatchValue::DateRange(DateRange {+ start: None,+ end: None,+ }),+ PropertyMatchValue::DateRange(DateRange {+ start: Some("2026-03-08T05:00:00Z".parse().unwrap()),+ end: None,+ }),+ ] {+ for negated in [false, true] {+ let literal = Expr::val(PropertiesLiteral {+ property_definition_id: Uuid::from_u128(4),+ entity_type: None,+ value: value.clone(),+ });+ let mut ast = excluded_deferred_partitions();+ ast.properties_filter = Some(Arc::new(if negated {+ Expr::is_not(literal)+ } else {+ literal+ }));+ assert_eq!(+ properties::compile_soup(&ast, request()).unwrap(),+ LocalCompileOutcome::Unsupported(UnsupportedReason::GlobalProperties),+ );+ assert_eq!(+ properties::compile_mail(&ast, request(), "inbox", &[], "macro|[email protected]")+ .unwrap(),+ LocalCompileOutcome::Unsupported(UnsupportedReason::GlobalProperties),+ );+ }+ }+}diff --git a/crates/item_filters/AGENTS.md b/crates/item_filters/AGENTS.mdindex ea3e3d68d8..f4b5776ba2 100644--- a/crates/item_filters/AGENTS.md+++ b/crates/item_filters/AGENTS.md@@ -60,6 +60,9 @@ logically-combinable query form.notification states) also implicitly opts in — don't assume an empty`include` flag means "show everything".- `#![deny(missing_docs)]`: every new public field needs a doc comment.+- Represent DATE presence as `DateRange` with both bounds open and absence as its negation; `start` is inclusive and `end` exclusive.+- Export filter intervals as `PropertyDateFilterRange` in schemas to distinguish half-open optional bounds from stored, inclusive `models_properties::DateRange` values.+- Keep DATE evaluation in Soup/OpenSearch; call, email, and frecency treat date literals as false and preserve ordinary boolean negation.## Relateddiff --git a/crates/item_filters/src/ast/properties.rs b/crates/item_filters/src/ast/properties.rsindex 734c71cb1c..66363baa5b 100644--- a/crates/item_filters/src/ast/properties.rs+++ b/crates/item_filters/src/ast/properties.rs@@ -1,6 +1,7 @@use std::fmt;use std::str::FromStr;+use chrono::{DateTime, Utc};use serde::{Deserialize, Serialize};use uuid::Uuid;@@ -15,6 +16,8 @@ use filter_ast::{ExpandFrame, Expr, FoldTree, TryExpandNode};#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq)]#[serde(rename_all = "SCREAMING_SNAKE_CASE")]pub enum PropertyEntityType {+ /// Native, archived, or imported call record.+ CallRecord,/// Calendar event entityCalendarEvent,/// Channel entity@@ -49,6 +52,7 @@ impl FromStr for PropertyEntityType {fn from_str(s: &str) -> Result<Self, Self::Err> {match s {"CALENDAR_EVENT" => Ok(Self::CalendarEvent),+ "CALL_RECORD" => Ok(Self::CallRecord),"CHANNEL" => Ok(Self::Channel),"CHAT" => Ok(Self::Chat),"COMPANY" => Ok(Self::Company),@@ -68,6 +72,7 @@ impl fmt::Display for PropertyEntityType {fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {match self {Self::CalendarEvent => write!(f, "CALENDAR_EVENT"),+ Self::CallRecord => write!(f, "CALL_RECORD"),Self::Channel => write!(f, "CHANNEL"),Self::Chat => write!(f, "CHAT"),Self::Company => write!(f, "COMPANY"),@@ -129,6 +134,20 @@ impl<'de> Deserialize<'de> for EntityRefId {}}+/// UTC timestamp interval. Lower bounds are inclusive; upper bounds are exclusive.+#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq)]+#[cfg_attr(feature = "schema", derive(utoipa::ToSchema, schemars::JsonSchema))]+#[cfg_attr(feature = "schema", schema(as = PropertyDateFilterRange))]+#[cfg_attr(feature = "schema", schemars(rename = "PropertyDateFilterRange"))]+pub struct DateRange {+ /// Inclusive UTC lower bound, omitted for an open start.+ #[serde(default, skip_serializing_if = "Option::is_none")]+ pub start: Option<DateTime<Utc>>,+ /// Exclusive UTC upper bound, omitted for an open end.+ #[serde(default, skip_serializing_if = "Option::is_none")]+ pub end: Option<DateTime<Utc>>,+}+/// Describes how to match against a property value in the entity_properties table.#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq)]pub enum PropertyMatchValue {@@ -138,6 +157,9 @@ pub enum PropertyMatchValue {/// Match an entity reference by entity_id. Uses the `@>` jsonb operator on `values->'value'`.#[serde(rename = "er")]EntityRef(EntityRefId),+ /// Match a DATE property within a UTC interval; open bounds match any present date.+ #[serde(rename = "dr")]+ DateRange(DateRange),}/// A single property-based filter condition for the AST.@@ -202,9 +224,37 @@ impl ExpandFrame<PropertiesLiteral> for Vec<PropertyFilter> {Expr::or,)?;- Ok([option_nodes, entity_ref_nodes]- .into_iter()- .fold_with(Expr::or))+ let date_range_node = pf.date_range.map(|range| {+ Expr::val(PropertiesLiteral {+ property_definition_id: prop_def_id,+ entity_type,+ value: PropertyMatchValue::DateRange(range),+ })+ });+ let date_present_node = pf.has_date.map(|has_date| {+ let literal = Expr::val(PropertiesLiteral {+ property_definition_id: prop_def_id,+ entity_type,+ value: PropertyMatchValue::DateRange(DateRange {+ start: None,+ end: None,+ }),+ });+ if has_date {+ literal+ } else {+ Expr::is_not(literal)+ }+ });+ Ok([+ [option_nodes, entity_ref_nodes]+ .into_iter()+ .fold_with(Expr::or),+ date_range_node,+ date_present_node,+ ]+ .into_iter()+ .fold_with(Expr::and))}).collect::<Result<_, ExpandErr>>()?;diff --git a/crates/item_filters/src/ast/tests.rs b/crates/item_filters/src/ast/tests.rsindex caeb4a6168..cb7360b48f 100644--- a/crates/item_filters/src/ast/tests.rs+++ b/crates/item_filters/src/ast/tests.rs@@ -599,6 +599,7 @@ fn it_expands_single_property_select_option() {entity_type: Some("TASK".to_string()),option_ids: vec![option_id.to_string()],entity_ids: vec![],+ ..Default::default()}],..Default::default()};@@ -618,6 +619,7 @@ fn it_expands_multiple_option_ids_as_or() {entity_type: Some("TASK".to_string()),option_ids: vec![option_a.to_string(), option_b.to_string()],entity_ids: vec![],+ ..Default::default()}],..Default::default()};@@ -643,6 +645,7 @@ fn it_expands_entity_ref_filter() {entity_type: Some("TASK".to_string()),option_ids: vec![],entity_ids: vec![entity_id.clone()],+ ..Default::default()}],..Default::default()};@@ -675,12 +678,14 @@ fn it_ands_multiple_property_filters() {entity_type: Some("TASK".to_string()),option_ids: vec![option_a.to_string()],entity_ids: vec![],+ ..Default::default()},PropertyFilter {property_definition_id: priority_id.to_string(),entity_type: Some("TASK".to_string()),option_ids: vec![option_b.to_string()],entity_ids: vec![],+ ..Default::default()},],..Default::default()@@ -708,6 +713,7 @@ fn it_ors_mixed_option_and_entity_ref_within_single_filter() {entity_type: Some("TASK".to_string()),option_ids: vec![option_id.to_string()],entity_ids: vec![entity_id],+ ..Default::default()}],..Default::default()};@@ -745,6 +751,7 @@ fn property_filter_with_empty_values_produce_no_ast() {entity_type: Some("TASK".to_string()),option_ids: vec![],entity_ids: vec![],+ ..Default::default()}],..Default::default()};@@ -765,6 +772,7 @@ fn it_expands_property_filter_without_entity_type() {entity_type: None,option_ids: vec![option_id.to_string()],entity_ids: vec![],+ ..Default::default()}],..Default::default()};@@ -794,6 +802,7 @@ fn it_expands_property_filter_with_entity_type() {entity_type: Some("TASK".to_string()),option_ids: vec![option_id.to_string()],entity_ids: vec![],+ ..Default::default()}],..Default::default()};@@ -916,6 +925,7 @@ fn invalid_entity_type_returns_error() {entity_type: Some("TASK'; DROP TABLE documents; --".to_string()),option_ids: vec![option_id.to_string()],entity_ids: vec![],+ ..Default::default()}],..Default::default()};@@ -935,6 +945,7 @@ fn entity_ref_with_single_quote_returns_error() {entity_type: Some("TASK".to_string()),option_ids: vec![],entity_ids: vec!["x'); DROP TABLE documents; --".to_string()],+ ..Default::default()}],..Default::default()};@@ -1835,6 +1846,73 @@ fn crm_associations_deduplicate_repeated_records() {assert!(EntityFilterAst::default().crm_associations().is_empty());}+#[test]+fn date_property_expansion_preserves_utc_boundaries_and_negates_missing() {+ use properties::{DateRange, PropertyMatchValue};+ let definition = Uuid::from_u128(0x00000001_0000_0000_0000_000000000004);+ let start = chrono::DateTime::parse_from_rfc3339("2025-12-31T23:59:59Z")+ .unwrap()+ .with_timezone(&chrono::Utc);+ let end = chrono::DateTime::parse_from_rfc3339("2026-01-01T00:00:00Z")+ .unwrap()+ .with_timezone(&chrono::Utc);+ let make = |range, has_date| {+ EntityFilterAst::new_from_filters(EntityFilters {+ property_filters: vec![PropertyFilter {+ property_definition_id: definition.to_string(),+ entity_type: Some("TASK".into()),+ date_range: range,+ has_date,+ ..Default::default()+ }],+ ..Default::default()+ })+ .unwrap()+ .unwrap()+ };+ let range = make(+ Some(DateRange {+ start: Some(start),+ end: Some(end),+ }),+ None,+ );+ assert_matches!(range.properties_filter.as_deref().unwrap(), Expr::Literal(properties::PropertiesLiteral {+ value: PropertyMatchValue::DateRange(DateRange { start: lower, end: upper }), ..+ }) if *lower == Some(start) && *upper == Some(end));+ let missing = make(None, Some(false));+ assert_matches!(missing.properties_filter.as_deref().unwrap(), Expr::Not(inner)+ if matches!(inner.as_ref(), Expr::Literal(properties::PropertiesLiteral { value: PropertyMatchValue::DateRange(DateRange { start: None, end: None }), .. })));+ let present = make(None, Some(true));+ assert_matches!(+ present.properties_filter.as_deref().unwrap(),+ Expr::Literal(properties::PropertiesLiteral {+ value: PropertyMatchValue::DateRange(DateRange {+ start: None,+ end: None+ }),+ ..+ })+ );+ assert!(make(None, Some(false)).properties_filter.is_some());+ let open_end = make(+ Some(DateRange {+ start: Some(start),+ end: None,+ }),+ None,+ );+ assert_matches!(open_end.properties_filter.as_deref().unwrap(), Expr::Literal(properties::PropertiesLiteral { value: PropertyMatchValue::DateRange(DateRange { start: lower, end: None }), .. }) if *lower == Some(start));+ let open_start = make(+ Some(DateRange {+ start: None,+ end: Some(end),+ }),+ None,+ );+ assert_matches!(open_start.properties_filter.as_deref().unwrap(), Expr::Literal(properties::PropertiesLiteral { value: PropertyMatchValue::DateRange(DateRange { start: None, end: upper }), .. }) if *upper == Some(end));+}+#[test]fn agent_session_source_literals_use_the_column_values() {use crate::ast::agent_session::{AgentSessionLiteral, AgentSessionSource};diff --git a/crates/item_filters/src/lib.rs b/crates/item_filters/src/lib.rsindex a243d7b231..8e51a3598d 100644--- a/crates/item_filters/src/lib.rs+++ b/crates/item_filters/src/lib.rs@@ -684,11 +684,20 @@ pub struct PropertyFilter {/// Entity reference IDs to match. Multiple values are OR'd together.#[serde(default, skip_serializing_if = "Vec::is_empty")]pub entity_ids: Vec<String>,+ /// UTC range for Soup/search: inclusive start, exclusive end; both open matches any date.+ #[serde(default, skip_serializing_if = "Option::is_none")]+ pub date_range: Option<ast::properties::DateRange>,+ /// Flat Soup/search presence filter: true expands to an open date range, false to its negation.+ #[serde(default, skip_serializing_if = "Option::is_none")]+ pub has_date: Option<bool>,}impl IsEmpty for PropertyFilter {fn is_empty(&self) -> bool {- self.option_ids.is_empty() && self.entity_ids.is_empty()+ self.option_ids.is_empty()+ && self.entity_ids.is_empty()+ && self.date_range.is_none()+ && self.has_date.is_none()}}diff --git a/crates/models_grouping/Cargo.toml b/crates/models_grouping/Cargo.tomlindex 0025a3e23d..3d5e0edbb4 100644--- a/crates/models_grouping/Cargo.toml+++ b/crates/models_grouping/Cargo.toml@@ -7,5 +7,8 @@ version = "0.1.0"[dependencies]chrono = { workspace = true }serde = { workspace = true }+models_pagination = { path = "../models_pagination" }+models_properties = { path = "../models_properties" }uuid = { workspace = true }+utoipa = { workspace = true }workspace-hack = { version = "0.1", path = "../workspace-hack" }diff --git a/crates/models_grouping/src/field.rs b/crates/models_grouping/src/field.rsindex 25b1e56a6c..d1bccfaa3f 100644--- a/crates/models_grouping/src/field.rs+++ b/crates/models_grouping/src/field.rs@@ -3,6 +3,13 @@use serde::{Deserialize, Serialize};use uuid::Uuid;+/// Optional transformation of a selected property's stored value into group keys.+#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, utoipa::ToSchema)]+#[serde(tag = "type", rename_all = "snake_case")]+pub enum PropertyBucketing {+ /// Caller-defined, ordered UTC date ranges and a separate missing-value key.+ DateRanges(crate::PropertyDateRanges),+}/// Field to group results by.#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]#[serde(tag = "type", rename_all = "snake_case")]@@ -21,6 +28,9 @@ pub enum GroupByField {/// Optional entity type scope for the property lookup#[serde(skip_serializing_if = "Option::is_none")]entity_type: Option<String>,+ /// Optional DATE-value partition supplied by the caller.+ #[serde(default, skip_serializing_if = "Option::is_none")]+ bucketing: Option<PropertyBucketing>,},}@@ -29,4 +39,16 @@ impl GroupByField {pub fn requires_property_join(&self) -> bool {matches!(self, GroupByField::Property { .. })}++ /// Selected DATE property and its caller-defined partition, when present.+ pub fn date_ranges(&self) -> Option<(Uuid, &crate::PropertyDateRanges)> {+ match self {+ Self::Property {+ property_definition_id,+ bucketing: Some(PropertyBucketing::DateRanges(ranges)),+ ..+ } => Some((*property_definition_id, ranges)),+ _ => None,+ }+ }}diff --git a/crates/models_grouping/src/lib.rs b/crates/models_grouping/src/lib.rsindex 7060ee73d3..178b60edc0 100644--- a/crates/models_grouping/src/lib.rs+++ b/crates/models_grouping/src/lib.rs@@ -11,8 +11,10 @@ mod config;mod date_buckets;mod field;mod meta;+mod property_date_ranges;pub use config::*;pub use date_buckets::*;pub use field::*;pub use meta::*;+pub use property_date_ranges::*;diff --git a/crates/models_grouping/src/property_date_ranges.rs b/crates/models_grouping/src/property_date_ranges.rsnew file mode 100644index 0000000000..3a66d90185--- /dev/null+++ b/crates/models_grouping/src/property_date_ranges.rs@@ -0,0 +1,109 @@+//! Frozen, caller-defined buckets for DATE property queries.++use std::collections::HashSet;++use chrono::{DateTime, Utc};+use serde::{Deserialize, Serialize};++/// Maximum number of date ranges in one grouping request.+pub const MAX_DATE_RANGES: usize = 32;+/// Maximum UTF-8 byte length of a caller-supplied bucket key.+pub const MAX_DATE_RANGE_KEY_BYTES: usize = 128;++/// A half-open UTC interval. An absent start or end extends to infinity.+#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, utoipa::ToSchema)]+pub struct PropertyDateRange {+ /// Unique caller-supplied group key.+ pub key: String,+ /// Inclusive start, or negative infinity.+ pub start: Option<DateTime<Utc>>,+ /// Exclusive end, or positive infinity.+ pub end: Option<DateTime<Utc>>,+}++/// A complete partition of present dates plus one bucket for absent values.+#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, utoipa::ToSchema)]+pub struct PropertyDateRanges {+ /// Ordered, contiguous ranges covering every present date.+ pub ranges: Vec<PropertyDateRange>,+ /// Caller-supplied group key for entities with no date value.+ pub missing_value_bucket_key: String,+}++/// Why a date-range grouping configuration cannot partition all values.+#[derive(Debug, Clone, Copy, PartialEq, Eq)]+pub enum PropertyDateRangeError {+ /// A partition must contain between one and 32 intervals.+ RangeCount,+ /// Keys must be unique, nonempty and at most 128 bytes long.+ InvalidKey,+ /// The first range must begin at negative infinity and the last must end at positive infinity.+ UnboundedEdges,+ /// Intermediate boundaries must be finite, contiguous and strictly increasing.+ InvalidBounds,+}++impl PropertyDateRanges {+ /// Check that every present date belongs to exactly one bucket.+ pub fn validate(&self) -> Result<(), PropertyDateRangeError> {+ if !(1..=MAX_DATE_RANGES).contains(&self.ranges.len()) {+ return Err(PropertyDateRangeError::RangeCount);+ }+ let mut keys = HashSet::with_capacity(self.ranges.len() + 1);+ for key in self+ .ranges+ .iter()+ .map(|range| range.key.as_str())+ .chain(std::iter::once(self.missing_value_bucket_key.as_str()))+ {+ if key.is_empty()+ || key.contains('\0')+ || key.len() > MAX_DATE_RANGE_KEY_BYTES+ || !keys.insert(key)+ {+ return Err(PropertyDateRangeError::InvalidKey);+ }+ }+ if self+ .ranges+ .first()+ .is_none_or(|range| range.start.is_some())+ || self.ranges.last().is_none_or(|range| range.end.is_some())+ {+ return Err(PropertyDateRangeError::UnboundedEdges);+ }+ for (index, range) in self.ranges.iter().enumerate() {+ if let (Some(start), Some(end)) = (range.start, range.end)+ && start >= end+ {+ return Err(PropertyDateRangeError::InvalidBounds);+ }+ if let Some(next) = self.ranges.get(index + 1)+ && (range.end.is_none() || range.end != next.start)+ {+ return Err(PropertyDateRangeError::InvalidBounds);+ }+ }+ Ok(())+ }++ /// Return the caller's key for a date or its missing-value bucket.+ /// Reject invalid configurations instead of assigning unmatched dates to the missing bucket.+ pub fn key(&self, value: Option<DateTime<Utc>>) -> Result<&str, PropertyDateRangeError> {+ self.validate()?;+ let Some(value) = value else {+ return Ok(&self.missing_value_bucket_key);+ };+ self.ranges+ .iter()+ .find(|range| {+ range.start.is_none_or(|start| value >= start)+ && range.end.is_none_or(|end| value < end)+ })+ .map(|range| range.key.as_str())+ .ok_or(PropertyDateRangeError::InvalidBounds)+ }+}++#[cfg(test)]+mod test;diff --git a/crates/models_grouping/src/property_date_ranges/test.rs b/crates/models_grouping/src/property_date_ranges/test.rsnew file mode 100644index 0000000000..690438708f--- /dev/null+++ b/crates/models_grouping/src/property_date_ranges/test.rs@@ -0,0 +1,111 @@+use super::*;++#[test]+fn boundaries_are_half_open_and_null_has_a_distinct_key() {+ let boundary = "2026-03-09T04:00:00Z".parse().unwrap();+ let buckets = PropertyDateRanges {+ ranges: vec![+ PropertyDateRange {+ key: "before".into(),+ start: None,+ end: Some(boundary),+ },+ PropertyDateRange {+ key: "after".into(),+ start: Some(boundary),+ end: None,+ },+ ],+ missing_value_bucket_key: "no date".into(),+ };+ assert_eq!(buckets.validate(), Ok(()));+ assert_eq!(+ buckets.key(Some("2026-03-09T03:59:59Z".parse().unwrap())),+ Ok("before")+ );+ assert_eq!(buckets.key(Some(boundary)), Ok("after"));+ assert_eq!(buckets.key(None), Ok("no date"));+}++#[test]+fn rejects_gaps_overlaps_empty_intervals_and_unbounded_edges() {+ let at = |s: &str| s.parse::<DateTime<Utc>>().unwrap();+ let first = at("2026-03-09T04:00:00Z");+ let second = at("2026-03-10T04:00:00Z");+ let mut buckets = PropertyDateRanges {+ ranges: vec![+ PropertyDateRange {+ key: "a".into(),+ start: None,+ end: Some(first),+ },+ PropertyDateRange {+ key: "b".into(),+ start: Some(first),+ end: None,+ },+ ],+ missing_value_bucket_key: "missing".into(),+ };+ buckets.ranges[1].start = Some(second);+ assert_eq!(+ buckets.validate(),+ Err(PropertyDateRangeError::InvalidBounds)+ );+ buckets.ranges[1].start = Some(at("2026-03-08T04:00:00Z"));+ assert_eq!(+ buckets.validate(),+ Err(PropertyDateRangeError::InvalidBounds)+ );+ buckets.ranges[1].start = Some(first);+ buckets.ranges[1].end = Some(first);+ assert_eq!(+ buckets.validate(),+ Err(PropertyDateRangeError::UnboundedEdges)+ );+ buckets.ranges.push(PropertyDateRange {+ key: "c".into(),+ start: Some(first),+ end: None,+ });+ assert_eq!(+ buckets.validate(),+ Err(PropertyDateRangeError::InvalidBounds)+ );+ buckets.ranges.remove(2);+ buckets.ranges[1].end = None;+ buckets.ranges[0].start = Some(first);+ assert_eq!(+ buckets.validate(),+ Err(PropertyDateRangeError::UnboundedEdges)+ );+}++#[test]+fn rejects_duplicate_oversized_or_empty_keys_and_invalid_range_counts() {+ let mut buckets = PropertyDateRanges {+ ranges: vec![PropertyDateRange {+ key: "a".into(),+ start: None,+ end: None,+ }],+ missing_value_bucket_key: "a".into(),+ };+ assert_eq!(buckets.validate(), Err(PropertyDateRangeError::InvalidKey));+ buckets.missing_value_bucket_key = "".into();+ assert_eq!(buckets.validate(), Err(PropertyDateRangeError::InvalidKey));+ buckets.missing_value_bucket_key = "x".repeat(MAX_DATE_RANGE_KEY_BYTES + 1);+ assert_eq!(buckets.validate(), Err(PropertyDateRangeError::InvalidKey));+ buckets.missing_value_bucket_key = "missing".into();+ assert_eq!(buckets.validate(), Ok(()));+ buckets.ranges.clear();+ assert_eq!(buckets.validate(), Err(PropertyDateRangeError::RangeCount));+ buckets.ranges = (0..=MAX_DATE_RANGES)+ .map(|i| PropertyDateRange {+ key: i.to_string(),+ start: None,+ end: None,+ })+ .collect();+ assert_eq!(buckets.validate(), Err(PropertyDateRangeError::RangeCount));+}diff --git a/crates/models_pagination/AGENTS.md b/crates/models_pagination/AGENTS.mdindex 24fdcffbc2..f8c13ad22a 100644--- a/crates/models_pagination/AGENTS.md+++ b/crates/models_pagination/AGENTS.md@@ -11,7 +11,7 @@ methods, shared by almost every list endpoint in the backend.the three traits an item/sort method must implement to be paginated, plusthe opaque base64 cursor types.- `src/sort.rs`: concrete sort methods (`CreatedAt`, `Frecency`, `NotifiedAt`,- `TouchedByMe`, `SimpleSortMethod`).+ `TouchedByMe`, `SimpleSortMethod`); Soup extends position values in its own domain for numeric property sorts.- `src/collections.rs`: `CollectBy`/`CollectByIds` helpers.- `src/axum.rs` (feature `axum`): `BidirectionalCursor` extractor.diff --git a/crates/opensearch_client/AGENTS.md b/crates/opensearch_client/AGENTS.mdindex 85880ae761..84dc35e0f0 100644--- a/crates/opensearch_client/AGENTS.md+++ b/crates/opensearch_client/AGENTS.md@@ -37,6 +37,7 @@ projects.`src/upsert/<entity>.rs` + `src/delete/<entity>.rs` → a `src/search/<entity>.rs`query if it needs its own search endpoint → wire into`services/search_processing_service`.+- Property DATE filters use the existing nested `properties.date_value` epoch-millisecond projection; emit only supplied inclusive/exclusive bounds and use a negated nested exists query for missing dates.## Checksdiff --git a/crates/opensearch_client/src/search/documents.rs b/crates/opensearch_client/src/search/documents.rsindex 786b72980b..9f97a7e157 100644--- a/crates/opensearch_client/src/search/documents.rs+++ b/crates/opensearch_client/src/search/documents.rs@@ -55,10 +55,19 @@ pub enum DocumentSearchMode {NameContent,}+/// UTC bounds for an indexed DATE property.+#[derive(Debug, Clone, Copy)]+pub struct PropertyDateRange {+ /// Inclusive lower bound, when provided.+ pub start: Option<DateTime<Utc>>,+ /// Exclusive upper bound, when provided.+ pub end: Option<DateTime<Utc>>,+}+/// A property-equality filter applied against the indexed `properties` nested/// field. Matches parents that have a nested entry whose `definition_id`/// equals `definition_id` and whose `values` contains any of `values`.-/// Empty `values` means "no constraint" and is dropped before querying.+/// Empty `values` imposes no membership constraint; date predicates still apply.#[derive(Debug, Clone)]pub struct PropertyFilterArg {/// The property definition id to match on.@@ -66,6 +75,10 @@ pub struct PropertyFilterArg {/// Candidate values (OR'd). Select-option UUIDs and entity-ref ids both/// live in the indexed `values` keyword array.pub values: Vec<String>,+ /// UTC range with optional inclusive start and exclusive end.+ pub date_range: Option<PropertyDateRange>,+ /// True for a non-null DATE; false for absent, null, or cleared values.+ pub has_date: Option<bool>,}#[derive(Clone)]@@ -273,25 +286,51 @@ impl DocumentQueryBuilder {/// the filter's id AND `values` containing any of the filter's values./// Returns `None` when the filter carries no values.fn build_property_filter<'a>(filter: &PropertyFilterArg) -> Option<QueryType<'a>> {- if filter.values.is_empty() {+ if filter.values.is_empty() && filter.date_range.is_none() && filter.has_date.is_none() {return None;}- let mut inner = BoolQueryBuilder::new();- inner.filter(QueryType::term(- format!("{PROPERTIES_PATH}.definition_id"),- filter.definition_id.clone(),- ));- inner.filter(QueryType::terms(- format!("{PROPERTIES_PATH}.values"),- filter.values.clone(),- ));- // ignore_unmapped: the unified query spans indices that don't map- // `properties` as nested; there the clause is a no-op rather than an error.- Some(+ let definition_field = format!("{PROPERTIES_PATH}.definition_id");+ let date_field = format!("{PROPERTIES_PATH}.date_value");+ let nested = |value_query: QueryType<'a>| {+ let mut inner = BoolQueryBuilder::new();+ inner.filter(QueryType::term(+ definition_field.clone(),+ filter.definition_id.clone(),+ ));+ inner.filter(value_query);NestedQuery::new(PROPERTIES_PATH, inner.build().into()).ignore_unmapped(true)- .into(),- )+ .into()+ };+ if filter.date_range.is_none() && filter.has_date.is_none() {+ return Some(nested(QueryType::terms(+ format!("{PROPERTIES_PATH}.values"),+ filter.values.clone(),+ )));+ }+ let mut outer = BoolQueryBuilder::new();+ if !filter.values.is_empty() {+ outer.filter(nested(QueryType::terms(+ format!("{PROPERTIES_PATH}.values"),+ filter.values.clone(),+ )));+ }+ if let Some(bounds) = filter.date_range {+ let mut range = QueryType::range(date_field.clone());+ if let Some(start) = bounds.start {+ range.gte(start.timestamp_millis());+ }+ if let Some(end) = bounds.end {+ range.lt(end.timestamp_millis());+ }+ outer.filter(nested(range.build().into()));+ }+ match filter.has_date {+ Some(true) => outer.filter(nested(QueryType::Exists(date_field.into()))),+ Some(false) => outer.must_not(nested(QueryType::Exists(date_field.into()))),+ None => &mut outer,+ };+ Some(outer.build().into())}/// Highlight config attached to each `has_child` inner_hits block.diff --git a/crates/opensearch_client/src/search/documents/test.rs b/crates/opensearch_client/src/search/documents/test.rsindex 69903c471e..61a77bb3f2 100644--- a/crates/opensearch_client/src/search/documents/test.rs+++ b/crates/opensearch_client/src/search/documents/test.rs@@ -240,10 +240,14 @@ fn test_build_bool_query_property_filters_emit_nested() -> anyhow::Result<()> {"00000001-0000-0000-0002-000000000001".to_string(),"00000001-0000-0000-0002-000000000004".to_string(),],+ date_range: None,+ has_date: None,},PropertyFilterArg {definition_id: "00000001-0000-0000-0000-000000000001".to_string(),values: vec!["macro|[email protected]".to_string()],+ date_range: None,+ has_date: None,},]);@@ -283,6 +287,8 @@ fn test_build_bool_query_property_filter_empty_values_skipped() -> anyhow::Resul.property_filters(vec![PropertyFilterArg {definition_id: "00000001-0000-0000-0000-000000000002".to_string(),values: vec![],+ date_range: None,+ has_date: None,}]);let json = builder.build_bool_query()?.build().to_json();@@ -410,3 +416,89 @@ fn document_index_deserializes_parent_shape() {assert_eq!(doc.document_name, "Q3 Planning");assert_eq!(doc.owner_id, "macro|[email protected]");}++#[test]+fn date_property_filters_constrain_candidates_before_search_pagination() -> anyhow::Result<()> {+ let start =+ chrono::DateTime::parse_from_rfc3339("2025-12-31T23:59:59Z")?.with_timezone(&chrono::Utc);+ let end =+ chrono::DateTime::parse_from_rfc3339("2026-01-01T00:00:00Z")?.with_timezone(&chrono::Utc);+ let arg = PropertyFilterArg {+ definition_id: "00000001-0000-0000-0000-000000000004".into(),+ values: vec![],+ date_range: Some(PropertyDateRange {+ start: Some(start),+ end: Some(end),+ }),+ has_date: Some(true),+ };+ let query = DocumentQueryBuilder::new(vec!["foo".into()])+ .user_id("alice")+ .property_filters(vec![arg.clone()])+ .build_bool_query()?+ .build()+ .to_json();+ let filter = query["bool"]["filter"].as_array().unwrap();+ let range = filter.iter().find(|v| v["bool"].is_object()).unwrap();+ let nested = &range["bool"]["filter"][0]["nested"]["query"]["bool"]["filter"];+ assert_eq!(+ nested[0]["term"]["properties.definition_id"],+ arg.definition_id+ );+ assert_eq!(+ nested[1]["range"]["properties.date_value"]["gte"],+ start.timestamp_millis()+ );+ assert_eq!(+ nested[1]["range"]["properties.date_value"]["lt"],+ end.timestamp_millis()+ );+ assert_eq!(+ range["bool"]["filter"][1]["nested"]["query"]["bool"]["filter"][1]["exists"]["field"],+ "properties.date_value"+ );+ let missing = DocumentQueryBuilder::new(vec!["foo".into()])+ .user_id("alice")+ .property_filters(vec![PropertyFilterArg {+ date_range: None,+ has_date: Some(false),+ ..arg+ }])+ .build_bool_query()?+ .build()+ .to_json();+ let missing_clause = missing["bool"]["filter"]+ .as_array()+ .unwrap()+ .iter()+ .find(|v| v["bool"].is_object())+ .unwrap();+ assert_eq!(+ missing_clause["bool"]["must_not"][0]["nested"]["query"]["bool"]["filter"][1]["exists"]["field"],+ "properties.date_value"+ );+ Ok(())+}++#[test]+fn open_date_ranges_only_emit_supplied_search_bounds() -> anyhow::Result<()> {+ let boundary =+ chrono::DateTime::parse_from_rfc3339("2026-10-21T00:00:00Z")?.with_timezone(&chrono::Utc);+ for (start, end, expected, absent) in [+ (Some(boundary), None, "gte", "lt"),+ (None, Some(boundary), "lt", "gte"),+ ] {+ let query = build_property_filter(&PropertyFilterArg {+ definition_id: "00000001-0000-0000-0000-000000000004".to_owned(),+ values: vec![],+ date_range: Some(PropertyDateRange { start, end }),+ has_date: None,+ })+ .unwrap()+ .to_json();+ let range = &query["bool"]["filter"][0]["nested"]["query"]["bool"]["filter"][1]["range"]["properties.date_value"];+ assert_eq!(range[expected], boundary.timestamp_millis());+ assert!(range.get(absent).is_none());+ }+ Ok(())+}diff --git a/crates/opensearch_query_builder/src/query.rs b/crates/opensearch_query_builder/src/query.rsindex a8e2bbb04f..6a58682bcf 100644--- a/crates/opensearch_query_builder/src/query.rs+++ b/crates/opensearch_query_builder/src/query.rs@@ -65,6 +65,8 @@ pub enum QueryType<'a> {HasChild(HasChildQuery<'a>),/// nested query (returns parents whose nested objects match)Nested(NestedQuery<'a>),+ /// Match documents with an indexed value for this field.+ Exists(Cow<'a, str>),}impl<'a> ToOpenSearchJson for QueryType<'a> {@@ -83,6 +85,7 @@ impl<'a> ToOpenSearchJson for QueryType<'a> {QueryType::SimpleQueryString(simple_query_string) => simple_query_string.to_json(),QueryType::HasChild(has_child) => has_child.to_json(),QueryType::Nested(nested) => nested.to_json(),+ QueryType::Exists(field) => serde_json::json!({ "exists": { "field": field } }),}}}@@ -171,6 +174,7 @@ impl<'a> QueryType<'a> {QueryType::SimpleQueryString(sqs) => QueryType::SimpleQueryString(sqs.to_owned()),QueryType::HasChild(has_child) => QueryType::HasChild(has_child.to_owned()),QueryType::Nested(nested) => QueryType::Nested(nested.to_owned()),+ QueryType::Exists(field) => QueryType::Exists(Cow::Owned(field.to_string())),}}}diff --git a/crates/properties/AGENTS.md b/crates/properties/AGENTS.mdindex dcc809f7c6..764c3ff19b 100644--- a/crates/properties/AGENTS.md+++ b/crates/properties/AGENTS.md@@ -19,6 +19,7 @@ events to the `macro.properties` Kafka topic.- `src/outbound/properties_pg_repo.rs` +`src/outbound/*_queries.rs`: the Postgres adapters, one file per concern(definitions, options, entity values, metadata, tag promotion).+- `src/domain/service.rs`: property reads and mutations; Soup does not require a separate definition-reader collaborator.## Scope@@ -35,6 +36,7 @@ events to the `macro.properties` Kafka topic.`search_service`, `soup`, `crm`, `graphql_properties`, `properties_service`,`services/document_storage_service`, `services/agent_trigger_service`,`services/search_processing_service`.+- Keep Soup sort/group SQL in Soup; property-definition authorization must be designed consistently across filters, grouping, and sorting, not added to one path.## Recipesdiff --git a/crates/properties/Cargo.toml b/crates/properties/Cargo.tomlindex 1b97d581c4..2fc939b6b5 100644--- a/crates/properties/Cargo.toml+++ b/crates/properties/Cargo.toml@@ -47,6 +47,8 @@ entity_access = { path = "../entity_access", default-features = false, features] }entity_access_db_utils = { path = "../entity_access_db_utils", optional = true }futures = { workspace = true, optional = true }+filter_ast = { path = "../filter_ast" }+item_filters = { path = "../item_filters", default-features = false }macro_authorization = { path = "../macro_authorization", default-features = false, features = ["axum",], optional = true }@@ -77,6 +79,7 @@ ai_toolset = { path = "../ai_toolset" }chrono = { workspace = true }macro_db_migrator = { path = "../macro_db_migrator" }mockall = { workspace = true }+models_pagination = { path = "../models_pagination" }rootcause = { workspace = true }serde_json = { workspace = true }tokio = { workspace = true, features = ["macros", "rt-multi-thread"] }diff --git a/crates/search_service/src/api/search/simple/simple_unified.rs b/crates/search_service/src/api/search/simple/simple_unified.rsindex 82a9ab8594..1be41c1c8c 100644--- a/crates/search_service/src/api/search/simple/simple_unified.rs+++ b/crates/search_service/src/api/search/simple/simple_unified.rs@@ -20,7 +20,9 @@ use models_search::{MatchType, SearchOn, SimpleSearchResponse, unified::UnifiedSuse models_search_cursor::{SearchCursor, SearchCursorOption, SearchMethodCursor};use opensearch_client::search::agent_sessions::{AgentSessionSearchArgs, AgentSessionSearchMode};use opensearch_client::search::call_records::CallRecordSearchMode;-use opensearch_client::search::documents::{DocumentSearchMode, PropertyFilterArg};+use opensearch_client::search::documents::{+ DocumentSearchMode, PropertyDateRange, PropertyFilterArg,+};use opensearch_client::search::model::SearchHit;use opensearch_client::search::unified::UnifiedSearchArgs;@@ -173,12 +175,17 @@ fn to_property_filter_args(filters: &[item_filters::PropertyFilter]) -> Vec<Prop.chain(f.entity_ids.iter()).cloned().collect();- if values.is_empty() {+ if values.is_empty() && f.date_range.is_none() && f.has_date.is_none() {return None;}Some(PropertyFilterArg {definition_id: f.property_definition_id.clone(),values,+ date_range: f.date_range.as_ref().map(|range| PropertyDateRange {+ start: range.start,+ end: range.end,+ }),+ has_date: f.has_date,})}).collect()diff --git a/crates/soup/AGENTS.md b/crates/soup/AGENTS.mdindex 80d713ba2d..110ae65749 100644--- a/crates/soup/AGENTS.md+++ b/crates/soup/AGENTS.md@@ -13,6 +13,8 @@ rows, initiatives, ...) and get back a single unified, paginated result.its repository/collaborator traits.- `src/domain/models.rs` (+ `grouping.rs`, `exclusions.rs`, `contact_listing.rs`):the unified `SoupItem`/grouping/exclusion shapes.+- `src/domain/models/sort.rs`: property/timestamp sort descriptors and ordinary+ position cursors; timestamp encodings remain backward-compatible.- `src/domain/service/favorites.rs`, `agent_metadata.rs`: entity-kind-specificquery logic layered onto the core service.- `src/outbound/pg_soup_repo.rs`: the Postgres repo, split by entity kind@@ -85,6 +87,17 @@ rows, initiatives, ...) and get back a single unified, paginated result.- `expanded/` vs `unexpanded/` queries exist because hydrating full entitiesis expensive — don't widen `unexpanded` to return hydrated data; add a new`expanded` path instead.+- Extend the existing dynamic query for property sorts and date-range groups; do not rebuild its source UNION in a candidate pipeline.+- Keep property definition IDs unchecked like existing filters/grouping; enforce item visibility through the existing source access gates.+- Order property pages by typed key with explicit ASC/DESC and NULLS LAST, then update timestamp and descending ID; keep timestamp SQL unchanged.+- Validate caller DATE ranges in REST/GraphQL input conversion; render typed UTC bounds with `to_rfc3339()` and map numeric range indices to caller keys in Rust.+- Preserve projection-backed hydration, the UUID-keyed item/fact pools, and per-group total/has-more metadata through the shared grouped response.+- Flat property sorts omit calendar events, email, channels, calls, companies, and agent sessions; grouped reads retain calendar events and timestamp queries retain their existing sources.+- Preserve deployed timestamp cursor encodings; client query keys restart pages when ranges or selections change.+- Keep flat timestamp top clauses lightweight; bind document-ID arrays after the sort's fixed parameters and skip subtype namespace joins when the filter proves TASK-only unless other predicates need them.+- Read grouping/sort definition types through uncorrelated scalar lookups; join grouping options once outside the value expansion and preserve missing-option groups.+- Build option-sort order maps with an uncorrelated `jsonb_object_agg` lookup using the sort definition bind; ignore unknown option IDs and keep unknown-only values missing.+- Materialize grouped `TopItems` only for property sorts so the sort key is computed before multi-value group expansion; leave timestamp CTEs inlineable.- `candidate_gates.rs` encodes access-gate SQL shared across repo queries;changing it changes what every entity kind can return.- Keep the notified feed's notification lookup behind a lateral `OFFSET 0`diff --git a/crates/soup/Cargo.toml b/crates/soup/Cargo.tomlindex 09c7fc521b..5f84c49ac8 100644--- a/crates/soup/Cargo.toml+++ b/crates/soup/Cargo.toml@@ -34,7 +34,6 @@ axum = [inbound = ["email/inbound", "entity_access/inbound", "ports"]outbound = ["crm/outbound",- "dep:properties","dep:readonly_pool","dep:sqlx","ports",@@ -82,7 +81,7 @@ models_pagination = { path = "../models_pagination" }models_properties = { path = "../models_properties" }models_soup = { path = "../models_soup" }non_empty = { path = "../non_empty" }-properties = { path = "../properties", default-features = false, optional = true }+properties = { path = "../properties", default-features = false }readonly_pool = { path = "../readonly_pool", optional = true }recursion = { workspace = true }rootcause = { workspace = true }diff --git a/crates/soup/src/domain/models.rs b/crates/soup/src/domain/models.rsindex a50d850c02..2911d5c77a 100644--- a/crates/soup/src/domain/models.rs+++ b/crates/soup/src/domain/models.rs@@ -1,6 +1,9 @@#[cfg(feature = "ports")]pub(crate) mod contact_listing;pub mod grouping;+/// Numeric property and timestamp sort positions.+pub mod sort;+pub use sort::{DynamicSort, DynamicSortValue};#[cfg(feature = "ports")]mod exclusions;@@ -63,7 +66,8 @@ use {/// Deliberately Soup's own type rather than one borrowed from the paginator:/// `Paginator` already exposes `sort_asc`/`sort_desc`, so this only has to name/// the choice, and doing it here keeps the shared pagination crate untouched.-#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]+#[derive(Debug, Clone, Copy, PartialEq, Eq, Default, serde::Serialize, serde::Deserialize)]+#[serde(rename_all = "snake_case")]pub enum SoupSortDirection {/// Smallest sort value first — oldest, or soonest for a future timestamp.Asc,@@ -100,18 +104,7 @@ pub struct SimpleSortRequest<'a> {pub(crate) user_id: MacroUserIdStr<'a>,}-/// Parameters for grouped soup queries.-#[derive(Debug)]-pub struct GroupedSortRequest<'a> {- /// the limit of the number of items to return- pub limit: u16,- /// the cursor/query- pub cursor: Query<Uuid, SimpleSortMethod, EntityFilterAst>,- /// the id of the user- pub user_id: MacroUserIdStr<'a>,- /// grouping configuration- pub grouping: GroupingConfig,-}+pub use grouping::query::GroupedSortRequest;#[cfg(feature = "ports")]#[cfg_attr(@@ -131,6 +124,8 @@ pub(crate) enum SimpleSortQuery {ItemsFilter(Query<Uuid, SimpleSortMethod, EntityFilterAst>),/// we filter out items based on the input [EntityFilterAst] IN ADDITION to ANY items that DO have a [Frecency] scoreItemsAndFrecencyFilter(Query<Uuid, SimpleSortMethod, (Frecency, EntityFilterAst)>),+ /// Property sorting through the same dynamic source query.+ Property(Query<Uuid, DynamicSort, EntityFilterAst>),}#[cfg(feature = "ports")]@@ -175,6 +170,7 @@ impl SimpleSortQuery {SimpleSortQuery::FilterFrecency(query) => query.sort_method(),SimpleSortQuery::ItemsFilter(query) => query.sort_method(),SimpleSortQuery::ItemsAndFrecencyFilter(query) => query.sort_method(),+ SimpleSortQuery::Property(_) => &SimpleSortMethod::UpdatedAt,}}}@@ -201,6 +197,8 @@ pub enum SoupQuery<T> {/// Query filtered and sorted by the user's latest notification per/// entity (the inbox's notified-at surface).Notified(NotifiedQueryInner<T>),+ /// Numeric property ordering through the dynamic SQL query.+ Property(Query<Uuid, DynamicSort, T>),}impl<T> SoupQuery<T> {@@ -221,6 +219,7 @@ impl<T> SoupQuery<T> {SoupQuery::Notified(NotifiedQueryInner(i)) => {SoupQuery::Notified(NotifiedQueryInner(i.map_filter(f)))}+ SoupQuery::Property(query) => SoupQuery::Property(query.map_filter(f)),}}}@@ -321,6 +320,7 @@ impl<T> SoupQuery<T> {SoupQuery::Frecency(FrecencyQueryInner(query)) => query.filter(),SoupQuery::Touched(TouchedQueryInner(query)) => query.filter(),SoupQuery::Notified(NotifiedQueryInner(query)) => query.filter(),+ SoupQuery::Property(query) => query.filter(),}}}@@ -341,6 +341,9 @@ impl SoupQuery<EntityFilters> {SoupQuery::Notified(NotifiedQueryInner(query)) => Ok(SoupQuery::Notified(NotifiedQueryInner(query.try_map_filter(EntityFilterAst::new_from_filters)?),)),+ SoupQuery::Property(query) => Ok(SoupQuery::Property(+ query.try_map_filter(EntityFilterAst::new_from_filters)?,+ )),}}}@@ -378,6 +381,24 @@ pub struct SoupRequest<T> {pub link_ids: Vec<Uuid>,}+/// A filter input that can be converted without constructing a query.+pub trait IntoSoupFilterAst {+ /// Convert filters into the authoritative entity AST.+ fn into_filter_ast(self) -> Result<Option<EntityFilterAst>, ExpandErr>;+}++impl IntoSoupFilterAst for EntityFilters {+ fn into_filter_ast(self) -> Result<Option<EntityFilterAst>, ExpandErr> {+ EntityFilterAst::new_from_filters(self)+ }+}++impl IntoSoupFilterAst for EntityFilterAst {+ fn into_filter_ast(self) -> Result<Option<EntityFilterAst>, ExpandErr> {+ Ok(if self.is_empty() { None } else { Some(self) })+ }+}+/// trait which defines a type which can be fallibly converted into a SoupRequest with astpub trait IntoSoupReqAst {/// perform the conversion@@ -483,6 +504,7 @@ impl SoupRequest<Option<EntityFilterAst>> {macro_id: self.user.clone(),limit: Some(self.limit as u32),query: match &self.cursor {+ SoupQuery::Property(_) => return None,SoupQuery::Simple(SimpleQueryInner(Query::Sort(t, f))) => Some(Query::Sort(*t,with_properties_filter(@@ -531,6 +553,7 @@ impl SoupRequest<Option<EntityFilterAst>> {/// The request's entity filter ast, regardless of cursor position.pub(crate) fn entity_ast(&self) -> Option<&EntityFilterAst> {match &self.cursor {+ SoupQuery::Property(query) => query.filter().as_ref(),SoupQuery::Simple(SimpleQueryInner(Query::Sort(_, f))) => f.as_ref(),SoupQuery::Simple(SimpleQueryInner(Query::Cursor(CursorWithValAndFilter {filter,@@ -572,6 +595,7 @@ impl SoupRequest<Option<EntityFilterAst>> {user_id: self.user.clone(),limit: self.limit as u32,query: match &self.cursor {+ SoupQuery::Property(_) => return None,SoupQuery::Simple(SimpleQueryInner(Query::Sort(t, f))) => Some(Query::Sort(*t,with_call_properties_filter(@@ -634,6 +658,7 @@ impl SoupRequest<Option<EntityFilterAst>> {Option<&EntityFilterAst>,Option<CrmCompanySoupCursor>,) = match &self.cursor {+ SoupQuery::Property(_) => return None,SoupQuery::Simple(SimpleQueryInner(Query::Sort(t, f))) => (*t, f.as_ref(), None),SoupQuery::Simple(SimpleQueryInner(Query::Cursor(CursorWithValAndFilter {id,@@ -693,6 +718,7 @@ impl SoupRequest<Option<EntityFilterAst>> {limit: Some(self.limit as u32),include_frecency: false,query: match &self.cursor {+ SoupQuery::Property(_) => return None,SoupQuery::Simple(SimpleQueryInner(Query::Sort(t, f))) => Some(Query::Sort(*t,f.as_ref().and_then(|f| f.channel_filter.clone()),@@ -732,6 +758,7 @@ impl SoupRequest<Option<EntityFilterAst>> {return None;}let query = match &self.cursor {+ SoupQuery::Property(_) => return None,SoupQuery::Simple(SimpleQueryInner(Query::Sort(t, f))) => Some(Query::Sort(*t,f.as_ref().and_then(|f| f.channel_thread_filter.clone()),@@ -780,6 +807,7 @@ impl SoupRequest<Option<EntityFilterAst>> {return None;}match &self.cursor {+ SoupQuery::Property(_) => None,SoupQuery::Simple(SimpleQueryInner(Query::Sort(t, f))) => Some(Query::Sort(*t,f.as_ref()@@ -1259,6 +1287,8 @@ pub struct SoupProjectionHydration<Item = SoupItem<()>> {pub item: Item,/// Relation-backed document facts unavailable in direct Soup fields.pub document_server_facts: Option<SoupDocumentServerFacts>,+ /// Signed property key produced by the same query; null for missing values.+ pub sort_key: Option<f64>,}impl<Item> SoupProjectionHydration<Item> {@@ -1270,6 +1300,7 @@ impl<Item> SoupProjectionHydration<Item> {SoupProjectionHydration {item: map(self.item),document_server_facts: self.document_server_facts,+ sort_key: self.sort_key,}}}diff --git a/crates/soup/src/domain/models/grouping.rs b/crates/soup/src/domain/models/grouping.rsindex b54bf0bdbd..0130fa685c 100644--- a/crates/soup/src/domain/models/grouping.rs+++ b/crates/soup/src/domain/models/grouping.rs@@ -1,16 +1,17 @@//! Grouping utilities for soup queries.+/// Grouped request constructors and continuation queries.+pub mod query;+#[cfg(test)]mod test;-use super::{EnrichedSoupItem, SoupPropertiesField};+use super::{DynamicSort, EnrichedSoupItem, SoupDocumentServerFacts, SoupPropertiesField};use indexmap::IndexMap;use item_filters::ast::EntityFilterAst;pub use models_grouping::GroupByField;use models_grouping::{date_bucket_label, date_bucket_order};-use models_pagination::{- Base64Str, CursorVal, CursorWithValAndFilter, Identify, SimpleSortMethod, SortOn,-};+use models_pagination::{Base64Str, CursorVal, CursorWithValAndFilter, Identify, SortOn};use models_soup::item::SoupItem;use serde::Serialize;use std::collections::HashMap;@@ -36,11 +37,19 @@ impl FromIterator<(String, String)> for GroupLabels {}/// Resolve label and display order for a group key based on the grouping field.-fn resolve_group_label_and_order(+pub(super) fn resolve_group_label_and_order(key: &str,group_by: &GroupByField,labels: &GroupLabels,) -> (String, Option<i32>) {+ if let Some((_, ranges)) = group_by.date_ranges() {+ let order = ranges+ .ranges+ .iter()+ .position(|range| range.key == key)+ .unwrap_or(ranges.ranges.len());+ return (key.to_owned(), Some(order as i32));+ }match group_by {GroupByField::Date => (date_bucket_label(key).to_string(),@@ -87,6 +96,8 @@ pub struct GroupedResponse {pub groups: Vec<GroupMeta>,/// Page-level cursor for loading more items.pub page_cursor: Option<String>,+ /// Authoritative document facts from the same SQL rows.+ pub document_server_facts: HashMap<Uuid, SoupDocumentServerFacts>,}/// Build a grouped response from grouped soup items, labeling groups from@@ -94,30 +105,40 @@ pub struct GroupedResponse {pub fn build_grouped_response(items: impl IntoIterator<Item = ItemGroupingInfo<SoupPropertiesField>>,group_by: &GroupByField,- sort_method: SimpleSortMethod,+ sort_method: impl Into<DynamicSort>,requested_group_key: Option<String>,filters: EntityFilterAst,labels: &GroupLabels,) -> GroupedResponse {+ let sort_method = sort_method.into();+ let mut document_server_facts = HashMap::new();struct GroupData {total_count: u32,item_ids: Vec<Uuid>,last_item_id: Option<Uuid>,- last_cursor_val: Option<CursorVal<SimpleSortMethod>>,+ last_cursor_val: Option<CursorVal<DynamicSort>>,+ last_index: usize,label: Option<String>,display_order: Option<i32>,}- let mut group_stats: HashMap<String, GroupData> = HashMap::new();+ let mut group_stats: IndexMap<String, GroupData> = IndexMap::new();let items = items.into_iter();let mut items_pool: HashMap<Uuid, EnrichedSoupItem> =HashMap::with_capacity(items.size_hint().0);- let mut get_cursor_val = SoupItem::sort_on(sort_method);+ let mut get_cursor_val = SoupItem::sort_on(sort_method.timestamp_method());for grouped_item in items {let key = grouped_item.key.clone();let item_id = grouped_item.item.id();- let cursor_val = get_cursor_val(&grouped_item.item);+ if let Some(facts) = grouped_item.document_server_facts {+ document_server_facts.insert(item_id, facts);+ }+ let timestamp = get_cursor_val(&grouped_item.item).last_val;+ let cursor_val = models_pagination::CursorVal {+ sort_type: sort_method,+ last_val: sort_method.position(grouped_item.sort_key, timestamp),+ };let entry = group_stats.entry(key.clone()).or_insert_with(|| {let (label, display_order) = resolve_group_label_and_order(&key, group_by, labels);@@ -126,13 +147,15 @@ pub fn build_grouped_response(item_ids: Vec::new(),last_item_id: None,last_cursor_val: None,+ last_index: 0,label: Some(label),- display_order,+ display_order: grouped_item.display_order.or(display_order),}});entry.item_ids.push(item_id);entry.last_item_id = Some(item_id);entry.last_cursor_val = Some(cursor_val);+ entry.last_index = grouped_item.index_in_group;// First occurrence wins; later duplicates are dropped instead of// overwriting an already-populated entry.@@ -144,21 +167,18 @@ pub fn build_grouped_response(let mut groups: Vec<GroupMeta> = group_stats.into_iter().map(|(key, data)| {- let has_more = (data.item_ids.len() as u32) < data.total_count;+ let has_more = data.last_index < data.total_count as usize;let next_cursor = if has_more {data.last_item_id.zip(data.last_cursor_val).map(|(id, val)| {- let cursor: CursorWithValAndFilter<- Uuid,- SimpleSortMethod,- EntityFilterAst,- > = CursorWithValAndFilter {- id,- limit: data.item_ids.len(),- val,- filter: filters.clone(),- };+ let cursor: CursorWithValAndFilter<Uuid, DynamicSort, EntityFilterAst> =+ CursorWithValAndFilter {+ id,+ limit: data.item_ids.len(),+ val,+ filter: filters.clone(),+ };Base64Str::encode_json(cursor).type_erase()})} else {@@ -192,6 +212,7 @@ pub fn build_grouped_response(items: items_pool,groups,page_cursor,+ document_server_facts,}}@@ -226,75 +247,6 @@ pub mod entity_type_labels {}}-/// Items and metadata belonging to one nested Soup group.-pub struct BinData<T = ()> {- data: Vec<SoupItem<T>>,- group_total_size: usize,- next_cursor: Option<String>,-}--impl<T> BinData<T> {- /// The total number of items in this group across all pages.- pub fn group_total_size(&self) -> usize {- self.group_total_size- }-- /// Return the cursor for the next page in this bin, when one exists.- pub fn next_cursor(&self) -> Option<&str> {- self.next_cursor.as_deref()- }-- /// Consume the bin and return its items in their group order.- pub fn into_items(self) -> impl Iterator<Item = SoupItem<T>> {- self.data.into_iter()- }-}--/// Soup items nested into bins keyed by their grouping value.-pub struct NestedSoupGroups<T = (), Bin = String>(IndexMap<Bin, BinData<T>>);--impl<Bin, T> NestedSoupGroups<T, Bin> {- /// The keys of every bin, in bin order.- pub fn keys(&self) -> impl Iterator<Item = &Bin> {- self.0.keys()- }-- /// Consume the nested groups and iterate over their bins.- pub fn into_bins(self) -> impl Iterator<Item = (Bin, BinData<T>)> {- self.0.into_iter()- }-}--impl<T> NestedSoupGroups<T> {- /// Attach an opaque continuation cursor to every truncated bin.- pub fn with_next_cursors(- mut self,- sort_method: SimpleSortMethod,- filters: EntityFilterAst,- ) -> Self {- let mut get_cursor_val = SoupItem::sort_on(sort_method);-- for bin in self.0.values_mut() {- if bin.data.len() >= bin.group_total_size {- continue;- }-- bin.next_cursor = bin.data.last().map(|item| {- let cursor: CursorWithValAndFilter<Uuid, SimpleSortMethod, EntityFilterAst> =- CursorWithValAndFilter {- id: item.id(),- limit: bin.data.len(),- val: get_cursor_val(item),- filter: filters.clone(),- };- Base64Str::encode_json(cursor).type_erase()- });- }-- self- }-}-/// A Soup item paired with the metadata needed to place it into a group.#[derive(Debug)]pub struct ItemGroupingInfo<T = (), Bin = String> {@@ -304,31 +256,12 @@ pub struct ItemGroupingInfo<T = (), Bin = String> {pub total_group_count: usize,/// The item's position within its bin.pub index_in_group: usize,+ /// Numeric key read with the item.+ pub sort_key: Option<f64>,+ /// Stored option rank, when grouping by selectable values.+ pub display_order: Option<i32>,+ /// Server facts carried through grouped enrichment.+ pub document_server_facts: Option<SoupDocumentServerFacts>,/// The Soup item.pub item: SoupItem<T>,}--impl<Bin, T> FromIterator<ItemGroupingInfo<T, Bin>> for NestedSoupGroups<T, Bin>-where- Bin: Eq + std::hash::Hash,-{- fn from_iter<I: IntoIterator<Item = ItemGroupingInfo<T, Bin>>>(iter: I) -> Self {- let mut out = IndexMap::new();-- for item in iter {- let ItemGroupingInfo {- key,- total_group_count,- item,- ..- } = item;- let entry = out.entry(key).or_insert_with(|| BinData {- data: Vec::new(),- group_total_size: total_group_count,- next_cursor: None,- });- entry.data.push(item);- }- NestedSoupGroups(out)- }-}diff --git a/crates/soup/src/domain/models/grouping/query.rs b/crates/soup/src/domain/models/grouping/query.rsnew file mode 100644index 0000000000..78450a2c41--- /dev/null+++ b/crates/soup/src/domain/models/grouping/query.rs@@ -0,0 +1,63 @@+//! Requests for ordinary timestamp grouping.++use item_filters::ast::{EntityFilterAst, ExpandErr};+use macro_user_id::user_id::MacroUserIdStr;+use models_grouping::GroupingConfig;+use models_pagination::{Base64Str, CursorWithValAndFilter, Query};+use uuid::Uuid;++use crate::domain::models::{DynamicSort, SoupErr};++/// Parameters for timestamp-sorted grouped Soup queries.+#[derive(Debug)]+pub struct GroupedSortRequest<'a> {+ /// Maximum number of items in a continuation page.+ pub limit: u16,+ /// Timestamp sort, filters, and optional continuation.+ pub cursor: Query<Uuid, DynamicSort, EntityFilterAst>,+ /// Authenticated viewer.+ pub user_id: MacroUserIdStr<'a>,+ /// Group field, optional key, and initial per-group limit.+ pub grouping: GroupingConfig,+}++impl<'a> GroupedSortRequest<'a> {+ /// Start a timestamp-sorted grouped page.+ pub fn initial(+ user_id: MacroUserIdStr<'a>,+ limit: u16,+ sort: impl Into<DynamicSort>,+ filters: EntityFilterAst,+ grouping: GroupingConfig,+ ) -> Self {+ Self {+ user_id,+ limit,+ cursor: Query::Sort(sort.into(), filters),+ grouping,+ }+ }++ /// Continue the deployed timestamp format with the caller's page size.+ pub fn continue_from(+ user_id: MacroUserIdStr<'a>,+ encoded: String,+ grouping: GroupingConfig,+ limit: Option<u16>,+ ) -> Result<Self, SoupErr> {+ let cursor: CursorWithValAndFilter<Uuid, DynamicSort, EntityFilterAst> =+ Base64Str::new_from_string(encoded)+ .decode_json()+ .map_err(|error| SoupErr::AstErr(ExpandErr::ApiAst(error.to_string())))?;+ let limit = limit.unwrap_or(cursor.limit.clamp(1, 500) as u16);+ Ok(Self {+ user_id,+ limit,+ cursor: Query::Cursor(cursor),+ grouping,+ })+ }+}++#[cfg(test)]+mod test;diff --git a/crates/soup/src/domain/models/grouping/query/test.rs b/crates/soup/src/domain/models/grouping/query/test.rsnew file mode 100644index 0000000000..db373de141--- /dev/null+++ b/crates/soup/src/domain/models/grouping/query/test.rs@@ -0,0 +1,25 @@+use super::*;+use models_pagination::{CursorVal, SimpleSortMethod};++#[test]+fn continuation_uses_requested_limit_not_initial_group_size() {+ let cursor = Base64Str::encode_json(CursorWithValAndFilter {+ id: Uuid::from_u128(1),+ limit: 10,+ val: CursorVal {+ sort_type: SimpleSortMethod::UpdatedAt,+ last_val: chrono::DateTime::default(),+ },+ filter: EntityFilterAst::default(),+ })+ .type_erase();+ let request = GroupedSortRequest::continue_from(+ MacroUserIdStr::parse_from_str("macro|[email protected]").unwrap(),+ cursor,+ GroupingConfig::new(models_grouping::GroupByField::EntityType).with_group_key("document"),+ Some(100),+ )+ .unwrap();+ assert_eq!(request.limit, 100);+ assert!(matches!(request.cursor, Query::Cursor(cursor) if cursor.limit == 10));+}diff --git a/crates/soup/src/domain/models/grouping/test.rs b/crates/soup/src/domain/models/grouping/test.rsindex d2f30c5261..3d184c5ba6 100644--- a/crates/soup/src/domain/models/grouping/test.rs+++ b/crates/soup/src/domain/models/grouping/test.rs@@ -8,7 +8,7 @@ use uuid::Uuid;use super::*;-fn project(id: u128) -> SoupItem {+fn project(id: u128) -> SoupItem<SoupPropertiesField> {SoupItem::Project(SoupProject {id: Uuid::from_u128(id),name: format!("Project {id}"),@@ -18,102 +18,118 @@ fn project(id: u128) -> SoupItem {updated_at: DateTime::default(),viewed_at: None,deleted_at: None,- extra: (),+ extra: SoupPropertiesField::default(),})}#[test]-fn nested_groups_preserve_bin_and_item_insertion_order() {- let groups: NestedSoupGroups = vec![- ItemGroupingInfo {- key: "project".to_string(),- total_group_count: 2,- index_in_group: 2,- item: project(2),- },- ItemGroupingInfo {- key: "project".to_string(),- total_group_count: 2,- index_in_group: 1,- item: project(1),- },- ItemGroupingInfo {- key: "document".to_string(),- total_group_count: 1,- index_in_group: 1,- item: project(3),- },- ]- .into_iter()- .collect();-- let mut bins = groups.into_bins();- let (project_key, project_bin) = bins.next().unwrap();- assert_eq!(project_key, "project");- assert_eq!(project_bin.group_total_size(), 2);- assert_eq!(- project_bin- .into_items()- .map(|item| item.id())- .collect::<Vec<_>>(),- vec![Uuid::from_u128(2), Uuid::from_u128(1)]+fn grouped_response_preserves_unranked_group_and_item_order() {+ let response = build_grouped_response(+ vec![+ ItemGroupingInfo {+ sort_key: None,+ display_order: None,+ document_server_facts: None,+ key: "project".to_string(),+ total_group_count: 2,+ index_in_group: 1,+ item: project(2),+ },+ ItemGroupingInfo {+ sort_key: None,+ display_order: None,+ document_server_facts: None,+ key: "project".to_string(),+ total_group_count: 2,+ index_in_group: 2,+ item: project(1),+ },+ ItemGroupingInfo {+ sort_key: None,+ display_order: None,+ document_server_facts: None,+ key: "document".to_string(),+ total_group_count: 1,+ index_in_group: 1,+ item: project(3),+ },+ ],+ &GroupByField::Project,+ SimpleSortMethod::UpdatedAt,+ None,+ EntityFilterAst::default(),+ &GroupLabels::default(),);- let (document_key, document_bin) = bins.next().unwrap();- assert_eq!(document_key, "document");+ assert_eq!(response.groups.len(), 2);+ assert_eq!(response.groups[0].key, "project");+ assert_eq!(response.groups[0].total_count, 2);assert_eq!(- document_bin- .into_items()- .map(|item| item.id())- .collect::<Vec<_>>(),- vec![Uuid::from_u128(3)]+ response.groups[0].item_ids,+ vec![Uuid::from_u128(2), Uuid::from_u128(1)]);- assert!(bins.next().is_none());+ assert_eq!(response.groups[1].key, "document");+ assert_eq!(response.groups[1].item_ids, vec![Uuid::from_u128(3)]);}#[test]-fn nested_groups_add_cursor_only_to_truncated_bins() {- let groups: NestedSoupGroups = vec![- ItemGroupingInfo {- key: "truncated".to_string(),- total_group_count: 2,- index_in_group: 1,- item: project(1),- },- ItemGroupingInfo {- key: "complete".to_string(),- total_group_count: 1,- index_in_group: 1,- item: project(2),- },- ]- .into_iter()- .collect::<NestedSoupGroups>()- .with_next_cursors(SimpleSortMethod::UpdatedAt, EntityFilterAst::default());+fn grouped_response_adds_cursor_only_to_truncated_groups() {+ let response = build_grouped_response(+ vec![+ ItemGroupingInfo {+ sort_key: None,+ display_order: None,+ document_server_facts: None,+ key: "truncated".to_string(),+ total_group_count: 2,+ index_in_group: 1,+ item: project(1),+ },+ ItemGroupingInfo {+ sort_key: None,+ display_order: None,+ document_server_facts: None,+ key: "complete".to_string(),+ total_group_count: 1,+ index_in_group: 1,+ item: project(2),+ },+ ],+ &GroupByField::Project,+ SimpleSortMethod::UpdatedAt,+ None,+ EntityFilterAst::default(),+ &GroupLabels::default(),+ );- let mut bins = groups.into_bins();- let (_, truncated) = bins.next().unwrap();- let cursor = Base64Str::<- CursorWithValAndFilter<Uuid, SimpleSortMethod, EntityFilterAst>,- >::new_from_string(truncated.next_cursor().unwrap().to_owned())- .decode_json()- .unwrap();+ let cursor =+ Base64Str::<CursorWithValAndFilter<Uuid, DynamicSort, EntityFilterAst>>::new_from_string(+ response.groups[0].next_cursor.clone().unwrap(),+ )+ .decode_json()+ .unwrap();assert_eq!(cursor.id, Uuid::from_u128(1));assert_eq!(cursor.limit, 1);-- let (_, complete) = bins.next().unwrap();- assert!(complete.next_cursor().is_none());+ assert!(matches!(+ cursor.val.sort_type,+ DynamicSort::Timestamp(SimpleSortMethod::UpdatedAt)+ ));+ assert!(response.groups[1].next_cursor.is_none());+ assert!(response.page_cursor.is_none());}#[test]-fn rest_grouped_response_remains_normalized() {+fn grouped_response_remains_normalized() {let id = Uuid::from_u128(1);let response = build_grouped_response(vec![ItemGroupingInfo {+ sort_key: None,+ display_order: None,+ document_server_facts: None,key: "project".to_string(),total_group_count: 1,index_in_group: 1,- item: project(1).map_extra(|()| SoupPropertiesField::default()),+ item: project(1),}],&GroupByField::EntityType,SimpleSortMethod::ViewedUpdated,@@ -140,10 +156,13 @@ fn project_groups_take_the_initiative_name_the_user_can_read() {.into_iter().collect();let group = |key: &str, id: u128| ItemGroupingInfo {+ sort_key: None,+ display_order: None,+ document_server_facts: None,key: key.to_string(),total_group_count: 1,index_in_group: 1,- item: project(id).map_extra(|()| SoupPropertiesField::default()),+ item: project(id),};let response = build_grouped_response(vec![group(readable, 1), group(unreadable, 2), group("", 3)],diff --git a/crates/soup/src/domain/models/sort.rs b/crates/soup/src/domain/models/sort.rsnew file mode 100644index 0000000000..0a6306bf43--- /dev/null+++ b/crates/soup/src/domain/models/sort.rs@@ -0,0 +1,170 @@+//! Sort descriptors and position values for Soup's dynamic query.++use chrono::{DateTime, Utc};+use models_pagination::{Cursor, CursorVal, Query, SimpleSortMethod, Sortable};+use serde::{Deserialize, Serialize};+use std::cmp::Ordering;+use uuid::Uuid;++use super::SoupSortDirection;++/// The existing timestamp sort or a selected property and its direction.+#[derive(Debug, Clone, Copy, Serialize, Deserialize)]+#[serde(untagged)]+pub enum DynamicSort {+ /// Preserve the deployed timestamp sort encoding.+ Timestamp(SimpleSortMethod),+ /// Sort by a definition visible to the requesting viewer.+ Property {+ /// Selected property definition, not an assignment ID.+ property_definition_id: Uuid,+ /// Ascending or descending property values, with missing values last.+ direction: SoupSortDirection,+ },+}++impl From<SimpleSortMethod> for DynamicSort {+ fn from(value: SimpleSortMethod) -> Self {+ Self::Timestamp(value)+ }+}++impl DynamicSort {+ /// Timestamp column used by the existing top clauses and by property ties.+ pub fn timestamp_method(self) -> SimpleSortMethod {+ match self {+ Self::Timestamp(method) => method,+ Self::Property { .. } => SimpleSortMethod::UpdatedAt,+ }+ }++ /// Convert an existing timestamp request without changing its wire cursor.+ pub fn from_timestamp_query<F>(+ query: Query<Uuid, SimpleSortMethod, F>,+ ) -> Query<Uuid, Self, F> {+ match query {+ Query::Sort(sort, filter) => Query::Sort(sort.into(), filter),+ Query::Cursor(cursor) => Query::Cursor(Cursor {+ id: cursor.id,+ limit: cursor.limit,+ val: CursorVal {+ sort_type: cursor.val.sort_type.into(),+ last_val: DynamicSortValue::Timestamp(cursor.val.last_val),+ },+ filter: cursor.filter,+ }),+ }+ }++ /// Construct the position returned by the dynamic SQL row.+ pub fn position(self, key: Option<f64>, timestamp: DateTime<Utc>) -> DynamicSortValue {+ match self {+ Self::Timestamp(_) => DynamicSortValue::Timestamp(timestamp),+ Self::Property { direction, .. } => DynamicSortValue::Property {+ key: key.map(PropertySortKey::Number),+ timestamp,+ direction,+ },+ }+ }+}++impl Sortable for DynamicSort {+ type Value = DynamicSortValue;+}++/// The key type of a property sort cursor.+#[derive(Debug, Clone, Serialize, Deserialize)]+pub enum PropertySortKey {+ /// A numeric key, including dates as epoch microseconds and option ranks.+ Number(f64),+}++/// A timestamp cursor retains its old string encoding; property cursors add a key.+#[derive(Debug, Clone, Serialize, Deserialize)]+#[serde(untagged)]+pub enum DynamicSortValue {+ /// Position in an ordinary timestamp query.+ Timestamp(DateTime<Utc>),+ /// Typed property key and its update-time tie breaker.+ Property {+ /// A missing key sorts after every present key.+ key: Option<PropertySortKey>,+ /// Update timestamp for deterministic ties.+ timestamp: DateTime<Utc>,+ /// Property sort direction.+ direction: SoupSortDirection,+ },+}++impl DynamicSortValue {+ /// Timestamp for the SQL keyset.+ pub fn timestamp(&self) -> DateTime<Utc> {+ match self {+ Self::Timestamp(value) => *value,+ Self::Property { timestamp, .. } => *timestamp,+ }+ }++ /// Numeric key for the SQL keyset; ordinary timestamp queries use zero.+ pub fn key(&self) -> Option<f64> {+ match self {+ Self::Timestamp(_) => Some(0.0),+ Self::Property { key, .. } => key.as_ref().map(|key| match key {+ PropertySortKey::Number(number) => *number,+ }),+ }+ }+}++impl PartialEq for DynamicSortValue {+ fn eq(&self, other: &Self) -> bool {+ self.cmp(other) == Ordering::Equal+ }+}+impl Eq for DynamicSortValue {}+impl PartialOrd for DynamicSortValue {+ fn partial_cmp(&self, other: &Self) -> Option<Ordering> {+ Some(self.cmp(other))+ }+}+impl Ord for DynamicSortValue {+ fn cmp(&self, other: &Self) -> Ordering {+ match (self, other) {+ (+ Self::Property {+ key: left,+ direction,+ ..+ },+ Self::Property {+ key: right,+ direction: other_direction,+ ..+ },+ ) => {+ if direction != other_direction {+ return (*direction == SoupSortDirection::Desc)+ .cmp(&(*other_direction == SoupSortDirection::Desc));+ }+ match (left, right) {+ (Some(PropertySortKey::Number(left)), Some(PropertySortKey::Number(right))) => {+ let order = left.total_cmp(right);+ if *direction == SoupSortDirection::Asc {+ order.reverse()+ } else {+ order+ }+ }+ (Some(_), None) => Ordering::Greater,+ (None, Some(_)) => Ordering::Less,+ (None, None) => Ordering::Equal,+ }+ }+ (Self::Timestamp(left), Self::Timestamp(right)) => left.cmp(right),+ (Self::Timestamp(_), Self::Property { .. }) => Ordering::Less,+ (Self::Property { .. }, Self::Timestamp(_)) => Ordering::Greater,+ }+ .then_with(|| self.timestamp().cmp(&other.timestamp()))+ }+}diff --git a/crates/soup/src/domain/ports.rs b/crates/soup/src/domain/ports.rsindex fff8ed4ec7..e06ea34e80 100644--- a/crates/soup/src/domain/ports.rs+++ b/crates/soup/src/domain/ports.rs@@ -30,6 +30,7 @@ pub trait SoupRepo: Send + Sync + 'static {type Err;/// Iterator returned by grouped Soup queries.type GroupedItems: Iterator<Item = ItemGroupingInfo> + Send;+/// Fetch expanded soup items for a simple sorted cursor query.fn expanded_generic_cursor_soup<'a>(&self,@@ -142,6 +143,8 @@ pub enum SoupOutput<T, Item = SoupItem<()>> {Touched(PaginatedCursor<Item, String, TouchedByMe, T>),/// Page of a notified-at query.Notified(PaginatedCursor<Item, String, NotifiedAt, T>),+ /// Page sorted by a selected property's numeric key.+ Property(PaginatedCursor<Item, String, super::models::DynamicSort, T>),}impl<T, Item> SoupOutput<T, Item> {@@ -152,6 +155,7 @@ impl<T, Item> SoupOutput<T, Item> {{match self {SoupOutput::Simple(page) => SoupOutput::Simple(page.map(f)),+ SoupOutput::Property(page) => SoupOutput::Property(page.map(f)),SoupOutput::Frecency(page) => SoupOutput::Frecency(page.map(f)),SoupOutput::Touched(page) => SoupOutput::Touched(page.map(f)),SoupOutput::Notified(page) => SoupOutput::Notified(page.map(f)),@@ -162,6 +166,7 @@ impl<T, Item> SoupOutput<T, Item> {pub fn into_items(self) -> Vec<Item> {match self {SoupOutput::Simple(page) => page.items,+ SoupOutput::Property(page) => page.items,SoupOutput::Frecency(page) => page.items,SoupOutput::Touched(page) => page.items,SoupOutput::Notified(page) => page.items,@@ -172,7 +177,10 @@ impl<T, Item> SoupOutput<T, Item> {pub fn into_simple(self) -> Option<PaginatedCursor<Item, String, SimpleSortMethod, T>> {match self {SoupOutput::Simple(page) => Some(page),- SoupOutput::Frecency(_) | SoupOutput::Touched(_) | SoupOutput::Notified(_) => None,+ SoupOutput::Frecency(_)+ | SoupOutput::Touched(_)+ | SoupOutput::Notified(_)+ | SoupOutput::Property(_) => None,}}@@ -180,7 +188,10 @@ impl<T, Item> SoupOutput<T, Item> {pub fn into_frecency(self) -> Option<PaginatedCursor<Item, String, Frecency, T>> {match self {SoupOutput::Frecency(page) => Some(page),- SoupOutput::Simple(_) | SoupOutput::Touched(_) | SoupOutput::Notified(_) => None,+ SoupOutput::Property(_)+ | SoupOutput::Simple(_)+ | SoupOutput::Touched(_)+ | SoupOutput::Notified(_) => None,}}@@ -188,7 +199,10 @@ impl<T, Item> SoupOutput<T, Item> {pub fn into_touched(self) -> Option<PaginatedCursor<Item, String, TouchedByMe, T>> {match self {SoupOutput::Touched(page) => Some(page),- SoupOutput::Simple(_) | SoupOutput::Frecency(_) | SoupOutput::Notified(_) => None,+ SoupOutput::Property(_)+ | SoupOutput::Simple(_)+ | SoupOutput::Frecency(_)+ | SoupOutput::Notified(_) => None,}}@@ -196,7 +210,10 @@ impl<T, Item> SoupOutput<T, Item> {pub fn into_notified(self) -> Option<PaginatedCursor<Item, String, NotifiedAt, T>> {match self {SoupOutput::Notified(page) => Some(page),- SoupOutput::Simple(_) | SoupOutput::Frecency(_) | SoupOutput::Touched(_) => None,+ SoupOutput::Property(_)+ | SoupOutput::Simple(_)+ | SoupOutput::Frecency(_)+ | SoupOutput::Touched(_) => None,}}}@@ -205,6 +222,7 @@ impl<T, Item> TypeEraseCursor<Item> for SoupOutput<T, Item> {fn type_erase(self) -> PaginatedOpaqueCursor<Item> {match self {SoupOutput::Simple(page) => page.type_erase(),+ SoupOutput::Property(page) => page.type_erase(),SoupOutput::Frecency(page) => page.type_erase(),SoupOutput::Touched(page) => page.type_erase(),SoupOutput::Notified(page) => page.type_erase(),@@ -251,6 +269,7 @@ pub trait SoupService: Send + Sync + 'static {output.map(|item| SoupProjectionHydration {item,document_server_facts: None,+ sort_key: None,})})}@@ -296,6 +315,7 @@ pub trait SoupService: Send + Sync + 'static {output.map(|item| SoupProjectionHydration {item,document_server_facts: None,+ sort_key: None,})})}diff --git a/crates/soup/src/domain/service.rs b/crates/soup/src/domain/service.rsindex badaa7bb52..b631a45e41 100644--- a/crates/soup/src/domain/service.rs+++ b/crates/soup/src/domain/service.rs@@ -49,8 +49,8 @@ use item_filters::ast::{use macro_user_id::user_id::MacroUserIdStr;use model_entity::{Entity, EntityType};use models_pagination::{- Base64Str, Cursor, CursorVal, Frecency, FrecencyValue, Identify, NotifiedAt, PaginateOn,- Paginated, Query, SimpleSortMethod, SortOn, TouchedByMe,+ Base64Str, Cursor, CursorVal, Frecency, FrecencyValue, Identify, NotifiedAt, Paginate,+ PaginateOn, Paginated, Query, SimpleSortMethod, SortOn, TouchedByMe,};use models_properties::service::property_definition_with_options::PropertyDefinitionWithOptions;use models_soup::{@@ -81,6 +81,7 @@ struct SoupCandidate {frecency_score: Option<AggregateFrecency>,touched_at: Option<chrono::DateTime<chrono::Utc>>,notified_at: Option<chrono::DateTime<chrono::Utc>>,+ sort_key: Option<f64>,}impl SoupCandidate {@@ -92,6 +93,7 @@ impl SoupCandidate {frecency_score: None,touched_at: None,notified_at: None,+ sort_key: None,}}@@ -103,6 +105,7 @@ impl SoupCandidate {frecency_score: None,touched_at: None,notified_at: None,+ sort_key: hydration.sort_key,}}}@@ -1011,6 +1014,7 @@ wherehydration: SoupProjectionHydration {item: candidate.item,document_server_facts: candidate.document_server_facts,+ sort_key: candidate.sort_key,},}).collect(),@@ -1239,6 +1243,7 @@ wherefrecency_score,touched_at: None,notified_at: None,+ sort_key: None,},)))}@@ -1267,6 +1272,7 @@ wherefrecency_score,touched_at: None,notified_at: None,+ sort_key: None,}})})?,@@ -1480,6 +1486,9 @@ whereSoupOutput::Simple(page) => Ok(SoupOutput::Simple(self.populate_properties_page(user_id, page).await?,)),+ SoupOutput::Property(page) => Ok(SoupOutput::Property(+ self.populate_properties_page(user_id, page).await?,+ )),SoupOutput::Frecency(page) => Ok(SoupOutput::Frecency(self.populate_properties_page(user_id, page).await?,)),@@ -1537,6 +1546,9 @@ where// and cursor construction. Reuse them rather than issuing a// duplicate by-id lookup.SoupOutput::Frecency(page) => Ok(SoupOutput::Frecency(page)),+ SoupOutput::Property(page) => Ok(SoupOutput::Property(+ self.populate_frecency_page(user_id, page).await?,+ )),// Touched sorting orders on the activity log, so scores are not// loaded during page construction; load them for the final page.SoupOutput::Touched(page) => Ok(SoupOutput::Touched(@@ -1572,6 +1584,7 @@ whereoutput.map(|candidate| SoupProjectionHydration {item: candidate.item,document_server_facts: candidate.document_server_facts,+ sort_key: candidate.sort_key,})}@@ -1588,6 +1601,7 @@ wherenotified_at: candidate.notified_at,},document_server_facts: candidate.document_server_facts,+ sort_key: candidate.sort_key,})}@@ -1609,7 +1623,14 @@ where.map(|item| {(item.item,- (item.key, item.total_group_count, item.index_in_group),+ (+ item.key,+ item.total_group_count,+ item.index_in_group,+ item.sort_key,+ item.display_order,+ item.document_server_facts,+ ),)}).unzip();@@ -1633,11 +1654,24 @@ where.into_iter().zip(metadata).map(- |(item, (key, total_group_count, index_in_group))| ItemGroupingInfo {+ |(+ item,+ (+ key,+ total_group_count,+ index_in_group,+ sort_key,+ display_order,+ document_server_facts,+ ),+ )| ItemGroupingInfo {item,key,total_group_count,index_in_group,+ sort_key,+ display_order,+ document_server_facts,},).collect::<Vec<_>>()@@ -1657,10 +1691,10 @@ wherelet entity_filter = req.filters().clone();let mut req = req.into_ast()?;if req.entity_ast().and_then(|ast| ast.favorites_only) == Some(true)- && !matches!(&req.cursor, SoupQuery::Simple(_))+ && !matches!(&req.cursor, SoupQuery::Simple(_) | SoupQuery::Property(_)){return Err(SoupErr::AstErr(item_filters::ast::ExpandErr::ApiAst(- "favorites_only requires a timestamp sort".into(),+ "favorites_only requires a timestamp or property sort".into(),)));}let favorite_entities = self.favorite_entities(&req.user, req.entity_ast()).await?;@@ -1669,8 +1703,7 @@ where.cursor.map(|ast| ast.map(|ast| favorites::apply(ast, entities)));}- // CRM associations resolve to complete entity sets, so they only- // compose with the timestamp-sorted sources that take those sets.+ // Resolve CRM associations before either timestamp or task due-date selection.let crm_record = req.entity_ast().and_then(|ast| ast.crm_association);// Read the filter of every query kind: `entity_ast` hides frecency// filters, which must be rejected rather than silently unscoped.@@ -1680,9 +1713,9 @@ where.as_ref().is_some_and(|ast| !ast.crm_associations().is_empty()){- if !matches!(&req.cursor, SoupQuery::Simple(_)) {+ if !matches!(&req.cursor, SoupQuery::Simple(_) | SoupQuery::Property(_)) {return Err(SoupErr::AstErr(item_filters::ast::ExpandErr::ApiAst(- "CRM associations require a timestamp sort".into(),+ "CRM associations require timestamp or property sorting".into(),)));}// Unexpanded candidate queries cannot apply filter trees, so the@@ -1717,7 +1750,6 @@ wherereturn Err(SoupErr::CrmTeamRequired);}- // Borrow before email's builder consumes team_receipt.let crm_contact_request = req.build_crm_contact_request(team_receipt.as_ref())?;let mut crm_company_request = req.build_crm_company_request(&team_receipt);let foreign_entity_source_ids = req.build_foreign_entity_source_ids(team_receipt.as_ref());@@ -1750,6 +1782,30 @@ wherelet sort_direction = req.sort_direction;let output: Result<SoupOutput<R, SoupCandidate>, SoupErr> = match req.cursor {+ SoupQuery::Property(cursor) => {+ let sort = *cursor.sort_method();+ let items = self+ .soup_storage+ .expanded_generic_cursor_soup_with_projection(SimpleSortRequest {+ user_id: req.user,+ limit: limit.saturating_add(1),+ cursor: SimpleSortQuery::Property(+ cursor.map_filter(Option::unwrap_or_default),+ ),+ })+ .await+ .map_err(anyhow::Error::from)?;+ let page = items+ .into_iter()+ .map(SoupCandidate::from_projection_hydration)+ .paginate(limit.into(), |item: &SoupCandidate| CursorVal {+ sort_type: sort,+ last_val: sort.position(item.sort_key, item.item.updated_at()),+ })+ .filter_on(entity_filter)+ .into_page();+ Ok(SoupOutput::Property(page))+ }SoupQuery::Simple(SimpleQueryInner(cursor)) => {let sort_method = *cursor.sort_method();@@ -1896,6 +1952,7 @@ wherelet mut output = output?;let items = match &mut output {SoupOutput::Simple(page) => &mut page.items,+ SoupOutput::Property(page) => &mut page.items,SoupOutput::Frecency(page) => &mut page.items,SoupOutput::Touched(page) => &mut page.items,SoupOutput::Notified(page) => &mut page.items,@@ -2090,7 +2147,6 @@ whereself.populate_grouped_items(user_id, items).await}- #[tracing::instrument(err, skip(self))]async fn caller_tag_sets<'a>(&self,user_id: MacroUserIdStr<'a>,diff --git a/crates/soup/src/domain/service/crm_association/test.rs b/crates/soup/src/domain/service/crm_association/test.rsindex bbe250fa16..e171203885 100644--- a/crates/soup/src/domain/service/crm_association/test.rs+++ b/crates/soup/src/domain/service/crm_association/test.rs@@ -269,6 +269,34 @@ fn requested_opt_in_sources_are_constrained() {assert!(!intersect_crm_companies(&mut other, &entities));}+#[test]+fn task_scope_keeps_crm_membership_and_disabled_entity_legs() {+ let ast = EntityFilterAst {+ crm_association: Some(CrmAssociation::Company(COMPANY)),+ document_filter: Some(Arc::new(Expr::val(DocumentLiteral::SubType(+ document_sub_type::DocumentSubType::Task,+ )))),+ project_filter: Some(Arc::new(Expr::val(ProjectLiteral::ProjectIdSelf(+ Uuid::nil(),+ )))),+ chat_filter: Some(Arc::new(Expr::val(ChatLiteral::ChatId(Uuid::nil())))),+ ..EntityFilterAst::default()+ };++ let scoped = resolved(AssociatedEntities {+ documents: ids(&[1, 2]),+ projects: ids(&[3]),+ chats: ids(&[4]),+ ..AssociatedEntities::default()+ })+ .apply(ast);++ assert_matches!(scoped.document_filter.as_deref(), Some(Expr::And(ids_tree, task)) => {+ assert_eq!(id_set(ids_tree, document_id), ids(&[1, 2]));+ assert_matches!(task.as_ref(), Expr::Literal(DocumentLiteral::SubType(_)));+ });+}+#[test]fn activity_uses_property_edges_only_and_matches_email_in_every_direction() {let entities = AssociatedEntities::from_edges(diff --git a/crates/soup/src/domain/service/tests.rs b/crates/soup/src/domain/service/tests.rsindex ed7d364690..b5eb7b6d76 100644--- a/crates/soup/src/domain/service/tests.rs+++ b/crates/soup/src/domain/service/tests.rs@@ -1417,6 +1417,9 @@ async fn grouped_properties_are_populated_by_the_service() {.returning(|_| {Box::pin(async move {Ok(vec![ItemGroupingInfo {+ sort_key: None,+ display_order: None,+ document_server_facts: None,item: SoupItem::Document(soup_document("grouped-document")),key: "document".to_string(),total_group_count: 1,@@ -1451,7 +1454,7 @@ async fn grouped_properties_are_populated_by_the_service() {.get_user_soup_grouped(GroupedSortRequest {limit: 20,cursor: Query::Sort(- SimpleSortMethod::ViewedUpdated,+ SimpleSortMethod::ViewedUpdated.into(),EntityFilterAst::mock_empty(),),user_id: MacroUserIdStr::parse_from_str("macro|[email protected]").unwrap(),@@ -2651,6 +2654,7 @@ async fn touched_soup_projection_preserves_authoritative_attachment_facts() {Box::pin(async move {Ok(vec![SoupProjectionHydration {+ sort_key: None,item: SoupItem::Document(soup_document_uuid_with_updated(ordinary_document,Default::default(),@@ -2662,6 +2666,7 @@ async fn touched_soup_projection_preserves_authoritative_attachment_facts() {}),},SoupProjectionHydration {+ sort_key: None,item: SoupItem::Document(soup_document_uuid_with_updated(attachment,Default::default(),diff --git a/crates/soup/src/domain/service/tests/work_feed.rs b/crates/soup/src/domain/service/tests/work_feed.rsindex fe5aab1b7b..48b81634b3 100644--- a/crates/soup/src/domain/service/tests/work_feed.rs+++ b/crates/soup/src/domain/service/tests/work_feed.rs@@ -98,6 +98,7 @@ async fn work_feed_refills_after_drops_and_carries_reason_timestamps() {.filter_map(|entity| {let id = Uuid::parse_str(&entity.entity_id).unwrap();(id != ghost).then(|| SoupProjectionHydration {+ sort_key: None,item: SoupItem::Document(soup_document_uuid_with_updated(id,Default::default(),@@ -173,6 +174,7 @@ async fn work_feed_full_page_continues_from_the_last_candidate() {.entities.iter().map(|entity| SoupProjectionHydration {+ sort_key: None,item: SoupItem::Document(soup_document_uuid_with_updated(Uuid::parse_str(&entity.entity_id).unwrap(),Default::default(),diff --git a/crates/soup/src/inbound/axum_router.rs b/crates/soup/src/inbound/axum_router.rsindex 3335aa5487..834e9eed4e 100644--- a/crates/soup/src/inbound/axum_router.rs+++ b/crates/soup/src/inbound/axum_router.rs@@ -1,8 +1,8 @@use crate::domain::{models::{- EnrichedSoupItem, FrecencyQueryInner, GroupedSortRequest, IntoSoupReqAst,- NotifiedQueryInner, SimpleQueryInner, SoupErr, SoupItemWithProperties, SoupQuery,- SoupRequest, SoupSortDirection, SoupType, TouchedQueryInner,+ DynamicSort, EnrichedSoupItem, FrecencyQueryInner, GroupedSortRequest, IntoSoupFilterAst,+ IntoSoupReqAst, NotifiedQueryInner, SimpleQueryInner, SoupErr, SoupItemWithProperties,+ SoupQuery, SoupRequest, SoupSortDirection, SoupType, TouchedQueryInner,grouping::{GroupMeta, build_grouped_response},},ports::SoupService,@@ -14,7 +14,7 @@ use axum::{response::IntoResponse,routing::{get, post},};-use axum_extra::either::Either4;+use axum_extra::either::Either5;use cowlike::CowLike;use email::{domain::{@@ -57,6 +57,7 @@ use macro_user_id::user_id::MacroUserIdStr;use model_entity::Entity;use model_error_response::ErrorResponse;use models_grouping::{GroupByField, GroupingConfig};+pub use models_grouping::{PropertyBucketing, PropertyDateRange, PropertyDateRanges};use models_pagination::{CursorWithValAndFilter, Frecency, NotifiedAt, PaginatedOpaqueCursor, SimpleSortMethod,TouchedByMe, TypeEraseCursor,@@ -72,6 +73,13 @@ use thiserror::Error;use utoipa::{IntoParams, ToSchema};use uuid::Uuid;+/// Opaque continuation accepted by the grouped Soup endpoint.+#[derive(Debug, Default, Deserialize)]+pub struct GroupedSoupCursorParams {+ /// Cursor from a previous grouped response.+ pub cursor: Option<String>,+}+#[cfg(test)]mod tests;@@ -85,19 +93,20 @@ pub struct Params {/// Limit the number of items returned. Defaults to 20. Max 500.#[serde(default)]limit: Option<u16>,- /// Sort method. Options are viewed_at, created_at, updated_at,- /// viewed_updated, frecency, touched_by_me, notified_at. Defaults to- /// viewed_at.+ /// Sort method. Property ordering supports DATE, NUMBER, BOOLEAN, SELECT and TAG.+ /// Missing definitions, unsupported types, and mismatched values sort as missing.+ /// Flat property sorts omit calendar events, email, channels, calls, companies, and agent sessions.+ /// Defaults to viewed_at.#[serde(default)]sort_method: Option<SoupApiSort>,+ /// Property definition selected for numeric property sorting.+ #[serde(default)]+ sort_property_definition_id: Option<Uuid>,/// Sort direction. Options are asc, desc. Defaults to desc.///- /// Re-send this with every page: it is not carried in the cursor.- ///- /// Applies to the timestamp sort methods only. `asc` combined with- /// `frecency` is rejected rather than ignored: frecency pages are ordered- /// by relevance score and the cursor comparison assumes descending, so- /// there is no ascending frecency order to give.+ /// Timestamp sorts require this parameter again on each page. Property+ /// cursors preserve their direction and always put missing values last.+ /// Ascending frecency, touched-by-me, and notified-at sorts are unsupported.#[serde(default)]sort_direction: Option<SoupApiSortDirection>,}@@ -145,28 +154,42 @@ pub enum SoupApiSort {/// notifications surface as channel-thread rows; calls and CRM/// companies never appear.NotifiedAt,+ /// Sort by the selected property's key with missing values last, then newest update and ID.+ /// Missing definitions and unsupported types use update-time ordering.+ /// Flat reads omit calendar events, email, channels, calls, companies, and agent sessions.+ /// Grouped reads retain calendar events.+ Property,}impl SoupApiSort {- /// Builds the initial query for this sort method over the given filters.- fn into_query<R>(self, filters: R) -> SoupQuery<R> {- match self {- SoupApiSort::ViewedAt => {- SoupQuery::new_sort_simple(SimpleSortMethod::ViewedAt, filters)- }- SoupApiSort::CreatedAt => {- SoupQuery::new_sort_simple(SimpleSortMethod::CreatedAt, filters)- }- SoupApiSort::UpdatedAt => {- SoupQuery::new_sort_simple(SimpleSortMethod::UpdatedAt, filters)- }- SoupApiSort::ViewedUpdated => {+ /// Builds an ordinary timestamp or relevance query.+ fn into_query<R>(+ self,+ filters: R,+ property: Option<Uuid>,+ direction: SoupSortDirection,+ ) -> Result<SoupQuery<R>, SoupHandlerErr> {+ if !matches!(self, Self::Property) && property.is_some() {+ return Err(SoupHandlerErr::Expand);+ }+ Ok(match self {+ Self::Property => SoupQuery::Property(models_pagination::Query::Sort(+ DynamicSort::Property {+ property_definition_id: property.ok_or(SoupHandlerErr::Expand)?,+ direction,+ },+ filters,+ )),+ Self::ViewedAt => SoupQuery::new_sort_simple(SimpleSortMethod::ViewedAt, filters),+ Self::CreatedAt => SoupQuery::new_sort_simple(SimpleSortMethod::CreatedAt, filters),+ Self::UpdatedAt => SoupQuery::new_sort_simple(SimpleSortMethod::UpdatedAt, filters),+ Self::ViewedUpdated => {SoupQuery::new_sort_simple(SimpleSortMethod::ViewedUpdated, filters)}- SoupApiSort::Frecency => SoupQuery::new_sort_frecency(Frecency, filters),- SoupApiSort::TouchedByMe => SoupQuery::new_sort_touched(filters),- SoupApiSort::NotifiedAt => SoupQuery::new_sort_notified(filters),- }+ Self::Frecency => SoupQuery::new_sort_frecency(Frecency, filters),+ Self::TouchedByMe => SoupQuery::new_sort_touched(filters),+ Self::NotifiedAt => SoupQuery::new_sort_notified(filters),+ })}}@@ -182,16 +205,37 @@ pub enum GroupedSoupSort {UpdatedAt,/// Sort by viewed and updated activity.ViewedUpdated,+ /// Sort by the selected property's key with missing values last, then newest update and ID.+ /// Missing definitions and unsupported types use update-time ordering.+ /// Email, channels, calls, companies, and agent sessions never appear.+ Property,}impl GroupedSoupSort {- fn into_simple_sort(self) -> SimpleSortMethod {- match self {- GroupedSoupSort::ViewedAt => SimpleSortMethod::ViewedAt,- GroupedSoupSort::CreatedAt => SimpleSortMethod::CreatedAt,- GroupedSoupSort::UpdatedAt => SimpleSortMethod::UpdatedAt,- GroupedSoupSort::ViewedUpdated => SimpleSortMethod::ViewedUpdated,+ fn into_sort(+ self,+ property: Option<Uuid>,+ direction: Option<SoupApiSortDirection>,+ ) -> Result<DynamicSort, SoupHandlerErr> {+ if matches!(self, Self::Property) {+ return Ok(DynamicSort::Property {+ property_definition_id: property.ok_or(SoupHandlerErr::Expand)?,+ direction: direction.map(Into::into).unwrap_or_default(),+ });}+ if property.is_some() {+ return Err(SoupHandlerErr::Expand);+ }+ self.into_model().map(Into::into)+ }+ fn into_model(self) -> Result<SimpleSortMethod, SoupHandlerErr> {+ Ok(match self {+ Self::ViewedAt => SimpleSortMethod::ViewedAt,+ Self::CreatedAt => SimpleSortMethod::CreatedAt,+ Self::UpdatedAt => SimpleSortMethod::UpdatedAt,+ Self::ViewedUpdated => SimpleSortMethod::ViewedUpdated,+ _ => return Err(SoupHandlerErr::Expand),+ })}}@@ -206,6 +250,12 @@ pub struct GroupedParams {/// Sort method. Defaults to viewed_updated.#[serde(default)]pub sort_method: Option<GroupedSoupSort>,+ /// Property definition selected for numeric property sorting.+ #[serde(default)]+ pub sort_property_definition_id: Option<Uuid>,+ /// Direction of property values. Defaults to descending.+ #[serde(default)]+ pub sort_direction: Option<SoupApiSortDirection>,/// Limit the number of items returned. Defaults to 20. Max 500.#[serde(default)]pub limit: Option<u16>,@@ -219,6 +269,12 @@ pub struct GroupedInitialParams {/// Sort method. Defaults to viewed_updated.#[serde(default)]pub sort_method: Option<GroupedSoupSort>,+ /// Property definition selected for numeric property sorting.+ #[serde(default)]+ pub sort_property_definition_id: Option<Uuid>,+ /// Direction of property values. Defaults to descending.+ #[serde(default)]+ pub sort_direction: Option<SoupApiSortDirection>,/// Limit the number of items returned per group. Defaults to 20. Max 500.#[serde(default)]pub per_group_limit: Option<u16>,@@ -234,6 +290,12 @@ pub struct GroupedPageParams {/// Sort method. Defaults to viewed_updated.#[serde(default)]pub sort_method: Option<GroupedSoupSort>,+ /// Property definition selected for numeric property sorting.+ #[serde(default)]+ pub sort_property_definition_id: Option<Uuid>,+ /// Direction of property values. Defaults to descending.+ #[serde(default)]+ pub sort_direction: Option<SoupApiSortDirection>,/// Limit the number of items returned. Defaults to 20. Max 500.#[serde(default)]pub limit: Option<u16>,@@ -245,6 +307,8 @@ impl From<GroupedInitialParams> for GroupedParams {group_by: params.group_by,group_key: None,sort_method: params.sort_method,+ sort_property_definition_id: params.sort_property_definition_id,+ sort_direction: params.sort_direction,limit: params.per_group_limit,}}@@ -256,6 +320,8 @@ impl From<GroupedPageParams> for GroupedParams {group_by: params.group_by,group_key: Some(params.group_key),sort_method: params.sort_method,+ sort_property_definition_id: params.sort_property_definition_id,+ sort_direction: params.sort_direction,limit: params.limit,}}@@ -265,6 +331,14 @@ impl From<GroupedPageParams> for GroupedParams {#[derive(Debug, Clone, Copy, Deserialize, Serialize, ToSchema)]#[serde(rename_all = "SCREAMING_SNAKE_CASE")]pub enum ApiPropertyEntityType {+ /// Call record entity.+ CallRecord,+ /// Calendar event entity.+ CalendarEvent,+ /// Database row entity.+ DatabaseRow,+ /// Initiative entity.+ Initiative,/// Channel entityChannel,/// Chat entity@@ -286,6 +360,10 @@ pub enum ApiPropertyEntityType {impl From<ApiPropertyEntityType> for PropertyEntityType {fn from(api: ApiPropertyEntityType) -> Self {match api {+ ApiPropertyEntityType::CallRecord => PropertyEntityType::CallRecord,+ ApiPropertyEntityType::CalendarEvent => PropertyEntityType::CalendarEvent,+ ApiPropertyEntityType::DatabaseRow => PropertyEntityType::DatabaseRow,+ ApiPropertyEntityType::Initiative => PropertyEntityType::Initiative,ApiPropertyEntityType::Channel => PropertyEntityType::Channel,ApiPropertyEntityType::Chat => PropertyEntityType::Chat,ApiPropertyEntityType::Company => PropertyEntityType::Company,@@ -316,6 +394,9 @@ pub enum ApiGroupByField {/// Optional entity type filter for the property lookup#[serde(skip_serializing_if = "Option::is_none")]entity_type: Option<ApiPropertyEntityType>,+ /// Caller-defined date partition; non-DATE values enter the missing bucket.+ #[serde(default, skip_serializing_if = "Option::is_none")]+ bucketing: Option<PropertyBucketing>,},}@@ -328,9 +409,11 @@ impl From<ApiGroupByField> for GroupByField {ApiGroupByField::Property {property_definition_id,entity_type,+ bucketing,} => GroupByField::Property {property_definition_id,entity_type: entity_type.map(|et| PropertyEntityType::from(et).to_string()),+ bucketing,},}}@@ -386,7 +469,7 @@ pub struct SoupPage {#[derive(Debug, Serialize, ToSchema)]pub struct GroupedSoupInitialPage {/// Items in this page, keyed by id. Ordering lives in `groups[].item_ids`.- pub items: HashMap<Uuid, SoupApiItem>,+ pub items: HashMap<String, SoupApiItem>,/// Ordered group metadata for this grouped response.pub groups: Vec<ApiGroupMeta>,}@@ -395,7 +478,7 @@ pub struct GroupedSoupInitialPage {#[derive(Debug, Serialize, ToSchema)]pub struct GroupedSoupGroupPage {/// Items in this page, keyed by id. Ordering lives in `group.item_ids`.- pub items: HashMap<Uuid, SoupApiItem>,+ pub items: HashMap<String, SoupApiItem>,/// Metadata and item membership for the requested group page.pub group: ApiGroupMeta,}@@ -411,7 +494,7 @@ pub enum GroupedSoupPage {}struct ApiGroupedSoupParts {- items: HashMap<Uuid, SoupApiItem>,+ items: HashMap<String, SoupApiItem>,groups: Vec<ApiGroupMeta>,}@@ -549,31 +632,30 @@ where) -> Result<Json<PaginatedOpaqueCursor<SoupApiItem>>, SoupHandlerErr>whereSoupRequest<R>: IntoSoupReqAst,- R: Clone + Serialize + Send,+ R: Clone + Serialize + Send + IntoSoupFilterAst,{let user_for_favorites = macro_user_id.copied().into_owned();let sort_direction: SoupSortDirection =params.sort_direction.map(Into::into).unwrap_or_default();- let create_fallback = move || -> SoupQuery<R> {+ let create_fallback = move || -> Result<SoupQuery<R>, SoupHandlerErr> {params.sort_method.unwrap_or(SoupApiSort::ViewedAt)- .into_query(filters)+ .into_query(filters, params.sort_property_definition_id, sort_direction)};let cursor: SoupQuery<R> = match cursor {- Either4::E1(l) => l- .map(SoupQuery::new_cursor_simple)- .unwrap_or_else(create_fallback),- Either4::E2(r) => r- .map(SoupQuery::new_cursor_frecency)- .unwrap_or_else(create_fallback),- Either4::E3(t) => t- .map(SoupQuery::new_cursor_touched)- .unwrap_or_else(create_fallback),- Either4::E4(n) => n- .map(SoupQuery::new_cursor_notified)- .unwrap_or_else(create_fallback),+ Either5::E1(Some(cursor)) => SoupQuery::new_cursor_simple(cursor),+ Either5::E2(Some(cursor)) => SoupQuery::new_cursor_frecency(cursor),+ Either5::E3(Some(cursor)) => SoupQuery::new_cursor_touched(cursor),+ Either5::E4(Some(cursor)) => SoupQuery::new_cursor_notified(cursor),+ Either5::E1(None) | Either5::E2(None) | Either5::E3(None) | Either5::E4(None) => {+ create_fallback()?+ }+ Either5::E5(Some(cursor)) => {+ SoupQuery::Property(models_pagination::Query::Cursor(cursor))+ }+ Either5::E5(None) => create_fallback()?,};// Frecency pages are ordered by relevance score, touched pages by the@@ -594,7 +676,7 @@ whereSoupQuery::Notified(_) => {return Err(SoupHandlerErr::AscendingNotifiedUnsupported);}- SoupQuery::Simple(_) => {}+ SoupQuery::Simple(_) | SoupQuery::Property(_) => {}}}@@ -614,7 +696,7 @@ wherecursor,sort_direction,user: macro_user_id,- email_preview_view: email_view,+ email_preview_view: email_view.unwrap_or_default(),link_ids,},team_receipt_option,@@ -632,36 +714,39 @@ wheremacro_user_id: MacroUserIdStr<'static>,filters: EntityFilterAst,params: GroupedParams,- cursor: Option<CursorWithValAndFilter<Uuid, SimpleSortMethod, EntityFilterAst>>,+ cursor: Option<String>,) -> Result<ApiGroupedSoupParts, SoupHandlerErr> {let user_for_favorites = macro_user_id.copied().into_owned();- let limit = params.limit.unwrap_or(20).clamp(20, 500);- let sort_method = params- .sort_method- .map(|s| s.into_simple_sort())- .unwrap_or(SimpleSortMethod::ViewedUpdated);-- let group_by_field = GroupByField::from(params.group_by);let grouping = GroupingConfig {- field: group_by_field.clone(),- group_key: params.group_key.clone(),- per_group_limit: None,- };-- // Use cursor if provided, otherwise start fresh- let query_cursor = match cursor {- Some(c) => models_pagination::Query::Cursor(c),- None => models_pagination::Query::Sort(sort_method, filters.clone()),+ field: GroupByField::from(params.group_by),+ group_key: params.group_key,+ per_group_limit: params.limit.map(u32::from),};-- let req = GroupedSortRequest {- limit,- cursor: query_cursor,- user_id: macro_user_id,- grouping,+ if let Some((_, ranges)) = grouping.field.date_ranges() {+ ranges.validate().map_err(|error| {+ SoupHandlerErr::ExpandErr(ExpandErr::ApiAst(format!("{error:?}")))+ })?;+ }+ let request = match cursor {+ Some(cursor) => GroupedSortRequest::continue_from(+ macro_user_id,+ cursor,+ grouping,+ Some(params.limit.unwrap_or(20).clamp(20, 500)),+ )?,+ None => {+ let limit = params.limit.unwrap_or(20).clamp(20, 500);+ let sort = params+ .sort_method+ .unwrap_or(GroupedSoupSort::ViewedUpdated)+ .into_sort(params.sort_property_definition_id, params.sort_direction)?;+ GroupedSortRequest::initial(macro_user_id, limit, sort, filters, grouping)+ }};-- let items: Vec<_> = self.service.get_user_soup_grouped(req).await?.collect();+ let sort = *request.cursor.sort_method();+ let filters = request.cursor.filter().clone();+ let grouping = request.grouping.clone();+ let items: Vec<_> = self.service.get_user_soup_grouped(request).await?.collect();let mut keys: Vec<String> = items.iter().map(|item| item.key.clone())@@ -671,22 +756,21 @@ wherekeys.dedup();let labels = self.service- .group_labels(user_for_favorites.copied(), &group_by_field, &keys)+ .group_labels(user_for_favorites.copied(), &grouping.field, &keys).await?;-let response = build_grouped_response(items,- &group_by_field,- sort_method,- params.group_key,+ &grouping.field,+ sort,+ grouping.group_key,filters,&labels,);- let mut items: HashMap<Uuid, SoupApiItem> = response+ let mut items: HashMap<String, SoupApiItem> = response.items.into_iter()- .map(|(id, item)| (id, SoupApiItem::from_frecency_soup_item(item)))+ .map(|(id, item)| (id.to_string(), SoupApiItem::from_frecency_soup_item(item))).collect();mark_favorited(&*self.favorites, &user_for_favorites, items.values_mut()).await;@@ -957,16 +1041,16 @@ pub struct PostSoupRequest {/// the view of specific emails to display#[serde(default)]#[schema(value_type = String)]- email_view: PreviewView,+ email_view: Option<PreviewView>,}struct ApiSoupRequestInner<T> {filters: T,params: Params,- email_view: PreviewView,+ email_view: Option<PreviewView>,}-type SoupCursor<R> = Either4<+type SoupCursor<R> = Either5<Option<CursorWithValAndFilter<Uuid, SimpleSortMethod, R>>,Option<CursorWithValAndFilter<Uuid, Frecency, R>>,// String id, not Uuid: the touched keyset compares the raw stored@@ -975,6 +1059,7 @@ type SoupCursor<R> = Either4<// Same value shape as the touched cursor; its `"notified_at"` sort// marker (touched serializes `null`) is what keeps it out of arm 3.Option<CursorWithValAndFilter<String, NotifiedAt, R>>,+ Option<CursorWithValAndFilter<Uuid, DynamicSort, R>>,>;/// Gets the items the user has access to@@ -1040,7 +1125,7 @@ pub struct PostSoupAstRequest {/// the view of specific emails to display#[serde(default)]#[schema(value_type = String)]- email_view: PreviewView,+ email_view: Option<PreviewView>,}/// Gets the items the user has access to using AST filters@@ -1156,7 +1241,8 @@ enum GroupedSoupRequestMode {pub async fn post_grouped_soup_ast_handler<T, U, EAS, Auth>(State(service): State<SoupRouterState<T, U, EAS, Auth>>,authorization: MacroAuthorizationExtractor<Auth, UserOrInternal>,- cursor: Option<CursorWithValAndFilter<Uuid, SimpleSortMethod, EntityFilterAst>>,+ _team: OptionalMacroUserTeamExtractorV2<MemberTeamRole, EAS, Auth>,+ Query(GroupedSoupCursorParams { cursor }): Query<GroupedSoupCursorParams>,Json(request): Json<PostGroupedSoupAstRequest>,) -> Result<Json<GroupedSoupPage>, SoupHandlerErr>where@@ -1166,18 +1252,19 @@ whereAuth: MacroAuthorizationService,{let macro_user_id = authorization.authorization.user.macro_user_id;- let (filters, params, mode) = match request {- PostGroupedSoupAstRequest::Initial(request) => (- request.filters,- request.params.into(),- GroupedSoupRequestMode::Initial,- ),- PostGroupedSoupAstRequest::GroupPage(request) => (- request.filters,- request.params.into(),- GroupedSoupRequestMode::GroupPage,- ),- };+ let (filters, params, mode): (ApiEntityFilterAst, GroupedParams, GroupedSoupRequestMode) =+ match request {+ PostGroupedSoupAstRequest::Initial(request) => (+ request.filters,+ request.params.into(),+ GroupedSoupRequestMode::Initial,+ ),+ PostGroupedSoupAstRequest::GroupPage(request) => (+ request.filters,+ request.params.into(),+ GroupedSoupRequestMode::GroupPage,+ ),+ };let filters = filters.into_entity_ast()@@ -1204,6 +1291,12 @@ where}))}+impl IntoSoupFilterAst for ApiEntityFilterAst {+ fn into_filter_ast(self) -> Result<Option<EntityFilterAst>, item_filters::ast::ExpandErr> {+ self.into_optional_entity_ast()+ }+}+/// Wire-format entity filter AST accepted by soup AST endpoints.#[derive(Debug, Default, Serialize, Deserialize, Clone, ToSchema)]pub struct ApiEntityFilterAst {@@ -1214,7 +1307,7 @@ pub struct ApiEntityFilterAst {/// (wire key `crma`): its Companies or Contacts property names the/// record, or it references the record. A company also matches through/// its contacts. Unknown or inaccessible records answer 404; requests- /// that are not expanded or not timestamp-sorted answer 400.+ /// require expanded queries sorted by a timestamp or selected numeric property.#[serde(default, rename = "crma", skip_serializing_if = "Option::is_none")]pub crm_association: Option<item_filters::ast::crm_association::CrmAssociation>,/// filters applied to canonical calendar events@@ -1330,6 +1423,9 @@ impl IntoSoupReqAst for SoupRequest<ApiEntityFilterAst> {} = self;let cursor = match cursor {+ SoupQuery::Property(query) => SoupQuery::Property(+ query.try_map_filter(ApiEntityFilterAst::into_optional_entity_ast)?,+ ),SoupQuery::Simple(SimpleQueryInner(query)) => SoupQuery::Simple(SimpleQueryInner(query.try_map_filter(ApiEntityFilterAst::into_optional_entity_ast)?,)),diff --git a/crates/soup/src/inbound/axum_router/tests.rs b/crates/soup/src/inbound/axum_router/tests.rsindex 53c3c16622..ace05d3f62 100644--- a/crates/soup/src/inbound/axum_router/tests.rs+++ b/crates/soup/src/inbound/axum_router/tests.rs@@ -32,7 +32,7 @@ use item_filters::ast::EntityFilterAst;use crate::{domain::{models::{- EnrichedSoupItem, FrecencyQueryInner, GroupedSortRequest, IntoSoupReqAst,+ DynamicSort, EnrichedSoupItem, FrecencyQueryInner, GroupedSortRequest, IntoSoupReqAst,NotifiedQueryInner, SimpleQueryInner, SoupErr, SoupPropertiesField, SoupQuery,SoupRequest, SoupSortDirection, SoupType, TouchedQueryInner,grouping::ItemGroupingInfo,@@ -43,6 +43,8 @@ use crate::{inbound::axum_router::{SoupRouterState, soup_router},};+/// Date-range grouping, sort routing, and nullable continuation coverage.+static CURSOR: &str = "eyJpZCI6ImUzNmM5MTJlLTU2M2MtNDIxZS1iMTAzLWE0YjAwY2ZmMzBlZSIsImxpbWl0IjoxMDAsInZhbCI6eyJzb3J0X3R5cGUiOiJ1cGRhdGVkX2F0IiwibGFzdF92YWwiOiIyMDI1LTExLTA3VDE5OjEyOjU5Ljc4MFoifSwiZmlsdGVyIjp7fX0=";const USER_ID: &str = "macro|[email protected]";const INTERNAL_USER_ID: &str = "macro|[email protected]";@@ -58,6 +60,8 @@ enum MockCursorKind {TouchedCursor,NotifiedSort,NotifiedCursor,+ PropertySort,+ PropertyCursor,}#[derive(Debug)]@@ -74,6 +78,7 @@ struct MockSoupCall {#[derive(Clone)]struct MockSoup {called: Arc<std::sync::Mutex<Vec<MockSoupCall>>>,+ grouped_calls: Arc<std::sync::Mutex<Vec<(models_grouping::GroupingConfig, DynamicSort)>>>,succeeds: bool,}@@ -81,6 +86,7 @@ impl MockSoup {fn new() -> Self {Self {called: Arc::new(std::sync::Mutex::new(Vec::new())),+ grouped_calls: Arc::new(std::sync::Mutex::new(Vec::new())),succeeds: false,}}@@ -156,6 +162,8 @@ impl SoupService for MockSoup {T: Clone + Serialize + Send,{let cursor_kind = match &req.cursor {+ SoupQuery::Property(Query::Sort(..)) => MockCursorKind::PropertySort,+ SoupQuery::Property(Query::Cursor(..)) => MockCursorKind::PropertyCursor,SoupQuery::Simple(SimpleQueryInner(Query::Sort(..))) => MockCursorKind::SimpleSort,SoupQuery::Simple(SimpleQueryInner(Query::Cursor(..))) => MockCursorKind::SimpleCursor,SoupQuery::Frecency(FrecencyQueryInner(Query::Sort(..))) => {@@ -204,11 +212,18 @@ impl SoupService for MockSoup {async fn get_user_soup_grouped(&self,- _req: GroupedSortRequest<'_>,+ req: GroupedSortRequest<'_>,) -> Result<impl Iterator<Item = ItemGroupingInfo<SoupPropertiesField>> + Send, SoupErr> {- Err::<std::vec::IntoIter<ItemGroupingInfo<SoupPropertiesField>>, _>(SoupErr::SoupDbErr(- anyhow::anyhow!("Not implemented"),- ))+ let sort = *req.cursor.sort_method();+ self.grouped_calls+ .lock()+ .unwrap()+ .push((req.grouping, sort));+ if self.succeeds {+ Ok(Vec::<ItemGroupingInfo<SoupPropertiesField>>::new().into_iter())+ } else {+ Err(SoupErr::SoupDbErr(anyhow::anyhow!("Not implemented")))+ }}async fn group_labels<'a>(@@ -2304,3 +2319,99 @@ async fn ascending_notified_is_rejected() {}));}++#[tokio::test]+async fn property_sort_uses_the_ordinary_route_in_both_directions() {+ for direction in ["asc", "desc"] {+ let soup = MockSoup::succeeding();+ let calls = soup.called.clone();+ let router = mock_router_with(+ soup,+ MockEmailLinkResult {+ get_link_result: Arc::new(|| Ok(None)),+ },+ );+ let request = authenticated_request().uri("/soup/ast").method(Method::POST)+ .header("content-type", "application/json")+ .body(axum::body::Body::from(serde_json::to_vec(&json!({+ "sort_method": "property", "sort_property_definition_id": Uuid::from_u128(17), "sort_direction": direction+ })).unwrap())).unwrap();+ let (status, _) = send_json(router, request).await;+ assert_eq!(status, StatusCode::OK);+ assert!(matches!(+ calls.lock().unwrap()[0].cursor_kind,+ MockCursorKind::PropertySort+ ));+ }+}++#[tokio::test]+async fn property_cursor_with_missing_key_is_not_restarted() {+ let sort = DynamicSort::Property {+ property_definition_id: Uuid::from_u128(17),+ direction: SoupSortDirection::Asc,+ };+ let cursor = models_pagination::Base64Str::encode_json(CursorWithValAndFilter {+ id: Uuid::from_u128(1),+ limit: 10,+ val: CursorVal {+ sort_type: sort,+ last_val: sort.position(None, chrono::DateTime::default()),+ },+ filter: ApiEntityFilterAst::default(),+ })+ .type_erase();+ let soup = MockSoup::succeeding();+ let calls = soup.called.clone();+ let router = mock_router_with(+ soup,+ MockEmailLinkResult {+ get_link_result: Arc::new(|| Ok(None)),+ },+ );+ let request = authenticated_request()+ .uri(format!("/soup/ast?cursor={cursor}"))+ .method(Method::POST)+ .header("content-type", "application/json")+ .body(axum::body::Body::from("{}"))+ .unwrap();+ let (status, _) = send_json(router, request).await;+ assert_eq!(status, StatusCode::OK);+ assert!(matches!(+ calls.lock().unwrap()[0].cursor_kind,+ MockCursorKind::PropertyCursor+ ));+}++#[tokio::test]+async fn invalid_date_buckets_are_rejected_before_the_service_runs() {+ for ranges in [+ json!([]),+ json!([+ {"key": "before", "start": null, "end": "2026-10-21T00:00:00Z"},+ {"key": "after", "start": "2026-10-20T00:00:00Z", "end": null}+ ]),+ ] {+ let request = authenticated_request()+ .uri("/soup/ast/grouped")+ .method(Method::POST)+ .header("content-type", "application/json")+ .body(axum::body::Body::from(+ serde_json::to_vec(&json!({+ "mode": "initial",+ "group_by": {"property": {+ "property_definition_id": Uuid::from_u128(17),+ "bucketing": {+ "type": "date_ranges",+ "ranges": ranges,+ "missing_value_bucket_key": "missing"+ }+ }}+ }))+ .unwrap(),+ ))+ .unwrap();+ let (status, _) = send_json(mock_router(), request).await;+ assert_eq!(status, StatusCode::BAD_REQUEST);+ }+}diff --git a/crates/soup/src/outbound/pg_soup_repo.rs b/crates/soup/src/outbound/pg_soup_repo.rsindex 37c2a98f9b..a5fc0c3fac 100644--- a/crates/soup/src/outbound/pg_soup_repo.rs+++ b/crates/soup/src/outbound/pg_soup_repo.rs@@ -1,7 +1,7 @@use crate::{domain::{models::{- AdvancedSortParams, CrmPropertyEdge, GroupedSortRequest, NotifiedEntity,+ AdvancedSortParams, CrmPropertyEdge, DynamicSort, GroupedSortRequest, NotifiedEntity,NotifiedSoupRequest, SimpleSortQuery, SimpleSortRequest, SoupProjectionHydration,SoupPropertiesField, TouchedEntity, TouchedSoupRequest, WorkFeedCandidate,WorkFeedCandidateRequest, grouping::ItemGroupingInfo,@@ -69,6 +69,18 @@ impl SoupRepo for PgSoupRepo {let sort = *req.cursor.sort_method();let limit = req.limit;let mut items = match req.cursor {+ SimpleSortQuery::Property(cursor) => {+ return expanded::dynamic::expanded_dynamic_cursor_soup_with_projection(+ &self.pool.0,+ ExpandedDynamicCursorArgs {+ user_id: req.user_id,+ limit: req.limit,+ cursor,+ exclude_frecency: false,+ },+ )+ .await;+ }SimpleSortQuery::ItemsAndFrecencyFilter(query) => {// Extract the EntityFilterAst from the tuple (Frecency, EntityFilterAst)expanded::dynamic::expanded_dynamic_cursor_soup_with_projection(@@ -76,7 +88,7 @@ impl SoupRepo for PgSoupRepo {ExpandedDynamicCursorArgs {user_id: req.user_id,limit: req.limit,- cursor: query.map_filter(|(_, ast)| ast),+ cursor: DynamicSort::from_timestamp_query(query.map_filter(|(_, ast)| ast)),exclude_frecency: true,},)@@ -88,7 +100,7 @@ impl SoupRepo for PgSoupRepo {ExpandedDynamicCursorArgs {user_id: req.user_id,limit: req.limit,- cursor: ast,+ cursor: DynamicSort::from_timestamp_query(ast),exclude_frecency: false,},)@@ -109,7 +121,9 @@ impl SoupRepo for PgSoupRepo {ExpandedDynamicCursorArgs {user_id: req.user_id,limit: req.limit,- cursor: f.map_filter(|_| EntityFilterAst::default()),+ cursor: DynamicSort::from_timestamp_query(+ f.map_filter(|_| EntityFilterAst::default()),+ ),exclude_frecency: true,},)@@ -121,7 +135,9 @@ impl SoupRepo for PgSoupRepo {ExpandedDynamicCursorArgs {user_id: req.user_id,limit: req.limit,- cursor: f.map_filter(|_| EntityFilterAst::default()),+ cursor: DynamicSort::from_timestamp_query(+ f.map_filter(|_| EntityFilterAst::default()),+ ),exclude_frecency: false,},)@@ -135,6 +151,7 @@ impl SoupRepo for PgSoupRepo {.map(|item| SoupProjectionHydration {item,document_server_facts: None,+ sort_key: None,}),);items.extend(@@ -144,6 +161,7 @@ impl SoupRepo for PgSoupRepo {.map(|item| SoupProjectionHydration {item,document_server_facts: None,+ sort_key: None,}),);sort_and_truncate_hydrations(&mut items, sort, limit);@@ -158,6 +176,7 @@ impl SoupRepo for PgSoupRepo {let sort = *req.cursor.sort_method();let limit = req.limit;let mut items = match req.cursor {+ SimpleSortQuery::Property(_) => return self.expanded_generic_cursor_soup(req).await,SimpleSortQuery::ItemsFilter(_) => not_implemented(req).await?,SimpleSortQuery::ItemsAndFrecencyFilter(_) => not_implemented(req).await?,// Same substitution as the expanded path above; this arm has@@ -168,7 +187,9 @@ impl SoupRepo for PgSoupRepo {ExpandedDynamicCursorArgs {user_id: req.user_id,limit: req.limit,- cursor: f.map_filter(|_| EntityFilterAst::default()),+ cursor: DynamicSort::from_timestamp_query(+ f.map_filter(|_| EntityFilterAst::default()),+ ),exclude_frecency: true,},)@@ -223,6 +244,7 @@ impl SoupRepo for PgSoupRepo {.map(|item| SoupProjectionHydration {item,document_server_facts: None,+ sort_key: None,}),);items.extend(@@ -232,6 +254,7 @@ impl SoupRepo for PgSoupRepo {.map(|item| SoupProjectionHydration {item,document_server_facts: None,+ sort_key: None,}),);items.extend(@@ -241,6 +264,7 @@ impl SoupRepo for PgSoupRepo {.map(|item| SoupProjectionHydration {item,document_server_facts: None,+ sort_key: None,}),);items.extend(@@ -250,6 +274,7 @@ impl SoupRepo for PgSoupRepo {.map(|item| SoupProjectionHydration {item,document_server_facts: None,+ sort_key: None,}),);Ok(items)@@ -570,6 +595,7 @@ macro_rules! map_soup_projection_hydration {$crate::domain::models::SoupProjectionHydration {item,document_server_facts,+ sort_key: None,}})}diff --git a/crates/soup/src/outbound/pg_soup_repo/agent_session.rs b/crates/soup/src/outbound/pg_soup_repo/agent_session.rsindex 202764d967..8c56db723f 100644--- a/crates/soup/src/outbound/pg_soup_repo/agent_session.rs+++ b/crates/soup/src/outbound/pg_soup_repo/agent_session.rs@@ -101,7 +101,9 @@ pub(super) async fn cursor_soup(db: &PgPool,req: SimpleSortRequest<'_>,) -> Result<Vec<SoupItem<()>>, sqlx::Error> {- let parts = cursor_parts(req.cursor);+ let Some(parts) = cursor_parts(req.cursor) else {+ return Ok(Vec::new());+ };let Some(filter) = parts.filter.as_ref().filter(|filter| opted_in(filter)) else {return Ok(Vec::new());};@@ -195,8 +197,9 @@ pub(super) async fn by_ids(.collect()}-fn cursor_parts(cursor: SimpleSortQuery) -> CursorParts {- match cursor {+fn cursor_parts(cursor: SimpleSortQuery) -> Option<CursorParts> {+ Some(match cursor {+ SimpleSortQuery::Property(_) => return None,// No AST means the query never mentioned agent sessions: opt-out.SimpleSortQuery::NoFilter(query) => parts_from_query(&query, None, None),SimpleSortQuery::FilterFrecency(query) => parts_from_query(&query, None, None),@@ -216,7 +219,7 @@ fn cursor_parts(cursor: SimpleSortQuery) -> CursorParts {ast.properties_filter.as_deref().cloned(),)}- }+ })}fn parts_from_query<F>(diff --git a/crates/soup/src/outbound/pg_soup_repo/calendar_event.rs b/crates/soup/src/outbound/pg_soup_repo/calendar_event.rsindex 64f502085a..b4c0aa9cd9 100644--- a/crates/soup/src/outbound/pg_soup_repo/calendar_event.rs+++ b/crates/soup/src/outbound/pg_soup_repo/calendar_event.rs@@ -57,7 +57,9 @@ pub(super) async fn cursor_soup(db: &PgPool,req: SimpleSortRequest<'_>,) -> Result<Vec<SoupItem<()>>, sqlx::Error> {- let parts = cursor_parts(req.cursor);+ let Some(parts) = cursor_parts(req.cursor) else {+ return Ok(Vec::new());+ };if parts.property_filter.as_ref().is_some_and(|filter| {!properties_filter_can_apply_to(filter, &[PropertyEntityType::CalendarEvent])}) {@@ -176,8 +178,9 @@ fn notified_event_ids_sql(predicate: NotificationPredicate) -> String {)}-fn cursor_parts(cursor: SimpleSortQuery) -> CursorParts {- match cursor {+fn cursor_parts(cursor: SimpleSortQuery) -> Option<CursorParts> {+ Some(match cursor {+ SimpleSortQuery::Property(_) => return None,SimpleSortQuery::NoFilter(query) => parts_from_query(&query, None, None),// CalendarEvent is not emitted by the primary frecency query yet, so// it must remain in the timestamp fallback even if an aggregate exists.@@ -198,7 +201,7 @@ fn cursor_parts(cursor: SimpleSortQuery) -> CursorParts {ast.properties_filter.as_deref().cloned(),)}- }+ })}fn parts_from_query<F>(diff --git a/crates/soup/src/outbound/pg_soup_repo/database_row/test.rs b/crates/soup/src/outbound/pg_soup_repo/database_row/test.rsindex fc70bc3dac..cada8e871f 100644--- a/crates/soup/src/outbound/pg_soup_repo/database_row/test.rs+++ b/crates/soup/src/outbound/pg_soup_repo/database_row/test.rs@@ -64,7 +64,7 @@ async fn page(ExpandedDynamicCursorArgs {user_id,limit: 20,- cursor: Query::Sort(SimpleSortMethod::CreatedAt, filter),+ cursor: Query::Sort(SimpleSortMethod::CreatedAt.into(), filter),exclude_frecency: false,},)@@ -80,7 +80,7 @@ async fn a_viewer_reads_the_won_deals_of_one_table(pool: PgPool) {user_id: MacroUserIdStr::parse_from_str("macro|[email protected]").unwrap(),limit: 20,cursor: Query::Sort(- SimpleSortMethod::CreatedAt,+ SimpleSortMethod::CreatedAt.into(),EntityFilterAst {database_row_filter: Some(Arc::new(Expr::val(DatabaseRowLiteral::TableId(DEALS,@@ -255,7 +255,7 @@ async fn deals_grouped_by_stage_count_each_option(pool: PgPool) {user_id: viewer(),limit: 20,cursor: Query::Sort(- SimpleSortMethod::CreatedAt,+ SimpleSortMethod::CreatedAt.into(),rows_of(Some(Expr::val(DatabaseRowLiteral::TableId(DEALS)))),),exclude_frecency: false,@@ -263,6 +263,7 @@ async fn deals_grouped_by_stage_count_each_option(pool: PgPool) {field: GroupByField::Property {property_definition_id: STAGE,entity_type: Some("DATABASE_ROW".into()),+ bucketing: None,},group_key: None,per_group_limit: None,diff --git a/crates/soup/src/outbound/pg_soup_repo/expanded/dynamic.rs b/crates/soup/src/outbound/pg_soup_repo/expanded/dynamic.rsindex 021cd20290..7898d97217 100644--- a/crates/soup/src/outbound/pg_soup_repo/expanded/dynamic.rs+++ b/crates/soup/src/outbound/pg_soup_repo/expanded/dynamic.rs@@ -52,14 +52,128 @@ use tracing::Instrument;use uuid::Uuid;use crate::domain::models::{- SoupDocumentServerFacts, SoupProjectionHydration, grouping::ItemGroupingInfo,+ DynamicSort, SoupDocumentServerFacts, SoupProjectionHydration, SoupSortDirection,+ grouping::ItemGroupingInfo,};use crate::outbound::pg_soup_repo::grouping::{- GroupJoinClause, group_join_clause, group_select_expr,+ GroupJoinClause, group_join_clause, group_order_expr, group_select_expr,+ property_date_expression, property_value_sql,};use crate::outbound::pg_soup_repo::type_err;use models_grouping::{GroupByField, GroupingConfig, date_bucket_sql_order};+fn property_sort_join(enabled: bool, parameter: usize) -> String {+ if !enabled {+ return String::new();+ }+ let property_definition_id = format!("${parameter}::uuid");+ let data_type =+ format!("(SELECT data_type FROM property_definitions WHERE id = {property_definition_id})");+ let value = property_value_sql(+ "ep_sort",+ &property_definition_id,+ &data_type,+ "NULL::jsonb",+ "po_group",+ );+ format!(+ r#" LEFT JOIN entity_properties ep_sort+ ON ep_sort.property_definition_id = ${parameter}::uuid+ AND ep_sort.entity_id = all_items.id::text+ AND ep_sort.entity_type = all_items.property_entity_type+ LEFT JOIN LATERAL (SELECT ({key})::{sql_type} AS key) property_sort ON true "#,+ key = value.sort_key,+ sql_type = value.sort_type,+ )+}++fn sort_key_expression(enabled: bool) -> &'static str {+ if enabled {+ "property_sort.key"+ } else {+ "0::double precision"+ }+}++/// First document-ID array after the existing query parameters and optional property sort.+fn first_document_id_slot(sort: DynamicSort, grouped: bool) -> usize {+ let fixed_parameters = if grouped { 10 } else { 8 };+ let property_parameters = if matches!(sort, DynamicSort::Property { .. }) {+ 2+ } else {+ 0+ };+ fixed_parameters + property_parameters + 1+}++// The non-null and missing-key branches both follow SQL's NULLS LAST order.+fn property_keyset(+ sort: DynamicSort,+ key: &str,+ cursor_key: usize,+ timestamp: &str,+ id: &str,+) -> String {+ let comparison = match sort {+ DynamicSort::Property {+ direction: SoupSortDirection::Asc,+ ..+ } => ">",+ DynamicSort::Property {+ direction: SoupSortDirection::Desc,+ ..+ } => "<",+ DynamicSort::Timestamp(_) => unreachable!("timestamp uses the deployed tuple predicate"),+ };+ format!(+ "($4::timestamptz IS NULL OR (+ (${cursor_key}::double precision IS NULL AND {key} IS NULL+ AND ({timestamp}, {id}::text) < ($4, $5))+ OR (${cursor_key}::double precision IS NOT NULL AND (+ {key} IS NULL OR {key} {comparison} ${cursor_key}::double precision+ OR ({key} = ${cursor_key}::double precision+ AND ({timestamp}, {id}::text) < ($4, $5))+ ))))"+ )+}++fn property_order(sort: DynamicSort, key: &str, timestamp: &str, id: &str) -> String {+ match sort {+ DynamicSort::Property { direction, .. } => {+ let direction = match direction {+ SoupSortDirection::Asc => "ASC",+ SoupSortDirection::Desc => "DESC",+ };+ format!("{key} {direction} NULLS LAST, {timestamp} DESC, {id} DESC")+ }+ DynamicSort::Timestamp(_) => format!("{timestamp} DESC, {id} DESC"),+ }+}++fn date_range_group_expression(grouping: &GroupingConfig) -> Option<String> {+ let (_, ranges) = grouping.field.date_ranges()?;+ let date = property_date_expression("ep_group");+ let mut sql = format!("CASE WHEN ep_group.data_type != 'DATE' OR ({date}) IS NULL THEN '-1'");+ for (index, range) in ranges.ranges.iter().enumerate() {+ let start = range+ .start+ .map(|bound| format!("({date}) >= '{}'::timestamptz", bound.to_rfc3339()));+ let end = range+ .end+ .map(|bound| format!("({date}) < '{}'::timestamptz", bound.to_rfc3339()));+ let bounds = start+ .into_iter()+ .chain(end)+ .collect::<Vec<_>>()+ .join(" AND ");+ sql.push_str(&format!(+ " WHEN {} THEN '{index}'",+ if bounds.is_empty() { "TRUE" } else { &bounds }+ ));+ }+ sql.push_str(" ELSE '-1' END");+ Some(sql)+}static PREFIX: &str = r#"WITH user_source_ids AS (SELECT cp.channel_id::text as source_id FROM comms_channel_participants cp@@ -87,10 +201,109 @@ static DOCUMENT_TASK_PROPERTY_JOINS: &str = r#"AND ep_status.property_definition_id = $7"#;+fn document_top_clause(+ sort_method: SimpleSortMethod,+ needs_sub_type_join: bool,+ property_sort: bool,+ task_only: bool,+) -> String {+ let sub_type_join = if needs_sub_type_join || (property_sort && !task_only) {+ r#" LEFT JOIN document_sub_type dt ON dt.document_id = d.id+"#+ } else {+ ""+ };+ let property_column = match (property_sort, task_only) {+ (true, true) => ", 'TASK'::property_entity_type as property_entity_type",+ (true, false) => {+ ", CASE WHEN dt.sub_type = 'task' THEN 'TASK'::property_entity_type ELSE 'DOCUMENT'::property_entity_type END as property_entity_type"+ }+ (false, _) => "",+ };+ format!(+ r#"+ SELECT+ 'document'::text as item_type,+ d.id,+ {}::timestamptz as sort_ts{property_column}+ FROM "Document" d+{}"#,+ top_sort_expr("d", sort_method),+ sub_type_join+ )+}++fn chat_top_clause(sort_method: SimpleSortMethod, property_sort: bool) -> String {+ let user_history_join = if top_needs_user_history(sort_method) {+ r#" LEFT JOIN "UserHistory" uh ON uh."itemId" = c.id AND uh."itemType" = 'chat' AND uh."userId" = $1+"#+ } else {+ ""+ };+ let property_column = if property_sort {+ ", 'CHAT'::property_entity_type as property_entity_type"+ } else {+ ""+ };+ format!(+ r#"+ SELECT+ 'chat'::text as item_type,+ c.id,+ {}::timestamptz as sort_ts{property_column}+ FROM "Chat" c+{}"#,+ top_sort_expr("c", sort_method),+ user_history_join+ )+}++fn project_top_clause(sort_method: SimpleSortMethod, property_sort: bool) -> String {+ let user_history_join = if top_needs_user_history(sort_method) {+ r#" LEFT JOIN "UserHistory" uh+ ON uh."itemId" = p.id+ AND uh."itemType" = 'project'+ AND uh."userId" = $1+"#+ } else {+ ""+ };+ let property_column = if property_sort {+ ", 'PROJECT'::property_entity_type as property_entity_type"+ } else {+ ""+ };+ format!(+ r#"+ SELECT+ 'project'::text as item_type,+ p.id,+ {}::timestamptz as sort_ts{property_column}+ FROM "Project" p+{}"#,+ top_sort_expr("p", sort_method),+ user_history_join+ )+}+// -- Grouped top clauses: include project_id for grouping support ---fn grouped_document_top_clause(sort_method: SimpleSortMethod) -> String {+fn grouped_document_top_clause(+ sort_method: SimpleSortMethod,+ needs_sub_type_join: bool,+ task_only: bool,+) -> String {let sort_ts = top_sort_expr("d", sort_method);+ let property_entity_type = if task_only {+ "'TASK'::property_entity_type"+ } else {+ "CASE WHEN dt.sub_type = 'task' THEN 'TASK'::property_entity_type ELSE 'DOCUMENT'::property_entity_type END"+ };+ let sub_type_join = if needs_sub_type_join || !task_only {+ "LEFT JOIN document_sub_type dt ON dt.document_id = d.id"+ } else {+ ""+ };format!(r#"SELECT@@ -98,12 +311,9 @@ fn grouped_document_top_clause(sort_method: SimpleSortMethod) -> String {d.id,{sort_ts}::timestamptz as sort_ts,d."projectId"::text as project_id,- CASE- WHEN dt.sub_type = 'task' THEN 'TASK'::property_entity_type- ELSE 'DOCUMENT'::property_entity_type- END as property_entity_type+ {property_entity_type} as property_entity_typeFROM "Document" d- LEFT JOIN document_sub_type dt ON dt.document_id = d.id+ {sub_type_join}"#)}@@ -230,6 +440,7 @@ static DOCUMENT_DETAIL_CLAUSE: &str = r#") as "status_option_ids",uh."updatedAt"::timestamptz as "viewed_at",t.sort_ts as "sort_ts",+ t.sort_key as "sort_key",CASEWHEN dt.sub_type = 'task'AND ep_status.values->'value' ? $6@@ -239,6 +450,7 @@ static DOCUMENT_DETAIL_CLAUSE: &str = r#"ELSE NULLEND as "is_completed",d."deletedAt"::timestamptz as "deleted_at",+ NULL::jsonb as "calendar_event",NULL::jsonb as "database_row"FROM TopItems tINNER JOIN "Document" d ON d.id = t.id@@ -290,8 +502,10 @@ static CHAT_DETAIL_CLAUSE: &str = r#"ARRAY[]::uuid[] as "status_option_ids",uh."updatedAt"::timestamptz as "viewed_at",t.sort_ts as "sort_ts",+ t.sort_key as "sort_key",NULL as "is_completed",c."deletedAt"::timestamptz as "deleted_at",+ NULL::jsonb as "calendar_event",NULL::jsonb as "database_row"FROM TopItems tINNER JOIN "Chat" c ON c.id = t.id@@ -323,8 +537,10 @@ static PROJECT_DETAIL_CLAUSE: &str = r#"ARRAY[]::uuid[] as "status_option_ids",uh."updatedAt"::timestamptz as "viewed_at",t.sort_ts as "sort_ts",+ t.sort_key as "sort_key",NULL as "is_completed",p."deletedAt"::timestamptz as "deleted_at",+ NULL::jsonb as "calendar_event",NULL::jsonb as "database_row"FROM TopItems tINNER JOIN "Project" p ON p.id = t.id@@ -339,13 +555,6 @@ static INITIATIVE_DETAIL_CLAUSE: &str = include_str!("dynamic/initiative_detail.static DATABASE_ROW_DETAIL_CLAUSE: &str = include_str!("dynamic/database_row_detail.sql");-static DETAIL_SUFFIX: &str = r#"- )- SELECT * FROM Combined- ORDER BY "sort_ts" DESC, "id" DESC- LIMIT $3-"#;-// -- Grouped detail clauses: join from GroupedItems, include group columns --static GROUPED_DOCUMENT_DETAIL_CLAUSE: &str = r#"@@ -366,8 +575,37 @@ static GROUPED_DOCUMENT_DETAIL_CLAUSE: &str = r#"NULL::text as "model",di.sha as "sha",dt.sub_type as "sub_type",+ EXISTS (+ SELECT 1+ FROM document_email de+ WHERE de.document_id = d.id+ ) as "is_email_attachment",+ (+ dt.sub_type IS DISTINCT FROM 'task'+ OR EXISTS (+ SELECT 1+ FROM entity_properties ep_assignees_projection+ WHERE ep_assignees_projection.entity_id = d.id+ AND ep_assignees_projection.entity_type = 'TASK'+ AND ep_assignees_projection.property_definition_id = $8+ AND ep_assignees_projection.values->'value' @> jsonb_build_array(+ jsonb_build_object('entity_id', $1)+ )+ )+ ) as "is_important",+ ARRAY(+ SELECT status_option_id::uuid+ FROM jsonb_array_elements_text(+ CASE+ WHEN jsonb_typeof(ep_status.values->'value') = 'array'+ THEN ep_status.values->'value'+ ELSE '[]'::jsonb+ END+ ) AS status_option_id+ ) as "status_option_ids",uh."updatedAt"::timestamptz as "viewed_at",gi.sort_ts as "sort_ts",+ gi.sort_key as "sort_key",CASEWHEN dt.sub_type = 'task'AND ep_status.values->'value' ? $6@@ -380,6 +618,7 @@ static GROUPED_DOCUMENT_DETAIL_CLAUSE: &str = r#"NULL::jsonb as "calendar_event",NULL::jsonb as "database_row",gi.group_key as "group_key",+ gi.group_order as "group_order",gi.group_total_count as "group_total_count",gi.row_in_group as "row_in_group"FROM GroupedItems gi@@ -427,13 +666,18 @@ static GROUPED_CHAT_DETAIL_CLAUSE: &str = r#"c.model as "model",NULL::text as "sha",NULL::document_sub_type_value as "sub_type",+ false as "is_email_attachment",+ true as "is_important",+ ARRAY[]::uuid[] as "status_option_ids",uh."updatedAt"::timestamptz as "viewed_at",gi.sort_ts as "sort_ts",+ gi.sort_key as "sort_key",NULL::boolean as "is_completed",c."deletedAt"::timestamptz as "deleted_at",NULL::jsonb as "calendar_event",NULL::jsonb as "database_row",gi.group_key as "group_key",+ gi.group_order as "group_order",gi.group_total_count as "group_total_count",gi.row_in_group as "row_in_group"FROM GroupedItems gi@@ -461,13 +705,18 @@ static GROUPED_PROJECT_DETAIL_CLAUSE: &str = r#"NULL::text as "model",NULL::text as "sha",NULL::document_sub_type_value as "sub_type",+ false as "is_email_attachment",+ true as "is_important",+ ARRAY[]::uuid[] as "status_option_ids",uh."updatedAt"::timestamptz as "viewed_at",gi.sort_ts as "sort_ts",+ gi.sort_key as "sort_key",NULL::boolean as "is_completed",p."deletedAt"::timestamptz as "deleted_at",NULL::jsonb as "calendar_event",NULL::jsonb as "database_row",gi.group_key as "group_key",+ gi.group_order as "group_order",gi.group_total_count as "group_total_count",gi.row_in_group as "row_in_group"FROM GroupedItems gi@@ -503,8 +752,12 @@ static GROUPED_CALENDAR_EVENT_DETAIL_CLAUSE: &str = r#"NULL::text as "model",NULL::text as "sha",NULL::document_sub_type_value as "sub_type",+ false as "is_email_attachment",+ true as "is_important",+ ARRAY[]::uuid[] as "status_option_ids",NULL::timestamptz as "viewed_at",gi.sort_ts as "sort_ts",+ gi.sort_key as "sort_key",NULL::boolean as "is_completed",NULL::timestamptz as "deleted_at",jsonb_build_object(@@ -542,6 +795,7 @@ static GROUPED_CALENDAR_EVENT_DETAIL_CLAUSE: &str = r#") as "calendar_event",NULL::jsonb as "database_row",gi.group_key as "group_key",+ gi.group_order as "group_order",gi.group_total_count as "group_total_count",gi.row_in_group as "row_in_group"FROM GroupedItems gi@@ -567,13 +821,18 @@ static GROUPED_EMPTY_COMBINED_CLAUSE: &str = r#"NULL::text as "model",NULL::text as "sha",NULL::document_sub_type_value as "sub_type",+ false as "is_email_attachment",+ true as "is_important",+ ARRAY[]::uuid[] as "status_option_ids",NULL::timestamptz as "viewed_at",NULL::timestamptz as "sort_ts",+ 0::double precision as "sort_key",NULL::boolean as "is_completed",NULL::timestamptz as "deleted_at",NULL::jsonb as "calendar_event",NULL::jsonb as "database_row",NULL::text as "group_key",+ NULL::double precision as "group_order",NULL::bigint as "group_total_count",NULL::bigint as "row_in_group"WHERE false@@ -1169,6 +1428,23 @@ fn property_literal_predicate(literal: &PropertiesLiteral, entity_id_sql: &str)"ep_prop.values->'value' @> jsonb_build_array(jsonb_build_object('entity_id', '{entity_id}'))")}+ PropertyMatchValue::DateRange(range) => {+ let date_value = property_date_expression("ep_prop");+ let mut predicates = vec![format!("{date_value} IS NOT NULL")];+ if let Some(start) = range.start {+ predicates.push(format!(+ "{date_value} >= '{}'::timestamptz",+ start.to_rfc3339()+ ));+ }+ if let Some(end) = range.end {+ predicates.push(format!(+ "{date_value} < '{}'::timestamptz",+ end.to_rfc3339()+ ));+ }+ predicates.join(" AND ")+ }};let entity_type_clause = match entity_type {Some(et) => format!("AND ep_prop.entity_type = '{et}'"),@@ -1185,6 +1461,19 @@ fn property_literal_predicate(literal: &PropertiesLiteral, entity_id_sql: &str))}+/// Prove that every matching document belongs to the task property namespace.+fn document_filter_is_task_only(ast: Option<&Expr<DocumentLiteral>>) -> bool {+ ast.is_some_and(|expr| {+ expr.collapse_frames(|frame| match frame {+ filter_ast::ExprFrame::And(a, b) => a || b,+ filter_ast::ExprFrame::Or(a, b) => a && b,+ filter_ast::ExprFrame::Not(_) => false,+ filter_ast::ExprFrame::Literal(DocumentLiteral::SubType(DocumentSubType::Task)) => true,+ filter_ast::ExprFrame::Literal(_) => false,+ })+ })+}+pub(in crate::outbound::pg_soup_repo) fn document_filter_needs_task_property_joins(ast: Option<&Expr<DocumentLiteral>>,) -> bool {@@ -1324,26 +1613,6 @@ pub(in crate::outbound::pg_soup_repo) fn access_semi_join()}-fn document_top_clause(sort_method: SimpleSortMethod, needs_sub_type_join: bool) -> String {- let sub_type_join = if needs_sub_type_join {- r#" LEFT JOIN document_sub_type dt ON dt.document_id = d.id-"#- } else {- ""- };- format!(- r#"- SELECT- 'document'::text as item_type,- d.id,- {}::timestamptz as sort_ts- FROM "Document" d-{}"#,- top_sort_expr("d", sort_method),- sub_type_join- )-}-fn document_top_where_clause(sort_method: SimpleSortMethod) -> String {let user_history_join = if top_needs_user_history(sort_method) {r#" LEFT JOIN "UserHistory" uh ON uh."itemId" = d.id AND uh."itemType" = 'document' AND uh."userId" = $1@@ -1359,26 +1628,6 @@ fn document_top_where_clause(sort_method: SimpleSortMethod) -> String {)}-fn chat_top_clause(sort_method: SimpleSortMethod) -> String {- let user_history_join = if top_needs_user_history(sort_method) {- r#" LEFT JOIN "UserHistory" uh ON uh."itemId" = c.id AND uh."itemType" = 'chat' AND uh."userId" = $1-"#- } else {- ""- };- format!(- r#"- SELECT- 'chat'::text as item_type,- c.id,- {}::timestamptz as sort_ts- FROM "Chat" c-{}"#,- top_sort_expr("c", sort_method),- user_history_join- )-}-fn chat_top_where_clause() -> String {format!(r#" WHERE c."deletedAt" IS NULL@@ -1388,29 +1637,6 @@ fn chat_top_where_clause() -> String {)}-fn project_top_clause(sort_method: SimpleSortMethod) -> String {- let user_history_join = if top_needs_user_history(sort_method) {- r#" LEFT JOIN "UserHistory" uh- ON uh."itemId" = p.id- AND uh."itemType" = 'project'- AND uh."userId" = $1-"#- } else {- ""- };- format!(- r#"- SELECT- 'project'::text as item_type,- p.id,- {}::timestamptz as sort_ts- FROM "Project" p-{}"#,- top_sort_expr("p", sort_method),- user_history_join- )-}-fn project_top_where_clause() -> String {format!(r#" WHERE p."deletedAt" IS NULL@@ -1423,9 +1649,11 @@ fn project_top_where_clause() -> String {fn build_query<'a>(filter_ast: &'a EntityFilterAst,exclude_frecency: bool,- sort_method: SimpleSortMethod,+ sort: DynamicSort,document_ids: &mut DocumentIdArrays,) -> QueryBuilder<'a, Postgres> {+ let sort_method = sort.timestamp_method();+ let property_sort = matches!(sort, DynamicSort::Property { .. });let mut builder = sqlx::QueryBuilder::new(PREFIX);let include_initiatives = initiative_opted_in(filter_ast.initiative_filter.as_deref())@@ -1528,17 +1756,22 @@ fn build_query<'a>(// TopItems CTE: lightweight id + sort_ts with filters, cursor, and limitbuilder.push("TopItems AS (");- builder.push("SELECT all_items.item_type, all_items.id, all_items.sort_ts FROM (");+ builder.push("SELECT all_items.item_type, all_items.id, all_items.sort_ts, ");+ builder.push(sort_key_expression(property_sort));+ builder.push(" AS sort_key FROM (");let mut needs_separator = false;if include_documents {push_union_separator(&mut builder, &mut needs_separator);- // Document top clause (lightweight). The document_sub_type join is- // only needed by filters that reference `dt` (Importance / CBM);- // SubType literals render as their own EXISTS probes.+ // Subtype is needed only for task-property filters or property-sort namespaces.let needs_task_property_joins = document_filter_needs_task_property_joins(document_filter);- builder.push(document_top_clause(sort_method, needs_task_property_joins));+ builder.push(document_top_clause(+ sort_method,+ needs_task_property_joins,+ property_sort,+ document_filter_is_task_only(document_filter),+ ));if optimized_notification_predicate.is_some() && document_notification.is_some() {builder.push(build_notification_join("d", "document"));}@@ -1556,7 +1789,7 @@ fn build_query<'a>(if include_chats {push_union_separator(&mut builder, &mut needs_separator);// Chat top clause (lightweight)- builder.push(chat_top_clause(sort_method));+ builder.push(chat_top_clause(sort_method, property_sort));if optimized_notification_predicate.is_some() && chat_notification.is_some() {builder.push(build_notification_join("c", "chat"));}@@ -1571,7 +1804,7 @@ fn build_query<'a>(if include_projects {push_union_separator(&mut builder, &mut needs_separator);// Project top clause (lightweight)- builder.push(project_top_clause(sort_method));+ builder.push(project_top_clause(sort_method, property_sort));if optimized_notification_predicate.is_some() && project_notification.is_some() {builder.push(build_notification_join("p", "project"));}@@ -1585,7 +1818,7 @@ fn build_query<'a>(if include_initiatives {push_union_separator(&mut builder, &mut needs_separator);- builder.push(initiative_top_clause(sort_method, false));+ builder.push(initiative_top_clause(sort_method, false, property_sort));builder.push(build_initiative_filter(filter_ast.initiative_filter.as_deref(),));@@ -1597,7 +1830,7 @@ fn build_query<'a>(if include_database_rows {push_union_separator(&mut builder, &mut needs_separator);- builder.push(database_row_top_clause(sort_method, false));+ builder.push(database_row_top_clause(sort_method, false, property_sort));builder.push(build_database_row_filter(filter_ast.database_row_filter.as_deref(),));@@ -1609,11 +1842,16 @@ fn build_query<'a>(if !needs_separator {builder.push(- "SELECT 'document'::text as item_type, NULL::text as id, NULL::timestamptz as sort_ts WHERE false",+ "SELECT 'document'::text as item_type, NULL::text as id, NULL::timestamptz as sort_ts",);+ if property_sort {+ builder.push(", NULL::property_entity_type as property_entity_type");+ }+ builder.push(" WHERE false");}builder.push(") all_items ");+ builder.push(property_sort_join(property_sort, 9));// Frecency exclusion join (only when exclude_frecency is true)if exclude_frecency {@@ -1629,17 +1867,37 @@ fn build_query<'a>(}// Cursor condition- builder.push(- r#"($4::timestamptz IS NULL)- OR- (all_items.sort_ts, all_items.id::text) < ($4, $5)"#,- );+ if property_sort {+ builder.push(property_keyset(+ sort,+ "property_sort.key",+ 10,+ "all_items.sort_ts",+ "all_items.id",+ ));+ } else {+ // Preserve the deployed timestamp predicate and its tie-breaking order.+ builder.push(+ "($4::timestamptz IS NULL) OR (all_items.sort_ts, all_items.id::text) < ($4, $5)",+ );+ }if exclude_frecency {builder.push(")");}- builder.push(" ORDER BY all_items.sort_ts DESC, all_items.id DESC LIMIT $3");+ if property_sort {+ builder.push(" ORDER BY ");+ builder.push(property_order(+ sort,+ "sort_key",+ "all_items.sort_ts",+ "all_items.id",+ ));+ builder.push(" LIMIT $3");+ } else {+ builder.push(" ORDER BY all_items.sort_ts DESC, all_items.id DESC LIMIT $3");+ }builder.push("), ");// Combined CTE: full detail joins back from TopItems. Keep this in sync@@ -1692,13 +1950,22 @@ fn build_query<'a>(ARRAY[]::uuid[] as "status_option_ids",NULL::timestamptz as "viewed_at",NULL::timestamptz as "sort_ts",+ 0::double precision as "sort_key",NULL::boolean as "is_completed",NULL::timestamptz as "deleted_at",+ NULL::jsonb as "calendar_event",NULL::jsonb as "database_row"WHERE false"#,);}- builder.push(DETAIL_SUFFIX);+ builder.push(") SELECT * FROM Combined ORDER BY ");+ builder.push(property_order(+ sort,+ "\"sort_key\"",+ "\"sort_ts\"",+ "\"id\"",+ ));+ builder.push(" LIMIT $3");builder}@@ -1838,6 +2105,7 @@ impl SoupRow {Ok(SoupProjectionHydration {item: self.into_soup_item()?,document_server_facts,+ sort_key: None,})}@@ -1978,7 +2246,7 @@ pub(crate) struct ExpandedDynamicCursorArgs<'a> {/// the limit of items we can returnpub limit: u16,/// the Query that we are attempting to perform- pub cursor: Query<Uuid, SimpleSortMethod, EntityFilterAst>,+ pub cursor: Query<Uuid, DynamicSort, EntityFilterAst>,/// whether or not the query should explicitly remove items that DO have/// frecency recordspub exclude_frecency: bool,@@ -1996,15 +2264,17 @@ async fn expanded_dynamic_cursor_soup_hydrated(exclude_frecency,} = args;let query_limit = limit as i64;- let sort_method_str = cursor.sort_method().to_string();- let (cursor_id, cursor_timestamp) = cursor.vals();+ let sort_method_str = cursor.sort_method().timestamp_method().to_string();+ let (cursor_id, cursor_position) = cursor.vals();+ let cursor_timestamp = cursor_position.map(|position| position.timestamp());+ let cursor_key = cursor_position.and_then(|position| position.key());let cursor_id_str = cursor_id.as_ref().map(|u| u.to_string());let status_property_id = SystemPropertyKey::STATUS_UUID;let assignees_property_id = SystemPropertyKey::ASSIGNEES_UUID;let completed_option_id = StatusOption::COMPLETED_UUID.to_string();- // Document id arrays follow the eight fixed binds.- let mut document_ids = DocumentIdArrays::starting_at(9);+ let mut document_ids =+ DocumentIdArrays::starting_at(first_document_id_slot(*cursor.sort_method(), false));let mut builder = build_query(cursor.filter(),exclude_frecency,@@ -2021,6 +2291,13 @@ async fn expanded_dynamic_cursor_soup_hydrated(.bind(completed_option_id).bind(status_property_id).bind(assignees_property_id);+ if let DynamicSort::Property {+ property_definition_id,+ ..+ } = *cursor.sort_method()+ {+ query = query.bind(property_definition_id).bind(cursor_key);+ }for ids in document_ids.into_binds() {query = query.bind(ids);}@@ -2041,7 +2318,11 @@ async fn expanded_dynamic_cursor_soup_hydrated(// enough to run 10x slower. Planning with the real bind values every// time costs ~1ms and keeps the plan stable..persistent(false)- .try_map(|row| SoupRow::from_row(&row)?.into_projection_hydration())+ .try_map(|row| {+ let mut item = SoupRow::from_row(&row)?.into_projection_hydration()?;+ item.sort_key = row.try_get("sort_key")?;+ Ok(item)+ }).fetch_all(&mut *connection).instrument(query_span.clone()).await?;@@ -2086,7 +2367,7 @@ pub struct GroupedDynamicCursorArgs<'a> {/// The limit of items we can returnpub limit: u16,/// The Query that we are attempting to perform- pub cursor: Query<Uuid, SimpleSortMethod, EntityFilterAst>,+ pub cursor: Query<Uuid, DynamicSort, EntityFilterAst>,/// Whether or not the query should explicitly remove items that DO have frecency recordspub exclude_frecency: bool,/// Grouping configuration@@ -2097,8 +2378,10 @@ pub struct GroupedDynamicCursorArgs<'a> {#[derive(FromRow)]struct GroupFields {group_key: String,+ group_order: Option<f64>,group_total_count: i64,row_in_group: i64,+ sort_key: Option<f64>,}/// Grouped row: reuses SoupRow for item data, adds group metadata.@@ -2110,8 +2393,7 @@ struct GroupedSoupRow {group: GroupFields,}-/// Per-group limit for initial grouped queries.-/// Each group will return at most this many items initially.+/// Legacy initial grouped queries return ten items per group.const PER_GROUP_LIMIT: i32 = 10;/// Build the GroupedItems CTE based on the grouping configuration.@@ -2119,47 +2401,84 @@ const PER_GROUP_LIMIT: i32 = 10;fn build_grouped_items_cte(builder: &mut QueryBuilder<'_, Postgres>,grouping: &GroupingConfig,+ sort: DynamicSort,) -> Option<String> {- let select_expr = group_select_expr(&grouping.field);-+ let date_expression = date_range_group_expression(grouping);+ let select_expr =+ date_expression.unwrap_or_else(|| group_select_expr(&grouping.field).into_owned());builder.push("GroupedItems AS (SELECT t.*, (");builder.push(&select_expr);- builder.push(") as group_key, COUNT(*) OVER (PARTITION BY ");+ builder.push(") as group_key, ");+ let group_order = if matches!(grouping.field, GroupByField::Property { .. }) {+ property_value_sql(+ "ep_group",+ "NULL::uuid",+ "ep_group.data_type",+ "ep_group.val",+ "po_group",+ )+ .group_order+ } else {+ "NULL::double precision".to_string()+ };+ builder.push(group_order);+ builder.push(" AS group_order, COUNT(*) OVER (PARTITION BY ");builder.push(&select_expr);builder.push(") as group_total_count, ROW_NUMBER() OVER (PARTITION BY ");builder.push(&select_expr);- builder.push(" ORDER BY t.sort_ts DESC, t.id DESC) as row_in_group FROM TopItems t ");-- let entity_type_bind = if let Some(GroupJoinClause {+ if matches!(sort, DynamicSort::Property { .. }) {+ builder.push(" ORDER BY ");+ builder.push(property_order(sort, "t.sort_key", "t.sort_ts", "t.id"));+ builder.push(") as row_in_group FROM TopItems t ");+ } else {+ builder.push(" ORDER BY t.sort_ts DESC, t.id DESC) as row_in_group FROM TopItems t ");+ }+ let bind = if let Some(GroupJoinClause {sql,entity_type_bind,}) = group_join_clause(&grouping.field){- builder.push(&sql);- builder.push(" ");+ builder.push(sql);+ let property_definition_id = match &grouping.field {+ GroupByField::Property {+ property_definition_id,+ ..+ } => Some(*property_definition_id),+ GroupByField::Project => Some(SystemPropertyKey::PROJECT_UUID),+ _ => None,+ };+ if let Some(property_definition_id) = property_definition_id {+ builder.push(format!(+ " LEFT JOIN property_options po_group ON po_group.property_definition_id = '{property_definition_id}' AND po_group.id::text = ep_group.val#>>'{{}}' "+ ));+ }entity_type_bind} else {None};-if grouping.group_key.is_some() {- // Single group mode: fetch items for a specific group (for "load more")- // Uses $9 parameter for group_key to prevent SQL injection- builder.push("WHERE (");+ builder.push(" WHERE (");builder.push(&select_expr);builder.push(") = $9 ");}-- builder.push("), ");-- // FilteredGroupedItems: apply per-group limit when not fetching a specific group+ builder.push("), FilteredGroupedItems AS (SELECT * FROM GroupedItems WHERE ");+ if matches!(sort, DynamicSort::Property { .. }) {+ builder.push(property_keyset(sort, "sort_key", 12, "sort_ts", "id"));+ } else {+ builder.push("($4::timestamptz IS NULL OR (sort_ts, id::text) < ($4, $5))");+ }if grouping.group_key.is_none() {- builder.push("FilteredGroupedItems AS (SELECT * FROM GroupedItems WHERE row_in_group <= ");- builder.push(PER_GROUP_LIMIT.to_string());- builder.push("), ");+ builder.push(" AND row_in_group <= ");+ builder.push(+ grouping+ .per_group_limit+ .unwrap_or(PER_GROUP_LIMIT as u32)+ .clamp(1, 500)+ .to_string(),+ );}-- entity_type_bind+ builder.push("), ");+ bind}/// Build the grouped query with grouping CTE.@@ -2169,9 +2488,11 @@ fn build_grouped_query<'a>(filter_ast: &'a EntityFilterAst,exclude_frecency: bool,grouping: &'a GroupingConfig,- sort_method: SimpleSortMethod,+ sort: DynamicSort,document_ids: &mut DocumentIdArrays,) -> (QueryBuilder<'a, Postgres>, Option<String>) {+ let sort_method = sort.timestamp_method();+ let property_sort = matches!(sort, DynamicSort::Property { .. });let mut builder = sqlx::QueryBuilder::new(PREFIX);// Determine which entity types to include based on filters (same logic as build_query)@@ -2210,18 +2531,30 @@ fn build_grouped_query<'a>(&[PropertyEntityType::CalendarEvent],);- // All matching candidates are needed for exact counts; limits apply after grouping.- builder.push("TopItems AS (");+ // Full-set windows run before the position filter.+ builder.push(if property_sort {+ "TopItems AS MATERIALIZED ("+ } else {+ "TopItems AS ("+ });builder.push(- "SELECT all_items.item_type, all_items.id, all_items.sort_ts, all_items.project_id, all_items.property_entity_type FROM (",+ "SELECT all_items.item_type, all_items.id, all_items.sort_ts, all_items.project_id, all_items.property_entity_type, ",);+ builder.push(sort_key_expression(property_sort));+ builder.push(" AS sort_key FROM (");let mut needs_separator = false;if include_documents {push_union_separator(&mut builder, &mut needs_separator);- builder.push(grouped_document_top_clause(sort_method));- if document_filter_needs_task_property_joins(filter_ast.document_filter.as_deref()) {+ let document_filter = filter_ast.document_filter.as_deref();+ let needs_task_property_joins = document_filter_needs_task_property_joins(document_filter);+ builder.push(grouped_document_top_clause(+ sort_method,+ needs_task_property_joins,+ document_filter_is_task_only(document_filter),+ ));+ if needs_task_property_joins {builder.push(DOCUMENT_TASK_PROPERTY_JOINS);}builder.push(document_top_where_clause(sort_method));@@ -2271,7 +2604,7 @@ fn build_grouped_query<'a>(if include_initiatives {push_union_separator(&mut builder, &mut needs_separator);- builder.push(initiative_top_clause(sort_method, true));+ builder.push(initiative_top_clause(sort_method, true, false));builder.push(build_initiative_filter(filter_ast.initiative_filter.as_deref(),));@@ -2283,7 +2616,7 @@ fn build_grouped_query<'a>(if include_database_rows {push_union_separator(&mut builder, &mut needs_separator);- builder.push(database_row_top_clause(sort_method, true));+ builder.push(database_row_top_clause(sort_method, true, false));builder.push(build_database_row_filter(filter_ast.database_row_filter.as_deref(),));@@ -2301,6 +2634,7 @@ fn build_grouped_query<'a>(}builder.push(") all_items ");+ builder.push(property_sort_join(property_sort, 11));// Frecency exclusion join (only when exclude_frecency is true)if exclude_frecency {@@ -2309,36 +2643,30 @@ fn build_grouped_query<'a>(ON fa.entity_id = all_items.idAND fa.entity_type = all_items.item_typeAND fa.user_id = $1- WHERE fa.id IS NULL AND ("#,+ WHERE fa.id IS NULL AND TRUE"#,);} else {- builder.push("WHERE ");+ builder.push("WHERE TRUE ");}- // Cursor condition- builder.push(- r#"($4::timestamptz IS NULL)- OR- (all_items.sort_ts, all_items.id::text) < ($4, $5)"#,- );-- if exclude_frecency {- builder.push(")");+ if matches!(+ &grouping.field,+ GroupByField::Property {+ entity_type: Some(_),+ ..+ }+ ) {+ builder.push(" AND all_items.property_entity_type = $10::property_entity_type ");}// Ranking windows and the final SELECT provide their own ordering.builder.push("), ");- // GroupedItems CTE: adds group metadata (and FilteredGroupedItems if not single-group mode)- let entity_type_bind = build_grouped_items_cte(&mut builder, grouping);+ // Rank/count the full group before applying the cursor and page cap.+ let entity_type_bind = build_grouped_items_cte(&mut builder, grouping, sort);- // Combined CTE: full detail joins from GroupedItems (or FilteredGroupedItems)- // When fetching a specific group, use GroupedItems directly; otherwise use FilteredGroupedItems- let source_table = if grouping.group_key.is_some() {- "GroupedItems"- } else {- "FilteredGroupedItems"- };+ // Hydrate only the rows selected for each group's page.+ let source_table = "FilteredGroupedItems";builder.push("Combined AS (");@@ -2397,10 +2725,24 @@ fn build_grouped_query<'a>(builder.push(date_bucket_sql_order("sort_ts"));}_ => {- builder.push("\"group_key\"");+ if grouping.field.date_ranges().is_some() {+ builder.push("\"group_key\"::integer");+ } else {+ builder.push(group_order_expr(&grouping.field));+ }}}- builder.push(", \"sort_ts\" DESC, \"id\" DESC");+ builder.push(", ");+ if property_sort {+ builder.push(property_order(+ sort,+ "\"sort_key\"",+ "\"sort_ts\"",+ "\"id\"",+ ));+ } else {+ builder.push("\"sort_ts\" DESC, \"id\" DESC");+ }// Apply LIMIT only in single-group "load more" mode. In multi-group mode the// result is already bounded by the per-group cap inside FilteredGroupedItems@@ -2428,15 +2770,17 @@ pub async fn expanded_dynamic_cursor_soup_grouped(} = args;let query_limit = limit as i64;- let sort_method_str = cursor.sort_method().to_string();- let (cursor_id, cursor_timestamp) = cursor.vals();+ let sort_method_str = cursor.sort_method().timestamp_method().to_string();+ let (cursor_id, cursor_position) = cursor.vals();+ let cursor_timestamp = cursor_position.map(|position| position.timestamp());+ let cursor_key = cursor_position.and_then(|position| position.key());let cursor_id_str = cursor_id.as_ref().map(|u| u.to_string());let status_property_id = SystemPropertyKey::STATUS_UUID;let assignees_property_id = SystemPropertyKey::ASSIGNEES_UUID;let completed_option_id = StatusOption::COMPLETED_UUID.to_string();- // Document id arrays follow the ten fixed binds.- let mut document_ids = DocumentIdArrays::starting_at(11);+ let mut document_ids =+ DocumentIdArrays::starting_at(first_document_id_slot(*cursor.sort_method(), true));let (mut query_builder, entity_type_bind) = build_grouped_query(cursor.filter(),exclude_frecency,@@ -2445,9 +2789,7 @@ pub async fn expanded_dynamic_cursor_soup_grouped(&mut document_ids,);- // Keep the reserved $2 sort slot even though candidates now specialize it away.- // $9 and $10 are bound unconditionally (NULL when unused) so the document- // id arrays after them keep their slots.+ // Keep main's fixed grouping parameters; property sorts append their two values.let mut query = query_builder.build_query_as::<'_, GroupedSoupRow>().bind(user_id.as_ref())@@ -2458,9 +2800,27 @@ pub async fn expanded_dynamic_cursor_soup_grouped(.bind(completed_option_id).bind(status_property_id).bind(assignees_property_id)- .bind(grouping.group_key.clone())+ .bind(grouping.group_key.as_ref().map(|key| {+ if let Some((_, ranges)) = grouping.field.date_ranges() {+ ranges+ .ranges+ .iter()+ .position(|range| &range.key == key)+ .map(|index| index.to_string())+ .unwrap_or_else(|| "-1".into())+ } else {+ key.clone()+ }+ }))// The entity type of property grouping with an entity type filter..bind(entity_type_bind);+ if let DynamicSort::Property {+ property_definition_id,+ ..+ } = *cursor.sort_method()+ {+ query = query.bind(property_definition_id).bind(cursor_key);+ }for ids in document_ids.into_binds() {query = query.bind(ids);}@@ -2490,8 +2850,21 @@ pub async fn expanded_dynamic_cursor_soup_grouped(rows.into_iter().map(|row| {Ok(ItemGroupingInfo {+ document_server_facts: row.item.document_server_facts(),+ sort_key: row.group.sort_key,+ display_order: row.group.group_order.map(|order| order as i32),item: row.item.into_soup_item()?,- key: row.group.group_key,+ key: if let Some((_, ranges)) = grouping.field.date_ranges() {+ row.group+ .group_key+ .parse::<usize>()+ .ok()+ .and_then(|index| ranges.ranges.get(index))+ .map(|range| range.key.clone())+ .unwrap_or_else(|| ranges.missing_value_bucket_key.clone())+ } else {+ row.group.group_key+ },total_group_count: usize::try_from(row.group.group_total_count).map_err(|error| sqlx::Error::Decode(Box::new(error)))?,index_in_group: usize::try_from(row.group.row_in_group)diff --git a/crates/soup/src/outbound/pg_soup_repo/expanded/dynamic/database_row.rs b/crates/soup/src/outbound/pg_soup_repo/expanded/dynamic/database_row.rsindex dfe3ddf6ac..2655575466 100644--- a/crates/soup/src/outbound/pg_soup_repo/expanded/dynamic/database_row.rs+++ b/crates/soup/src/outbound/pg_soup_repo/expanded/dynamic/database_row.rs@@ -40,7 +40,11 @@ const FORM_EDITOR_SEMI_JOIN: &str = r#"row_database.database_id IN (/// Rows are never viewed on their own: `ViewedAt` sorts them last and `ViewedUpdated`/// uses `updated_at`, matching [`models_soup::item::SoupItem`]'s cursor.-pub(super) fn database_row_top_clause(sort: SimpleSortMethod, grouped: bool) -> String {+pub(super) fn database_row_top_clause(+ sort: SimpleSortMethod,+ grouped: bool,+ property_sort: bool,+) -> String {let sort_ts = match sort {SimpleSortMethod::CreatedAt => "r.created_at",SimpleSortMethod::ViewedAt => "'1970-01-01 00:00:00+00'",@@ -48,6 +52,8 @@ pub(super) fn database_row_top_clause(sort: SimpleSortMethod, grouped: bool) ->};let group_columns = if grouped {", NULL::text as project_id, 'DATABASE_ROW'::property_entity_type as property_entity_type"+ } else if property_sort {+ ", 'DATABASE_ROW'::property_entity_type as property_entity_type"} else {""};diff --git a/crates/soup/src/outbound/pg_soup_repo/expanded/dynamic/database_row_detail.sql b/crates/soup/src/outbound/pg_soup_repo/expanded/dynamic/database_row_detail.sqlindex 3be6194d32..6ef3035e6f 100644--- a/crates/soup/src/outbound/pg_soup_repo/expanded/dynamic/database_row_detail.sql+++ b/crates/soup/src/outbound/pg_soup_repo/expanded/dynamic/database_row_detail.sql@@ -21,8 +21,10 @@ARRAY[]::uuid[] as "status_option_ids",NULL::timestamptz as "viewed_at",t.sort_ts as "sort_ts",+ t.sort_key as "sort_key",NULL as "is_completed",NULL::timestamptz as "deleted_at",+ NULL::jsonb as "calendar_event",jsonb_build_object('tableId', r.table_id,'databaseId', row_table.database_id,diff --git a/crates/soup/src/outbound/pg_soup_repo/expanded/dynamic/database_row_grouped_detail.sql b/crates/soup/src/outbound/pg_soup_repo/expanded/dynamic/database_row_grouped_detail.sqlindex 3b3925fa51..9730e1be71 100644--- a/crates/soup/src/outbound/pg_soup_repo/expanded/dynamic/database_row_grouped_detail.sql+++ b/crates/soup/src/outbound/pg_soup_repo/expanded/dynamic/database_row_grouped_detail.sql@@ -16,8 +16,12 @@NULL::text as "model",NULL::text as "sha",NULL::document_sub_type_value as "sub_type",+ false as "is_email_attachment",+ true as "is_important",+ ARRAY[]::uuid[] as "status_option_ids",NULL::timestamptz as "viewed_at",gi.sort_ts as "sort_ts",+ gi.sort_key as "sort_key",NULL::boolean as "is_completed",NULL::timestamptz as "deleted_at",NULL::jsonb as "calendar_event",@@ -28,6 +32,7 @@'createdBy', r.created_by) as "database_row",gi.group_key as "group_key",+ gi.group_order as "group_order",gi.group_total_count as "group_total_count",gi.row_in_group as "row_in_group"FROM GroupedItems gidiff --git a/crates/soup/src/outbound/pg_soup_repo/expanded/dynamic/document_ids/test.rs b/crates/soup/src/outbound/pg_soup_repo/expanded/dynamic/document_ids/test.rsindex 22d7b73de1..2f253f93d1 100644--- a/crates/soup/src/outbound/pg_soup_repo/expanded/dynamic/document_ids/test.rs+++ b/crates/soup/src/outbound/pg_soup_repo/expanded/dynamic/document_ids/test.rs@@ -1,9 +1,9 @@use super::DocumentIdArrays;-use crate::domain::models::grouping::ItemGroupingInfo;+use crate::domain::models::{DynamicSort, SoupSortDirection, grouping::ItemGroupingInfo};use crate::outbound::pg_soup_repo::expanded::dynamic::{ExpandedDynamicCursorArgs, GroupedDynamicCursorArgs, build_document_filter,build_grouped_query, build_query, expanded_dynamic_cursor_soup,- expanded_dynamic_cursor_soup_grouped,+ expanded_dynamic_cursor_soup_grouped, first_document_id_slot,};use document_sub_type::DocumentSubType;use filter_ast::Expr;@@ -87,6 +87,7 @@ fn status(entity_type: Option<&str>) -> GroupByField {GroupByField::Property {property_definition_id: SystemPropertyKey::STATUS_UUID,entity_type: entity_type.map(str::to_owned),+ bucketing: None,}}@@ -174,43 +175,68 @@ fn bind_free_rendering_keeps_every_id_inline() {#[test]fn arrays_follow_each_querys_fixed_binds() {- let render = |count| {- let filter = tasks(Expr::and(- any_of(&absent(1, count)),- Expr::is_not(any_of(&absent(2, count))),- ));- let mut flat_ids = DocumentIdArrays::starting_at(9);- let flat = build_query(&filter, false, SimpleSortMethod::UpdatedAt, &mut flat_ids)- .sql()- .to_owned();- let grouping = GroupingConfig {- field: status(Some("TASK")),- group_key: None,- per_group_limit: None,+ for sort in [+ SimpleSortMethod::UpdatedAt.into(),+ DynamicSort::Property {+ property_definition_id: SystemPropertyKey::DUE_DATE_UUID,+ direction: SoupSortDirection::Asc,+ },+ DynamicSort::Property {+ property_definition_id: SystemPropertyKey::DUE_DATE_UUID,+ direction: SoupSortDirection::Desc,+ },+ ] {+ let flat_first = first_document_id_slot(sort, false);+ let grouped_first = first_document_id_slot(sort, true);+ let render = |count| {+ let filter = tasks(Expr::and(+ any_of(&absent(1, count)),+ Expr::is_not(any_of(&absent(2, count))),+ ));+ let mut flat_ids = DocumentIdArrays::starting_at(flat_first);+ let flat = build_query(&filter, false, sort, &mut flat_ids)+ .sql()+ .to_owned();+ let grouping = GroupingConfig {+ field: status(Some("TASK")),+ group_key: None,+ per_group_limit: None,+ };+ let mut grouped_ids = DocumentIdArrays::starting_at(grouped_first);+ let (grouped, _) =+ build_grouped_query(&filter, false, &grouping, sort, &mut grouped_ids);+ (+ flat,+ flat_ids.into_binds().len(),+ grouped.sql().to_owned(),+ grouped_ids.into_binds().len(),+ )};- let mut grouped_ids = DocumentIdArrays::starting_at(11);- let (grouped, _) = build_grouped_query(- &filter,- false,- &grouping,- SimpleSortMethod::UpdatedAt,- &mut grouped_ids,- );- (- flat,- flat_ids.into_binds().len(),- grouped.sql().to_owned(),- grouped_ids.into_binds().len(),- )- };- let few = render(2);- assert_eq!(few, render(5_000));- let (flat, flat_arrays, grouped, grouped_arrays) = few;- assert_eq!((flat_arrays, grouped_arrays), (2, 2));- assert!(flat.contains("(d.id = ANY($9::text[]) AND (NOT d.id = ANY($10::text[])))"));- assert!(!flat.contains("$11"));- assert!(grouped.contains("ep.entity_type = $10::property_entity_type"));- assert!(grouped.contains("(d.id = ANY($11::text[]) AND (NOT d.id = ANY($12::text[])))"));+ let few = render(2);+ assert_eq!(few, render(5_000));+ let (flat, flat_arrays, grouped, grouped_arrays) = few;+ assert_eq!((flat_arrays, grouped_arrays), (2, 2));+ for (sql, first) in [(&flat, flat_first), (&grouped, grouped_first)] {+ assert!(sql.contains(&format!(+ "(d.id = ANY(${first}::text[]) AND (NOT d.id = ANY(${}::text[])))",+ first + 1+ )));+ assert!(!sql.contains(&format!("${}", first + 2)));+ assert!(!sql.contains("sort_parameters"));+ }+ assert!(grouped.contains("ep.entity_type = $10::property_entity_type"));+ if matches!(sort, DynamicSort::Property { .. }) {+ assert_eq!((flat_first, grouped_first), (11, 13));+ assert!(flat.contains("WHERE id = $9::uuid"));+ assert!(flat.contains("$10::double precision"));+ assert!(grouped.contains("WHERE id = $11::uuid"));+ assert!(grouped.contains("$12::double precision"));+ } else {+ assert_eq!((flat_first, grouped_first), (9, 11));+ assert!(!flat.contains("property_sort"));+ assert!(!grouped.contains("property_sort"));+ }+ }}async fn flat_page(@@ -223,7 +249,7 @@ async fn flat_page(ExpandedDynamicCursorArgs {user_id: user(),limit,- cursor,+ cursor: DynamicSort::from_timestamp_query(cursor),exclude_frecency: false,},)@@ -347,7 +373,7 @@ async fn grouped_page(GroupedDynamicCursorArgs {user_id: user(),limit,- cursor,+ cursor: DynamicSort::from_timestamp_query(cursor),exclude_frecency: false,grouping,},@@ -371,7 +397,7 @@ async fn grouped_pages_match_bound_id_sets(pool: PgPool) -> anyhow::Result<()> {Expr::is_not(any_of(&among_absent(&[IN_D], 2))),)};- let by_status = vec![("", IN_A), (IN_PROGRESS, IN_C)];+ let by_status = vec![(IN_PROGRESS, IN_C), ("", IN_A)];for (label, field, filter, arrays, expected) in [// The entity type takes `$10`, the arrays `$11` and `$12`.(@@ -412,12 +438,15 @@ async fn grouped_pages_match_bound_id_sets(pool: PgPool) -> anyhow::Result<()> {group_key: None,per_group_limit: None,};- let mut document_ids = DocumentIdArrays::starting_at(11);+ let mut document_ids = DocumentIdArrays::starting_at(first_document_id_slot(+ SimpleSortMethod::UpdatedAt.into(),+ true,+ ));build_grouped_query(&filter,false,&grouping,- SimpleSortMethod::UpdatedAt,+ SimpleSortMethod::UpdatedAt.into(),&mut document_ids,);assert_eq!(document_ids.into_binds().len(), arrays, "{label}");diff --git a/crates/soup/src/outbound/pg_soup_repo/expanded/dynamic/initiative.rs b/crates/soup/src/outbound/pg_soup_repo/expanded/dynamic/initiative.rsindex 930991030d..d490bd669c 100644--- a/crates/soup/src/outbound/pg_soup_repo/expanded/dynamic/initiative.rs+++ b/crates/soup/src/outbound/pg_soup_repo/expanded/dynamic/initiative.rs@@ -59,10 +59,11 @@ pub(in crate::outbound::pg_soup_repo) fn build_initiative_filter(}}fn due_date_filter(operator: &str, date: &DateTime<Utc>) -> String {+ let value = super::property_date_expression("ep_due");format!(- "EXISTS (SELECT 1 FROM entity_properties ep_due WHERE ep_due.entity_id = i.id::text AND ep_due.entity_type = 'INITIATIVE' AND ep_due.property_definition_id = '{}' AND (ep_due.values->>'value')::timestamptz {operator} '{}'::timestamptz)",+ "EXISTS (SELECT 1 FROM entity_properties ep_due WHERE ep_due.entity_id = i.id::text AND ep_due.entity_type = 'INITIATIVE' AND ep_due.property_definition_id = '{}' AND {value} {operator} '{}'::timestamptz)",SystemPropertyKey::DUE_DATE_UUID,- date.to_rfc3339()+ date.to_rfc3339(),)}filter@@ -70,7 +71,11 @@ pub(in crate::outbound::pg_soup_repo) fn build_initiative_filter(.unwrap_or_default()}-pub(super) fn initiative_top_clause(sort: SimpleSortMethod, grouped: bool) -> String {+pub(super) fn initiative_top_clause(+ sort: SimpleSortMethod,+ grouped: bool,+ property_sort: bool,+) -> String {let sort_ts = match sort {SimpleSortMethod::CreatedAt => "i.created_at",SimpleSortMethod::UpdatedAt => "i.updated_at",@@ -81,6 +86,8 @@ pub(super) fn initiative_top_clause(sort: SimpleSortMethod, grouped: bool) -> St};let group_columns = if grouped {", NULL::text as project_id, 'INITIATIVE'::property_entity_type as property_entity_type"+ } else if property_sort {+ ", 'INITIATIVE'::property_entity_type as property_entity_type"} else {""};diff --git a/crates/soup/src/outbound/pg_soup_repo/expanded/dynamic/initiative_detail.sql b/crates/soup/src/outbound/pg_soup_repo/expanded/dynamic/initiative_detail.sqlindex fe1dc2eff2..2643af912c 100644--- a/crates/soup/src/outbound/pg_soup_repo/expanded/dynamic/initiative_detail.sql+++ b/crates/soup/src/outbound/pg_soup_repo/expanded/dynamic/initiative_detail.sql@@ -21,8 +21,10 @@ARRAY[]::uuid[] as "status_option_ids",uh."updatedAt"::timestamptz as "viewed_at",t.sort_ts as "sort_ts",+ t.sort_key as "sort_key",NULL as "is_completed",NULL::timestamptz as "deleted_at",+ NULL::jsonb as "calendar_event",NULL::jsonb as "database_row"FROM TopItems tINNER JOIN initiative i ON i.id::text = t.iddiff --git a/crates/soup/src/outbound/pg_soup_repo/expanded/dynamic/initiative_grouped_detail.sql b/crates/soup/src/outbound/pg_soup_repo/expanded/dynamic/initiative_grouped_detail.sqlindex 150115e0c5..91630ded66 100644--- a/crates/soup/src/outbound/pg_soup_repo/expanded/dynamic/initiative_grouped_detail.sql+++ b/crates/soup/src/outbound/pg_soup_repo/expanded/dynamic/initiative_grouped_detail.sql@@ -16,13 +16,18 @@NULL::text as "model",NULL::text as "sha",NULL::document_sub_type_value as "sub_type",+ false as "is_email_attachment",+ true as "is_important",+ ARRAY[]::uuid[] as "status_option_ids",uh."updatedAt"::timestamptz as "viewed_at",gi.sort_ts as "sort_ts",+ gi.sort_key as "sort_key",NULL::boolean as "is_completed",NULL::timestamptz as "deleted_at",NULL::jsonb as "calendar_event",NULL::jsonb as "database_row",gi.group_key as "group_key",+ gi.group_order as "group_order",gi.group_total_count as "group_total_count",gi.row_in_group as "row_in_group"FROM GroupedItems gidiff --git a/crates/soup/src/outbound/pg_soup_repo/expanded/dynamic/test.rs b/crates/soup/src/outbound/pg_soup_repo/expanded/dynamic/test.rsindex 205e713741..0c2d7699cf 100644--- a/crates/soup/src/outbound/pg_soup_repo/expanded/dynamic/test.rs+++ b/crates/soup/src/outbound/pg_soup_repo/expanded/dynamic/test.rs@@ -14,8 +14,11 @@ fn grouped_access_shape() {&filter,false,&grouping,- SimpleSortMethod::ViewedUpdated,- &mut DocumentIdArrays::starting_at(11),+ SimpleSortMethod::ViewedUpdated.into(),+ &mut DocumentIdArrays::starting_at(first_document_id_slot(+ SimpleSortMethod::ViewedUpdated.into(),+ true,+ )),);let candidates = builder.sql().split("GroupedItems AS").next().unwrap();assert!(!candidates.contains("AccessibleItems"));@@ -43,6 +46,7 @@ fn grouped_candidate_sort_shape() {field: GroupByField::Property {property_definition_id: SystemPropertyKey::ASSIGNEES_UUID,entity_type: Some("TASK".to_string()),+ bucketing: None,},group_key,per_group_limit: None,@@ -51,8 +55,8 @@ fn grouped_candidate_sort_shape() {&filter,true,&grouping,- sort,- &mut DocumentIdArrays::starting_at(11),+ sort.into(),+ &mut DocumentIdArrays::starting_at(first_document_id_slot(sort.into(), true)),);let sql = builder.sql();let (candidates, rest) = sql.split_once("GroupedItems AS").unwrap();@@ -70,8 +74,8 @@ fn grouped_candidate_sort_shape() {)));}assert!(candidates.contains("LEFT JOIN document_sub_type dt"));- assert!(candidates.contains("fa.id IS NULL AND ("));- assert!(candidates.contains("(all_items.sort_ts, all_items.id::text) < ($4, $5)"));+ assert!(candidates.contains("fa.id IS NULL AND TRUE"));+ assert!(rest.contains("(sort_ts, id::text) < ($4, $5)"));assert_eq!(rest.matches("LEFT JOIN \"UserHistory\"").count(), 3);assert!(rest.contains("COUNT(*) OVER (PARTITION BY"));assert!(rest.contains("ORDER BY t.sort_ts DESC, t.id DESC"));@@ -86,6 +90,182 @@ fn grouped_candidate_sort_shape() {}}+#[test]+fn flat_timestamp_top_clauses_remain_lightweight() {+ let filter = EntityFilterAst::mock_empty();+ for sort in [+ SimpleSortMethod::CreatedAt,+ SimpleSortMethod::UpdatedAt,+ SimpleSortMethod::ViewedAt,+ SimpleSortMethod::ViewedUpdated,+ ] {+ let mut arrays = DocumentIdArrays::starting_at(first_document_id_slot(sort.into(), false));+ let query = build_query(&filter, false, sort.into(), &mut arrays);+ let top = query.sql().split("Combined AS").next().unwrap();+ assert!(!top.contains("JOIN document_sub_type"));+ assert!(!top.contains("property_entity_type"));+ assert!(!top.contains("as project_id"));+ assert!(!top.contains("FROM calendar_events"));+ assert!(!top.contains("sort_parameters"));+ }+ let property = DynamicSort::Property {+ property_definition_id: SystemPropertyKey::DUE_DATE_UUID,+ direction: SoupSortDirection::Asc,+ };+ let mut arrays = DocumentIdArrays::starting_at(first_document_id_slot(property, false));+ let query = build_query(&filter, false, property, &mut arrays);+ let top = query.sql().split("Combined AS").next().unwrap();+ assert!(top.contains("LEFT JOIN document_sub_type"));+ assert!(top.contains("THEN 'TASK'::property_entity_type"));+ assert!(!top.contains("as project_id"));+ assert!(!query.sql().contains("FROM calendar_events"));+}+#[test]+fn property_queries_hoist_definition_and_option_lookups() {+ let filter = EntityFilterAst::mock_empty();+ let grouping = GroupingConfig {+ field: GroupByField::Property {+ property_definition_id: SystemPropertyKey::STATUS_UUID,+ entity_type: None,+ bucketing: None,+ },+ group_key: None,+ per_group_limit: None,+ };+ for sort in [+ DynamicSort::Timestamp(SimpleSortMethod::UpdatedAt),+ DynamicSort::Property {+ property_definition_id: SystemPropertyKey::DUE_DATE_UUID,+ direction: SoupSortDirection::Asc,+ },+ ] {+ let (query, _) = build_grouped_query(+ &filter,+ false,+ &grouping,+ sort,+ &mut DocumentIdArrays::starting_at(first_document_id_slot(sort, true)),+ );+ let sql = query.sql();+ assert!(!sql.contains("JOIN property_definitions"));+ assert_eq!(sql.matches("JOIN property_options po_group").count(), 1);+ assert!(!sql.contains("SELECT po.display_order"));+ assert!(sql.contains("CASE WHEN po_group.id IS NOT NULL"));+ assert!(sql.contains("po_group.display_order::double precision"));+ assert_eq!(+ sql.contains("TopItems AS MATERIALIZED ("),+ matches!(sort, DynamicSort::Property { .. }),+ );+ if matches!(sort, DynamicSort::Property { .. }) {+ assert!(sql.contains("LEFT JOIN entity_properties ep_sort"));+ assert!(+ sql.contains("SELECT data_type FROM property_definitions WHERE id = $11::uuid")+ );+ assert!(sql.contains("LEFT JOIN LATERAL (SELECT (CASE"));+ }+ }+}++#[test]+fn option_sorts_build_one_uncorrelated_option_map() {+ let filter = EntityFilterAst::mock_empty();+ let grouping = GroupingConfig {+ field: GroupByField::EntityType,+ group_key: None,+ per_group_limit: None,+ };+ let sort = DynamicSort::Property {+ property_definition_id: SystemPropertyKey::STATUS_UUID,+ direction: SoupSortDirection::Asc,+ };+ for grouped in [false, true] {+ let mut arrays = DocumentIdArrays::starting_at(first_document_id_slot(sort, grouped));+ let query = if grouped {+ build_grouped_query(&filter, false, &grouping, sort, &mut arrays).0+ } else {+ build_query(&filter, false, sort, &mut arrays)+ };+ let parameter = if grouped { 11 } else { 9 };+ let sql = query.sql();+ assert_eq!(+ sql.matches("jsonb_object_agg(po.id::text, po.display_order)")+ .count(),+ 1+ );+ assert!(sql.contains(&format!(+ "FROM property_options po WHERE po.property_definition_id = ${parameter}::uuid"+ )));+ assert!(!sql.contains("po.property_definition_id = ep_sort.property_definition_id"));+ }+}++#[test]+fn task_only_filters_omit_redundant_namespace_joins() {+ let task = Expr::val(DocumentLiteral::SubType(DocumentSubType::Task));+ let id = Expr::val(DocumentLiteral::Id(Uuid::from_u128(1)));+ assert!(!document_filter_is_task_only(None));+ for (filter, expected) in [+ (task.clone(), true),+ (Expr::and(task.clone(), id.clone()), true),+ (Expr::and(id.clone(), task.clone()), true),+ (+ Expr::or(task.clone(), Expr::and(task.clone(), id.clone())),+ true,+ ),+ (Expr::or(task.clone(), id), false),+ (Expr::is_not(task.clone()), false),+ (Expr::is_not(Expr::is_not(task.clone())), false),+ (+ Expr::and(task, Expr::val(DocumentLiteral::Importance(true))),+ true,+ ),+ ] {+ assert_eq!(document_filter_is_task_only(Some(&filter)), expected);+ let needs_task_joins = document_filter_needs_task_property_joins(Some(&filter));+ let filter = EntityFilterAst {+ document_filter: Some(Arc::new(filter)),+ ..EntityFilterAst::mock_empty()+ };+ let sort = DynamicSort::Property {+ property_definition_id: SystemPropertyKey::DUE_DATE_UUID,+ direction: SoupSortDirection::Asc,+ };+ let grouping = GroupingConfig {+ field: GroupByField::Property {+ property_definition_id: SystemPropertyKey::STATUS_UUID,+ entity_type: None,+ bucketing: None,+ },+ group_key: None,+ per_group_limit: None,+ };+ let flat = build_query(+ &filter,+ false,+ sort,+ &mut DocumentIdArrays::starting_at(first_document_id_slot(sort, false)),+ );+ let (grouped, _) = build_grouped_query(+ &filter,+ false,+ &grouping,+ sort,+ &mut DocumentIdArrays::starting_at(first_document_id_slot(sort, true)),+ );+ for query in [&flat, &grouped] {+ let top = query.sql().split(") all_items").next().unwrap();+ assert_eq!(+ top.contains("LEFT JOIN document_sub_type dt"),+ !expected || needs_task_joins+ );+ assert_eq!(+ top.contains("'TASK'::property_entity_type as property_entity_type"),+ expected+ );+ }+ }+}+/// Bounded, synthetic diagnostic. SQLx creates an isolated database; never point/// the test harness at a hosted database. No planner settings or timing assertions.#[sqlx::test(@@ -157,6 +337,7 @@ async fn grouped_query_explain_local(pool: PgPool) -> anyhow::Result<()> {GroupByField::Property {property_definition_id: SystemPropertyKey::ASSIGNEES_UUID,entity_type: None,+ bucketing: None,},None,),@@ -181,11 +362,11 @@ async fn grouped_query_explain_local(pool: PgPool) -> anyhow::Result<()> {&filter,false,&grouping,- sort,- &mut DocumentIdArrays::starting_at(11),+ sort.into(),+ &mut DocumentIdArrays::starting_at(first_document_id_slot(sort.into(), true)),);- // Dynamic AST/grouping SQL cannot use a compile-time macro. Mirror- // production's positional binds, including unused reserved slots.+ // Dynamic AST/grouping SQL cannot use a compile-time macro.+ // Mirror the production timestamp query's ten fixed parameters.let sql = format!("EXPLAIN (ANALYZE, BUFFERS, VERBOSE, FORMAT JSON) {}",builder.sql()@@ -221,7 +402,7 @@ fn initiatives_are_opt_in_and_share_the_existing_sql_pagination() {!build_query(&filter,false,- SimpleSortMethod::UpdatedAt,+ SimpleSortMethod::UpdatedAt.into(),&mut DocumentIdArrays::starting_at(9),).sql()@@ -234,7 +415,7 @@ fn initiatives_are_opt_in_and_share_the_existing_sql_pagination() {!build_query(&filter,false,- SimpleSortMethod::UpdatedAt,+ SimpleSortMethod::UpdatedAt.into(),&mut DocumentIdArrays::starting_at(9),).sql()@@ -244,7 +425,7 @@ fn initiatives_are_opt_in_and_share_the_existing_sql_pagination() {let query = build_query(&filter,false,- SimpleSortMethod::UpdatedAt,+ SimpleSortMethod::UpdatedAt.into(),&mut DocumentIdArrays::starting_at(9),);let (candidates, details) = query.sql().split_once("Combined AS").unwrap();@@ -263,6 +444,8 @@ fn initiative_name_literals_are_escaped_and_not_like_patterns() {assert!(sql.contains("strpos("));}+mod property_sort;+#[test]fn notification_conjunction_folds_to_the_side_that_implies_the_other() {use item_filters::NotificationState::{Done, Seen, Unseen};diff --git a/crates/soup/src/outbound/pg_soup_repo/expanded/dynamic/test/property_sort.rs b/crates/soup/src/outbound/pg_soup_repo/expanded/dynamic/test/property_sort.rsnew file mode 100644index 0000000000..c99991686d--- /dev/null+++ b/crates/soup/src/outbound/pg_soup_repo/expanded/dynamic/test/property_sort.rs@@ -0,0 +1,781 @@+use super::*;+use crate::domain::models::{+ DynamicSort, SoupProjectionHydration, SoupSortDirection, grouping::ItemGroupingInfo,+};+use chrono::{DateTime, Utc};+use item_filters::ast::{+ calendar_event::CalendarEventLiteral, chat::ChatLiteral, document::DocumentLiteral,+ project::ProjectLiteral,+};+use models_grouping::{PropertyBucketing, PropertyDateRange, PropertyDateRanges};+use models_pagination::{+ CursorVal, CursorWithValAndFilter, Identify, Query, SimpleSortMethod, SortOn,+};+use serde_json::{Value, json};++const A: Uuid = uuid::uuid!("11111111-aaaa-aaaa-aaaa-aaaaaaaaaaaa");+const B: Uuid = uuid::uuid!("11111111-bbbb-bbbb-bbbb-bbbbbbbbbbbb");+const C: Uuid = uuid::uuid!("11111111-cccc-cccc-cccc-cccccccccccc");+const D: Uuid = uuid::uuid!("11111111-dddd-dddd-dddd-dddddddddddd");+const UNSET: Uuid = uuid::uuid!("11111111-0000-0000-0000-000000000000");++fn documents() -> EntityFilterAst {+ EntityFilterAst {+ document_filter: [A, B, C, D, UNSET]+ .into_iter()+ .map(|id| Expr::val(DocumentLiteral::Id(id)))+ .reduce(Expr::or)+ .map(Arc::new),+ chat_filter: Some(Arc::new(Expr::val(ChatLiteral::Importance(false)))),+ project_filter: Some(Arc::new(Expr::val(ProjectLiteral::Importance(false)))),+ calendar_event_filter: Some(Arc::new(Expr::val(CalendarEventLiteral::Id(Uuid::nil())))),+ ..EntityFilterAst::mock_empty()+ }+}++async fn seed_property(+ pool: &PgPool,+ data_type: &str,+ first: Value,+ second: Value,+) -> anyhow::Result<Uuid> {+ let property_id = Uuid::now_v7();+ sqlx::query!(+ r#"INSERT INTO property_definitions (id, user_id, display_name, data_type, is_multi_select)+ SELECT $1, owner, $2, $3::text::property_data_type, false FROM "Document" WHERE id = $4"#,+ property_id,+ format!("Sort {property_id}"),+ data_type,+ A.to_string(),+ )+ .execute(pool)+ .await?;+ for (id, value) in [+ (A, Some(first)),+ (B, Some(second)),+ // A valid-looking payload under the wrong tag never supplies a sort key.+ (C, Some(json!({"type": "String", "value": "999"}))),+ (D, None),+ ] {+ sqlx::query!(+ "INSERT INTO entity_properties (id, entity_id, entity_type, property_definition_id, values) VALUES ($1, $2, 'DOCUMENT', $3, $4)",+ Uuid::now_v7(),+ id.to_string(),+ property_id,+ value,+ )+ .execute(pool)+ .await?;+ }+ Ok(property_id)+}++fn sort(property_definition_id: Uuid, direction: SoupSortDirection) -> DynamicSort {+ DynamicSort::Property {+ property_definition_id,+ direction,+ }+}++fn continuation(+ id: Uuid,+ key: Option<f64>,+ timestamp: DateTime<Utc>,+ sort: DynamicSort,+) -> Query<Uuid, DynamicSort, EntityFilterAst> {+ Query::Cursor(CursorWithValAndFilter {+ id,+ limit: 2,+ val: CursorVal {+ sort_type: sort,+ last_val: sort.position(key, timestamp),+ },+ filter: documents(),+ })+}++async fn flat(+ pool: &PgPool,+ cursor: Query<Uuid, DynamicSort, EntityFilterAst>,+ limit: u16,+) -> anyhow::Result<Vec<SoupProjectionHydration>> {+ let user_id = sqlx::query_scalar!(+ r#"SELECT owner FROM "Document" WHERE id = $1"#,+ A.to_string()+ )+ .fetch_one(pool)+ .await?;+ Ok(expanded_dynamic_cursor_soup_with_projection(+ pool,+ ExpandedDynamicCursorArgs {+ user_id: MacroUserIdStr::parse_from_str(&user_id)?,+ limit,+ cursor,+ exclude_frecency: false,+ },+ )+ .await?)+}++async fn grouped(+ pool: &PgPool,+ cursor: Query<Uuid, DynamicSort, EntityFilterAst>,+ field: GroupByField,+ group_key: Option<&str>,+ limit: u16,+) -> anyhow::Result<Vec<ItemGroupingInfo>> {+ let user_id = sqlx::query_scalar!(+ r#"SELECT owner FROM "Document" WHERE id = $1"#,+ A.to_string()+ )+ .fetch_one(pool)+ .await?;+ Ok(expanded_dynamic_cursor_soup_grouped(+ pool,+ GroupedDynamicCursorArgs {+ user_id: MacroUserIdStr::parse_from_str(&user_id)?,+ limit,+ cursor,+ exclude_frecency: false,+ grouping: GroupingConfig {+ field,+ group_key: group_key.map(str::to_owned),+ per_group_limit: None,+ },+ },+ )+ .await?+ .collect())+}++#[sqlx::test(+ fixtures(+ path = "../../../../../../../macro_db_client/fixtures",+ scripts("mixed_items_expanded")+ ),+ migrator = "MACRO_DB_MIGRATIONS"+)]+async fn property_sort_flat_and_grouped_pages_preserve_keys_and_missing_values(+ pool: PgPool,+) -> anyhow::Result<()> {+ for data_type in [+ "DATE",+ "NUMBER",+ "BOOLEAN",+ "SELECT_STRING",+ "SELECT_NUMBER",+ "TAG",+ ] {+ let (first, second) = match data_type {+ "DATE" => (+ json!({"type":"Date","value":"2025-01-01T00:00:00Z"}),+ json!({"type":"Date","value":"2025-02-01T00:00:00Z"}),+ ),+ "NUMBER" => (+ json!({"type":"Number","value":10}),+ json!({"type":"Number","value":20}),+ ),+ "BOOLEAN" => (+ json!({"type":"Boolean","value":false}),+ json!({"type":"Boolean","value":true}),+ ),+ _ => {+ let early = Uuid::now_v7();+ let middle = Uuid::now_v7();+ let late = Uuid::now_v7();+ let deleted = Uuid::now_v7();+ // Keep options tied to the definition inserted below.+ let property_id = Uuid::now_v7();+ sqlx::query!(+ r#"INSERT INTO property_definitions (id, user_id, display_name, data_type, is_multi_select)+ SELECT $1, owner, $2, $3::text::property_data_type, true FROM "Document" WHERE id = $4"#,+ property_id, format!("Sort {property_id}"), data_type, A.to_string(),+ ).execute(&pool).await?;+ for (id, order) in [(early, 1), (middle, 2), (late, 3), (deleted, 0)] {+ if data_type == "SELECT_NUMBER" {+ sqlx::query!(+ "INSERT INTO property_options (id, property_definition_id, display_order, number_value) VALUES ($1, $2, $3, $4)",+ id, property_id, order, f64::from(order),+ ).execute(&pool).await?;+ } else {+ sqlx::query!(+ "INSERT INTO property_options (id, property_definition_id, display_order, string_value) VALUES ($1, $2, $3, $4)",+ id, property_id, order, id.to_string(),+ ).execute(&pool).await?;+ }+ }+ for (id, value) in [+ (+ A,+ Some(json!({"type":"SelectOption","value":[late, middle]})),+ ),+ (B, Some(json!({"type":"SelectOption","value":[early]}))),+ (C, Some(json!({"type":"String","value":"999"}))),+ (D, None),+ ] {+ sqlx::query!(+ "INSERT INTO entity_properties (id, entity_id, entity_type, property_definition_id, values) VALUES ($1, $2, 'DOCUMENT', $3, $4)",+ Uuid::now_v7(), id.to_string(), property_id, value,+ ).execute(&pool).await?;+ }+ for direction in [SoupSortDirection::Asc, SoupSortDirection::Desc] {+ check_pages(&pool, data_type, property_id, direction, 2.0, 1.0).await?;+ }+ let option_groups = grouped(+ &pool,+ Query::Sort(sort(property_id, SoupSortDirection::Asc), documents()),+ GroupByField::Property {+ property_definition_id: property_id,+ entity_type: None,+ bucketing: None,+ },+ None,+ 10,+ )+ .await?;+ assert_eq!(+ option_groups+ .iter()+ .map(|item| (item.key.as_str(), item.item.id()))+ .collect::<Vec<_>>(),+ [+ (early.to_string(), B),+ (middle.to_string(), A),+ (late.to_string(), A),+ (String::new(), UNSET),+ (String::new(), D),+ (String::new(), C)+ ]+ .iter()+ .map(|(key, id)| (key.as_str(), *id))+ .collect::<Vec<_>>()+ );+ sqlx::query!("DELETE FROM property_options WHERE id = $1", deleted)+ .execute(&pool)+ .await?;+ // Deleted and malformed IDs do not lower A's key or give C a key.+ for (id, value) in [+ (+ A,+ json!({"type":"SelectOption","value":[late, deleted, "not-a-uuid", middle]}),+ ),+ (+ C,+ json!({"type":"SelectOption","value":[deleted, "not-a-uuid", Uuid::now_v7()]}),+ ),+ ] {+ sqlx::query!(+ "UPDATE entity_properties SET values = $1 WHERE entity_id = $2 AND property_definition_id = $3",+ value, id.to_string(), property_id,+ ).execute(&pool).await?;+ }+ for direction in [SoupSortDirection::Asc, SoupSortDirection::Desc] {+ check_pages(&pool, data_type, property_id, direction, 2.0, 1.0).await?;+ }+ continue;+ }+ };+ let property_id = seed_property(&pool, data_type, first, second).await?;+ let (a, b) = match data_type {+ "DATE" => (1735689600.0 * 1_000_000.0, 1738368000.0 * 1_000_000.0),+ "NUMBER" => (10.0, 20.0),+ "BOOLEAN" => (0.0, 1.0),+ _ => unreachable!(),+ };+ for direction in [SoupSortDirection::Asc, SoupSortDirection::Desc] {+ check_pages(&pool, data_type, property_id, direction, a, b).await?;+ }+ }+ Ok(())+}++async fn check_pages(+ pool: &PgPool,+ label: &str,+ property_id: Uuid,+ direction: SoupSortDirection,+ a: f64,+ b: f64,+) -> anyhow::Result<()> {+ let order = if (a < b) == (direction == SoupSortDirection::Asc) {+ [A, B, UNSET, D, C]+ } else {+ [B, A, UNSET, D, C]+ };+ let selected_sort = sort(property_id, direction);+ let mut cursor = Query::Sort(selected_sort, documents());+ let mut seen = Vec::new();+ for _ in 0..4 {+ let page = flat(pool, cursor, 2).await?;+ if page.is_empty() {+ break;+ }+ for item in &page {+ let id = item.item.id();+ let key = match id {+ A => Some(a),+ B => Some(b),+ _ => None,+ };+ assert_eq!(item.sort_key, key, "{label} {direction:?} {id}");+ seen.push(id);+ }+ let last = page.last().unwrap();+ cursor = continuation(+ last.item.id(),+ last.sort_key,+ SoupItem::sort_on(SimpleSortMethod::UpdatedAt)(&last.item).last_val,+ selected_sort,+ );+ }+ assert_eq!(seen, order, "flat {label} {direction:?}");++ let initial = grouped(+ pool,+ Query::Sort(selected_sort, documents()),+ GroupByField::EntityType,+ None,+ 2,+ )+ .await?;+ assert_eq!(+ initial+ .iter()+ .map(|item| item.item.id())+ .collect::<Vec<_>>(),+ order,+ "grouped {label} {direction:?}"+ );+ assert!(+ initial+ .iter()+ .all(|item| item.key == "document" && item.total_group_count == 5)+ );+ for (index, item) in initial.iter().enumerate() {+ assert_eq!(item.index_in_group, index + 1);+ }+ let mut cursor = Query::Sort(selected_sort, documents());+ let mut seen = Vec::new();+ for _ in 0..4 {+ let page = grouped(pool, cursor, GroupByField::EntityType, Some("document"), 2).await?;+ if page.is_empty() {+ break;+ }+ for item in &page {+ assert_eq!(item.total_group_count, 5);+ assert_eq!(item.index_in_group, seen.len() + 1);+ seen.push(item.item.id());+ }+ let last = page.last().unwrap();+ cursor = continuation(+ last.item.id(),+ last.sort_key,+ SoupItem::sort_on(SimpleSortMethod::UpdatedAt)(&last.item).last_val,+ selected_sort,+ );+ }+ assert_eq!(seen, order, "grouped continuation {label} {direction:?}");+ Ok(())+}++#[sqlx::test(+ fixtures(+ path = "../../../../../../../macro_db_client/fixtures",+ scripts("mixed_items_expanded")+ ),+ migrator = "MACRO_DB_MIGRATIONS"+)]+async fn property_date_ranges_keep_full_totals_and_missing_bucket(+ pool: PgPool,+) -> anyhow::Result<()> {+ let property_id = seed_property(+ &pool,+ "DATE",+ json!({"type":"Date","value":"2025-01-01T00:00:00Z"}),+ json!({"type":"Date","value":"2025-02-01T00:00:00Z"}),+ )+ .await?;+ let boundary = "2025-02-01T00:00:00Z".parse::<DateTime<Utc>>()?;+ let field = GroupByField::Property {+ property_definition_id: property_id,+ entity_type: Some("DOCUMENT".into()),+ bucketing: Some(PropertyBucketing::DateRanges(PropertyDateRanges {+ ranges: vec![+ PropertyDateRange {+ key: "before".into(),+ start: None,+ end: Some(boundary),+ },+ PropertyDateRange {+ key: "after".into(),+ start: Some(boundary),+ end: None,+ },+ ],+ missing_value_bucket_key: "missing".into(),+ })),+ };+ let selected_sort = sort(property_id, SoupSortDirection::Asc);+ let initial = grouped(+ &pool,+ Query::Sort(selected_sort, documents()),+ field.clone(),+ None,+ 1,+ )+ .await?;+ assert_eq!(+ initial+ .iter()+ .map(|item| (+ item.key.as_str(),+ item.item.id(),+ item.total_group_count,+ item.index_in_group+ ))+ .collect::<Vec<_>>(),+ [+ ("missing", UNSET, 3, 1),+ ("missing", D, 3, 2),+ ("missing", C, 3, 3),+ ("before", A, 1, 1),+ ("after", B, 1, 1)+ ]+ );+ let first = grouped(+ &pool,+ Query::Sort(selected_sort, documents()),+ field.clone(),+ Some("missing"),+ 1,+ )+ .await?;+ assert_eq!(+ (+ first[0].item.id(),+ first[0].total_group_count,+ first[0].index_in_group+ ),+ (UNSET, 3, 1)+ );+ let second = grouped(+ &pool,+ continuation(+ first[0].item.id(),+ first[0].sort_key,+ SoupItem::sort_on(SimpleSortMethod::UpdatedAt)(&first[0].item).last_val,+ selected_sort,+ ),+ field,+ Some("missing"),+ 1,+ )+ .await?;+ assert_eq!(+ (+ second[0].item.id(),+ second[0].total_group_count,+ second[0].index_in_group+ ),+ (D, 3, 2)+ );+ Ok(())+}++#[sqlx::test(+ fixtures(+ path = "../../../../../../../macro_db_client/fixtures",+ scripts("mixed_items_expanded")+ ),+ migrator = "MACRO_DB_MIGRATIONS"+)]+async fn grouped_property_pages_cross_missing_values_in_both_directions(+ pool: PgPool,+) -> anyhow::Result<()> {+ let property_id = seed_property(+ &pool,+ "NUMBER",+ json!({"type": "Number", "value": 10}),+ json!({"type": "Number", "value": 20}),+ )+ .await?;+ for (direction, expected) in [+ (SoupSortDirection::Asc, [A, B, UNSET, D, C]),+ (SoupSortDirection::Desc, [B, A, UNSET, D, C]),+ ] {+ let selected_sort = sort(property_id, direction);+ let mut cursor = Query::Sort(selected_sort, documents());+ for (index, id) in expected.into_iter().enumerate() {+ let page =+ grouped(&pool, cursor, GroupByField::EntityType, Some("document"), 1).await?;+ assert_eq!(page.len(), 1);+ assert_eq!(page[0].item.id(), id);+ assert_eq!(page[0].index_in_group, index + 1);+ assert_eq!(page[0].total_group_count, 5);+ cursor = continuation(+ id,+ page[0].sort_key,+ SoupItem::sort_on(SimpleSortMethod::UpdatedAt)(&page[0].item).last_val,+ selected_sort,+ );+ }+ assert!(+ grouped(&pool, cursor, GroupByField::EntityType, Some("document"), 1)+ .await?+ .is_empty()+ );+ }+ Ok(())+}++#[sqlx::test(+ fixtures(+ path = "../../../../../../../macro_db_client/fixtures",+ scripts("mixed_items_expanded")+ ),+ migrator = "MACRO_DB_MIGRATIONS"+)]+async fn deleted_options_use_the_empty_group_and_live_options_follow_display_order(+ pool: PgPool,+) -> anyhow::Result<()> {+ let property_id = Uuid::now_v7();+ let first = Uuid::now_v7();+ let second = Uuid::now_v7();+ let deleted = Uuid::now_v7();+ sqlx::query!(+ r#"INSERT INTO property_definitions (id, user_id, display_name, data_type, is_multi_select)+ SELECT $1, owner, $2, 'SELECT_STRING', false FROM "Document" WHERE id = $3"#,+ property_id,+ format!("Sort {property_id}"),+ A.to_string(),+ )+ .execute(&pool)+ .await?;+ for (id, order) in [(first, 20), (second, 10), (deleted, 0)] {+ sqlx::query!(+ "INSERT INTO property_options (id, property_definition_id, display_order, string_value) VALUES ($1, $2, $3, $4)",+ id, property_id, order, id.to_string(),+ )+ .execute(&pool)+ .await?;+ }+ for (id, option) in [(A, first), (B, second), (C, deleted)] {+ sqlx::query!(+ "INSERT INTO entity_properties (id, entity_id, entity_type, property_definition_id, values) VALUES ($1, $2, 'DOCUMENT', $3, $4)",+ Uuid::now_v7(), id.to_string(), property_id,+ json!({"type": "SelectOption", "value": [option]}),+ )+ .execute(&pool)+ .await?;+ }+ sqlx::query!("DELETE FROM property_options WHERE id = $1", deleted)+ .execute(&pool)+ .await?;++ let items = grouped(+ &pool,+ Query::Sort(sort(property_id, SoupSortDirection::Asc), documents()),+ GroupByField::Property {+ property_definition_id: property_id,+ entity_type: None,+ bucketing: None,+ },+ None,+ 10,+ )+ .await?;+ assert_eq!(+ items+ .iter()+ .map(|item| (item.key.clone(), item.item.id(), item.display_order))+ .collect::<Vec<_>>(),+ vec![+ (second.to_string(), B, Some(10)),+ (first.to_string(), A, Some(20)),+ (String::new(), UNSET, None),+ (String::new(), D, None),+ (String::new(), C, None),+ ]+ );+ assert!(items[2..].iter().all(|item| item.total_group_count == 3));+ Ok(())+}++#[sqlx::test(+ fixtures(+ path = "../../../../../../../macro_db_client/fixtures",+ scripts("mixed_items_expanded")+ ),+ migrator = "MACRO_DB_MIGRATIONS"+)]+async fn mixed_task_and_document_filters_use_canonical_property_assignments(+ pool: PgPool,+) -> anyhow::Result<()> {+ let early = Uuid::now_v7();+ let middle = Uuid::now_v7();+ let late = Uuid::now_v7();+ let property_id = seed_property(+ &pool,+ "SELECT_STRING",+ json!({"type": "SelectOption", "value": [middle]}),+ json!({"type": "SelectOption", "value": [late]}),+ )+ .await?;+ for (id, order) in [(early, 1), (middle, 2), (late, 3)] {+ sqlx::query!(+ "INSERT INTO property_options (id, property_definition_id, display_order, string_value) VALUES ($1, $2, $3, $4)",+ id, property_id, order, id.to_string(),+ )+ .execute(&pool)+ .await?;+ }+ for id in [A, C] {+ sqlx::query!(+ "INSERT INTO document_sub_type (document_id, sub_type) VALUES ($1, 'task')",+ id.to_string(),+ )+ .execute(&pool)+ .await?;+ }+ sqlx::query!(+ "UPDATE entity_properties SET entity_type = 'TASK' WHERE entity_id = $1 AND property_definition_id = $2",+ A.to_string(), property_id,+ )+ .execute(&pool)+ .await?;+ sqlx::query!(+ "UPDATE entity_properties SET values = $1 WHERE entity_id = $2 AND property_definition_id = $3",+ json!({"type": "SelectOption", "value": [early]}), C.to_string(), property_id,+ )+ .execute(&pool)+ .await?;+ for (id, entity_type) in [(A, "DOCUMENT"), (B, "TASK")] {+ sqlx::query!(+ "INSERT INTO entity_properties (id, entity_id, entity_type, property_definition_id, values) VALUES ($1, $2, $3::text::property_entity_type, $4, $5)",+ Uuid::now_v7(), id.to_string(), entity_type, property_id,+ json!({"type": "SelectOption", "value": [early]}),+ )+ .execute(&pool)+ .await?;+ }+ let mut filter = documents();+ filter.document_filter = Some(Arc::new(Expr::or(+ Expr::and(+ Expr::val(DocumentLiteral::SubType(+ document_sub_type::DocumentSubType::Task,+ )),+ Expr::or(+ Expr::val(DocumentLiteral::Id(A)),+ Expr::val(DocumentLiteral::Id(C)),+ ),+ ),+ Expr::val(DocumentLiteral::Id(B)),+ )));++ for (direction, expected) in [+ (+ SoupSortDirection::Asc,+ [(A, Some(2.0)), (B, Some(3.0)), (C, None)],+ ),+ (+ SoupSortDirection::Desc,+ [(B, Some(3.0)), (A, Some(2.0)), (C, None)],+ ),+ ] {+ let items = flat(+ &pool,+ Query::Sort(sort(property_id, direction), filter.clone()),+ 10,+ )+ .await?;+ assert_eq!(+ items+ .iter()+ .map(|item| (item.item.id(), item.sort_key))+ .collect::<Vec<_>>(),+ expected,+ );+ }+ let mut task_filter = filter.clone();+ task_filter.document_filter = Some(Arc::new(Expr::and(+ Expr::val(DocumentLiteral::SubType(+ document_sub_type::DocumentSubType::Task,+ )),+ Expr::or(+ Expr::val(DocumentLiteral::Id(A)),+ Expr::val(DocumentLiteral::Id(C)),+ ),+ )));+ let task_items = flat(+ &pool,+ Query::Sort(+ sort(property_id, SoupSortDirection::Asc),+ task_filter.clone(),+ ),+ 10,+ )+ .await?;+ assert_eq!(+ task_items+ .iter()+ .map(|item| (item.item.id(), item.sort_key))+ .collect::<Vec<_>>(),+ [(A, Some(2.0)), (C, None)],+ );+ let task_groups = grouped(+ &pool,+ Query::Sort(sort(property_id, SoupSortDirection::Asc), task_filter),+ GroupByField::Property {+ property_definition_id: property_id,+ entity_type: None,+ bucketing: None,+ },+ None,+ 10,+ )+ .await?;+ assert_eq!(+ task_groups+ .iter()+ .map(|item| (item.key.clone(), item.item.id()))+ .collect::<Vec<_>>(),+ [(middle.to_string(), A), (String::new(), C)],+ );+ for (entity_type, expected) in [+ (+ None,+ vec![+ (middle.to_string(), A),+ (late.to_string(), B),+ (String::new(), C),+ ],+ ),+ (+ Some("TASK"),+ vec![(middle.to_string(), A), (String::new(), C)],+ ),+ (Some("DOCUMENT"), vec![(late.to_string(), B)]),+ ] {+ let items = grouped(+ &pool,+ Query::Sort(sort(property_id, SoupSortDirection::Asc), filter.clone()),+ GroupByField::Property {+ property_definition_id: property_id,+ entity_type: entity_type.map(str::to_owned),+ bucketing: None,+ },+ None,+ 10,+ )+ .await?;+ assert_eq!(+ items+ .iter()+ .map(|item| (item.key.clone(), item.item.id()))+ .collect::<Vec<_>>(),+ expected,+ "entity_type={entity_type:?}",+ );+ }+ Ok(())+}diff --git a/crates/soup/src/outbound/pg_soup_repo/expanded/tests.rs b/crates/soup/src/outbound/pg_soup_repo/expanded/tests.rsindex ae0a22a35f..d0adfa22c4 100644--- a/crates/soup/src/outbound/pg_soup_repo/expanded/tests.rs+++ b/crates/soup/src/outbound/pg_soup_repo/expanded/tests.rs@@ -1,5 +1,5 @@use crate::{- domain::models::SoupDocumentServerFacts,+ domain::models::{DynamicSort, DynamicSortValue, SoupDocumentServerFacts},outbound::pg_soup_repo::{expanded::{by_ids::{expanded_soup_by_ids, expanded_soup_by_ids_with_projection},@@ -47,7 +47,9 @@ async fn expanded_generic_cursor_soup(ExpandedDynamicCursorArgs {user_id,limit,- cursor: cursor.map_filter(|_| EntityFilterAst::default()),+ cursor: DynamicSort::from_timestamp_query(+ cursor.map_filter(|_| EntityFilterAst::default()),+ ),exclude_frecency: false,},)@@ -65,7 +67,9 @@ async fn no_frecency_expanded_generic_soup(ExpandedDynamicCursorArgs {user_id,limit,- cursor: cursor.map_filter(|_| EntityFilterAst::default()),+ cursor: DynamicSort::from_timestamp_query(+ cursor.map_filter(|_| EntityFilterAst::default()),+ ),exclude_frecency: true,},)@@ -752,7 +756,10 @@ async fn empty_ast_returns_same_as_static_query(db: PgPool) {ExpandedDynamicCursorArgs {user_id: user_id.clone(),limit: 20,- cursor: Query::Sort(SimpleSortMethod::CreatedAt, EntityFilterAst::mock_empty()),+ cursor: Query::Sort(+ SimpleSortMethod::CreatedAt.into(),+ EntityFilterAst::mock_empty(),+ ),exclude_frecency: false,},)@@ -808,7 +815,7 @@ async fn test_filter_by_document_file_type(db: PgPool) -> anyhow::Result<()> {ExpandedDynamicCursorArgs {user_id: user_id.copied(),limit: 20,- cursor: Query::Sort(SimpleSortMethod::CreatedAt, filters),+ cursor: Query::Sort(SimpleSortMethod::CreatedAt.into(), filters),exclude_frecency: false,},)@@ -883,7 +890,7 @@ async fn test_filter_by_document_ids(db: PgPool) -> anyhow::Result<()> {ExpandedDynamicCursorArgs {user_id: user_id.copied(),limit: 20,- cursor: Query::Sort(SimpleSortMethod::CreatedAt, filters),+ cursor: Query::Sort(SimpleSortMethod::CreatedAt.into(), filters),exclude_frecency: false,},)@@ -960,7 +967,7 @@ async fn test_filter_documents_by_project_id(db: PgPool) -> anyhow::Result<()> {ExpandedDynamicCursorArgs {user_id: user_id.copied(),limit: 20,- cursor: Query::Sort(SimpleSortMethod::CreatedAt, filters),+ cursor: Query::Sort(SimpleSortMethod::CreatedAt.into(), filters),exclude_frecency: false,},)@@ -1032,7 +1039,7 @@ async fn test_filter_chats_by_project_id(db: PgPool) -> anyhow::Result<()> {ExpandedDynamicCursorArgs {user_id: user_id.copied(),limit: 20,- cursor: Query::Sort(SimpleSortMethod::CreatedAt, filters),+ cursor: Query::Sort(SimpleSortMethod::CreatedAt.into(), filters),exclude_frecency: false,},)@@ -1107,7 +1114,7 @@ async fn test_filter_by_chat_ids(db: PgPool) -> anyhow::Result<()> {ExpandedDynamicCursorArgs {user_id: user_id.copied(),limit: 20,- cursor: Query::Sort(SimpleSortMethod::CreatedAt, filters),+ cursor: Query::Sort(SimpleSortMethod::CreatedAt.into(), filters),exclude_frecency: false,},)@@ -1190,7 +1197,7 @@ async fn test_filter_by_project_ids(db: PgPool) -> anyhow::Result<()> {ExpandedDynamicCursorArgs {user_id: user_id.copied(),limit: 20,- cursor: Query::Sort(SimpleSortMethod::CreatedAt, filters),+ cursor: Query::Sort(SimpleSortMethod::CreatedAt.into(), filters),exclude_frecency: false,},)@@ -1273,7 +1280,7 @@ async fn test_filter_by_project_ids_include_root(db: PgPool) -> anyhow::Result<(ExpandedDynamicCursorArgs {user_id: user_id.copied(),limit: 20,- cursor: Query::Sort(SimpleSortMethod::CreatedAt, filters),+ cursor: Query::Sort(SimpleSortMethod::CreatedAt.into(), filters),exclude_frecency: false,},)@@ -1332,7 +1339,7 @@ async fn test_negated_project_id_filter_includes_root_projects(db: PgPool) -> anExpandedDynamicCursorArgs {user_id: user_id.copied(),limit: 20,- cursor: Query::Sort(SimpleSortMethod::CreatedAt, filters),+ cursor: Query::Sort(SimpleSortMethod::CreatedAt.into(), filters),exclude_frecency: false,},)@@ -1407,7 +1414,7 @@ async fn test_combined_entity_filters(db: PgPool) -> anyhow::Result<()> {ExpandedDynamicCursorArgs {user_id: user_id.copied(),limit: 20,- cursor: Query::Sort(SimpleSortMethod::CreatedAt, filters),+ cursor: Query::Sort(SimpleSortMethod::CreatedAt.into(), filters),exclude_frecency: false,},)@@ -1499,7 +1506,7 @@ async fn test_multiple_filter_criteria_documents(db: PgPool) -> anyhow::Result<(ExpandedDynamicCursorArgs {user_id: user_id.copied(),limit: 20,- cursor: Query::Sort(SimpleSortMethod::CreatedAt, filters),+ cursor: Query::Sort(SimpleSortMethod::CreatedAt.into(), filters),exclude_frecency: false,},)@@ -1577,7 +1584,7 @@ async fn test_filters_respect_access_control(db: PgPool) -> anyhow::Result<()> {ExpandedDynamicCursorArgs {user_id: user_id.copied(),limit: 20,- cursor: Query::Sort(SimpleSortMethod::CreatedAt, filters),+ cursor: Query::Sort(SimpleSortMethod::CreatedAt.into(), filters),exclude_frecency: false,},)@@ -1642,7 +1649,7 @@ async fn test_filter_by_owner(db: PgPool) -> anyhow::Result<()> {ExpandedDynamicCursorArgs {user_id: user_id.copied(),limit: 20,- cursor: Query::Sort(SimpleSortMethod::CreatedAt, filters),+ cursor: Query::Sort(SimpleSortMethod::CreatedAt.into(), filters),exclude_frecency: false,},)@@ -1709,7 +1716,7 @@ async fn test_filter_non_existent_items(db: PgPool) -> anyhow::Result<()> {ExpandedDynamicCursorArgs {user_id: user_id.copied(),limit: 20,- cursor: Query::Sort(SimpleSortMethod::CreatedAt, filters),+ cursor: Query::Sort(SimpleSortMethod::CreatedAt.into(), filters),exclude_frecency: false,},)@@ -1772,7 +1779,7 @@ async fn test_cursor_pagination_with_document_filter(db: PgPool) -> anyhow::ResuExpandedDynamicCursorArgs {user_id: user_id.copied(),limit: 3,- cursor: Query::Sort(SimpleSortMethod::CreatedAt, filters.clone()),+ cursor: Query::Sort(SimpleSortMethod::CreatedAt.into(), filters.clone()),exclude_frecency: false,},)@@ -1809,7 +1816,10 @@ async fn test_cursor_pagination_with_document_filter(db: PgPool) -> anyhow::Resucursor: Query::Cursor(models_pagination::Cursor {id: cursor_decoded.id,limit: cursor_decoded.limit,- val: cursor_decoded.val,+ val: models_pagination::CursorVal {+ sort_type: cursor_decoded.val.sort_type.into(),+ last_val: DynamicSortValue::Timestamp(cursor_decoded.val.last_val),+ },filter: filters_for_cursor,}),exclude_frecency: false,@@ -1893,7 +1903,7 @@ async fn test_cursor_pagination_with_combined_filters(db: PgPool) -> anyhow::ResExpandedDynamicCursorArgs {user_id: user_id.copied(),limit: 2,- cursor: Query::Sort(SimpleSortMethod::CreatedAt, filters.clone()),+ cursor: Query::Sort(SimpleSortMethod::CreatedAt.into(), filters.clone()),exclude_frecency: false,},)@@ -1917,7 +1927,10 @@ async fn test_cursor_pagination_with_combined_filters(db: PgPool) -> anyhow::Rescursor: Query::Cursor(models_pagination::Cursor {id: cursor_decoded.id,limit: cursor_decoded.limit,- val: cursor_decoded.val,+ val: models_pagination::CursorVal {+ sort_type: cursor_decoded.val.sort_type.into(),+ last_val: DynamicSortValue::Timestamp(cursor_decoded.val.last_val),+ },filter: filters_for_cursor,}),exclude_frecency: false,@@ -1993,7 +2006,7 @@ async fn test_cursor_pagination_filter_consistency(db: PgPool) -> anyhow::ResultExpandedDynamicCursorArgs {user_id: user_id.copied(),limit: page_size,- cursor: current_query,+ cursor: DynamicSort::from_timestamp_query(current_query),exclude_frecency: false,},)@@ -2090,7 +2103,7 @@ async fn test_cursor_pagination_with_single_item_filter(db: PgPool) -> anyhow::RExpandedDynamicCursorArgs {user_id: user_id.copied(),limit: 5,- cursor: Query::Sort(SimpleSortMethod::CreatedAt, filters.clone()),+ cursor: Query::Sort(SimpleSortMethod::CreatedAt.into(), filters.clone()),exclude_frecency: false,},)@@ -2120,7 +2133,10 @@ async fn test_cursor_pagination_with_single_item_filter(db: PgPool) -> anyhow::Rcursor: Query::Cursor(models_pagination::Cursor {id: cursor_decoded.id,limit: cursor_decoded.limit,- val: cursor_decoded.val,+ val: models_pagination::CursorVal {+ sort_type: cursor_decoded.val.sort_type.into(),+ last_val: DynamicSortValue::Timestamp(cursor_decoded.val.last_val),+ },filter: filters_for_cursor,}),exclude_frecency: false,@@ -2199,7 +2215,7 @@ async fn test_dynamic_query_with_ast_and_frecency_exclusion(ExpandedDynamicCursorArgs {user_id: user_id.copied(),limit: 20,- cursor: Query::Sort(SimpleSortMethod::UpdatedAt, filters.clone()),+ cursor: Query::Sort(SimpleSortMethod::UpdatedAt.into(), filters.clone()),exclude_frecency: true,},)@@ -2252,7 +2268,7 @@ async fn test_dynamic_query_with_ast_and_frecency_exclusion(ExpandedDynamicCursorArgs {user_id: user_id.copied(),limit: 20,- cursor: Query::Sort(SimpleSortMethod::UpdatedAt, filters),+ cursor: Query::Sort(SimpleSortMethod::UpdatedAt.into(), filters),exclude_frecency: false,},)@@ -2326,7 +2342,7 @@ async fn test_filter_documents_by_importance(db: PgPool) -> anyhow::Result<()> {ExpandedDynamicCursorArgs {user_id: user_id.copied(),limit: 20,- cursor: Query::Sort(SimpleSortMethod::CreatedAt, filters),+ cursor: Query::Sort(SimpleSortMethod::CreatedAt.into(), filters),exclude_frecency: false,},)@@ -2382,7 +2398,7 @@ async fn test_filter_documents_by_importance(db: PgPool) -> anyhow::Result<()> {ExpandedDynamicCursorArgs {user_id: user_id.copied(),limit: 20,- cursor: Query::Sort(SimpleSortMethod::CreatedAt, filters),+ cursor: Query::Sort(SimpleSortMethod::CreatedAt.into(), filters),exclude_frecency: false,},)@@ -2453,7 +2469,7 @@ async fn test_filter_chats_by_importance(db: PgPool) -> anyhow::Result<()> {ExpandedDynamicCursorArgs {user_id: user_id.copied(),limit: 20,- cursor: Query::Sort(SimpleSortMethod::CreatedAt, filters),+ cursor: Query::Sort(SimpleSortMethod::CreatedAt.into(), filters),exclude_frecency: false,},)@@ -2494,7 +2510,7 @@ async fn test_filter_chats_by_importance(db: PgPool) -> anyhow::Result<()> {ExpandedDynamicCursorArgs {user_id: user_id.copied(),limit: 20,- cursor: Query::Sort(SimpleSortMethod::CreatedAt, filters),+ cursor: Query::Sort(SimpleSortMethod::CreatedAt.into(), filters),exclude_frecency: false,},)@@ -2553,7 +2569,7 @@ async fn test_filter_projects_by_importance(db: PgPool) -> anyhow::Result<()> {ExpandedDynamicCursorArgs {user_id: user_id.copied(),limit: 20,- cursor: Query::Sort(SimpleSortMethod::CreatedAt, filters),+ cursor: Query::Sort(SimpleSortMethod::CreatedAt.into(), filters),exclude_frecency: false,},)@@ -2597,7 +2613,7 @@ async fn test_filter_projects_by_importance(db: PgPool) -> anyhow::Result<()> {ExpandedDynamicCursorArgs {user_id: user_id.copied(),limit: 20,- cursor: Query::Sort(SimpleSortMethod::CreatedAt, filters),+ cursor: Query::Sort(SimpleSortMethod::CreatedAt.into(), filters),exclude_frecency: false,},)@@ -2645,7 +2661,10 @@ async fn test_bulk_populate_properties_enriches_raw_soup_items(ExpandedDynamicCursorArgs {user_id: user_id.copied(),limit: 20,- cursor: Query::Sort(SimpleSortMethod::UpdatedAt, EntityFilterAst::mock_empty()),+ cursor: Query::Sort(+ SimpleSortMethod::UpdatedAt.into(),+ EntityFilterAst::mock_empty(),+ ),exclude_frecency: false,},)@@ -3633,7 +3652,7 @@ async fn dyn_fetch(ExpandedDynamicCursorArgs {user_id: user_id.copied(),limit,- cursor: Query::Sort(sort, filters),+ cursor: Query::Sort(sort.into(), filters),exclude_frecency,},)@@ -4488,7 +4507,7 @@ async fn test_dyn_paginate_one_at_a_time(db: PgPool) -> anyhow::Result<()> {ExpandedDynamicCursorArgs {user_id: user_id.copied(),limit: 1,- cursor: current_query,+ cursor: DynamicSort::from_timestamp_query(current_query),exclude_frecency: false,},)@@ -4581,7 +4600,7 @@ async fn test_dyn_paginate_with_filters(db: PgPool) -> anyhow::Result<()> {ExpandedDynamicCursorArgs {user_id: user_id.copied(),limit: page_size,- cursor: current_query,+ cursor: DynamicSort::from_timestamp_query(current_query),exclude_frecency: false,},)@@ -4869,6 +4888,7 @@ async fn test_property_filter_by_select_option(db: Pool<Postgres>) -> anyhow::Reentity_type: Some("DOCUMENT".to_string()),option_ids: vec!["00000001-0000-0000-0003-000000000001".to_string()], // Lowentity_ids: vec![],+ ..Default::default()}],..Default::default()};@@ -4923,6 +4943,7 @@ async fn test_property_filter_by_status_completed(db: Pool<Postgres>) -> anyhow:entity_type: Some("DOCUMENT".to_string()),option_ids: vec!["00000001-0000-0000-0002-000000000004".to_string()], // Completedentity_ids: vec![],+ ..Default::default()}],..Default::default()};@@ -4978,12 +4999,14 @@ async fn test_property_filter_multiple_and(db: Pool<Postgres>) -> anyhow::Resultentity_type: Some("DOCUMENT".to_string()),option_ids: vec!["00000001-0000-0000-0003-000000000001".to_string()], // Lowentity_ids: vec![],+ ..Default::default()},PropertyFilter {property_definition_id: "00000001-0000-0000-0000-000000000002".to_string(), // Statusentity_type: Some("DOCUMENT".to_string()),option_ids: vec!["00000001-0000-0000-0002-000000000004".to_string()], // Completedentity_ids: vec![],+ ..Default::default()},],..Default::default()@@ -5038,6 +5061,7 @@ async fn test_property_filter_no_match(db: Pool<Postgres>) -> anyhow::Result<()>entity_type: Some("DOCUMENT".to_string()),option_ids: vec!["00000001-0000-0000-0003-000000000004".to_string()], // Urgententity_ids: vec![],+ ..Default::default()}],..Default::default()};@@ -5085,6 +5109,7 @@ async fn test_property_filter_multiple_options_or(db: Pool<Postgres>) -> anyhow:"00000001-0000-0000-0003-000000000002".to_string(), // Medium],entity_ids: vec![],+ ..Default::default()}],..Default::default()};@@ -5143,6 +5168,7 @@ async fn test_property_filter_without_entity_type(db: Pool<Postgres>) -> anyhow:"00000001-0000-0000-0003-000000000002".to_string(), // Medium],entity_ids: vec![],+ ..Default::default()}],..Default::default()};@@ -5197,6 +5223,7 @@ async fn test_property_filter_scoped_entity_type(db: Pool<Postgres>) -> anyhow::entity_type: Some("PROJECT".to_string()),option_ids: vec!["00000001-0000-0000-0003-000000000002".to_string()], // Mediumentity_ids: vec![],+ ..Default::default()}],..Default::default()};@@ -5272,7 +5299,7 @@ async fn test_dyn_filter_by_document_sub_type_task(db: PgPool) -> anyhow::ResultExpandedDynamicCursorArgs {user_id: user_id.copied(),limit: 20,- cursor: Query::Sort(SimpleSortMethod::CreatedAt, filters),+ cursor: Query::Sort(SimpleSortMethod::CreatedAt.into(), filters),exclude_frecency: false,},)@@ -5339,7 +5366,7 @@ async fn test_dyn_filter_by_sub_type_and_file_type(db: PgPool) -> anyhow::ResultExpandedDynamicCursorArgs {user_id: user_id.copied(),limit: 20,- cursor: Query::Sort(SimpleSortMethod::CreatedAt, filters),+ cursor: Query::Sort(SimpleSortMethod::CreatedAt.into(), filters),exclude_frecency: false,},)@@ -5383,7 +5410,7 @@ async fn document_ids_for_phase0_membership_filter(ExpandedDynamicCursorArgs {user_id,limit: 100,- cursor: Query::Sort(SimpleSortMethod::UpdatedAt, filters),+ cursor: Query::Sort(SimpleSortMethod::UpdatedAt.into(), filters),exclude_frecency: false,},)@@ -5524,7 +5551,10 @@ async fn projection_hydration_carries_viewer_relative_facts_from_flat_and_by_id_ExpandedDynamicCursorArgs {user_id: user_id.copied(),limit: 50,- cursor: Query::Sort(SimpleSortMethod::CreatedAt, EntityFilterAst::default()),+ cursor: Query::Sort(+ SimpleSortMethod::CreatedAt.into(),+ EntityFilterAst::default(),+ ),exclude_frecency: false,},)@@ -5667,7 +5697,10 @@ async fn projection_status_extraction_treats_non_array_values_as_empty(ExpandedDynamicCursorArgs {user_id: user_id.copied(),limit: 50,- cursor: Query::Sort(SimpleSortMethod::CreatedAt, EntityFilterAst::default()),+ cursor: Query::Sort(+ SimpleSortMethod::CreatedAt.into(),+ EntityFilterAst::default(),+ ),exclude_frecency: false,},)@@ -5725,7 +5758,7 @@ async fn test_dyn_filter_is_email_attachment_true(db: PgPool) -> anyhow::Result<ExpandedDynamicCursorArgs {user_id: user_id.copied(),limit: 20,- cursor: Query::Sort(SimpleSortMethod::CreatedAt, filters),+ cursor: Query::Sort(SimpleSortMethod::CreatedAt.into(), filters),exclude_frecency: false,},)@@ -5795,7 +5828,7 @@ async fn test_dyn_filter_is_email_attachment_false(db: PgPool) -> anyhow::ResultExpandedDynamicCursorArgs {user_id: user_id.copied(),limit: 20,- cursor: Query::Sort(SimpleSortMethod::CreatedAt, filters),+ cursor: Query::Sort(SimpleSortMethod::CreatedAt.into(), filters),exclude_frecency: false,},)@@ -5857,7 +5890,7 @@ async fn test_dyn_filter_by_not_document_sub_type_task(db: PgPool) -> anyhow::ReExpandedDynamicCursorArgs {user_id: user_id.copied(),limit: 50,- cursor: Query::Sort(SimpleSortMethod::CreatedAt, filters),+ cursor: Query::Sort(SimpleSortMethod::CreatedAt.into(), filters),exclude_frecency: false,},)@@ -5950,7 +5983,7 @@ async fn run_and_count(ExpandedDynamicCursorArgs {user_id: user_id.copied(),limit: 20,- cursor: Query::Sort(SimpleSortMethod::CreatedAt, ast),+ cursor: Query::Sort(SimpleSortMethod::CreatedAt.into(), ast),exclude_frecency: false,},)@@ -6630,7 +6663,7 @@ async fn run_notification_filter(ExpandedDynamicCursorArgs {user_id: user_id.copied(),limit: 100,- cursor: Query::Sort(SimpleSortMethod::UpdatedAt, ast),+ cursor: Query::Sort(SimpleSortMethod::UpdatedAt.into(), ast),exclude_frecency: false,},)@@ -7068,6 +7101,141 @@ async fn crm_document_literals_match_attachments_and_associations(Ok(())}+#[sqlx::test(+ migrator = "MACRO_DB_MIGRATIONS",+ fixtures(+ path = "../../../../../macro_db_client/fixtures",+ scripts("soup_items_with_properties")+ )+)]+async fn date_property_boundaries_presence_and_clearing(db: Pool<Postgres>) -> anyhow::Result<()> {+ use item_filters::ast::properties::DateRange;+ let at =+ chrono::DateTime::parse_from_rfc3339("2025-12-31T23:59:59Z")?.with_timezone(&chrono::Utc);+ let after = at + chrono::Duration::seconds(1);+ let before = at - chrono::Duration::seconds(1);+ let doc_a = Uuid::parse_str("11111111-aaaa-aaaa-aaaa-aaaaaaaaaaaa")?;+ let doc_b = Uuid::parse_str("11111111-bbbb-bbbb-bbbb-bbbbbbbbbbbb")?;+ let user_id = sqlx::query_scalar!(+ r#"SELECT owner FROM "Document" WHERE id = $1"#,+ doc_a.to_string(),+ )+ .fetch_one(&db)+ .await?;+ sqlx::query!(+ r#"INSERT INTO entity_properties (id, entity_id, entity_type, property_definition_id, values)+ VALUES ($1, $2, 'DOCUMENT', '00000001-0000-0000-0000-000000000004',+ '{"type":"String","value":"not a timestamp"}'::jsonb)"#,+ Uuid::now_v7(),+ doc_a.to_string(),+ )+ .execute(&db)+ .await?;+ for (range, has_date, expected) in [+ (+ Some(DateRange {+ start: Some(at),+ end: Some(after),+ }),+ None,+ Some(doc_b),+ ),+ (+ Some(DateRange {+ start: Some(before),+ end: Some(at),+ }),+ None,+ None,+ ),+ (+ Some(DateRange {+ start: None,+ end: Some(after),+ }),+ None,+ Some(doc_b),+ ),+ (+ Some(DateRange {+ start: None,+ end: Some(at),+ }),+ None,+ None,+ ),+ (+ Some(DateRange {+ start: Some(at),+ end: None,+ }),+ None,+ Some(doc_b),+ ),+ (+ Some(DateRange {+ start: Some(after),+ end: None,+ }),+ None,+ None,+ ),+ (+ Some(DateRange {+ start: None,+ end: None,+ }),+ None,+ Some(doc_b),+ ),+ (None, Some(true), Some(doc_b)),+ (None, Some(false), Some(doc_a)),+ ] {+ let ast = EntityFilterAst::new_from_filters(item_filters::EntityFilters {+ property_filters: vec![PropertyFilter {+ property_definition_id: "00000001-0000-0000-0000-000000000004".into(),+ entity_type: Some("DOCUMENT".into()),+ date_range: range,+ has_date,+ ..Default::default()+ }],+ ..Default::default()+ })?+ .unwrap();+ let items = dyn_fetch(&db, &user_id, 1, SimpleSortMethod::UpdatedAt, ast, false).await?;+ let ids: Vec<_> = items+ .iter()+ .filter_map(|item| match item {+ SoupItem::Document(doc) => Some(doc.id),+ _ => None,+ })+ .collect();+ assert_eq!(ids.first().copied(), expected);+ }+ sqlx::query!("UPDATE entity_properties SET values = NULL WHERE entity_id = '11111111-bbbb-bbbb-bbbb-bbbbbbbbbbbb' AND property_definition_id = '00000001-0000-0000-0000-000000000004'")+ .execute(&db).await?;+ let ast = EntityFilterAst::new_from_filters(item_filters::EntityFilters {+ property_filters: vec![PropertyFilter {+ property_definition_id: "00000001-0000-0000-0000-000000000004".into(),+ entity_type: Some("DOCUMENT".into()),+ has_date: Some(false),+ ..Default::default()+ }],+ ..Default::default()+ })?+ .unwrap();+ let items = dyn_fetch(&db, &user_id, 100, SimpleSortMethod::UpdatedAt, ast, false).await?;+ let ids: HashSet<_> = items+ .iter()+ .filter_map(|item| match item {+ SoupItem::Document(doc) => Some(doc.id),+ _ => None,+ })+ .collect();+ assert!(ids.contains(&doc_a) && ids.contains(&doc_b));+ Ok(())+}+/// The Home unread feed sends `(unseen OR seen) AND unseen` for every entity/// type. The notification join it now takes must agree with the per-row fold/// of an equivalent tree the stripper leaves alone.diff --git a/crates/soup/src/outbound/pg_soup_repo/grouping.rs b/crates/soup/src/outbound/pg_soup_repo/grouping.rsindex 29e21c90eb..e83752aece 100644--- a/crates/soup/src/outbound/pg_soup_repo/grouping.rs+++ b/crates/soup/src/outbound/pg_soup_repo/grouping.rs@@ -1,4 +1,4 @@-//! SQL grouping expressions for soup queries.+//! SQL grouping and property-value expressions for Soup queries.use models_grouping::{GroupByField, date_bucket_sql_key, date_bucket_sql_order};use std::borrow::Cow;@@ -7,24 +7,148 @@ use system_properties::SystemPropertyKey;const PROJECT_GROUPING: GroupByField = GroupByField::Property {property_definition_id: SystemPropertyKey::PROJECT_UUID,entity_type: None,+ bucketing: None,};+/// SQL expressions derived from one property value and its definition.+pub(super) struct PropertyValueSql {+ /// Nullable numeric sort key for the complete stored value.+ pub sort_key: String,+ /// SQL type used to bind the sort key.+ pub sort_type: &'static str,+ /// Group key for one expanded value; absent values retain the empty key.+ pub group_key: String,+ /// Nullable display order for one expanded option.+ pub group_order: String,+}++/// SQL expressions for one stored property type.+struct PropertyTypeSql {+ data_types: &'static str,+ value_type: &'static str,+ sort_key: Option<String>,+ group_key: Option<String>,+ group_order: Option<String>,+}++/// Guard a DATE value before casting its JSON payload.+pub(super) fn property_date_expression(alias: &str) -> String {+ format!(+ "CASE WHEN {alias}.values->>'type' = 'Date' THEN ({alias}.values->>'value')::timestamptz END"+ )+}++/// Derive sorting and grouping from the same per-type rules.+/// All arguments are trusted SQL aliases or expressions owned by this adapter.+pub(super) fn property_value_sql(+ alias: &str,+ property_definition_id: &str,+ data_type: &str,+ element: &str,+ option_alias: &str,+) -> PropertyValueSql {+ let date = property_date_expression(alias);+ let option_order = format!("{option_alias}.display_order::double precision");+ // Keep the map lookup independent of the item so PostgreSQL can build it once as an InitPlan.+ let selected_order = format!(+ "(SELECT min(((SELECT jsonb_object_agg(po.id::text, po.display_order) FROM property_options po WHERE po.property_definition_id = {property_definition_id}) ->> chosen.id)::double precision) FROM jsonb_array_elements_text(CASE WHEN jsonb_typeof({alias}.values->'value') = 'array' THEN {alias}.values->'value' ELSE '[]'::jsonb END) chosen(id))"+ );+ let number = format!(+ "CASE WHEN jsonb_typeof({alias}.values->'value') = 'number' THEN ({alias}.values->>'value')::double precision END"+ );+ let boolean = format!(+ "CASE WHEN jsonb_typeof({alias}.values->'value') = 'boolean' THEN CASE WHEN ({alias}.values->>'value')::boolean THEN 1::double precision ELSE 0::double precision END END"+ );+ let option_group =+ format!("CASE WHEN {option_alias}.id IS NOT NULL THEN {element}#>>'{{}}' END");+ let branches = [+ PropertyTypeSql {+ data_types: "'DATE'",+ value_type: "Date",+ sort_key: Some(format!(+ "EXTRACT(EPOCH FROM {date})::double precision * 1000000"+ )),+ group_key: None,+ group_order: None,+ },+ PropertyTypeSql {+ data_types: "'NUMBER'",+ value_type: "Number",+ sort_key: Some(number),+ group_key: None,+ group_order: None,+ },+ PropertyTypeSql {+ data_types: "'BOOLEAN'",+ value_type: "Boolean",+ sort_key: Some(boolean),+ group_key: None,+ group_order: None,+ },+ PropertyTypeSql {+ data_types: "'SELECT_STRING', 'SELECT_NUMBER', 'TAG'",+ value_type: "SelectOption",+ sort_key: Some(selected_order),+ group_key: Some(option_group),+ group_order: Some(option_order),+ },+ PropertyTypeSql {+ data_types: "'ENTITY'",+ value_type: "EntityReference",+ sort_key: None,+ group_key: Some(format!("{element}->>'entity_id'")),+ group_order: None,+ },+ PropertyTypeSql {+ data_types: "'LINK'",+ value_type: "Link",+ sort_key: None,+ group_key: Some(format!("{element}#>>'{{}}'")),+ group_order: None,+ },+ ];+ let mut sort_key = String::from("CASE");+ let mut group_key = String::from("CASE");+ let mut group_order = String::from("CASE");+ for branch in branches {+ let condition = format!(+ " WHEN {data_type} IN ({}) AND {alias}.values->>'type' = '{}' THEN ",+ branch.data_types, branch.value_type+ );+ let null_number = "NULL::double precision";+ sort_key.push_str(&condition);+ sort_key.push_str(branch.sort_key.as_deref().unwrap_or(null_number));+ group_key.push_str(&condition);+ group_key.push_str(branch.group_key.as_deref().unwrap_or("NULL::text"));+ group_order.push_str(&condition);+ group_order.push_str(branch.group_order.as_deref().unwrap_or(null_number));+ }+ sort_key.push_str(" ELSE NULL::double precision END");+ group_key.push_str(" ELSE NULL::text END");+ group_order.push_str(" ELSE NULL::double precision END");+ PropertyValueSql {+ sort_key,+ sort_type: "double precision",+ group_key: format!("COALESCE({group_key}, '')"),+ group_order,+ }+}+/// Build the group select expression for a field.pub fn group_select_expr(field: &GroupByField) -> Cow<'static, str> {match field {GroupByField::Date => Cow::Owned(date_bucket_sql_key("sort_ts")),GroupByField::EntityType => Cow::Borrowed("item_type"),GroupByField::Project => group_select_expr(&PROJECT_GROUPING),- GroupByField::Property { .. } => Cow::Borrowed(- "COALESCE(- CASE ep_group.values->>'type'- WHEN 'EntityReference' THEN ep_group.val->>'entity_id'- WHEN 'SelectOption' THEN ep_group.val#>>'{}'- WHEN 'Link' THEN ep_group.val#>>'{}'- ELSE NULL- END,- ''- )",+ GroupByField::Property { .. } => Cow::Owned(+ property_value_sql(+ "ep_group",+ "NULL::uuid",+ "ep_group.data_type",+ "ep_group.val",+ "po_group",+ )+ .group_key,),}}@@ -33,80 +157,62 @@ pub fn group_select_expr(field: &GroupByField) -> Cow<'static, str> {pub fn group_order_expr(field: &GroupByField) -> Cow<'static, str> {match field {GroupByField::Date => Cow::Owned(date_bucket_sql_order("sort_ts")),- GroupByField::EntityType => Cow::Borrowed("item_type"),+ GroupByField::EntityType => Cow::Borrowed("\"group_key\""),GroupByField::Project => group_order_expr(&PROJECT_GROUPING),- GroupByField::Property { .. } => Cow::Borrowed(- "COALESCE(- (SELECT po.display_order FROM property_options po- WHERE po.id::text =- CASE ep_group.values->>'type'- WHEN 'SelectOption' THEN ep_group.val#>>'{}'- ELSE NULL- END),- 999999- )",- ),+ GroupByField::Property { .. } => {+ Cow::Borrowed("(\"group_key\" = '') ASC, \"group_order\" ASC NULLS LAST, \"group_key\"")+ }}}/// Result of building a group JOIN clause with optional bind parameter.pub struct GroupJoinClause {- /// The SQL JOIN clause (may contain `$10` placeholder for entity_type).- /// Callers must ensure the entity_type value is bound at $10 (and that $9- /// is bound — with `group_key` or NULL — so the indices line up).+ /// SQL JOIN clause; the optional entity type uses the fixed `$10` slot.pub sql: String,- /// Entity type value to bind at `$10`, if present+ /// Entity type value to bind at `$10`, if present.pub entity_type_bind: Option<String>,}-/// Build the JOIN clause for property-based grouping.-/// Returns SQL with `$10` placeholder for entity_type when present.-///-/// The clause LATERAL-expands `entity_properties.values->'value'` into one row-/// per element, so multi-value properties (e.g. assignees) place each item into-/// every group it belongs to. Items without a matching row, or with an empty-/// array / scalar value, produce a single row with NULL `val` (→ "Not Set").-/// Property rows are also matched to the Soup item's canonical property entity-/// type, so a task ignores legacy `DOCUMENT` assignments for the same id.+/// Expand option, tag, entity and link values into their server-derived groups.+/// Scalar values never expand arrays, including malformed DATE payloads.pub fn group_join_clause(field: &GroupByField) -> Option<GroupJoinClause> {- match field {- // Project is the initiative property displayed by the task column.- GroupByField::Project => group_join_clause(&PROJECT_GROUPING),- GroupByField::Property {- property_definition_id,- entity_type,- } => {- let (entity_type_filter, entity_type_bind) = match entity_type {- Some(et) => (- "AND ep.entity_type = $10::property_entity_type".to_string(),- Some(et.clone()),- ),- None => (String::new(), None),- };-- Some(GroupJoinClause {- sql: format!(- "LEFT JOIN LATERAL (- SELECT ep.values, elem.val- FROM entity_properties ep- LEFT JOIN LATERAL jsonb_array_elements(- CASE WHEN jsonb_typeof(ep.values->'value') = 'array'- THEN ep.values->'value'- ELSE '[]'::jsonb- END- ) elem(val) ON TRUE- WHERE ep.entity_id = t.id::text- AND ep.entity_type = t.property_entity_type- AND ep.property_definition_id = '{}'- {}- ) ep_group ON TRUE",- property_definition_id, entity_type_filter- ),- entity_type_bind,- })- }- _ => None,+ if matches!(field, GroupByField::Project) {+ return group_join_clause(&PROJECT_GROUPING);}+ let GroupByField::Property {+ property_definition_id,+ entity_type,+ ..+ } = field+ else {+ return None;+ };+ let entity_type_filter = if entity_type.is_some() {+ "AND ep.entity_type = $10::property_entity_type"+ } else {+ ""+ };+ let data_type = format!(+ "(SELECT data_type FROM property_definitions WHERE id = '{property_definition_id}')"+ );+ Some(GroupJoinClause {+ sql: format!(+ "LEFT JOIN LATERAL (+ SELECT ep.values, ep.property_definition_id, {data_type} AS data_type, elem.val+ FROM entity_properties ep+ LEFT JOIN LATERAL jsonb_array_elements(+ CASE WHEN {data_type} IN ('SELECT_STRING', 'SELECT_NUMBER', 'TAG', 'ENTITY', 'LINK')+ AND jsonb_typeof(ep.values->'value') = 'array'+ THEN ep.values->'value' ELSE '[]'::jsonb END+ ) elem(val) ON TRUE+ WHERE ep.entity_id = t.id::text+ AND ep.entity_type = t.property_entity_type+ AND ep.property_definition_id = '{property_definition_id}'+ {entity_type_filter}+ ) ep_group ON TRUE"+ ),+ entity_type_bind: entity_type.clone(),+ })}#[cfg(test)]diff --git a/crates/soup/src/outbound/pg_soup_repo/grouping/test.rs b/crates/soup/src/outbound/pg_soup_repo/grouping/test.rsindex 66c8245fdc..4ee6ca646f 100644--- a/crates/soup/src/outbound/pg_soup_repo/grouping/test.rs+++ b/crates/soup/src/outbound/pg_soup_repo/grouping/test.rs@@ -52,6 +52,7 @@ fn property_join_includes_definition_id() {let field = GroupByField::Property {property_definition_id: uuid::Uuid::nil(),entity_type: None,+ bucketing: None,};let join = group_join_clause(&field).unwrap();assert!(join.sql.contains("ep_group"));@@ -114,7 +115,7 @@ async fn property_grouping_uses_canonical_task_entity_type(user_id: user_id.copied(),limit: 50,cursor: Query::Sort(- SimpleSortMethod::ViewedUpdated,+ SimpleSortMethod::ViewedUpdated.into(),EntityFilterAst::mock_empty(),),exclude_frecency: false,@@ -122,6 +123,7 @@ async fn property_grouping_uses_canonical_task_entity_type(field: GroupByField::Property {property_definition_id: STATUS_PROPERTY_ID,entity_type: None,+ bucketing: None,},group_key: None,per_group_limit: None,@@ -159,7 +161,7 @@ async fn test_grouped_by_entity_type(pool: Pool<Postgres>) -> anyhow::Result<()>user_id: user_id.copied(),limit: 50,cursor: Query::Sort(- SimpleSortMethod::ViewedUpdated,+ SimpleSortMethod::ViewedUpdated.into(),EntityFilterAst::mock_empty(),),exclude_frecency: false,@@ -212,7 +214,7 @@ async fn test_grouped_by_project(pool: Pool<Postgres>) -> anyhow::Result<()> {user_id: user_id.copied(),limit: 50,cursor: Query::Sort(- SimpleSortMethod::ViewedUpdated,+ SimpleSortMethod::ViewedUpdated.into(),EntityFilterAst::mock_empty(),),exclude_frecency: false,@@ -251,7 +253,7 @@ async fn test_grouped_single_group_filter(pool: Pool<Postgres>) -> anyhow::Resuluser_id: user_id.copied(),limit: 50,cursor: Query::Sort(- SimpleSortMethod::ViewedUpdated,+ SimpleSortMethod::ViewedUpdated.into(),EntityFilterAst::mock_empty(),),exclude_frecency: false,@@ -278,7 +280,7 @@ async fn test_grouped_single_group_filter(pool: Pool<Postgres>) -> anyhow::Resuluser_id: user_id.copied(),limit: 50,cursor: Query::Sort(- SimpleSortMethod::ViewedUpdated,+ SimpleSortMethod::ViewedUpdated.into(),EntityFilterAst::mock_empty(),),exclude_frecency: false,@@ -373,7 +375,7 @@ async fn tagged_calendar_event_participates_in_grouped_property_soup(user_id: user_id.copied(),limit: 50,cursor: Query::Sort(- SimpleSortMethod::ViewedUpdated,+ SimpleSortMethod::ViewedUpdated.into(),EntityFilterAst::mock_empty(),),exclude_frecency: false,@@ -381,6 +383,7 @@ async fn tagged_calendar_event_participates_in_grouped_property_soup(field: GroupByField::Property {property_definition_id: STATUS_PROPERTY_ID,entity_type: None,+ bucketing: None,},group_key: None,per_group_limit: None,@@ -470,7 +473,7 @@ async fn grouped_recency_sort_uses_reminder_delivery_time(user_id: user_id.copied(),limit: 50,cursor: Query::Sort(- SimpleSortMethod::ViewedUpdated,+ SimpleSortMethod::ViewedUpdated.into(),EntityFilterAst::mock_empty(),),exclude_frecency: false,@@ -516,7 +519,7 @@ async fn grouped_soup_runs_when_chat_arm_excluded(pool: Pool<Postgres>) -> anyhoGroupedDynamicCursorArgs {user_id: user_id.copied(),limit: 50,- cursor: Query::Sort(SimpleSortMethod::ViewedUpdated, filter),+ cursor: Query::Sort(SimpleSortMethod::ViewedUpdated.into(), filter),exclude_frecency: false,grouping: GroupingConfig {field: GroupByField::EntityType,@@ -560,7 +563,7 @@ async fn grouped_soup_runs_when_document_arm_excluded(pool: Pool<Postgres>) -> aGroupedDynamicCursorArgs {user_id: user_id.copied(),limit: 50,- cursor: Query::Sort(SimpleSortMethod::ViewedUpdated, filter),+ cursor: Query::Sort(SimpleSortMethod::ViewedUpdated.into(), filter),exclude_frecency: false,grouping: GroupingConfig {field: GroupByField::EntityType,@@ -606,7 +609,7 @@ async fn grouped_soup_runs_when_calendar_arm_excluded(pool: Pool<Postgres>) -> aGroupedDynamicCursorArgs {user_id: user_id.copied(),limit: 50,- cursor: Query::Sort(SimpleSortMethod::ViewedUpdated, filter),+ cursor: Query::Sort(SimpleSortMethod::ViewedUpdated.into(), filter),exclude_frecency: false,grouping: GroupingConfig {field: GroupByField::EntityType,@@ -713,7 +716,7 @@ async fn grouped_soup_renders_bind_bearing_calendar_literals(GroupedDynamicCursorArgs {user_id: user_id.copied(),limit: 50,- cursor: Query::Sort(SimpleSortMethod::ViewedUpdated, filter),+ cursor: Query::Sort(SimpleSortMethod::ViewedUpdated.into(), filter),exclude_frecency: false,grouping: GroupingConfig {field: GroupByField::Date,@@ -841,7 +844,7 @@ async fn grouped_soup_filters_calendar_events_by_notification_done(GroupedDynamicCursorArgs {user_id: user_id.copied(),limit: 50,- cursor: Query::Sort(SimpleSortMethod::ViewedUpdated, filter),+ cursor: Query::Sort(SimpleSortMethod::ViewedUpdated.into(), filter),exclude_frecency: false,grouping: GroupingConfig {field: GroupByField::Date,diff --git a/crates/soup/src/outbound/pg_soup_repo/grouping/test/access.rs b/crates/soup/src/outbound/pg_soup_repo/grouping/test/access.rsindex a6735cc31f..a97c1ce329 100644--- a/crates/soup/src/outbound/pg_soup_repo/grouping/test/access.rs+++ b/crates/soup/src/outbound/pg_soup_repo/grouping/test/access.rs@@ -6,7 +6,10 @@ async fn assert_membership(pool: &Pool<Postgres>) -> anyhow::Result<()> {GroupedDynamicCursorArgs {user_id: MacroUserIdStr::parse_from_str("macro|[email protected]")?,limit: 2,- cursor: Query::Sort(SimpleSortMethod::UpdatedAt, EntityFilterAst::mock_empty()),+ cursor: Query::Sort(+ SimpleSortMethod::UpdatedAt.into(),+ EntityFilterAst::mock_empty(),+ ),exclude_frecency: false,grouping: GroupingConfig {field: GroupByField::EntityType,@@ -97,7 +100,7 @@ async fn source_membership_deduplicates_grants(pool: Pool<Postgres>) -> anyhow::user_id: MacroUserIdStr::parse_from_str("macro|[email protected]")?,limit: 50,cursor: Query::Sort(- SimpleSortMethod::UpdatedAt,+ SimpleSortMethod::UpdatedAt.into(),super::pagination::task_filter(),),exclude_frecency: false,@@ -175,7 +178,7 @@ async fn calendar_owner_or_linked_account_only(pool: Pool<Postgres>) -> anyhow::GroupedDynamicCursorArgs {user_id: MacroUserIdStr::parse_from_str("macro|[email protected]")?,limit: 50,- cursor: Query::Sort(SimpleSortMethod::ViewedAt, filter),+ cursor: Query::Sort(SimpleSortMethod::ViewedAt.into(), filter),exclude_frecency: false,grouping: GroupingConfig {field: GroupByField::EntityType,diff --git a/crates/soup/src/outbound/pg_soup_repo/grouping/test/pagination.rs b/crates/soup/src/outbound/pg_soup_repo/grouping/test/pagination.rsindex 9219609d57..cb58f4af26 100644--- a/crates/soup/src/outbound/pg_soup_repo/grouping/test/pagination.rs+++ b/crates/soup/src/outbound/pg_soup_repo/grouping/test/pagination.rs@@ -1,5 +1,5 @@use super::*;-use crate::domain::models::grouping::ItemGroupingInfo;+use crate::domain::models::{DynamicSort, grouping::ItemGroupingInfo};use document_sub_type::DocumentSubType;use item_filters::ast::project::ProjectLiteral;use models_pagination::{CursorWithValAndFilter, SortOn};@@ -86,6 +86,7 @@ async fn fanout_caps_counts_and_tied_cursor_pages(pool: Pool<Postgres>) -> anyhofield: GroupByField::Property {property_definition_id: system_properties::SystemPropertyKey::ASSIGNEES_UUID,entity_type,+ bucketing: None,},group_key: None,per_group_limit: None,@@ -103,7 +104,7 @@ async fn fanout_caps_counts_and_tied_cursor_pages(pool: Pool<Postgres>) -> anyho)};let result = fetch(- Query::Sort(SimpleSortMethod::UpdatedAt, task_filter()),+ Query::Sort(SimpleSortMethod::UpdatedAt.into(), task_filter()),grouping.clone(),).await;@@ -135,7 +136,7 @@ async fn fanout_caps_counts_and_tied_cursor_pages(pool: Pool<Postgres>) -> anyholet mut cursor = continuation(group.last().unwrap(), SimpleSortMethod::UpdatedAt);loop {let page = fetch(- cursor,+ DynamicSort::from_timestamp_query(cursor),GroupingConfig {group_key: Some(key.to_string()),..grouping.clone()@@ -147,8 +148,8 @@ async fn fanout_caps_counts_and_tied_cursor_pages(pool: Pool<Postgres>) -> anyhobreak;}for (index, item) in page.iter().enumerate() {- assert_eq!(item.total_group_count, expected.len() - seen.len());- assert_eq!(item.index_in_group, index + 1);+ assert_eq!(item.total_group_count, expected.len());+ assert_eq!(item.index_in_group, seen.len() + index + 1);}cursor = continuation(page.last().unwrap(), SimpleSortMethod::UpdatedAt);seen.extend(page.iter().map(|i| i.item.id().to_string()));@@ -166,12 +167,13 @@ async fn fanout_caps_counts_and_tied_cursor_pages(pool: Pool<Postgres>) -> anyhoGroupedDynamicCursorArgs {user_id: MacroUserIdStr::parse_from_str("macro|[email protected]")?,limit: 50,- cursor: Query::Sort(SimpleSortMethod::UpdatedAt, task_filter()),+ cursor: Query::Sort(SimpleSortMethod::UpdatedAt.into(), task_filter()),exclude_frecency: true,grouping: GroupingConfig {field: GroupByField::Property {property_definition_id: system_properties::SystemPropertyKey::ASSIGNEES_UUID,entity_type: None,+ bucketing: None,},group_key: Some("a".to_string()),per_group_limit: None,diff --git a/crates/soup/src/outbound/pg_soup_repo/grouping/test/project.rs b/crates/soup/src/outbound/pg_soup_repo/grouping/test/project.rsindex b47e54c411..1ec681bd1a 100644--- a/crates/soup/src/outbound/pg_soup_repo/grouping/test/project.rs+++ b/crates/soup/src/outbound/pg_soup_repo/grouping/test/project.rs@@ -43,7 +43,7 @@ async fn tasks_group_by_their_project_property(pool: Pool<Postgres>) -> anyhow::GroupedDynamicCursorArgs {user_id: user_id.copied(),limit: 50,- cursor: Query::Sort(SimpleSortMethod::ViewedUpdated, filter.clone()),+ cursor: Query::Sort(SimpleSortMethod::ViewedUpdated.into(), filter.clone()),exclude_frecency: false,grouping: GroupingConfig {field: GroupByField::Project,@@ -100,6 +100,9 @@ async fn tasks_group_by_their_project_property(pool: Pool<Postgres>) -> anyhow::.collect();let response = build_grouped_response(items.into_iter().map(|group| ItemGroupingInfo {+ document_server_facts: group.document_server_facts,+ sort_key: group.sort_key,+ display_order: group.display_order,key: group.key,total_group_count: group.total_group_count,index_in_group: group.index_in_group,diff --git a/crates/soup/src/outbound/pg_soup_repo/grouping/test/sorting.rs b/crates/soup/src/outbound/pg_soup_repo/grouping/test/sorting.rsindex 3d45ef5571..0c37e05dc5 100644--- a/crates/soup/src/outbound/pg_soup_repo/grouping/test/sorting.rs+++ b/crates/soup/src/outbound/pg_soup_repo/grouping/test/sorting.rs@@ -1,5 +1,5 @@use super::*;-use crate::domain::models::grouping::ItemGroupingInfo;+use crate::domain::models::{DynamicSort, grouping::ItemGroupingInfo};use chrono::{DateTime, Duration, Utc};use models_pagination::{CursorWithValAndFilter, SortOn};use models_soup::item::SoupItem;@@ -24,7 +24,7 @@ async fn fetch(GroupedDynamicCursorArgs {user_id: MacroUserIdStr::parse_from_str("macro|[email protected]")?,limit,- cursor,+ cursor: DynamicSort::from_timestamp_query(cursor),exclude_frecency: false,grouping: GroupingConfig {field,@@ -154,8 +154,8 @@ async fn all_sorts_preserve_history_dates_and_real_cursors(break;}for (index, item) in page.iter().enumerate() {- assert_eq!(item.total_group_count, expected.len() - seen.len());- assert_eq!(item.index_in_group, index + 1);+ assert_eq!(item.total_group_count, expected.len());+ assert_eq!(item.index_in_group, seen.len() + index + 1);}cursor = cursor_from(page.last().unwrap(), sort, EntityFilterAst::mock_empty());seen.extend(page.iter().map(|i| i.item.id().to_string()));@@ -253,8 +253,8 @@ async fn calendar_sorts_preserve_reminders_and_linked_account_cursors(assert_eq!(page.len(), 1);let item = &page[0];assert_eq!(item.item.id(), id);- assert_eq!(item.total_group_count, 2 - index);- assert_eq!(item.index_in_group, 1);+ assert_eq!(item.total_group_count, 2);+ assert_eq!(item.index_in_group, index + 1);assert_eq!(SoupItem::sort_on(sort)(&item.item).last_val, ts);let SoupItem::CalendarEvent(event) = &item.item else {panic!("expected event")diff --git a/crates/soup/src/outbound/pg_soup_repo/initiative/test.rs b/crates/soup/src/outbound/pg_soup_repo/initiative/test.rsindex e04710e206..15b16723c4 100644--- a/crates/soup/src/outbound/pg_soup_repo/initiative/test.rs+++ b/crates/soup/src/outbound/pg_soup_repo/initiative/test.rs@@ -1,7 +1,13 @@use super::*;-use crate::outbound::pg_soup_repo::expanded::dynamic::{- ExpandedDynamicCursorArgs, GroupedDynamicCursorArgs, expanded_dynamic_cursor_soup,- expanded_dynamic_cursor_soup_grouped,+use crate::{+ domain::models::DynamicSortValue,+ outbound::pg_soup_repo::{+ candidate_gates::initiative_gate,+ expanded::dynamic::{+ ExpandedDynamicCursorArgs, GroupedDynamicCursorArgs, expanded_dynamic_cursor_soup,+ expanded_dynamic_cursor_soup_grouped,+ },+ },};use filter_ast::Expr;use item_filters::ast::{@@ -47,7 +53,7 @@ async fn initiatives_access_cursor_and_hydration(pool: PgPool) -> anyhow::ResultExpandedDynamicCursorArgs {user_id: user(),limit: 20,- cursor: Query::Sort(SimpleSortMethod::UpdatedAt, without_initiatives),+ cursor: Query::Sort(SimpleSortMethod::UpdatedAt.into(), without_initiatives),exclude_frecency: false,})@@ -61,7 +67,7 @@ async fn initiatives_access_cursor_and_hydration(pool: PgPool) -> anyhow::ResultExpandedDynamicCursorArgs {user_id: user(),limit: 2,- cursor: Query::Sort(sort, filters()),+ cursor: Query::Sort(sort.into(), filters()),exclude_frecency: false,},)@@ -83,7 +89,12 @@ async fn initiatives_access_cursor_and_hydration(pool: PgPool) -> anyhow::Resultcursor: Query::Cursor(CursorWithValAndFilter {id: first[1].id(),limit: 2,- val: SoupItem::sort_on(sort)(&first[1]),+ val: models_pagination::CursorVal {+ sort_type: sort.into(),+ last_val: DynamicSortValue::Timestamp(+ SoupItem::sort_on(sort)(&first[1]).last_val,+ ),+ },filter: filters(),}),exclude_frecency: false,@@ -138,7 +149,7 @@ async fn initiative_listing_and_candidate_gate_share_access_rules(ExpandedDynamicCursorArgs {user_id: user(),limit: 20,- cursor: Query::Sort(SimpleSortMethod::UpdatedAt, filters()),+ cursor: Query::Sort(SimpleSortMethod::UpdatedAt.into(), filters()),exclude_frecency: false,},)@@ -171,7 +182,7 @@ async fn initiative_listing_and_candidate_gate_share_access_rules(SELECT candidate.id FROM unnest($2::uuid[]) candidate(id)WHERE {}ORDER BY candidate.id"#,- crate::outbound::pg_soup_repo::candidate_gates::initiative_gate("candidate.id::text", None)+ initiative_gate("candidate.id::text", None,))).bind(user().as_ref()).bind(@@ -209,12 +220,13 @@ async fn initiatives_grouping_and_property_enrichment(pool: PgPool) -> anyhow::RGroupedDynamicCursorArgs {user_id: user(),limit: 20,- cursor: Query::Sort(SimpleSortMethod::UpdatedAt, filters()),+ cursor: Query::Sort(SimpleSortMethod::UpdatedAt.into(), filters()),exclude_frecency: false,grouping: GroupingConfig {field: GroupByField::Property {property_definition_id: system_properties::SystemPropertyKey::STATUS_UUID,entity_type: Some("INITIATIVE".into()),+ bucketing: None,},group_key: None,per_group_limit: None,@@ -244,7 +256,7 @@ async fn initiatives_grouping_and_property_enrichment(pool: PgPool) -> anyhow::RExpandedDynamicCursorArgs {user_id: user(),limit: 20,- cursor: Query::Sort(SimpleSortMethod::UpdatedAt, filtered),+ cursor: Query::Sort(SimpleSortMethod::UpdatedAt.into(), filtered),exclude_frecency: false,},)@@ -275,7 +287,7 @@ async fn initiatives_grouping_and_property_enrichment(pool: PgPool) -> anyhow::RExpandedDynamicCursorArgs {user_id: user(),limit: 20,- cursor: Query::Sort(SimpleSortMethod::UpdatedAt, filter),+ cursor: Query::Sort(SimpleSortMethod::UpdatedAt.into(), filter),exclude_frecency: false,},)diff --git a/crates/soup_filter_projection/src/test.rs b/crates/soup_filter_projection/src/test.rsindex ad95300ad2..c45c555830 100644--- a/crates/soup_filter_projection/src/test.rs+++ b/crates/soup_filter_projection/src/test.rs@@ -47,6 +47,7 @@ fn document_hydration(is_email_attachment: bool,) -> SoupProjectionHydration {SoupProjectionHydration {+ sort_key: None,item: SoupItem::Document(document(id, sub_type)),document_server_facts: Some(SoupDocumentServerFacts {is_email_attachment,@@ -220,6 +221,7 @@ fn entities_without_document_server_facts_do_not_emit_supplements() {extra: (),}),document_server_facts: None,+ sort_key: None,};let chat = SoupProjectionHydration {item: SoupItem::Chat(SoupChat {@@ -236,6 +238,7 @@ fn entities_without_document_server_facts_do_not_emit_supplements() {extra: (),}),document_server_facts: None,+ sort_key: None,};assert!(@@ -275,6 +278,7 @@ fn document_server_facts_attached_to_another_entity_are_rejected() {is_important: true,status_option_ids: Vec::new(),}),+ sort_key: None,};assert!(matches!(project_soup_cache_supplement(diff --git a/docs/agent-guide/tasks.md b/docs/agent-guide/tasks.mdindex e299dd9472..2eb7922614 100644--- a/docs/agent-guide/tasks.md+++ b/docs/agent-guide/tasks.md@@ -91,6 +91,8 @@ The Project column shows the linked project's name when one project is assigned,and `Project` when empty. Multiple linked projects show an item count.Long assignee and project names truncate within their columns; hover the cellto read the full value.+The Projects collection reuses a single Due date column and hides Updated in compact panes.+Property controls retain their selected values in accessible names when compact styles hide the text.The project pill beneath a task title shows the project icon and name withouta `Project:` prefix. It and the Project row in the Properties side panel split intwo once a project is set: the name opens the project (shift-click for a new@@ -134,6 +136,45 @@ should appear immediately and stay visible through both responses in the list,task header, side panel, and a reopened picker. A rejected save should remove onlythe optimistic tag. Repeat with an existing assignment and with removal.+## Due dates++Tasks lists and boards offer **Status**, **Priority**, **Due soonest**, and+**Due furthest away** sorting alongside Viewed, Updated, and Created. Status+follows stored option order; Priority puts urgent tasks first. Missing values+stay last. Property-sort ties use newest update, then descending task ID.+Text search retains its existing ordering and flat list results; clear search to sort.+Boards group the loaded search results as before, without complete counts or grouped-search requests.++**Filter → Due date** offers Overdue, Today, Tomorrow, Next 7 days, Later,+Has due date, No due date, and Custom range. **Any due date** removes only the date+filter. Custom range includes both selected calendar dates; either endpoint can be+empty. Cancel leaves the previous filter unchanged. Status remains independent:+select Completed or Canceled explicitly to include closed tasks in a date filter.+The mobile controls use the same options and date-range dialog in the sliders drawer.++**Group → Due date** puts No due date first, then uses non-overlapping viewer-local calendar buckets:+Overdue is before today's midnight; Today and Tomorrow cover those entire days;+Next 7 days covers D+2 through D+7; Later starts at D+8; No due date includes+missing and cleared dates. Relative filters and groups refresh at local midnight,+timezone changes, and app resume. Changed boundaries start fresh continuation pages.+Task lists show an editable **Due date** property column with a calendar icon+only when a date is set; click its header to switch between Due soonest and Due+furthest away. Phones and narrow panes show only the urgency-colored icon for+dated tasks. Empty date cells remain editable without a calendar icon. The+dropdown shows the current date, or **No due date** when unset, above the date+choices. Due dates stay outside the title.+Board cards show due dates in property pills. Overdue dates+on open tasks use the danger color; only dates due today or tomorrow use the+warning color. Later dates, completed tasks, and canceled tasks have neutral due+dates. Urgency refreshes at local midnight, on timezone changes, and app resume.+Date selections persist with the navigation entry and round-trip through+`tasks.dueDate`, `tasks.dueStart`, and `tasks.dueEnd` URL parameters.++Verify dates around midnight and a daylight-saving transition. Check both sort+directions with tied and undated tasks. Filter during local and service search,+then edit or clear a due date: loaded rows move between buckets immediately,+and refetches correct complete counts and previously absent tasks. Gantt's+saved-date semantics do not change.## Saved viewsSaved views are available on main Tasks, not inside Project or CRM task lists.@@ -143,14 +184,14 @@ Saved views are available on main Tasks, not inside Project or CRM task lists.- The empty sidebar and mobile picker show **Your go-to views**, the muted description **Save your setup for next time.**, and a secondary **Create view** button with a leading plus icon in a rounded container with a subtle border, 12px padding, the surrounding background, and no shadow or illustration. It starts the same unsaved draft as desktop **+**; on mobile, the picker closes first. Configure the draft in Filters, then choose **Save view**.- Desktop **+** starts an unsaved view without person restrictions and with explicit open-status filters. It expands the section and adds a selected, italic **New view** row labeled **Draft** in the sidebar and mobile picker. Configure filters, then choose **Save view**; the name defaults to **New view** and can be edited before saving. A confirmed save replaces the draft with the named view; **Cancel** in the desktop toolbar or mobile filter drawer, another selection, or leaving Tasks removes the unsaved row. Canceling only the name dialog keeps the draft for later.- Desktop **Save view** and draft **Cancel** are separate standalone buttons with a gap, not segments of a button group.-- When filters, layout, grouping, or sort differ from the built-in tab defaults, the filled **Save view** button appears immediately left of Filters on desktop and in an edge-to-edge mobile banner above the filter drawer footer. The borderless banner overlays content on a drawer-colored backing and has a leading bookmark icon on its button. Base settings and search alone do not show the banner. It captures current filters, layout, grouping, and ordered sort directions, but excludes text search and scroll state. My Tasks adds **Me** to Assignee; Created by me adds it to Created by. Additional people in the same filter use OR matching.+- When filters, due date, layout, grouping, or sort differ from the built-in tab defaults, the filled **Save view** button appears immediately left of Filters on desktop and in an edge-to-edge mobile banner above the filter drawer footer. The borderless banner overlays content on a drawer-colored backing and has a leading bookmark icon on its button. Base settings and search alone do not show the banner. It captures current filters, relative due-date presets or custom calendar bounds, layout, grouping, and ordered sort directions, but excludes text search and scroll state. My Tasks adds **Me** to Assignee; Created by me adds it to Created by. Additional people in the same filter use OR matching.- Saved views use the normal Assignee and Created by filters, not a separate Scope control. **Me** stays relative; its tooltip says “Matches whoever opens this saved view.” A named person stays fixed. Removing Me removes that restriction.-- Temporary filter, layout, grouping, or sort edits show a filled **Save changes** button and **Reset**. Opening or resetting a saved view restores all four. Mobile still displays a list without replacing the stored desktop layout. Right-click a sidebar view or use its **…** button for **Edit**, **Duplicate**, **Copy link**, and confirmed **Delete view**. On desktop, the selected view's topbar shows a bookmark icon before its name and an unframed ghost overflow button immediately after it. On mobile, the picker shows the name and contains row menus; creation and draft cancellation appear in the filter drawer's overlay banner above the footer; Save changes and Reset sit on the footer's right, opposite Clear all, not below the tabs. Non-owners cannot rename, share, overwrite, or delete a shared view.+- Temporary filter, due-date, layout, grouping, or sort edits show a filled **Save changes** button and **Reset**. Opening or resetting a saved view restores all five, including due-date grouping and property sorts. Older definitions without a due-date filter remain unrestricted. Mobile still displays a list without replacing the stored desktop layout. Right-click a sidebar view or use its **…** button for **Edit**, **Duplicate**, **Copy link**, and confirmed **Delete view**. On desktop, the selected view's topbar shows a bookmark icon before its name and an unframed ghost overflow button immediately after it. On mobile, the picker shows the name and contains row menus; creation and draft cancellation appear in the filter drawer's overlay banner above the footer; Save changes and Reset sit on the footer's right, opposite Clear all, not below the tabs. Non-owners cannot rename, share, overwrite, or delete a shared view.- **Edit** opens the shared create/edit dialog with the saved name and team-sharing checkbox prefilled, without saving temporary filter, layout, grouping, or sort changes. Edit and delete dialog titles identify the saved view by name and wrap long names. Both create and edit modes use a 600px-wide dialog that stays within narrow viewports. **Duplicate** opens a private copy with a prefilled “(copy)” name; duplicating the selected view includes its temporary settings. If the original has unsupported or invalid settings, the dialog warns that the copy omits them and leaves the original unchanged. Sidebar actions on another view do not change the current selection unless a duplicate is saved.- The optional **Share with team** checkbox shares only the view definition. Its adjacent info icon shows the explanation on hover; click, tap, or keyboard activation opens it without changing the checkbox. Each teammate still sees only permitted items. Both the owner and viewer must currently belong to that team; leaving disables access and rejoining restores it.- Leaving the view or opening task detail discards temporary edits. The return breadcrumb retains the saved-view identity and reloads its saved filters, layout, grouping, and sort.- An unavailable or deleted view shows an explicit unavailable state, not All Tasks under the old name. Unsupported or malformed filters are skipped while supported filters apply immediately. A danger-colored banner above the results names affected filters or view settings without an extra description. If no filters apply, the list shows all permitted tasks, including closed tasks. Loading never changes the saved definition. Unknown tag/person labels retain their filters until deliberately removed. Ordinary **Save changes** is disabled until the app understands every setting or the owner explicitly removes unsupported settings; Edit remains available.-- Owners can choose **Remove & save** at the right edge of that banner. It removes only skipped settings from the stored definition, preserves supported filters, layout, grouping, sort, and sharing, and leaves temporary edits unsaved. The banner disappears only after a confirmed save; failures retain it for retry, and revision conflicts offer **Reload saved view**.+- Owners can choose **Remove & save** at the right edge of that banner. It removes only skipped settings from the stored definition, preserves supported filters, due date, layout, grouping, sort, and sharing, and leaves temporary edits unsaved. The banner disappears only after a confirmed save; failures retain it for retry, and revision conflicts offer **Reload saved view**.- A conflicting save retains the draft and offers **Reload saved view** or **Duplicate**. A network failure also retains the name and sharing inputs.- Copy links use the existing split search codec, for example `/app/component/tasks?s0.tasks.savedView=<uuid>`.@@ -308,20 +349,26 @@ Gantt persists in `tasks.layout` or `projectTasks.layout`, just like List and BoChoose **Board** in the **Task layout** group in the toolbar(or **List** to switch back). One icon is selected at a time; hover or focus shows-its label. **Group by**-offers Status, Priority, Assignee, and (when Projects is enabled) Project.+its label. **Group by** offers Status, Priority, Assignee, Due date,+and (when Projects is enabled) Project.Both layouts share one grouping, which restores with the Tasks navigation entry.List-only None and Date groupings display Status columns in Board; switchingback to List retains those selections and collapsed groups until grouping changes.-Each column header has an icon-only **Add task** plus button. It opens the task-composer with that column's Status, Priority, Assignee, or Project preselected,-while preserving the originating pane's other creation presets. **Unassigned**+Status, Priority, Assignee, Project, and Due date column headers have an icon-only+**Add task** plus button. The button opens the task composer with that column's+property preselected, while preserving the originating pane's other creation+presets. Due-date columns prefill yesterday for Overdue, today or tomorrow for+their named columns, D+2 for Next 7 days, and D+8 for Later. No due date clears any+inherited date preset. The draft's due date remains editable. **Unassigned**and **No priority** start with that property empty. **No project** starts emptyoutside project boards; project boards always retain the current project.**No status** starts with **Not started**, because new tasks require a status.-Each pane or project scope and column keeps a separate composer draft. Project-boards hide creation actions when the project is read-only.+Each pane or project scope and column keeps a separate composer draft. Dated+column drafts are also scoped to the current local day and timezone, so reopening+after midnight or a timezone change starts with the new date preset. Undated and+non-date columns keep their existing draft scope. Normal draft expiration still+applies. Project boards hide creation actions when the project is read-only.Click a card's body or title to open the task. Right-click a card, or pressShift+F10 on its focused title, for the List row's task menu; it acts on that@@ -331,9 +378,9 @@ mouse button held to start dragging to another column; holding still does notstart a drag. Property pills remain interactive and do not start a drag.A new destination column highlights once movement slowsor pauses for about 100 ms. Fast travel suppresses activation of new columns.-A valid hover shows **Board sorted by Updated**, **Created**, or **Viewed**-using the active sort label. The drop does not choose a pointer insertion slot:-its card takes its place in the current sort (or search relevance order).+A valid hover shows **Board sorted by Updated**, **Created**, **Viewed**,+**Status**, **Priority**, or the active due-date sort label. The drop does not choose a pointer insertion slot:+its card takes its place in the current sort (or existing text-search order).Same-column moves and column reordering remain disabled.Layout, primary sort, sort direction, and grouping are reflected in `tasks.layout`,`tasks.sort`, `tasks.sortReversed`, and `tasks.groupBy` search parameters.@@ -376,9 +423,10 @@ a drop target.An icon-only status pill appears before the task title, and an icon-only assigneepill appears to its right in every grouping. The lower row omits status, assignee,-and the grouping property. The remaining properties use standard pill controls-and icons. Priority uses a compact icon-only pill; due date and project appear-when set. Metadata properties stay read-only, and pending writes disable editing.+and the grouping property, except that the exact due-date pill stays visible in+Due date grouping. The remaining properties use standard pill controls and icons.+Priority uses a compact icon-only pill; due date and project appear when set.+Metadata properties stay read-only, and pending writes disable editing.A task assigned to multiple people appears in each person's column. Moving itfrom Alice to Bob replaces Alice while keeping the other assignees. Moving to**Unassigned** clears all assignees. Project moves change the task's Project@@ -407,7 +455,15 @@ Filters remain active: completing a task or removing yourself as assignee canhide the card from the current view. Click its title to open the task; modifiedclicks can open a separate split.-Due-date columns and priority/due-date sorting are not in this version.+Due-date drops reschedule the task: Today and Tomorrow assign those dates;+No due date clears the value. Overdue, Next 7 days, and Later open a date picker+restricted to that bucket, with explicit Apply and Cancel. The source placement+stays unchanged until Apply; Cancel, Escape, dismissal, or a scope change makes no+write. A failed save restores the prior placement and counts. Existing property+permissions and pending states apply, and the destination uses the active sort.+A due-date filter also hides buckets that cannot contain a matching date;+**Reveal hidden columns** removes only that date filter.+Priority and Status use the same sort choices as the task list.The shared board primitives remain independent of Tasks queries and mutations.## Cached grouped listsdiff --git a/docs/design/date-property-queries.md b/docs/design/date-property-queries.mdnew file mode 100644index 0000000000..71fa5fafd9--- /dev/null+++ b/docs/design/date-property-queries.md@@ -0,0 +1,180 @@+# Property sorting and date-range grouping++Status: Accepted for PR #8494.++## Decision++Extend Soup's existing dynamic query and position cursor. Do not keep a separate+candidate query, cross-source merger, hydration pass, or versioned query context.+The single Soup source does not justify that extra pipeline. The previous+external-source experiment remains archived on `rahul/property-candidates-sources`+at `4292a28f33`; it is not a contract for future expansion.++Flat property sorting covers Soup-owned documents/tasks, chats, projects,+initiatives, and database rows. It omits calendar events, email threads,+channels, calls, companies, and propertyless agent sessions. Grouped reads+retain calendar events, matching the existing grouped query. Ordinary timestamp+queries retain their existing sources and behavior.++DATE filters are evaluated by Soup and OpenSearch. Call, email, and frecency+interpret DATE literals as false, preserving outer boolean negation. Tasks+excludes calls/emails and keeps text search's result ordering.++## Sort API++REST uses `sort_method=property`, `sort_property_definition_id=<definition UUID>`,+and `sort_direction=asc|desc`. GraphQL uses `PROPERTY`,+`sortPropertyDefinitionId`, and `sortDirection: ASC|DESC`.++The selected ID is a property **definition**, not an entity's assignment ID.+Like existing filters and grouping, Soup accepts definition IDs without a separate+visibility check; each source still enforces item access. Missing definitions,+unsupported types, and mismatched value variants produce missing keys rather+than a request error. DATE bucketing on a non-DATE definition puts every item+in the configured missing bucket.++The older `property_date_earliest` / `property_date_latest` names and GraphQL+variants are removed before release. Existing timestamp `sort_direction` support+is retained because that API already exists on main.++| Property type | Ascending key |+| --- | --- |+| DATE | UTC epoch microseconds |+| NUMBER | Numeric value |+| BOOLEAN | False = 0, true = 1 |+| SELECT_STRING / SELECT_NUMBER | Selected option's stored `display_order` |+| Multi-select / TAG | Lowest `display_order` among selected options |+| STRING / ENTITY / LINK | Missing key; fall back to update-time ordering |++A missing value, empty selection, or mismatched JSON variant has no key. Option+labels and numeric option values do not control ordering. Clients choose default+direction: Status is ascending; Priority is descending (urgent first).++SQL uses double-precision keys today, with the type carried alongside the key+expression. Property pages order by `sort_key ASC|DESC NULLS LAST, sort_ts DESC,+id DESC`. Direction applies only to the property key; ties use newest update,+then descending ID. Timestamp queries retain their existing SQL ordering and+keyset expressions without a `sort_key` term.++Flat timestamp queries keep the existing lightweight top clauses. A filter proven+to match only tasks selects the constant TASK property namespace, avoiding a+second subtype probe in flat and grouped queries. Mixed filters still resolve+TASK versus DOCUMENT through `document_sub_type`; predicates that use subtype+columns retain that join even for task-only filters.++Property sorting joins `entity_properties` directly by definition, entity ID,+and canonical entity type. Uncorrelated scalar lookups provide the definition+type for the guarded sort expression, rather than a per-item definition join.+Option sorts build a `jsonb_object_agg` map from option IDs to stored display+orders through an uncorrelated lookup of the sort definition bind (`$9` flat,+`$11` grouped). PostgreSQL can build the map once as an InitPlan, instead of+re-reading options per item. Each value takes the minimum mapped order; unknown,+deleted, and non-UUID option IDs are ignored, and unknown-only values stay missing.+Grouped property sorts materialize `TopItems` before expanding multi-value groups+so each item supplies its sort key before fan-out. Timestamp grouped queries+keep their inlineable `TopItems` CTE.++Document-ID arrays start at `$9` for flat timestamp queries and `$11` for grouped+timestamp queries. Property sorts append only the definition ID and cursor key,+moving those array starts to `$11` and `$13`, respectively. There is no reserved+sign-multiplier parameter or `sort_parameters` CTE.++## Grouping input++Property grouping accepts optional date-range bucketing:++```ts+{+ type: 'property',+ propertyDefinitionId: reviewDatePropertyId,+ bucketing: {+ type: 'date_ranges',+ ranges: [+ { key: 'before_period', start: null, end: periodStart },+ { key: 'in_period', start: periodStart, end: periodEnd },+ { key: 'after_period', start: periodEnd, end: null },+ ],+ missingValueBucketKey: 'no_review_date',+ },+}+```++Bounds are UTC RFC3339 strings. Starts are inclusive; ends are exclusive. Null+means unbounded. Ranges must be ordered, contiguous, non-overlapping, cover all+dates, and have unique keys distinct from `missingValueBucketKey`. Validate range+counts and key lengths in REST/GraphQL input conversion before calling the service.++The grouping SQL returns a range index, which Rust maps to the caller's key.+Interpolate typed UTC bounds with `to_rfc3339()`, as quoted `timestamptz` literals,+matching the existing date predicates. Never interpolate raw date strings or+caller bucket keys. Document-ID sets remain bound arrays.+Missing or cleared dates use the configured missing-value bucket. Keep the+existing count and row-number windows, per-group limits, and single-group+load-more behavior. REST keeps raw UUID pool keys; GraphQL keeps typed entities.++Property grouping reads definition types through uncorrelated scalar lookups.+After expanding stored values, one `property_options` join supplies both option+existence and `display_order`. Deleted options retain the empty/Not Set group;+legacy DOCUMENT assignments on tasks never override canonical TASK assignments.++## DATE filters++The AST has one date literal: `{"dr": {"start": ..., "end": ...}}`. Both+bounds are optional. `{"dr": {}}` matches any present DATE value; wrap the+literal in `!` (REST AST) or `not` (GraphQL) for missing or cleared dates.+GraphQL uses `value: {dateRange: {}}` and no `hasDate` variant. The flat+REST/search `has_date` flag remains for Tasks search, expanding to the same+open range or its negation.++## Pagination and authorization++Use the existing position cursor, extended with a typed property key (`Number`+today) and its direction. Missing keys serialize as null. For a non-null key,+compare it with `>` for ascending or `<` for descending, then use descending+`(sort_ts, id)` ties; include missing keys after present keys. A null cursor key+continues only through missing keys with the same descending tie-breakers.++Do not add a frozen source list, context version, unused email view, or link IDs.+The client sends grouping configuration again on continuation requests. Its+query key includes property, direction, filters, and ranges; a changed query key+starts fresh pages. Keep deployed timestamp cursor decoding compatible.++Property-definition authorization is not added solely for sort or grouping.+Any future policy must cover filter, group, and sort IDs together. Item access,+lifecycle gates, and complete filters stay in the existing source clauses.+Preserve projection-backed document facts and property enrichment without a+second fetch-by-ID pass.++## Client behavior++The view owns labels and calendar presets. Tasks builds Overdue, Today,+Tomorrow, Next 7 days (D+2 through D+7), Later, and No due date from viewer-local+calendar boundaries. Recompute at midnight, timezone changes, and resume;+do not add fixed 24-hour durations across daylight-saving transitions.++Loaded items move immediately between date buckets using the same half-open+range rule in TypeScript. Revalidation corrects unloaded rows and authoritative+counts. Refresh a query when the edited definition is its sort property, its+group property, or appears in a date predicate. Match those request fields,+not serialized-key substrings. Assignment deletion without a definition ID+refreshes all property-dependent queries.++Tasks uses cached property definitions/options for its local numeric comparator,+with missing values last and the same update/ID tie-breakers as SQL. Group+metadata uses the same stored option `display_order`; leave assignee labels in+alphabetical order. Status and Priority are explicit sort choices. Do not add+property sorting or date predicates to the WASM reconciliation engine:+property-sorted pages remain server-backed.++## Alternatives rejected++- A candidate pipeline for one source: duplicates the existing UNION and adds+ a merger, separate hydration, authorization capability, and cursor context.+- Task-only deadline handling or backend-relative presets: couples shared APIs+ to one feature instead of the selected property and caller-provided ranges.+- String/entity sorting through the numeric key: needs text collation or display+ names that this query does not provide.+- Client-only grouping of all results: cannot establish complete counts or+ membership from a bounded page. Local movement is optimism, not authority.++No database migration, new property definition, or WASM change is required.diff --git a/packages/sdk-docs/reference/generated/search/types.gen/README.md b/packages/sdk-docs/reference/generated/search/types.gen/README.mdindex 6a977c2a14..b804af4477 100644--- a/packages/sdk-docs/reference/generated/search/types.gen/README.md+++ b/packages/sdk-docs/reference/generated/search/types.gen/README.md@@ -80,6 +80,7 @@- [ProjectSearchResponseItem](type-aliases/ProjectSearchResponseItem.md)- [ProjectSearchResponseItemWithMetadata](type-aliases/ProjectSearchResponseItemWithMetadata.md)- [ProjectSearchResult](type-aliases/ProjectSearchResult.md)+- [PropertyDateFilterRange](type-aliases/PropertyDateFilterRange.md)- [PropertyDefinition](type-aliases/PropertyDefinition.md)- [PropertyFilter](type-aliases/PropertyFilter.md)- [PropertyOwner](type-aliases/PropertyOwner.md)diff --git a/packages/sdk-docs/reference/generated/search/types.gen/type-aliases/PropertyDateFilterRange.md b/packages/sdk-docs/reference/generated/search/types.gen/type-aliases/PropertyDateFilterRange.mdnew file mode 100644index 0000000000..6b989f7a83--- /dev/null+++ b/packages/sdk-docs/reference/generated/search/types.gen/type-aliases/PropertyDateFilterRange.md@@ -0,0 +1,12 @@+# Type Alias: PropertyDateFilterRange++> **PropertyDateFilterRange** = \{ `end?`: `string` \| `null`; `start?`: `string` \| `null`; \}++UTC timestamp interval. Lower bounds are inclusive; upper bounds are exclusive.++## Properties++| Property | Type | Description |+| ------ | ------ | ------ |+| <a id="property-end"></a> `end?` | `string` \| `null` | Exclusive UTC upper bound, omitted for an open end. |+| <a id="property-start"></a> `start?` | `string` \| `null` | Inclusive UTC lower bound, omitted for an open start. |diff --git a/packages/sdk-docs/reference/generated/search/types.gen/type-aliases/PropertyFilter.md b/packages/sdk-docs/reference/generated/search/types.gen/type-aliases/PropertyFilter.mdindex 5015c35706..1ff14b9e9b 100644--- a/packages/sdk-docs/reference/generated/search/types.gen/type-aliases/PropertyFilter.md+++ b/packages/sdk-docs/reference/generated/search/types.gen/type-aliases/PropertyFilter.md@@ -1,6 +1,6 @@# Type Alias: PropertyFilter-> **PropertyFilter** = \{ `entity_ids?`: `string`[]; `entity_type?`: `string` \| `null`; `option_ids?`: `string`[]; `property_definition_id`: `string`; \}+> **PropertyFilter** = \{ `date_range?`: `null` \| [`PropertyDateFilterRange`](PropertyDateFilterRange.md); `entity_ids?`: `string`[]; `entity_type?`: `string` \| `null`; `has_date?`: `boolean` \| `null`; `option_ids?`: `string`[]; `property_definition_id`: `string`; \}A single property-based filter condition.@@ -13,7 +13,9 @@ Multiple filters are AND'd together.| Property | Type | Description || ------ | ------ | ------ |+| <a id="property-date_range"></a> `date_range?` | `null` \| [`PropertyDateFilterRange`](PropertyDateFilterRange.md) | - || <a id="property-entity_ids"></a> `entity_ids?` | `string`[] | Entity reference IDs to match. Multiple values are OR'd together. || <a id="property-entity_type"></a> `entity_type?` | `string` \| `null` | The entity type for the property lookup (e.g., "TASK", "DOCUMENT", "PROJECT"). When None, matches across all entity types. |+| <a id="property-has_date"></a> `has_date?` | `boolean` \| `null` | Flat Soup/search presence filter: true expands to an open date range, false to its negation. || <a id="property-option_ids"></a> `option_ids?` | `string`[] | Select option UUIDs to match. Multiple values are OR'd together. || <a id="property-property_definition_id"></a> `property_definition_id` | `string` | The UUID of the property definition to filter on. |diff --git a/packages/sdk-docs/reference/generated/storage/types.gen/README.md b/packages/sdk-docs/reference/generated/storage/types.gen/README.mdindex 9a97ee37e0..7035717a17 100644--- a/packages/sdk-docs/reference/generated/storage/types.gen/README.md+++ b/packages/sdk-docs/reference/generated/storage/types.gen/README.md@@ -1777,6 +1777,10 @@- [ProjectFilters](type-aliases/ProjectFilters.md)- [ProjectPreview](type-aliases/ProjectPreview.md)- [ProjectPreviewData](type-aliases/ProjectPreviewData.md)+- [PropertyBucketing](type-aliases/PropertyBucketing.md)+- [PropertyDateFilterRange](type-aliases/PropertyDateFilterRange.md)+- [PropertyDateRange](type-aliases/PropertyDateRange.md)+- [PropertyDateRanges](type-aliases/PropertyDateRanges.md)- [PropertyDefinition](type-aliases/PropertyDefinition.md)- [PropertyDefinitionWithOptions](type-aliases/PropertyDefinitionWithOptions.md)- [PropertyFilter](type-aliases/PropertyFilter.md)diff --git a/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/ApiGroupByField.md b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/ApiGroupByField.mdindex cc2f4c52c2..f4eea82f2d 100644--- a/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/ApiGroupByField.md+++ b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/ApiGroupByField.md@@ -1,6 +1,6 @@# Type Alias: ApiGroupByField-> **ApiGroupByField** = `"date"` \| `"entity_type"` \| `"project"` \| \{ `property`: \{ `entity_type?`: `null` \| [`ApiPropertyEntityType`](ApiPropertyEntityType.md); `property_definition_id`: `string`; \}; \}+> **ApiGroupByField** = `"date"` \| `"entity_type"` \| `"project"` \| \{ `property`: \{ `bucketing?`: `null` \| [`PropertyBucketing`](PropertyBucketing.md); `entity_type?`: `null` \| [`ApiPropertyEntityType`](ApiPropertyEntityType.md); `property_definition_id`: `string`; \}; \}API representation of group-by field.@@ -20,10 +20,11 @@ API representation of group-by field.### Type Literal-\{ `property`: \{ `entity_type?`: `null` \| [`ApiPropertyEntityType`](ApiPropertyEntityType.md); `property_definition_id`: `string`; \}; \}+\{ `property`: \{ `bucketing?`: `null` \| [`PropertyBucketing`](PropertyBucketing.md); `entity_type?`: `null` \| [`ApiPropertyEntityType`](ApiPropertyEntityType.md); `property_definition_id`: `string`; \}; \}| Name | Type | Description || ------ | ------ | ------ |-| `property` | \{ `entity_type?`: `null` \| [`ApiPropertyEntityType`](ApiPropertyEntityType.md); `property_definition_id`: `string`; \} | Group by a property value (e.g., status, priority, or custom properties) |+| `property` | \{ `bucketing?`: `null` \| [`PropertyBucketing`](PropertyBucketing.md); `entity_type?`: `null` \| [`ApiPropertyEntityType`](ApiPropertyEntityType.md); `property_definition_id`: `string`; \} | Group by a property value (e.g., status, priority, or custom properties) |+| `property.bucketing?` | `null` \| [`PropertyBucketing`](PropertyBucketing.md) | - || `property.entity_type?` | `null` \| [`ApiPropertyEntityType`](ApiPropertyEntityType.md) | - || `property.property_definition_id` | `string` | The property definition UUID to group by |diff --git a/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/ApiPropertyEntityType.md b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/ApiPropertyEntityType.mdindex 568b03ee71..b3906a5772 100644--- a/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/ApiPropertyEntityType.md+++ b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/ApiPropertyEntityType.md@@ -1,5 +1,5 @@# Type Alias: ApiPropertyEntityType-> **ApiPropertyEntityType** = `"CHANNEL"` \| `"CHAT"` \| `"COMPANY"` \| `"DOCUMENT"` \| `"PROJECT"` \| `"TASK"` \| `"THREAD"` \| `"USER"`+> **ApiPropertyEntityType** = `"CALL_RECORD"` \| `"CALENDAR_EVENT"` \| `"DATABASE_ROW"` \| `"INITIATIVE"` \| `"CHANNEL"` \| `"CHAT"` \| `"COMPANY"` \| `"DOCUMENT"` \| `"PROJECT"` \| `"TASK"` \| `"THREAD"` \| `"USER"`Entity type for property lookups (API representation).diff --git a/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/GetItemsSoupData.md b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/GetItemsSoupData.mdindex 6a61808668..5dd6ef7e50 100644--- a/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/GetItemsSoupData.md+++ b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/GetItemsSoupData.md@@ -1,6 +1,6 @@# Type Alias: GetItemsSoupData-> **GetItemsSoupData** = \{ `body?`: `never`; `path?`: `never`; `query?`: \{ `cursor?`: `string`; `expand?`: `boolean`; `limit?`: `number`; `sort_direction?`: [`SoupApiSortDirection`](SoupApiSortDirection.md); `sort_method?`: [`SoupApiSort`](SoupApiSort.md); \}; `url`: `"/items/soup"`; \}+> **GetItemsSoupData** = \{ `body?`: `never`; `path?`: `never`; `query?`: \{ `cursor?`: `string`; `expand?`: `boolean`; `limit?`: `number`; `sort_direction?`: [`SoupApiSortDirection`](SoupApiSortDirection.md); `sort_method?`: [`SoupApiSort`](SoupApiSort.md); `sort_property_definition_id?`: `string`; \}; `url`: `"/items/soup"`; \}## Properties@@ -8,10 +8,11 @@| ------ | ------ | ------ || <a id="property-body"></a> `body?` | `never` | - || <a id="property-path"></a> `path?` | `never` | - |-| <a id="property-query"></a> `query?` | \{ `cursor?`: `string`; `expand?`: `boolean`; `limit?`: `number`; `sort_direction?`: [`SoupApiSortDirection`](SoupApiSortDirection.md); `sort_method?`: [`SoupApiSort`](SoupApiSort.md); \} | - |+| <a id="property-query"></a> `query?` | \{ `cursor?`: `string`; `expand?`: `boolean`; `limit?`: `number`; `sort_direction?`: [`SoupApiSortDirection`](SoupApiSortDirection.md); `sort_method?`: [`SoupApiSort`](SoupApiSort.md); `sort_property_definition_id?`: `string`; \} | - || `query.cursor?` | `string` | Base64 encoded cursor value. || `query.expand?` | `boolean` | Whether to expand projects. Defaults to true. || `query.limit?` | `number` | Limit the number of items returned. Defaults to 20. Max 500. |-| `query.sort_direction?` | [`SoupApiSortDirection`](SoupApiSortDirection.md) | Sort direction. Options are asc, desc. Defaults to desc. Re-send this with every page: it is not carried in the cursor. Applies to the timestamp sort methods only. `asc` combined with `frecency` is rejected rather than ignored: frecency pages are ordered by relevance score and the cursor comparison assumes descending, so there is no ascending frecency order to give. |-| `query.sort_method?` | [`SoupApiSort`](SoupApiSort.md) | Sort method. Options are viewed_at, created_at, updated_at, viewed_updated, frecency, touched_by_me, notified_at. Defaults to viewed_at. |+| `query.sort_direction?` | [`SoupApiSortDirection`](SoupApiSortDirection.md) | Sort direction. Options are asc, desc. Defaults to desc. Timestamp sorts require this parameter again on each page. Property cursors preserve their direction and always put missing values last. Ascending frecency, touched-by-me, and notified-at sorts are unsupported. |+| `query.sort_method?` | [`SoupApiSort`](SoupApiSort.md) | Sort method. Property ordering supports DATE, NUMBER, BOOLEAN, SELECT and TAG. Missing definitions, unsupported types, and mismatched values sort as missing. Flat property sorts omit calendar events, email, channels, calls, companies, and agent sessions. Defaults to viewed_at. |+| `query.sort_property_definition_id?` | `string` | Property definition selected for numeric property sorting. || <a id="property-url"></a> `url` | `"/items/soup"` | - |diff --git a/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/GroupedInitialParams.md b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/GroupedInitialParams.mdindex e3d16ce344..911fec6bb2 100644--- a/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/GroupedInitialParams.md+++ b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/GroupedInitialParams.md@@ -1,6 +1,6 @@# Type Alias: GroupedInitialParams-> **GroupedInitialParams** = \{ `group_by`: [`ApiGroupByField`](ApiGroupByField.md); `per_group_limit?`: `number` \| `null`; `sort_method?`: `null` \| [`GroupedSoupSort`](GroupedSoupSort.md); \}+> **GroupedInitialParams** = \{ `group_by`: [`ApiGroupByField`](ApiGroupByField.md); `per_group_limit?`: `number` \| `null`; `sort_direction?`: `null` \| [`SoupApiSortDirection`](SoupApiSortDirection.md); `sort_method?`: `null` \| [`GroupedSoupSort`](GroupedSoupSort.md); `sort_property_definition_id?`: `string` \| `null`; \}Parameters for the initial grouped soup query.@@ -10,4 +10,6 @@ Parameters for the initial grouped soup query.| ------ | ------ | ------ || <a id="property-group_by"></a> `group_by` | [`ApiGroupByField`](ApiGroupByField.md) | Field to group results by (required). || <a id="property-per_group_limit"></a> `per_group_limit?` | `number` \| `null` | Limit the number of items returned per group. Defaults to 20. Max 500. |+| <a id="property-sort_direction"></a> `sort_direction?` | `null` \| [`SoupApiSortDirection`](SoupApiSortDirection.md) | - || <a id="property-sort_method"></a> `sort_method?` | `null` \| [`GroupedSoupSort`](GroupedSoupSort.md) | - |+| <a id="property-sort_property_definition_id"></a> `sort_property_definition_id?` | `string` \| `null` | Property definition selected for numeric property sorting. |diff --git a/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/GroupedPageParams.md b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/GroupedPageParams.mdindex 091504cb83..1e4cc3804d 100644--- a/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/GroupedPageParams.md+++ b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/GroupedPageParams.md@@ -1,6 +1,6 @@# Type Alias: GroupedPageParams-> **GroupedPageParams** = \{ `group_by`: [`ApiGroupByField`](ApiGroupByField.md); `group_key`: `string`; `limit?`: `number` \| `null`; `sort_method?`: `null` \| [`GroupedSoupSort`](GroupedSoupSort.md); \}+> **GroupedPageParams** = \{ `group_by`: [`ApiGroupByField`](ApiGroupByField.md); `group_key`: `string`; `limit?`: `number` \| `null`; `sort_direction?`: `null` \| [`SoupApiSortDirection`](SoupApiSortDirection.md); `sort_method?`: `null` \| [`GroupedSoupSort`](GroupedSoupSort.md); `sort_property_definition_id?`: `string` \| `null`; \}Parameters for fetching one page within a specific group.@@ -11,4 +11,6 @@ Parameters for fetching one page within a specific group.| <a id="property-group_by"></a> `group_by` | [`ApiGroupByField`](ApiGroupByField.md) | Field to group results by (required). || <a id="property-group_key"></a> `group_key` | `string` | Group key to fetch. || <a id="property-limit"></a> `limit?` | `number` \| `null` | Limit the number of items returned. Defaults to 20. Max 500. |+| <a id="property-sort_direction"></a> `sort_direction?` | `null` \| [`SoupApiSortDirection`](SoupApiSortDirection.md) | - || <a id="property-sort_method"></a> `sort_method?` | `null` \| [`GroupedSoupSort`](GroupedSoupSort.md) | - |+| <a id="property-sort_property_definition_id"></a> `sort_property_definition_id?` | `string` \| `null` | Property definition selected for numeric property sorting. |diff --git a/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/GroupedSoupSort.md b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/GroupedSoupSort.mdindex 74f06c94c5..d4c96fa3cb 100644--- a/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/GroupedSoupSort.md+++ b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/GroupedSoupSort.md@@ -1,5 +1,5 @@# Type Alias: GroupedSoupSort-> **GroupedSoupSort** = `"viewed_at"` \| `"created_at"` \| `"updated_at"` \| `"viewed_updated"`+> **GroupedSoupSort** = `"viewed_at"` \| `"created_at"` \| `"updated_at"` \| `"viewed_updated"` \| `"property"`Sort method for grouped queries (frecency not supported).diff --git a/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/Params.md b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/Params.mdindex d0ac355be6..4ad8b7ea7b 100644--- a/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/Params.md+++ b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/Params.md@@ -1,6 +1,6 @@# Type Alias: Params-> **Params** = \{ `expand?`: `boolean` \| `null`; `limit?`: `number` \| `null`; `sort_direction?`: `null` \| [`SoupApiSortDirection`](SoupApiSortDirection.md); `sort_method?`: `null` \| [`SoupApiSort`](SoupApiSort.md); \}+> **Params** = \{ `expand?`: `boolean` \| `null`; `limit?`: `number` \| `null`; `sort_direction?`: `null` \| [`SoupApiSortDirection`](SoupApiSortDirection.md); `sort_method?`: `null` \| [`SoupApiSort`](SoupApiSort.md); `sort_property_definition_id?`: `string` \| `null`; \}Query parameters shared by soup endpoints.@@ -12,3 +12,4 @@ Query parameters shared by soup endpoints.| <a id="property-limit"></a> `limit?` | `number` \| `null` | Limit the number of items returned. Defaults to 20. Max 500. || <a id="property-sort_direction"></a> `sort_direction?` | `null` \| [`SoupApiSortDirection`](SoupApiSortDirection.md) | - || <a id="property-sort_method"></a> `sort_method?` | `null` \| [`SoupApiSort`](SoupApiSort.md) | - |+| <a id="property-sort_property_definition_id"></a> `sort_property_definition_id?` | `string` \| `null` | Property definition selected for numeric property sorting. |diff --git a/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/PropertyBucketing.md b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/PropertyBucketing.mdnew file mode 100644index 0000000000..0693adc4a2--- /dev/null+++ b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/PropertyBucketing.md@@ -0,0 +1,11 @@+# Type Alias: PropertyBucketing++> **PropertyBucketing** = [`PropertyDateRanges`](PropertyDateRanges.md) & \{ `type`: `"date_ranges"`; \}++Caller-defined, ordered UTC date ranges and a separate missing-value key.++## Type Declaration++| Name | Type |+| ------ | ------ |+| `type` | `"date_ranges"` |diff --git a/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/PropertyDateFilterRange.md b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/PropertyDateFilterRange.mdnew file mode 100644index 0000000000..6b989f7a83--- /dev/null+++ b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/PropertyDateFilterRange.md@@ -0,0 +1,12 @@+# Type Alias: PropertyDateFilterRange++> **PropertyDateFilterRange** = \{ `end?`: `string` \| `null`; `start?`: `string` \| `null`; \}++UTC timestamp interval. Lower bounds are inclusive; upper bounds are exclusive.++## Properties++| Property | Type | Description |+| ------ | ------ | ------ |+| <a id="property-end"></a> `end?` | `string` \| `null` | Exclusive UTC upper bound, omitted for an open end. |+| <a id="property-start"></a> `start?` | `string` \| `null` | Inclusive UTC lower bound, omitted for an open start. |diff --git a/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/PropertyDateRange.md b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/PropertyDateRange.mdnew file mode 100644index 0000000000..3ac51efd3e--- /dev/null+++ b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/PropertyDateRange.md@@ -0,0 +1,13 @@+# Type Alias: PropertyDateRange++> **PropertyDateRange** = \{ `end?`: `string` \| `null`; `key`: `string`; `start?`: `string` \| `null`; \}++A half-open UTC interval. An absent start or end extends to infinity.++## Properties++| Property | Type | Description |+| ------ | ------ | ------ |+| <a id="property-end"></a> `end?` | `string` \| `null` | Exclusive end, or positive infinity. |+| <a id="property-key"></a> `key` | `string` | Unique caller-supplied group key. |+| <a id="property-start"></a> `start?` | `string` \| `null` | Inclusive start, or negative infinity. |diff --git a/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/PropertyDateRanges.md b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/PropertyDateRanges.mdnew file mode 100644index 0000000000..de67f7ecb1--- /dev/null+++ b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/PropertyDateRanges.md@@ -0,0 +1,12 @@+# Type Alias: PropertyDateRanges++> **PropertyDateRanges** = \{ `missing_value_bucket_key`: `string`; `ranges`: [`PropertyDateRange`](PropertyDateRange.md)[]; \}++A complete partition of present dates plus one bucket for absent values.++## Properties++| Property | Type | Description |+| ------ | ------ | ------ |+| <a id="property-missing_value_bucket_key"></a> `missing_value_bucket_key` | `string` | Caller-supplied group key for entities with no date value. |+| <a id="property-ranges"></a> `ranges` | [`PropertyDateRange`](PropertyDateRange.md)[] | Ordered, contiguous ranges covering every present date. |diff --git a/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/PropertyFilter.md b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/PropertyFilter.mdindex 5015c35706..1ff14b9e9b 100644--- a/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/PropertyFilter.md+++ b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/PropertyFilter.md@@ -1,6 +1,6 @@# Type Alias: PropertyFilter-> **PropertyFilter** = \{ `entity_ids?`: `string`[]; `entity_type?`: `string` \| `null`; `option_ids?`: `string`[]; `property_definition_id`: `string`; \}+> **PropertyFilter** = \{ `date_range?`: `null` \| [`PropertyDateFilterRange`](PropertyDateFilterRange.md); `entity_ids?`: `string`[]; `entity_type?`: `string` \| `null`; `has_date?`: `boolean` \| `null`; `option_ids?`: `string`[]; `property_definition_id`: `string`; \}A single property-based filter condition.@@ -13,7 +13,9 @@ Multiple filters are AND'd together.| Property | Type | Description || ------ | ------ | ------ |+| <a id="property-date_range"></a> `date_range?` | `null` \| [`PropertyDateFilterRange`](PropertyDateFilterRange.md) | - || <a id="property-entity_ids"></a> `entity_ids?` | `string`[] | Entity reference IDs to match. Multiple values are OR'd together. || <a id="property-entity_type"></a> `entity_type?` | `string` \| `null` | The entity type for the property lookup (e.g., "TASK", "DOCUMENT", "PROJECT"). When None, matches across all entity types. |+| <a id="property-has_date"></a> `has_date?` | `boolean` \| `null` | Flat Soup/search presence filter: true expands to an open date range, false to its negation. || <a id="property-option_ids"></a> `option_ids?` | `string`[] | Select option UUIDs to match. Multiple values are OR'd together. || <a id="property-property_definition_id"></a> `property_definition_id` | `string` | The UUID of the property definition to filter on. |diff --git a/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/SoupApiSort.md b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/SoupApiSort.mdindex f6abc7fba9..b53b7f8376 100644--- a/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/SoupApiSort.md+++ b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/SoupApiSort.md@@ -1,5 +1,5 @@# Type Alias: SoupApiSort-> **SoupApiSort** = `"viewed_at"` \| `"created_at"` \| `"updated_at"` \| `"viewed_updated"` \| `"frecency"` \| `"touched_by_me"` \| `"notified_at"`+> **SoupApiSort** = `"viewed_at"` \| `"created_at"` \| `"updated_at"` \| `"viewed_updated"` \| `"frecency"` \| `"touched_by_me"` \| `"notified_at"` \| `"property"`Sort options accepted by non-grouped soup API endpoints.diff --git a/packages/sdk/generated/search/index.ts b/packages/sdk/generated/search/index.tsindex 377ea7bfa5..30149947e0 100644--- a/packages/sdk/generated/search/index.ts+++ b/packages/sdk/generated/search/index.ts@@ -1,4 +1,4 @@// This file is auto-generated by @hey-api/openapi-tsexport { type Options, Sdk } from './sdk.gen';-export type { AgentSessionAuthor, AgentSessionFilters, AgentSessionSearchResponseItem, AgentSessionSearchResult, CalendarEventFilters, CalendarEventMetadata, CalendarEventOrganizer, CalendarEventSearchOccurrence, CalendarEventSearchResponseItem, CalendarEventSearchResponseItemWithMetadata, CalendarEventSearchResult, CalendarEventSearchRole, CalendarEventSearchScope, CalendarEventSearchTime, CallFilters, CallRecordMetadata, CallRecordSearchResponseItem, CallRecordSearchResponseItemWithMetadata, CallRecordSearchResult, CallStatus, ChannelFilters, ChannelMessageSearchResponseItem, ChannelMetadata, ChannelNameSearchResponseItem, ChannelSearchRequest, ChannelSearchResponse, ChannelSearchResponseItem, ChannelSearchResponseItemWithMetadata, ChannelSearchResult, ChannelSortTimestamp, ChannelThreadFilters, ChatFilters, ChatMessageSearchResult, ChatMetadata, ChatSearchRequest, ChatSearchResponse, ChatSearchResponseItem, ChatSearchResponseItemWithMetadata, ClientOptions, CrmCompanyFilters, CrmCompanySearchDomain, CrmCompanySearchResponseItem, DataType, DateRange, DocumentFilters, DocumentMetadata, DocumentSearchRequest, DocumentSearchResponse, DocumentSearchResponseItem, DocumentSearchResponseItemWithMetadata, DocumentSearchResult, DocumentSubType, EmailFilters, EmailSearchParticipant, EmailSearchRequest, EmailSearchResponse, EmailSearchResponseItem, EmailSearchResponseItemWithMetadata, EmailSearchResult, EmptyResponse, EntityFilters, EntityReference, EntityType, ErrorResponse, FileType, ForeignEntityFilters, Highlight, InitiativeFilters, MatchType, NotificationFilters, NotificationState, ProjectFilters, ProjectMetadata, ProjectSearchMetadata, ProjectSearchRequest, ProjectSearchResponseItem, ProjectSearchResponseItemWithMetadata, ProjectSearchResult, PropertyDefinition, PropertyFilter, PropertyOwner, PropertyValue, SearchGotoAgentSession, SearchGotoCallRecord, SearchGotoChannel, SearchGotoChat, SearchGotoContent, SearchGotoDocument, SearchGotoEmail, SearchHighlight, SearchOn, SearchResponse, SharedEmailFilter, SimpleCalendarEventSearchResponseBaseItemHumanReadableTimestamp, SimpleCallRecordSearchResponseBaseItemHumanReadableTimestamp, SimpleChannelSearchReponseBaseItem, SimpleChannelSearchReponseBaseItemHumanReadableTimestamp, SimpleChannelSearchResponse, SimpleChatSearchResponse, SimpleChatSearchResponseBaseItem, SimpleChatSearchResponseBaseItemHumanReadableTimestamp, SimpleDocumentSearchResponse, SimpleDocumentSearchResponseBaseItem, SimpleDocumentSearchResponseBaseItemHumanReadableTimestamp, SimpleEmailSearchResponse, SimpleEmailSearchResponseBaseItem, SimpleEmailSearchResponseBaseItemHumanReadableTimestamp, SimpleProjectSearchResponse, SimpleProjectSearchResponseBaseItem, SimpleProjectSearchResponseBaseItemHumanReadableTimestamp, SimpleSearchResponse, SimpleSearchResponseItem, SimpleUnifiedSearchBaseResponse, SimpleUnifiedSearchData, SimpleUnifiedSearchError, SimpleUnifiedSearchErrors, SimpleUnifiedSearchResponse, SimpleUnifiedSearchResponseBaseItem, SimpleUnifiedSearchResponseBaseItemHumanReadableTimestamp, SimpleUnifiedSearchResponses, SoupProperty, TagFilterMode, TaskFilters, UnifiedSearchData, UnifiedSearchError, UnifiedSearchErrors, UnifiedSearchRequest, UnifiedSearchResponse, UnifiedSearchResponse2, UnifiedSearchResponseItem, UnifiedSearchResponses } from './types.gen';+export type { AgentSessionAuthor, AgentSessionFilters, AgentSessionSearchResponseItem, AgentSessionSearchResult, CalendarEventFilters, CalendarEventMetadata, CalendarEventOrganizer, CalendarEventSearchOccurrence, CalendarEventSearchResponseItem, CalendarEventSearchResponseItemWithMetadata, CalendarEventSearchResult, CalendarEventSearchRole, CalendarEventSearchScope, CalendarEventSearchTime, CallFilters, CallRecordMetadata, CallRecordSearchResponseItem, CallRecordSearchResponseItemWithMetadata, CallRecordSearchResult, CallStatus, ChannelFilters, ChannelMessageSearchResponseItem, ChannelMetadata, ChannelNameSearchResponseItem, ChannelSearchRequest, ChannelSearchResponse, ChannelSearchResponseItem, ChannelSearchResponseItemWithMetadata, ChannelSearchResult, ChannelSortTimestamp, ChannelThreadFilters, ChatFilters, ChatMessageSearchResult, ChatMetadata, ChatSearchRequest, ChatSearchResponse, ChatSearchResponseItem, ChatSearchResponseItemWithMetadata, ClientOptions, CrmCompanyFilters, CrmCompanySearchDomain, CrmCompanySearchResponseItem, DataType, DateRange, DocumentFilters, DocumentMetadata, DocumentSearchRequest, DocumentSearchResponse, DocumentSearchResponseItem, DocumentSearchResponseItemWithMetadata, DocumentSearchResult, DocumentSubType, EmailFilters, EmailSearchParticipant, EmailSearchRequest, EmailSearchResponse, EmailSearchResponseItem, EmailSearchResponseItemWithMetadata, EmailSearchResult, EmptyResponse, EntityFilters, EntityReference, EntityType, ErrorResponse, FileType, ForeignEntityFilters, Highlight, InitiativeFilters, MatchType, NotificationFilters, NotificationState, ProjectFilters, ProjectMetadata, ProjectSearchMetadata, ProjectSearchRequest, ProjectSearchResponseItem, ProjectSearchResponseItemWithMetadata, ProjectSearchResult, PropertyDateFilterRange, PropertyDefinition, PropertyFilter, PropertyOwner, PropertyValue, SearchGotoAgentSession, SearchGotoCallRecord, SearchGotoChannel, SearchGotoChat, SearchGotoContent, SearchGotoDocument, SearchGotoEmail, SearchHighlight, SearchOn, SearchResponse, SharedEmailFilter, SimpleCalendarEventSearchResponseBaseItemHumanReadableTimestamp, SimpleCallRecordSearchResponseBaseItemHumanReadableTimestamp, SimpleChannelSearchReponseBaseItem, SimpleChannelSearchReponseBaseItemHumanReadableTimestamp, SimpleChannelSearchResponse, SimpleChatSearchResponse, SimpleChatSearchResponseBaseItem, SimpleChatSearchResponseBaseItemHumanReadableTimestamp, SimpleDocumentSearchResponse, SimpleDocumentSearchResponseBaseItem, SimpleDocumentSearchResponseBaseItemHumanReadableTimestamp, SimpleEmailSearchResponse, SimpleEmailSearchResponseBaseItem, SimpleEmailSearchResponseBaseItemHumanReadableTimestamp, SimpleProjectSearchResponse, SimpleProjectSearchResponseBaseItem, SimpleProjectSearchResponseBaseItemHumanReadableTimestamp, SimpleSearchResponse, SimpleSearchResponseItem, SimpleUnifiedSearchBaseResponse, SimpleUnifiedSearchData, SimpleUnifiedSearchError, SimpleUnifiedSearchErrors, SimpleUnifiedSearchResponse, SimpleUnifiedSearchResponseBaseItem, SimpleUnifiedSearchResponseBaseItemHumanReadableTimestamp, SimpleUnifiedSearchResponses, SoupProperty, TagFilterMode, TaskFilters, UnifiedSearchData, UnifiedSearchError, UnifiedSearchErrors, UnifiedSearchRequest, UnifiedSearchResponse, UnifiedSearchResponse2, UnifiedSearchResponseItem, UnifiedSearchResponses } from './types.gen';diff --git a/packages/sdk/generated/search/types.gen.ts b/packages/sdk/generated/search/types.gen.tsindex cb295b3e0d..9bce34c23d 100644--- a/packages/sdk/generated/search/types.gen.ts+++ b/packages/sdk/generated/search/types.gen.ts@@ -1661,6 +1661,20 @@ export type ProjectSearchResult = {score?: number | null;};+/**+ * UTC timestamp interval. Lower bounds are inclusive; upper bounds are exclusive.+ */+export type PropertyDateFilterRange = {+ /**+ * Exclusive UTC upper bound, omitted for an open end.+ */+ end?: string | null;+ /**+ * Inclusive UTC lower bound, omitted for an open start.+ */+ start?: string | null;+};+/*** Property definition model (service representation).*/@@ -1693,6 +1707,7 @@ export type PropertyDefinition = {* Multiple filters are AND'd together.*/export type PropertyFilter = {+ date_range?: null | PropertyDateFilterRange;/*** Entity reference IDs to match. Multiple values are OR'd together.*/@@ -1702,6 +1717,10 @@ export type PropertyFilter = {* When None, matches across all entity types.*/entity_type?: string | null;+ /**+ * Flat Soup/search presence filter: true expands to an open date range, false to its negation.+ */+ has_date?: boolean | null;/*** Select option UUIDs to match. Multiple values are OR'd together.*/diff --git a/packages/sdk/generated/storage/index.ts b/packages/sdk/generated/storage/index.tsindex 4981596eca..beeedceaaf 100644--- a/packages/sdk/generated/storage/index.ts+++ b/packages/sdk/generated/storage/index.ts@@ -1,4 +1,4 @@// This file is auto-generated by @hey-api/openapi-tsexport { type Options, Sdk } from './sdk.gen';-export type { AccessiblePipeline, AccessLevel, AccessRequest, AccessRequestsCancelData, AccessRequestsCancelErrors, AccessRequestsCancelResponses, AccessRequestsDirectData, AccessRequestsDirectErrors, AccessRequestsDirectResponse, AccessRequestsDirectResponses, AccessRequestsRemoveDirectData, AccessRequestsRemoveDirectErrors, AccessRequestsRemoveDirectResponses, AccessRequestsResolveData, AccessRequestsResolveErrors, AccessRequestsResolveResponse, AccessRequestsResolveResponses, AccessRequestsSetDirectData, AccessRequestsSetDirectErrors, AccessRequestsSetDirectResponses, AccessRequestsStateData, AccessRequestsStateErrors, AccessRequestsStateResponse, AccessRequestsStateResponses, AccessRequestsSubmitData, AccessRequestsSubmitErrors, AccessRequestsSubmitResponse, AccessRequestsSubmitResponses, AccessRequestState, ActiveCallsResponse, ActiveCallSummary, ActiveMeeting, ActiveMeetingsResponse, ActivityType, AddFavoriteData, AddFavoriteError, AddFavoriteErrors, AddFavoriteRequest, AddFavoriteResponse, AddFavoriteResponses, AddParticipantsData, AddParticipantsError, AddParticipantsErrors, AddParticipantsRequest, AddParticipantsResponses, AddPinHandlerData, AddPinHandlerError, AddPinHandlerErrors, AddPinHandlerResponse, AddPinHandlerResponses, AddPinRequest, Agent, AgentActionId, AgentChannelScope, AgentDmProfile, AgentMcpServer, AgentMcpServers, AgentPullRequestState, AgentSessionFilters, AgentSessionLifecycleEvent, AgentSessionSource, AgentSessionVisibility, AgentTyping, AgentTypingPhase, Anchor, AnchorId, AnchorResponse, AnnotationIncrementalUpdate, Answer, ApiActivity, ApiAttachmentChannelReference, ApiAttachmentCommentReference, ApiAttachmentEntityReference, ApiAttachmentGenericReference, ApiChannelAttachment, ApiChannelAttachmentsPage, ApiChannelDetail, ApiChannelListMessage, ApiChannelListPage, ApiChannelListParticipant, ApiChannelListType, ApiChannelParticipant, ApiChannelWithLatest, ApiEntityFilterAst, ApiGroupByField, ApiGroupMeta, ApiParticipantListRole, ApiParticipantRole, ApiPropertyEntityType, AppliedOps, ApplyCrmPipelineOpsData, ApplyCrmPipelineOpsResponse, ApplyCrmPipelineOpsResponses, ApplyDatabaseOpsData, ApplyDatabaseOpsError, ApplyDatabaseOpsErrors, ApplyDatabaseOpsResponse, ApplyDatabaseOpsResponses, ApplyOpsRequest, ApplyOpsResponse, ApproveHarnessPairingData, ApproveHarnessPairingError, ApproveHarnessPairingErrors, ApproveHarnessPairingResponse, ApproveHarnessPairingResponses, ApprovePairingRequest, AttachmentChange, AttendeeResponseStatus, Audience, Awareness, AwarenessRelay, BasicDocument, BasicDocumentSubType, BomPart, BookingTarget, Bot, BotChannel, BotChannelType, BotId, BotKind, BotOwner, BotOwnerProfile, BotSenderProfile, BotToken, BranchNameResponse, BTreeMap, BulkWakeupRequest, BulkWakeupResponse, BulkWakeupSyncServiceDocumentsData, BulkWakeupSyncServiceDocumentsErrors, BulkWakeupSyncServiceDocumentsResponse, BulkWakeupSyncServiceDocumentsResponses, CalendarAttendee, CalendarEvent, CalendarEventFilters, CalendarEventSourceContent, CalendarJoinRequest, CalendarJoinRequestApiError, CalendarJoinRequestErrorCode, CalendarJoinRequestsResponse, CalendarJoinRequestStatus, CalendarMentionEvent, CalendarMentionPreviewItem, CalendarMentionPreviewKind, CalendarMentionPreviewRequest, CalendarMentionPreviewRequestItem, CalendarMentionPreviewResponse, CalendarMentionViewerCopy, CalendarOccurrence, CalendarOccurrenceItem, CalendarOccurrenceResponse, CalendarSyncStatus, CallActiveResponse, CallFilters, CallProvider, CallRecord, CallRecordGuest, CallRecordParticipant, CallRecordPreview, CallRecordPreviewData, CallRecordSource, CallRecordTranscriptSegment, CallStatus, CallTokenResponse, CallWebhookData, CallWebhookError, CallWebhookErrors, CallWebhookResponses, CancelSlackImportData, CancelSlackImportErrors, CancelSlackImportResponse, CancelSlackImportResponses, CardPosition, CastVerdict, CellValue, CellWrite, ChangedFileDto, ChangesetDto, ChangesetSourceDto, Channel, ChannelCreatedMetadata, ChannelDeletedMetadata, ChannelFilters, ChannelJoinCodeResponse, ChannelLabel, ChannelLabelRule, ChannelLabelsList, ChannelMessage, ChannelParticipant, ChannelParticipantAddedMetadata, ChannelParticipantRemovedMetadata, ChannelPictureChangedMetadata, ChannelPreview, ChannelPreviewData, ChannelSender, ChannelSharePermission, ChannelThreadFilters, ChannelTopicEvent, ChannelType, ChannelUpdatedMetadata, ChannelWebhookRequest, ChannelWebhookResponse, ChannelWithParticipants, Chat, ChatFilters, CheckActiveCallData, CheckActiveCallError, CheckActiveCallErrors, CheckActiveCallResponse, CheckActiveCallResponses, ClaimedPairing, ClaimHarnessPairingData, ClaimHarnessPairingError, ClaimHarnessPairingErrors, ClaimHarnessPairingResponse, ClaimHarnessPairingResponses, ClaimPairingRequest, ClientOptions, CloudStorageItemType, CollaborateFormData, CollaborateFormError, CollaborateFormErrors, CollaborateFormResponse, CollaborateFormResponses, CollabSurfaceResponse, CollabSurfaceTokenResponse, Column, ColumnCast, ColumnChange, ColumnChangeKind, ColumnConfig, ColumnConversion, ColumnConversionRequest, ColumnDetail, ColumnId, ColumnKind, ColumnProtection, ColumnResult, CommandFailure, CommandRejectedMetadata, CommittedChange, CompleteSlackImportUploadsData, CompleteSlackImportUploadsErrors, CompleteSlackImportUploadsResponse, CompleteSlackImportUploadsResponses, CompleteUploads, ConferenceProvider, Conjunction, ConversationId, ConversationKind, ConversationMetadata, ConversationProgress, ConversationSeal, ConversationStatus, ConvertDatabaseColumnData, ConvertDatabaseColumnError, ConvertDatabaseColumnErrors, ConvertDatabaseColumnResponse, ConvertDatabaseColumnResponses, ConvertedCell, CopyDocumentData, CopyDocumentError, CopyDocumentErrors, CopyDocumentQueryParams, CopyDocumentRequest, CopyDocumentResponse, CopyDocumentResponse2, CopyDocumentResponses, CountedReaction, CreateAgentData, CreateAgentError, CreateAgentErrors, CreateAgentRequest, CreateAgentResponse, CreateAgentResponses, CreateAnchorData, CreateAnchorError, CreateAnchorErrors, CreateAnchorResponse, CreateAnchorResponses, CreateBotRequest, CreateBulkDocumentResponse, CreateBulkDocumentResponseData, CreateCanvasDocumentRequest, CreateCanvasDocumentResponse, CreateCanvasHandlerData, CreateCanvasHandlerError, CreateCanvasHandlerErrors, CreateCanvasHandlerResponse, CreateCanvasHandlerResponses, CreateChannelData, CreateChannelError, CreateChannelErrors, CreateChannelLabelData, CreateChannelLabelError, CreateChannelLabelErrors, CreateChannelLabelRequest, CreateChannelLabelResponse, CreateChannelLabelResponses, CreateChannelRequest, CreateChannelResponse, CreateChannelResponse2, CreateChannelResponses, CreateChannelScopedBotData, CreateChannelScopedBotError, CreateChannelScopedBotErrors, CreateChannelScopedBotRequest, CreateChannelScopedBotResponse, CreateChannelScopedBotResponse2, CreateChannelScopedBotResponses, CreateCollabSurfaceTokenData, CreateCollabSurfaceTokenError, CreateCollabSurfaceTokenErrors, CreateCollabSurfaceTokenResponse, CreateCollabSurfaceTokenResponses, CreateCrmCompanyData, CreateCrmCompanyError, CreateCrmCompanyErrors, CreateCrmCompanyRequest, CreateCrmCompanyResponse, CreateCrmCompanyResponses, CreateCrmContactData, CreateCrmContactError, CreateCrmContactErrors, CreateCrmContactRequest, CreateCrmContactResponse, CreateCrmContactResponses, CreateCrmPipelineData, CreateCrmPipelineResponse, CreateCrmPipelineResponses, CreateDatabaseData, CreateDatabaseError, CreateDatabaseErrors, CreateDatabaseRequest, CreateDatabaseResponse, CreateDatabaseResponses, CreateDatabaseWebhookData, CreateDatabaseWebhookError, CreateDatabaseWebhookErrors, CreateDatabaseWebhookRequest, CreateDatabaseWebhookResponse, CreateDatabaseWebhookResponses, CreatedDatabaseWebhookResponse, CreateDocumentData, CreateDocumentError, CreateDocumentErrors, CreateDocumentRequest, CreateDocumentResponse, CreateDocumentResponseData, CreateDocumentResponses, CreatedPairing, CreatedUserApiKey, CreateEntityMentionData, CreateEntityMentionError, CreateEntityMentionErrors, CreateEntityMentionRequest, CreateEntityMentionResponse, CreateEntityMentionResponse2, CreateEntityMentionResponses, CreateForm, CreateFormData, CreateFormError, CreateFormErrors, CreateFormResponse, CreateFormResponses, CreateHarnessPairingData, CreateHarnessPairingError, CreateHarnessPairingErrors, CreateHarnessPairingResponse, CreateHarnessPairingResponses, CreateImport, CreateInitiativeData, CreateInitiativeError, CreateInitiativeErrors, CreateInitiativeRequest, CreateInitiativeResponse, CreateInitiativeResponses, CreateInstructionsDocumentResponse, CreateInstructionsHandlerData, CreateInstructionsHandlerError, CreateInstructionsHandlerErrors, CreateInstructionsHandlerResponse, CreateInstructionsHandlerResponses, CreateMarkdownDocumentRequest, CreateMarkdownDocumentResponse, CreateMarkdownHandlerData, CreateMarkdownHandlerError, CreateMarkdownHandlerErrors, CreateMarkdownHandlerResponse, CreateMarkdownHandlerResponses, CreateMeetingRequest, CreatePairingRequest, CreatePipeline, CreateProjectHandlerData, CreateProjectHandlerError, CreateProjectHandlerErrors, CreateProjectHandlerResponse, CreateProjectHandlerResponses, CreateProjectRequest, CreateProjectResponse, CreateSkillHandlerData, CreateSkillHandlerError, CreateSkillHandlerErrors, CreateSkillHandlerResponse, CreateSkillHandlerResponses, CreateSkillRequest, CreateSkillResponse, CreateSlackImportData, CreateSlackImportErrors, CreateSlackImportResponse, CreateSlackImportResponses, CreateSnippetHandlerData, CreateSnippetHandlerError, CreateSnippetHandlerErrors, CreateSnippetHandlerResponse, CreateSnippetHandlerResponses, CreateSnippetRequest, CreateSnippetResponse, CreateTaskHandlerData, CreateTaskHandlerError, CreateTaskHandlerErrors, CreateTaskHandlerResponse, CreateTaskHandlerResponses, CreateTaskRequest, CreateTaskResponse, CreateToken, CreateUnthreadedAnchorRequest, CreateUnthreadedAnchorResponse, CreateUnthreadedPdfAnchorRequest, CreateUserApiKeyData, CreateUserApiKeyError, CreateUserApiKeyErrors, CreateUserApiKeyRequest, CreateUserApiKeyResponse, CreateUserApiKeyResponses, CreateViewHandlerData, CreateViewHandlerError, CreateViewHandlerErrors, CreateViewHandlerResponse, CreateViewHandlerResponses, CreateViewRequest, CreateWebhookData, CreateWebhookError, CreateWebhookErrors, CreateWebhookRequest, CreateWebhookResponse, CreateWebhookResponse2, CreateWebhookResponses, CrmAssociation, CrmCompanyFilters, CrmCompanyResponse, CrmContactResponse, CrmDomainResponse, CrmPermissionRole, CrmStageInput, CrmStageResponse, CrmStagesResponse, CrmTeamSettingsResponse, CustomSpeakerAssignment, Database, DatabaseDetail, DatabaseId, DatabaseOp, DatabaseQueryRequest, DatabaseView, DatabaseWebhookDeliveryResponse, DatabaseWebhookPayloadProblem, DatabaseWebhookResponse, DataType, DateOperator, DateRange, DateRangeOperator, DeclineCallData, DeclineCallError, DeclineCallErrors, DeclineCallResponse, DeclineCallResponses, DeclineRingData, DeclineRingError, DeclineRingErrors, DeclineRingResponse, DeclineRingResponses, DeleteAnchorData, DeleteAnchorError, DeleteAnchorErrors, DeleteAnchorResponse, DeleteAnchorResponses, DeleteCallRecordData, DeleteCallRecordError, DeleteCallRecordErrors, DeleteCallRecordResponse, DeleteCallRecordResponses, DeleteChannelData, DeleteChannelError, DeleteChannelErrors, DeleteChannelLabelData, DeleteChannelLabelError, DeleteChannelLabelErrors, DeleteChannelLabelResponse, DeleteChannelLabelResponses, DeleteChannelResponse, DeleteChannelResponses, DeleteCollabSurfaceData, DeleteCollabSurfaceError, DeleteCollabSurfaceErrors, DeleteCollabSurfaceResponse, DeleteCollabSurfaceResponses, DeleteDatabaseWebhookData, DeleteDatabaseWebhookError, DeleteDatabaseWebhookErrors, DeleteDatabaseWebhookResponse, DeleteDatabaseWebhookResponses, DeleteDocumentData, DeleteDocumentError, DeleteDocumentErrors, DeleteDocumentResponse, DeleteDocumentResponses, DeleteEntityMentionData, DeleteEntityMentionError, DeleteEntityMentionErrors, DeleteEntityMentionResponse, DeleteEntityMentionResponse2, DeleteEntityMentionResponses, DeleteHarnessData, DeleteHarnessError, DeleteHarnessErrors, DeleteHarnessResponse, DeleteHarnessResponses, DeleteHistoryHandlerData, DeleteHistoryHandlerError, DeleteHistoryHandlerErrors, DeleteHistoryHandlerResponse, DeleteHistoryHandlerResponses, DeleteInitiativeData, DeleteInitiativeError, DeleteInitiativeErrors, DeleteInitiativeResponse, DeleteInitiativeResponses, DeleteProjectHandlerData, DeleteProjectHandlerError, DeleteProjectHandlerErrors, DeleteProjectHandlerResponse, DeleteProjectHandlerResponses, DeleteSelfHarnessData, DeleteSelfHarnessError, DeleteSelfHarnessErrors, DeleteSelfHarnessResponse, DeleteSelfHarnessResponses, DeleteUnthreadedAnchorRequest, DeleteUnthreadedAnchorResponse, DeleteUnthreadedPdfAnchorRequest, DeleteUserApiKeyData, DeleteUserApiKeyError, DeleteUserApiKeyErrors, DeleteUserApiKeyResponse, DeleteUserApiKeyResponses, DeleteUserDocumentViewLocationData, DeleteUserDocumentViewLocationError, DeleteUserDocumentViewLocationErrors, DeleteUserDocumentViewLocationResponse, DeleteUserDocumentViewLocationResponses, DeleteViewHandlerData, DeleteViewHandlerError, DeleteViewHandlerErrors, DeleteViewHandlerResponses, DeleteWebhookData, DeleteWebhookError, DeleteWebhookErrors, DeleteWebhookResponse, DeleteWebhookResponses, DeliverDatabaseWebhookData, DeliverDatabaseWebhookError, DeliverDatabaseWebhookErrors, DeliverDatabaseWebhookResponse, DeliverDatabaseWebhookResponses, DirectAccess, DocumentBasic, DocumentContent, DocumentContentLocation, DocumentContentState, DocumentContentUploadedMetadata, DocumentCopiedMetadata, DocumentCreatedMetadata, DocumentDeletedMetadata, DocumentFilters, DocumentId, DocumentInteractionMetadata, DocumentMetadata, DocumentMetadataWithContent, DocumentPermissionsToken, DocumentPermissionsTokenRequest, DocumentPermissionsTokenResponse, DocumentPreview, DocumentPreviewData, DocumentPreviewDataSubType, DocumentPurgedMetadata, DocumentResponse, DocumentResponseMetadata, DocumentResponseMetadataWithContent, DocumentStorageServiceApiVersion, DocumentSubType, DocumentSyncContentUpdatedMetadata, DocumentSyncEditor, DocumentTeamShareResponse, DocumentTextContent, DocumentTopicEvent, DocumentUpdatedMetadata, EditAnchorData, EditAnchorError, EditAnchorErrors, EditAnchorRequest, EditAnchorResponse, EditAnchorResponse2, EditAnchorResponses, EditCallRecordData, EditCallRecordError, EditCallRecordErrors, EditCallRecordRequest, EditCallRecordResponse, EditCallRecordResponses, EditCallTranscriptData, EditCallTranscriptError, EditCallTranscriptErrors, EditCallTranscriptRequest, EditCallTranscriptResponse, EditCallTranscriptResponses, EditDocumentData, EditDocumentError, EditDocumentErrors, EditDocumentResponse, EditDocumentResponse2, EditDocumentResponses, EditDocumentServiceArgs, EditMyFormResponseData, EditMyFormResponseError, EditMyFormResponseErrors, EditMyFormResponseResponse, EditMyFormResponseResponses, EditPdfAnchorRequest, EditPdfPlaceableCommentAnchorRequest, EditProjectV2Data, EditProjectV2Error, EditProjectV2Errors, EditProjectV2Response, EditProjectV2Responses, EditThreadV2Data, EditThreadV2Error, EditThreadV2Errors, EditThreadV2Response, EditThreadV2Responses, EmailFilters, EmailFollowup, EmailFollowupCommand, EmailFollowupResponse, EmailReminderCondition, EmailReminderPage, EmailReminderSummary, EmptyResponse, EnsureCollabSurfaceData, EnsureCollabSurfaceError, EnsureCollabSurfaceErrors, EnsureCollabSurfaceRequest, EnsureCollabSurfaceResponse, EnsureCollabSurfaceResponses, EnsureStarterHandlerData, EnsureStarterHandlerErrors, EnsureStarterHandlerResponse, EnsureStarterHandlerResponses, EntityFilters, EntityKind, EntityMessageCreateData, EntityMessageCreateResponse, EntityMessageCreateResponses, EntityMessageDeleteMessageData, EntityMessageDeleteMessageResponse, EntityMessageDeleteMessageResponses, EntityMessageDeleteThreadData, EntityMessageDeleteThreadResponse, EntityMessageDeleteThreadResponses, EntityMessageEditData, EntityMessageEditResponse, EntityMessageEditResponses, EntityMessageGetMessageData, EntityMessageGetMessageResponse, EntityMessageGetMessageResponses, EntityMessageGetThreadData, EntityMessageGetThreadResponse, EntityMessageGetThreadResponses, EntityMessageLegacyData, EntityMessageLegacyResponse, EntityMessageLegacyResponses, EntityMessagePatchThreadData, EntityMessagePatchThreadResponse, EntityMessagePatchThreadResponses, EntityMessageReactData, EntityMessageReactResponse, EntityMessageReactResponses, EntityMessageTypingData, EntityMessageTypingResponse, EntityMessageTypingResponses, EntityPermission, EntityPermissionResponse, EntityRef, EntityReference, EntityType, ErrorResponse, EventIcsData, EventIcsErrors, EventIcsResponse, EventIcsResponses, EventReminderOverride, EventReminders, EventStatus, EventTime, EventTransparency, EventType, EventVisibility, ExcludedDefaultView, ExcludeDefaultViewHandlerData, ExcludeDefaultViewHandlerError, ExcludeDefaultViewHandlerErrors, ExcludeDefaultViewHandlerResponses, ExcludeDefaultViewRequest, ExportDocumentData, ExportDocumentError, ExportDocumentErrors, ExportDocumentResponse, ExportDocumentResponse2, ExportDocumentResponses, ExternalChatAdd, ExternalChatAddData, ExternalChatAdded, ExternalChatAddResponse, ExternalChatAddResponses, ExternalChatAttachment, ExternalChatAttachmentState, ExternalChatBackfill, ExternalChatBackfillState, ExternalChatCall, ExternalChatCallOutcome, ExternalChatCapabilities, ExternalChatCommunity, ExternalChatContactCard, ExternalChatContacts, ExternalChatData, ExternalChatDeliveryData, ExternalChatDeliveryResponse, ExternalChatDeliveryResponses, ExternalChatDeliveryState, ExternalChatDetail, ExternalChatEvent, ExternalChatKind, ExternalChatLocation, ExternalChatMediaKind, ExternalChatMediaPresentation, ExternalChatMembers, ExternalChatMention, ExternalChatMessage, ExternalChatMessageAttachments, ExternalChatMessageAttachmentsData, ExternalChatMessageAttachmentsResponse, ExternalChatMessageAttachmentsResponses, ExternalChatMessageData, ExternalChatMessageKind, ExternalChatMessageResponse, ExternalChatMessageResponses, ExternalChatMessages, ExternalChatMessagesData, ExternalChatMessagesResponse, ExternalChatMessagesResponses, ExternalChatMutation, ExternalChatParticipant, ExternalChatPermissionsData, ExternalChatPermissionsResponse, ExternalChatPermissionsResponses, ExternalChatPersonRef, ExternalChatPoll, ExternalChatPollOption, ExternalChatProvider, ExternalChatReaction, ExternalChatReadData, ExternalChatReadResponse, ExternalChatReadResponses, ExternalChatReference, ExternalChatRemoveData, ExternalChatRemoveResponse, ExternalChatRemoveResponses, ExternalChatReplyBlock, ExternalChatReplyContent, ExternalChatResponse, ExternalChatResponses, ExternalChatRichContent, ExternalChatsData, ExternalChatSendData, ExternalChatSender, ExternalChatSendErrors, ExternalChatSendProgress, ExternalChatSendReply, ExternalChatSendResponse, ExternalChatSendResponses, ExternalChatSendsData, ExternalChatSendsResponse, ExternalChatSendsResponses, ExternalChatsResponse, ExternalChatsResponses, ExternalChatSummary, ExternalChatSystemAction, ExternalChatSystemLine, ExternalChatUpdatePermissionsData, ExternalChatUpdatePermissionsResponse, ExternalChatUpdatePermissionsResponses, ExternalChatUploadData, ExternalChatUploadedAttachment, ExternalChatUploadRequest, ExternalChatUploadResponse, ExternalChatUploadResponses, Favorite, FavoriteEntityRef, FavoritesList, FileChangeKindDto, FileSystemNodeWithIds, FileType, FileTypeUpdate, FilterCondition, FilterGroup, FilterNode, FilterTest, FinalizeSlackImportData, FinalizeSlackImportErrors, FinalizeSlackImportResponse, FinalizeSlackImportResponses, FolderItem, FollowupState, ForeignEntity, ForeignEntityFilters, Form, FormAccess, FormCollaboration, FormDetail, FormErrorCode, FormErrorResponse, FormLayout, FormPublicationProblem, FormQuestionDetail, FormResponse, FormSection, FormSectionDetail, FormSource, FormStatus, FormTally, Formula, GenericErrorResponse, GenericResponse, GenericSuccessResponse, GetActiveCallsData, GetActiveCallsError, GetActiveCallsErrors, GetActiveCallsResponse, GetActiveCallsResponses, GetActivityData, GetActivityError, GetActivityErrors, GetActivityResponse, GetActivityResponses, GetAttachmentReferencesData, GetAttachmentReferencesError, GetAttachmentReferencesErrors, GetAttachmentReferencesResponse, GetAttachmentReferencesResponse2, GetAttachmentReferencesResponses, GetBatchCallRecordPreviewData, GetBatchCallRecordPreviewError, GetBatchCallRecordPreviewErrors, GetBatchCallRecordPreviewRequest, GetBatchCallRecordPreviewResponse, GetBatchCallRecordPreviewResponse2, GetBatchCallRecordPreviewResponses, GetBatchChannelPreviewData, GetBatchChannelPreviewError, GetBatchChannelPreviewErrors, GetBatchChannelPreviewRequest, GetBatchChannelPreviewResponse, GetBatchChannelPreviewResponse2, GetBatchChannelPreviewResponses, GetBatchPreviewHandlerData, GetBatchPreviewHandlerError, GetBatchPreviewHandlerErrors, GetBatchPreviewHandlerResponse, GetBatchPreviewHandlerResponses, GetBatchPreviewRequest, GetBatchPreviewResponse, GetBatchProjectPreviewData, GetBatchProjectPreviewError, GetBatchProjectPreviewErrors, GetBatchProjectPreviewRequest, GetBatchProjectPreviewResponse, GetBatchProjectPreviewResponse2, GetBatchProjectPreviewResponses, GetBotOwnerProfilesData, GetBotOwnerProfilesError, GetBotOwnerProfilesErrors, GetBotOwnerProfilesResponse, GetBotOwnerProfilesResponses, GetCallRecordData, GetCallRecordError, GetCallRecordErrors, GetCallRecordResponse, GetCallRecordResponses, GetChannelAttachmentsData, GetChannelAttachmentsError, GetChannelAttachmentsErrors, GetChannelAttachmentsResponse, GetChannelAttachmentsResponses, GetChannelData, GetChannelError, GetChannelErrors, GetChannelJoinLinkData, GetChannelJoinLinkError, GetChannelJoinLinkErrors, GetChannelJoinLinkResponse, GetChannelJoinLinkResponses, GetChannelParticipantsData, GetChannelParticipantsError, GetChannelParticipantsErrors, GetChannelParticipantsResponse, GetChannelParticipantsResponses, GetChannelResponse, GetChannelResponses, GetChannelsData, GetChannelsError, GetChannelsErrors, GetChannelsResponse, GetChannelsResponses, GetCollabSurfaceData, GetCollabSurfaceError, GetCollabSurfaceErrors, GetCollabSurfaceResponse, GetCollabSurfaceResponses, GetCompanyData, GetCompanyError, GetCompanyErrors, GetCompanyResponse, GetCompanyResponses, GetContactByEmailData, GetContactByEmailError, GetContactByEmailErrors, GetContactByEmailResponse, GetContactByEmailResponse2, GetContactByEmailResponses, GetContactData, GetContactError, GetContactErrors, GetContactResponse, GetContactResponses, GetCrmPipelineData, GetCrmPipelinePermissionsData, GetCrmPipelinePermissionsResponse, GetCrmPipelinePermissionsResponses, GetCrmPipelineResponse, GetCrmPipelineResponses, GetCrmPipelineRowsData, GetCrmPipelineRowsResponse, GetCrmPipelineRowsResponses, GetCrmPipelineTableData, GetCrmPipelineTableResponse, GetCrmPipelineTableResponses, GetCrmTeamSettingsData, GetCrmTeamSettingsError, GetCrmTeamSettingsErrors, GetCrmTeamSettingsResponse, GetCrmTeamSettingsResponses, GetDatabaseData, GetDatabaseError, GetDatabaseErrors, GetDatabasePermissionsData, GetDatabasePermissionsError, GetDatabasePermissionsErrors, GetDatabasePermissionsResponse, GetDatabasePermissionsResponses, GetDatabaseQueryData, GetDatabaseQueryError, GetDatabaseQueryErrors, GetDatabaseQueryResponse, GetDatabaseQueryResponses, GetDatabaseResponse, GetDatabaseResponses, GetDatabaseRowHistoryData, GetDatabaseRowHistoryError, GetDatabaseRowHistoryErrors, GetDatabaseRowHistoryResponse, GetDatabaseRowHistoryResponses, GetDatabaseTableChangesData, GetDatabaseTableChangesError, GetDatabaseTableChangesErrors, GetDatabaseTableChangesResponse, GetDatabaseTableChangesResponses, GetDatabaseViewPositionsData, GetDatabaseViewPositionsError, GetDatabaseViewPositionsErrors, GetDatabaseViewPositionsResponse, GetDatabaseViewPositionsResponses, GetDocumentAnchorsData, GetDocumentAnchorsError, GetDocumentAnchorsErrors, GetDocumentAnchorsResponse, GetDocumentAnchorsResponses, GetDocumentBranchNameData, GetDocumentBranchNameError, GetDocumentBranchNameErrors, GetDocumentBranchNameResponse, GetDocumentBranchNameResponses, GetDocumentByTeamSlugData, GetDocumentByTeamSlugError, GetDocumentByTeamSlugErrors, GetDocumentByTeamSlugResponse, GetDocumentByTeamSlugResponses, GetDocumentData, GetDocumentError, GetDocumentErrors, GetDocumentGithubPullRequestsData, GetDocumentGithubPullRequestsError, GetDocumentGithubPullRequestsErrors, GetDocumentGithubPullRequestsResponse, GetDocumentGithubPullRequestsResponses, GetDocumentKeyResponse, GetDocumentKeyResponseData, GetDocumentListHandlerData, GetDocumentListHandlerError, GetDocumentListHandlerErrors, GetDocumentListHandlerResponse, GetDocumentListHandlerResponses, GetDocumentListResult, GetDocumentLocationV3Data, GetDocumentLocationV3Error, GetDocumentLocationV3Errors, GetDocumentLocationV3Response, GetDocumentLocationV3Responses, GetDocumentPermissionsResponseDataV2, GetDocumentPermissionsTokenData, GetDocumentPermissionsTokenError, GetDocumentPermissionsTokenErrors, GetDocumentPermissionsTokenResponse, GetDocumentPermissionsTokenResponses, GetDocumentPermissionsV2Data, GetDocumentPermissionsV2Error, GetDocumentPermissionsV2Errors, GetDocumentPermissionsV2Response, GetDocumentPermissionsV2Responses, GetDocumentProcessingResult, GetDocumentProcessingResultData, GetDocumentProcessingResultError, GetDocumentProcessingResultErrors, GetDocumentProcessingResultResponse, GetDocumentProcessingResultResponse2, GetDocumentProcessingResultResponses, GetDocumentResponse, GetDocumentResponse2, GetDocumentResponseData, GetDocumentResponses, GetDocumentSearchResponse, GetDocumentShortIdData, GetDocumentShortIdError, GetDocumentShortIdErrors, GetDocumentShortIdResponse, GetDocumentShortIdResponses, GetDocumentsResponse, GetDocumentTeamShareData, GetDocumentTeamShareError, GetDocumentTeamShareErrors, GetDocumentTeamShareResponse, GetDocumentTeamShareResponses, GetDocumentTextContentData, GetDocumentTextContentErrors, GetDocumentTextContentResponse, GetDocumentTextContentResponses, GetDocumentUserAccessLevelResponse, GetDocumentVersionData, GetDocumentVersionError, GetDocumentVersionErrors, GetDocumentVersionResponse, GetDocumentVersionResponses, GetDocumentViewsHandlerData, GetDocumentViewsHandlerError, GetDocumentViewsHandlerErrors, GetDocumentViewsHandlerResponse, GetDocumentViewsHandlerResponses, GetEmailFollowupData, GetEmailFollowupError, GetEmailFollowupErrors, GetEmailFollowupResponse, GetEmailFollowupResponses, GetEntityPermissionData, GetEntityPermissionErrors, GetEntityPermissionResponse, GetEntityPermissionResponses, GetForeignEntityBySourceData, GetForeignEntityBySourceError, GetForeignEntityBySourceErrors, GetForeignEntityBySourceResponse, GetForeignEntityBySourceResponses, GetForeignEntityData, GetForeignEntityError, GetForeignEntityErrors, GetForeignEntityResponse, GetForeignEntityResponses, GetFormData, GetFormError, GetFormErrors, GetFormPermissionsData, GetFormPermissionsError, GetFormPermissionsErrors, GetFormPermissionsResponse, GetFormPermissionsResponses, GetFormResponse, GetFormResponses, GetFormResponseSummaryData, GetFormResponseSummaryError, GetFormResponseSummaryErrors, GetFormResponseSummaryResponse, GetFormResponseSummaryResponses, GetFormTallyData, GetFormTallyError, GetFormTallyErrors, GetFormTallyResponse, GetFormTallyResponses, GetGithubPullRequestChangesData, GetGithubPullRequestChangesError, GetGithubPullRequestChangesErrors, GetGithubPullRequestChangesPatchData, GetGithubPullRequestChangesPatchError, GetGithubPullRequestChangesPatchErrors, GetGithubPullRequestChangesPatchResponse, GetGithubPullRequestChangesPatchResponses, GetGithubPullRequestChangesResponse, GetGithubPullRequestChangesResponses, GetGithubPullRequestData, GetGithubPullRequestError, GetGithubPullRequestErrors, GetGithubPullRequestFacetsData, GetGithubPullRequestFacetsError, GetGithubPullRequestFacetsErrors, GetGithubPullRequestFacetsResponse, GetGithubPullRequestFacetsResponses, GetGithubPullRequestResponse, GetGithubPullRequestResponses, GetGithubPullRequestTasksData, GetGithubPullRequestTasksError, GetGithubPullRequestTasksErrors, GetGithubPullRequestTasksResponse, GetGithubPullRequestTasksResponses, GetHarnessPairingData, GetHarnessPairingError, GetHarnessPairingErrors, GetHarnessPairingResponse, GetHarnessPairingResponses, GetHistoryHandlerData, GetHistoryHandlerError, GetHistoryHandlerErrors, GetHistoryHandlerResponse, GetHistoryHandlerResponses, GetInitiativeData, GetInitiativeError, GetInitiativeErrors, GetInitiativeResponse, GetInitiativeResponses, GetInstructionsDocumentResponse, GetInstructionsHandlerData, GetInstructionsHandlerError, GetInstructionsHandlerErrors, GetInstructionsHandlerResponse, GetInstructionsHandlerResponses, GetItemsSoupData, GetItemsSoupError, GetItemsSoupErrors, GetItemsSoupResponse, GetItemsSoupResponses, GetLocationHandlerData, GetLocationHandlerError, GetLocationHandlerErrors, GetLocationHandlerResponse, GetLocationHandlerResponses, GetMyFormResponseData, GetMyFormResponseError, GetMyFormResponseErrors, GetMyFormResponseResponse, GetMyFormResponseResponses, GetOrCreateAction, GetOrCreateCallData, GetOrCreateCallError, GetOrCreateCallErrors, GetOrCreateCallResponse, GetOrCreateCallResponses, GetOrCreateChannelResponse, GetOrCreateDmData, GetOrCreateDmError, GetOrCreateDmErrors, GetOrCreateDmRequest, GetOrCreateDmResponse, GetOrCreateDmResponses, GetOrCreatePrivateData, GetOrCreatePrivateError, GetOrCreatePrivateErrors, GetOrCreatePrivateRequest, GetOrCreatePrivateResponse, GetOrCreatePrivateResponses, GetPendingProjectsHandlerData, GetPendingProjectsHandlerError, GetPendingProjectsHandlerErrors, GetPendingProjectsHandlerResponse, GetPendingProjectsHandlerResponses, GetPinsHandlerData, GetPinsHandlerError, GetPinsHandlerErrors, GetPinsHandlerResponse, GetPinsHandlerResponses, GetPinsResponse, GetProjectContentHandlerData, GetProjectContentHandlerError, GetProjectContentHandlerErrors, GetProjectContentHandlerResponse, GetProjectContentHandlerResponses, GetProjectContentResponse, GetProjectHandlerData, GetProjectHandlerError, GetProjectHandlerErrors, GetProjectHandlerResponse, GetProjectHandlerResponses, GetProjectPermissionsV2Data, GetProjectPermissionsV2Error, GetProjectPermissionsV2Errors, GetProjectPermissionsV2Response, GetProjectPermissionsV2Responses, GetProjectResponse, GetProjectResponseData, GetProjectsHandlerData, GetProjectsHandlerError, GetProjectsHandlerErrors, GetProjectsHandlerResponse, GetProjectsHandlerResponses, GetProjectsResponse, GetProjectUserAccessLevelData, GetProjectUserAccessLevelError, GetProjectUserAccessLevelErrors, GetProjectUserAccessLevelResponse, GetProjectUserAccessLevelResponses, GetRingStatusData, GetRingStatusError, GetRingStatusErrors, GetRingStatusResponse, GetRingStatusResponses, GetSelfBotData, GetSelfBotError, GetSelfBotErrors, GetSelfBotResponse, GetSelfBotResponses, GetSelfHarnessData, GetSelfHarnessError, GetSelfHarnessErrors, GetSelfHarnessResponse, GetSelfHarnessResponses, GetSlackImportData, GetSlackImportErrors, GetSlackImportResponse, GetSlackImportResponses, GetSystemSkillsHandlerData, GetSystemSkillsHandlerError, GetSystemSkillsHandlerErrors, GetSystemSkillsHandlerResponse, GetSystemSkillsHandlerResponses, GetUserDocumentsHandlerData, GetUserDocumentsHandlerError, GetUserDocumentsHandlerErrors, GetUserDocumentsHandlerResponse, GetUserDocumentsHandlerResponses, GetUserDocumentViewLocationData, GetUserDocumentViewLocationError, GetUserDocumentViewLocationErrors, GetUserDocumentViewLocationResponse, GetUserDocumentViewLocationResponses, GetUserHistoryResponse, GetViewsHandlerData, GetViewsHandlerError, GetViewsHandlerErrors, GetViewsHandlerResponse, GetViewsHandlerResponses, GetWebhookData, GetWebhookError, GetWebhookErrors, GetWebhookResponse, GetWebhookResponses, GithubLabelFacet, GithubPullRequest, GithubPullRequestChangesPatchResponse, GithubPullRequestChangesResponse, GithubPullRequestCheckRun, GithubPullRequestComment, GithubPullRequestFacets, GithubPullRequestLabel, GithubPullRequestReview, GithubPullRequestReviewDecision, GithubPullRequestReviewState, GithubPullRequestsResponse, GithubPullRequestTasks, GithubPullRequestTasksRequest, GithubPullRequestTasksResponse, GithubPullRequestUser, GithubRepositoryFacet, GithubUserFacet, GitRefDto, GroupedInitialParams, GroupedPageParams, GroupedSoupGroupPage, GroupedSoupInitialPage, GroupedSoupPage, GroupedSoupSort, GuestCallChatPostData, GuestCallChatPostErrors, GuestCallChatPostResponse, GuestCallChatPostResponses, GuestCallChatReadData, GuestCallChatReadErrors, GuestCallChatReadResponse, GuestCallChatReadResponses, GuestChatMessage, GuestChatPage, GuestChatPost, GuestId, GuestJoinRequest, GuestPolicy, HandlerData, HandlerError, HandlerErrors, HandlerResponse, HandlerResponses, Harness, HarnessAgent, HarnessId, HarnessOwner, HarnessSession, HashMap, HealthHandlerData, HealthHandlerResponse, HealthHandlerResponses, HighlightType, ImportCounters, ImportDatabaseTableData, ImportDatabaseTableError, ImportDatabaseTableErrors, ImportDatabaseTableResponse, ImportDatabaseTableResponses, ImportedAuthor, ImportError, ImportLimits, ImportPage, ImportProgress, ImportTable, ImportWarning, InferColumnTypeOutcome, InferColumnTypeRequest, InferDatabaseColumnTypeData, InferDatabaseColumnTypeError, InferDatabaseColumnTypeErrors, InferDatabaseColumnTypeResponse, InferDatabaseColumnTypeResponses, InFlightTurnSummary, IngestTranscriptData, IngestTranscriptError, IngestTranscriptErrors, IngestTranscriptResponses, InitializeUserDocumentsData, InitializeUserDocumentsError, InitializeUserDocumentsErrors, InitializeUserDocumentsResponse, InitializeUserDocumentsResponses, InitialPropertyValue, InitiativeDetail, InitiativeFilters, InitiativeId, InitiativeList, InitiativeSummary, InputReceivedMetadata, InstallSyncData, InstallSyncErrors, InteractionReason, InvalidDatabaseWebhookPayloadResponse, InviteMeetingRequest, InviteMeetingUsersRequest, Item, ItemWithUserAccessLevel, JobId, JobProcessingResultHandlerData, JobProcessingResultHandlerError, JobProcessingResultHandlerErrors, JobProcessingResultHandlerResponse, JobProcessingResultHandlerResponses, JobStatus, JoinChannelByCodeData, JoinChannelByCodeError, JoinChannelByCodeErrors, JoinChannelByCodeResponses, JoinChannelData, JoinChannelError, JoinChannelErrors, JoinChannelResponses, KeySegment, Lane, LaneKey, LatestMessage, LayoutProblem, LeaveCallResponse, LeaveChannelData, LeaveChannelError, LeaveChannelErrors, LeaveChannelResponses, LeaveOrEndCallData, LeaveOrEndCallError, LeaveOrEndCallErrors, LeaveOrEndCallResponse, LeaveOrEndCallResponses, LinkShare, ListAccessibleFormsData, ListAccessibleFormsError, ListAccessibleFormsErrors, ListAccessibleFormsResponse, ListAccessibleFormsResponses, ListAgentsData, ListAgentsError, ListAgentsErrors, ListAgentsResponse, ListAgentsResponses, ListBotChannelsData, ListBotChannelsError, ListBotChannelsErrors, ListBotChannelsResponse, ListBotChannelsResponses, ListChannelLabelsData, ListChannelLabelsError, ListChannelLabelsErrors, ListChannelLabelsResponse, ListChannelLabelsResponses, ListCompanyContactsData, ListCompanyContactsError, ListCompanyContactsErrors, ListCompanyContactsResponse, ListCompanyContactsResponses, ListCrmPipelinesData, ListCrmPipelinesResponse, ListCrmPipelinesResponses, ListDatabaseColumnCastsData, ListDatabaseColumnCastsError, ListDatabaseColumnCastsErrors, ListDatabaseColumnCastsResponse, ListDatabaseColumnCastsResponses, ListDatabasesData, ListDatabasesError, ListDatabasesErrors, ListDatabasesResponse, ListDatabasesResponses, ListDatabaseWebhooksData, ListDatabaseWebhooksError, ListDatabaseWebhooksErrors, ListDatabaseWebhooksResponse, ListDatabaseWebhooksResponse2, ListDatabaseWebhooksResponses, ListedDatabase, ListedForm, ListEmailRemindersData, ListEmailRemindersError, ListEmailRemindersErrors, ListEmailRemindersResponse, ListEmailRemindersResponses, ListFavoritesData, ListFavoritesError, ListFavoritesErrors, ListFavoritesResponse, ListFavoritesResponses, ListFormsData, ListFormsError, ListFormsErrors, ListFormsResponse, ListFormsResponses, ListHarnessAgentsData, ListHarnessAgentsError, ListHarnessAgentsErrors, ListHarnessAgentsResponse, ListHarnessAgentsResponses, ListHarnessesData, ListHarnessesError, ListHarnessesErrors, ListHarnessesResponse, ListHarnessesResponses, ListHarnessSessionsData, ListHarnessSessionsError, ListHarnessSessionsErrors, ListHarnessSessionsResponse, ListHarnessSessionsResponses, ListInitiativesData, ListInitiativesError, ListInitiativesErrors, ListInitiativesResponse, ListInitiativesResponses, ListJoinRequestsData, ListJoinRequestsError, ListJoinRequestsErrors, ListJoinRequestsResponse, ListJoinRequestsResponses, ListOccurrencesData, ListOccurrencesErrors, ListOccurrencesResponse, ListOccurrencesResponses, ListSlackImportsData, ListSlackImportsResponse, ListSlackImportsResponses, ListTeamCalendarData, ListTeamCalendarResponse, ListTeamCalendarResponses, ListTeamOutOfOfficeData, ListTeamOutOfOfficeErrors, ListTeamOutOfOfficeResponse, ListTeamOutOfOfficeResponses, ListUserApiKeysData, ListUserApiKeysError, ListUserApiKeysErrors, ListUserApiKeysResponse, ListUserApiKeysResponses, ListWebhooksData, ListWebhooksError, ListWebhooksErrors, ListWebhooksResponse, ListWebhooksResponse2, ListWebhooksResponses, LocationResponseData, LocationResponseV3, MacroUserIdStr, MarkRead, Meeting, MeetingCancelData, MeetingCancelError, MeetingCancelErrors, MeetingCancelPreparationData, MeetingCancelPreparationError, MeetingCancelPreparationErrors, MeetingCancelPreparationResponse, MeetingCancelPreparationResponses, MeetingCancelResponse, MeetingCancelResponses, MeetingCreateData, MeetingCreateError, MeetingCreateErrors, MeetingCreateResponse, MeetingCreateResponses, MeetingGuestJoinData, MeetingGuestJoinError, MeetingGuestJoinErrors, MeetingGuestJoinResponse, MeetingGuestJoinResponses, MeetingGuestParticipantsData, MeetingGuestParticipantsError, MeetingGuestParticipantsErrors, MeetingGuestParticipantsResponse, MeetingGuestParticipantsResponses, MeetingInviteData, MeetingInviteError, MeetingInviteErrors, MeetingInvitePermissions, MeetingInvitePermissionsData, MeetingInvitePermissionsError, MeetingInvitePermissionsErrors, MeetingInvitePermissionsResponse, MeetingInvitePermissionsResponses, MeetingInviteResponse, MeetingInviteResponses, MeetingInviteUsersData, MeetingInviteUsersError, MeetingInviteUsersErrors, MeetingInviteUsersResponse, MeetingInviteUsersResponses, MeetingJoinData, MeetingJoinError, MeetingJoinErrors, MeetingJoinResponse, MeetingJoinResponses, MeetingLeaveData, MeetingLeaveError, MeetingLeaveErrors, MeetingLeaveResponse, MeetingLeaveResponses, MeetingListActiveData, MeetingListActiveError, MeetingListActiveErrors, MeetingListActiveResponse, MeetingListActiveResponses, MeetingListData, MeetingListError, MeetingListErrors, MeetingListResponse, MeetingListResponses, MeetingLookupData, MeetingLookupError, MeetingLookupErrors, MeetingLookupResponse, MeetingLookupResponses, MeetingParticipant, MeetingParticipants, MeetingParticipantsData, MeetingParticipantsError, MeetingParticipantsErrors, MeetingParticipantsResponse, MeetingParticipantsResponses, MeetingPreparation, MeetingPrepareData, MeetingPrepareError, MeetingPrepareErrors, MeetingPrepareResponse, MeetingPrepareResponses, MeetingShareData, MeetingShareError, MeetingShareErrors, MeetingShareResponse, MeetingShareResponses, MeetingsResponse, MeetingToken, MeetingUpdateData, MeetingUpdateError, MeetingUpdateErrors, MeetingUpdateResponse, MeetingUpdateResponses, MentionPreviewsData, MentionPreviewsErrors, MentionPreviewsResponse, MentionPreviewsResponses, Message, MessageAttachment, MessageAttachmentCreatedMetadata, MessageAttachmentRemovedMetadata, MessageChange, MessageCursor, MessageDeletedMetadata, MessageDirection, MessageEvent, MessageEventAttachment, MessageListItem, MessageMentionedMetadata, MessagePage, MessageParent, MessagePatch, MessagePatchedMetadata, MessagePostedMetadata, MessageThread, MessageThreadPreview, MessageTimelineData, MessageTimelineEntriesData, MessageTimelineEntriesResponse, MessageTimelineEntriesResponses, MessageTimelineEntry, MessageTimelinePage, MessageTimelineQuery, MessageTimelineResponse, MessageTimelineResponses, MessageTopicEvent, MyResponse, NewAttachment, NewColumn, NewOption, NewThreadAnchor, NewView, NotificationFilters, NotificationState, NumberOperator, OpBatch, Operator, OpRefusalResponse, OpResult, OptionId, OptionRef, PairingDetails, Params, ParticipantRole, PatchBotRequest, PatchChannelData, PatchChannelError, PatchChannelErrors, PatchChannelRequest, PatchChannelResponse, PatchChannelResponses, PatchMessageNotificationPolicy, PatchProjectRequestV2, PatchThreadRequestV2, PatchViewHandlerData, PatchViewHandlerError, PatchViewHandlerErrors, PatchViewHandlerResponses, PatchWebhookData, PatchWebhookError, PatchWebhookErrors, PatchWebhookRequest, PatchWebhookResponse, PatchWebhookResponses, PdfAnchor, PdfAnchorId, PdfHighlightAnchor, PdfHighlightAnchorRequest, PdfHighlightRect, PdfHighlightRectAnchorRequest, PdfPlaceableCommentAnchor, PendingClaimResponse, PermanentlyDeleteDocumentData, PermanentlyDeleteDocumentError, PermanentlyDeleteDocumentErrors, PermanentlyDeleteDocumentResponse, PermanentlyDeleteDocumentResponses, PermanentlyDeleteProjectData, PermanentlyDeleteProjectError, PermanentlyDeleteProjectErrors, PermanentlyDeleteProjectResponse, PermanentlyDeleteProjectResponses, PinnedItem, PinRequest, Pipeline, PipelineRecordType, PipelineSharing, PostActivityData, PostActivityError, PostActivityErrors, PostActivityRequest, PostActivityResponse, PostActivityResponses, PostChannelBotWebhookData, PostChannelBotWebhookError, PostChannelBotWebhookErrors, PostChannelBotWebhookResponse, PostChannelBotWebhookResponses, PostGroupedSoupAstGroupPageRequest, PostGroupedSoupAstInitialRequest, PostGroupedSoupAstRequest, PostItemsSoupAstData, PostItemsSoupAstError, PostItemsSoupAstErrors, PostItemsSoupAstGroupedData, PostItemsSoupAstGroupedError, PostItemsSoupAstGroupedErrors, PostItemsSoupAstGroupedResponse, PostItemsSoupAstGroupedResponses, PostItemsSoupAstResponse, PostItemsSoupAstResponses, PostItemsSoupData, PostItemsSoupError, PostItemsSoupErrors, PostItemsSoupResponse, PostItemsSoupResponses, PostMessage, PostMessageNotificationPolicy, PostSoupAstRequest, PostSoupRequest, PresaveDocumentHandlerData, PresaveDocumentHandlerError, PresaveDocumentHandlerErrors, PresaveDocumentHandlerResponse, PresaveDocumentHandlerResponses, PreSaveDocumentRequest, PreSaveDocumentResponse, PreSaveDocumentResponseData, PresenceOperator, PresignedUrl, PreviewSmartTagData, PreviewSmartTagError, PreviewSmartTagErrors, PreviewSmartTagResponse, PreviewSmartTagResponses, Project, ProjectDeleteResponseData, ProjectDocumentStatus, ProjectFilters, ProjectPreview, ProjectPreviewData, PropertyDefinition, PropertyDefinitionWithOptions, PropertyFilter, PropertyInput, PropertyOption, PropertyOptionValue, PropertyOwner, PropertyValue, PutCrmTeamSettingsData, PutCrmTeamSettingsError, PutCrmTeamSettingsErrors, PutCrmTeamSettingsResponse, PutCrmTeamSettingsResponses, PutCrmTeamStagesData, PutCrmTeamStagesError, PutCrmTeamStagesErrors, PutCrmTeamStagesResponse, PutCrmTeamStagesResponses, PutFormLayoutData, PutFormLayoutError, PutFormLayoutErrors, PutFormLayoutResponse, PutFormLayoutResponses, QueryCrmPipelineRowsData, QueryCrmPipelineRowsResponse, QueryCrmPipelineRowsResponses, QueryDatabasesData, QueryDatabasesError, QueryDatabasesErrors, QueryDatabasesResponse, QueryDatabasesResponses, QueryDefinition, QuestionLayout, QuestionOption, QuestionTally, ReactionInput, RecentlyDeletedData, RecentlyDeletedError, RecentlyDeletedErrors, RecentlyDeletedResponse, RecentlyDeletedResponseData, RecentlyDeletedResponses, RegisterSlackImportUploadsData, RegisterSlackImportUploadsErrors, RegisterSlackImportUploadsResponse, RegisterSlackImportUploadsResponses, RegisterUploads, RemoveBotFromChannelByBotData, RemoveBotFromChannelByBotError, RemoveBotFromChannelByBotErrors, RemoveBotFromChannelByBotResponse, RemoveBotFromChannelByBotResponses, RemoveFavoriteByEntityData, RemoveFavoriteByEntityError, RemoveFavoriteByEntityErrors, RemoveFavoriteByEntityResponses, RemoveParticipantsData, RemoveParticipantsError, RemoveParticipantsErrors, RemoveParticipantsRequest, RemoveParticipantsResponses, RemovePinHandlerData, RemovePinHandlerError, RemovePinHandlerErrors, RemovePinHandlerResponse, RemovePinHandlerResponses, RenameChannelLabelData, RenameChannelLabelError, RenameChannelLabelErrors, RenameChannelLabelRequest, RenameChannelLabelResponse, RenameChannelLabelResponses, RenameCrmPipelineData, RenameCrmPipelineResponse, RenameCrmPipelineResponses, RenamePipeline, ReorderFavoritesData, ReorderFavoritesError, ReorderFavoritesErrors, ReorderFavoritesRequest, ReorderFavoritesResponses, ReorderPinRequest, ReorderPinsHandlerData, ReorderPinsHandlerError, ReorderPinsHandlerErrors, ReorderPinsHandlerResponse, ReorderPinsHandlerResponses, ReplaceCrmStagesRequest, RequestAccess, RequestedHarnessScope, RequestedLayout, RequestStatus, RequestToJoinData, RequestToJoinError, RequestToJoinErrors, RequestToJoinResponse, RequestToJoinResponses, ResetCrmTeamStagesData, ResetCrmTeamStagesError, ResetCrmTeamStagesErrors, ResetCrmTeamStagesResponse, ResetCrmTeamStagesResponses, ResolveRequest, ResponseStatus, ResponseSummary, ResultColumn, ResultSet, RevertDeleteDocumentData, RevertDeleteDocumentError, RevertDeleteDocumentErrors, RevertDeleteDocumentResponse, RevertDeleteDocumentResponses, RevertDeleteProjectData, RevertDeleteProjectError, RevertDeleteProjectErrors, RevertDeleteProjectResponse, RevertDeleteProjectResponses, RingStatus, RingStatusResponse, RowChange, RowChangeKind, RowChanges, RowHistoryEntry, RowHistoryResponse, RowId, RowsChange, RowsResult, S3ObjectInfo, SaveBomPart, SaveDatabaseQueryData, SaveDatabaseQueryError, SaveDatabaseQueryErrors, SaveDatabaseQueryResponse, SaveDatabaseQueryResponses, SaveDocumentHandlerData, SaveDocumentHandlerError, SaveDocumentHandlerErrors, SaveDocumentHandlerResponse, SaveDocumentHandlerResponses, SaveDocumentRequest, SaveDocumentResponse, SaveDocumentResponseData, SavedQuery, SaveQueryRequest, SearchContactsData, SearchContactsError, SearchContactsErrors, SearchContactsResponse, SearchContactsResponse2, SearchContactsResponses, SearchState, SectionCount, SessionDeletedMetadata, SessionIdentity, SessionMentionedMetadata, SessionOpenedMetadata, SessionRenamedMetadata, SessionSettledMetadata, SessionSource, SessionStoppedMetadata, SetChannelLabelData, SetChannelLabelError, SetChannelLabelErrors, SetChannelLabelRequest, SetChannelLabelResponse, SetChannelLabelResponses, SetChannelPictureData, SetChannelPictureError, SetChannelPictureErrors, SetChannelPictureRequest, SetChannelPictureResponse, SetChannelPictureResponses, SetCompanyHiddenData, SetCompanyHiddenError, SetCompanyHiddenErrors, SetCompanyHiddenRequest, SetCompanyHiddenResponse, SetCompanyHiddenResponses, SetCompanyNameRequest, SetContactHiddenData, SetContactHiddenError, SetContactHiddenErrors, SetContactHiddenRequest, SetContactHiddenResponse, SetContactHiddenResponses, SetContactNameRequest, SetCrmCompanyNameData, SetCrmCompanyNameError, SetCrmCompanyNameErrors, SetCrmCompanyNameResponse, SetCrmCompanyNameResponses, SetCrmContactNameData, SetCrmContactNameError, SetCrmContactNameErrors, SetCrmContactNameResponse, SetCrmContactNameResponses, SetDirectAccess, SetDocumentTeamShareData, SetDocumentTeamShareError, SetDocumentTeamShareErrors, SetDocumentTeamShareRequest, SetDocumentTeamShareResponse, SetDocumentTeamShareResponses, SetEmailFollowupData, SetEmailFollowupError, SetEmailFollowupErrors, SetEmailFollowupResponse, SetEmailFollowupResponses, SetEmailSyncData, SetEmailSyncError, SetEmailSyncErrors, SetEmailSyncRequest, SetEmailSyncResponse, SetEmailSyncResponses, SetOperator, SetPropertyValue, Sha256Digest, ShareCrmPipelineData, ShareCrmPipelineResponse, ShareCrmPipelineResponses, ShareDatabaseAwarenessData, ShareDatabaseAwarenessError, ShareDatabaseAwarenessErrors, ShareDatabaseAwarenessResponse, ShareDatabaseAwarenessResponses, SharedEmailFilter, SharedExternalChatReference, ShareEntity, ShareEntityType, SharePermissionV2, SharePipeline, ShortIdResponse, SimpleMention, SimpleSaveData, SimpleSaveError, SimpleSaveErrors, SimpleSaveResponse, SimpleSaveResponses, SkippedCell, SlackCompleteRequest, SlackCreateRequest, SlackRegisterRequest, SlackTimestamp, SlackUserId, SmartTagChannelMatch, SmartTagPreview, SortDirection, SortKey, SoupAgentSessionSoupPropertiesField, SoupApiItem, SoupApiSort, SoupApiSortDirection, SoupAttachment, SoupCalendarEventSoupPropertiesField, SoupCalendarEventTime, SoupCallRecordGuest, SoupCallRecordParticipant, SoupCallRecordSoupPropertiesField, SoupChannel, SoupChannelThread, SoupChatSoupPropertiesField, SoupContact, SoupCountedReaction, SoupCrmCompanySoupPropertiesField, SoupCrmContactSoupPropertiesField, SoupCrmDomain, SoupDatabaseRowSoupPropertiesField, SoupDocumentSoupPropertiesField, SoupDocumentSubType, SoupEmailThreadPreview, SoupEnrichedEmailThreadPreviewSoupPropertiesField, SoupForeignEntity, SoupInitiativeSoupPropertiesField, SoupItem, SoupLabel, SoupLabelListVisibility, SoupLabelType, SoupMessageAttachment, SoupMessageListVisibility, SoupMessageSender, SoupMessageSenderType, SoupPage, SoupProjectSoupPropertiesField, SoupPropertiesField, SoupProperty, SoupThreadInfo, SoupThreadReply, SourceBinding, SourceId, SourceIdentity, SqlCell, SqlEntityKind, SqlOutcome, SqlOutcomeKind, SqlSelectOption, SqlStatement, StarterDatabase, StarterDocumentsResponse, StorageRow, StorageRows, StorageRowsQuery, StoredGithubPullRequest, StreamEventsData, StreamEventsError, StreamEventsErrors, StreamEventsResponse, StreamEventsResponses, String, Submission, SubmissionOutcome, SubmitFormResponseData, SubmitFormResponseError, SubmitFormResponseErrors, SubmitFormResponseResponse, SubmitFormResponseResponses, SuccessResponse, SurfaceState, SyncServiceVersionId, SystemSkillSummary, Table, TableChange, TableChanged, TableChanges, TableDetail, TableId, TableResult, TableVersion, TagFilterMode, TakenId, TallyBucket, TallyValue, TaskFilters, TaskSimilarityResult, TaskSimilaritySearchHandlerData, TaskSimilaritySearchHandlerError, TaskSimilaritySearchHandlerErrors, TaskSimilaritySearchHandlerResponse, TaskSimilaritySearchHandlerResponses, TaskSimilaritySearchRequest, TaskSimilaritySearchResponse, TeamCalendarContent, TeamCalendarCoverage, TeamCalendarDetails, TeamCalendarItem, TeamCalendarMember, TeamCalendarPage, TeamCalendarSharing, TeamOutOfOfficeItem, TeamOutOfOfficeResponse, TeamRole, TextOperator, ThreadAnchor, ThreadOrigin, ThreadPatch, ThreadState, TimelineActivity, ToggleShareWithTeamData, ToggleShareWithTeamError, ToggleShareWithTeamErrors, ToggleShareWithTeamResponse, ToggleShareWithTeamResponses, TouchedColumn, TouchedRow, TranscribeDictationData, TranscribeDictationError, TranscribeDictationErrors, TranscribeDictationResponse, TranscribeDictationResponses, TranscribeResponse, TranscriptSegmentRequest, TrashCrmPipelineData, TrashCrmPipelineResponse, TrashCrmPipelineResponses, TrashPipeline, TurnEndedMetadata, TurnStartedMetadata, TurnSummary, TypedSuccessResponse, TypedSuccessResponseGetDocumentResponseData, TypingInput, UndoChangeResponse, UndoDatabaseChangeData, UndoDatabaseChangeError, UndoDatabaseChangeErrors, UndoDatabaseChangeResponse, UndoDatabaseChangeResponses, UndoOutcome, UndoRefusal, UnlockedBooking, UpdateAgentData, UpdateAgentError, UpdateAgentErrors, UpdateAgentRequest, UpdateAgentResponse, UpdateAgentResponses, UpdateChannelSharePermission, UpdateCrmPipelinePermissionsData, UpdateCrmPipelinePermissionsResponse, UpdateCrmPipelinePermissionsResponses, UpdateCrmTeamSettingsRequest, UpdateDatabasePermissionsData, UpdateDatabasePermissionsError, UpdateDatabasePermissionsErrors, UpdateDatabasePermissionsResponse, UpdateDatabasePermissionsResponses, UpdateForm, UpdateFormData, UpdateFormError, UpdateFormErrors, UpdateFormPermissionsData, UpdateFormPermissionsError, UpdateFormPermissionsErrors, UpdateFormPermissionsResponse, UpdateFormPermissionsResponses, UpdateFormResponse, UpdateFormResponses, UpdateInitiativeData, UpdateInitiativeError, UpdateInitiativeErrors, UpdateInitiativeRequest, UpdateInitiativeResponse, UpdateInitiativeResponses, UpdateMeetingRequest, UpdateOperation, UpdateSharePermissionRequestV2, UploadDescriptor, UploadDocumentStatus, UploadExtractFolderHandlerData, UploadExtractFolderHandlerError, UploadExtractFolderHandlerErrors, UploadExtractFolderHandlerResponse, UploadExtractFolderHandlerResponses, UploadExtractFolderRequest, UploadFolderHandlerData, UploadFolderHandlerError, UploadFolderHandlerErrors, UploadFolderHandlerResponse, UploadFolderHandlerResponses, UploadFolderRequest, UploadGrant, UploadId, UpsertHistoryHandlerData, UpsertHistoryHandlerError, UpsertHistoryHandlerErrors, UpsertHistoryHandlerResponse, UpsertHistoryHandlerResponses, UpsertUserDocumentViewLocationData, UpsertUserDocumentViewLocationError, UpsertUserDocumentViewLocationErrors, UpsertUserDocumentViewLocationRequest, UpsertUserDocumentViewLocationResponse, UpsertUserDocumentViewLocationResponses, UserApiKeyId, UserApiKeyInfo, UserApiKeysList, UserDocumentsResponse, UserDocumentViewLocation, UserDocumentViewLocationResponse, UserPinsResponse, UserViewsResponse, ValidateDocumentPermissionsTokenData, ValidateDocumentPermissionsTokenError, ValidateDocumentPermissionsTokenErrors, ValidateDocumentPermissionsTokenResponse, ValidateDocumentPermissionsTokenResponses, ValidateWebhookData, ValidateWebhookError, ValidateWebhookErrors, ValidateWebhookResponse, ValidateWebhookResponse2, ValidateWebhookResponses, Vec, VersionedTable, View, ViewChange, ViewColumn, ViewerCapabilities, ViewLayout, ViewPatch, ViewPosition, ViewPositionsResponse, ViewQuery, ViewResult, ViewsResponse, WaitingForInputMetadata, Webhook, WebhookEvent, WebhookFilter, WebhookScope, WebhookStatus, WebhookValidationTestEvent, WhatsAppAccount, WhatsappAccountData, WhatsappAccountResponse, WhatsappAccountResponses, WhatsAppAccountState, WhatsAppAccountView, WhatsappCancelPairingData, WhatsappCancelPairingResponse, WhatsappCancelPairingResponses, WhatsAppCannotAdd, WhatsAppChat, WhatsAppChats, WhatsappChatsData, WhatsappChatsResponse, WhatsappChatsResponses, WhatsAppConnect, WhatsappConnectData, WhatsappConnectResponse, WhatsappConnectResponses, WhatsAppDisconnect, WhatsappDisconnectData, WhatsAppDisconnectRequest, WhatsappDisconnectResponse, WhatsappDisconnectResponses, WhatsAppHistoryImport, WhatsappImportHistoryData, WhatsappImportHistoryResponse, WhatsappImportHistoryResponses, WhatsAppLookup, WhatsappLookupData, WhatsAppLookupRequest, WhatsappLookupResponse, WhatsappLookupResponses, WhatsAppLookupState, WhatsAppPairing, WhatsappPairingData, WhatsappPairingResponse, WhatsappPairingResponses, WhatsAppPairingState, WhatsAppPairState, WhatsappPasskeyData, WhatsappPasskeyResponse, WhatsappPasskeyResponses, WhatsappStartLookupData, WhatsappStartLookupResponse, WhatsappStartLookupResponses, Widget, WithCallId, WithChannelId, WithDocumentId, WithProjectId } from './types.gen';+export type { AccessiblePipeline, AccessLevel, AccessRequest, AccessRequestsCancelData, AccessRequestsCancelErrors, AccessRequestsCancelResponses, AccessRequestsDirectData, AccessRequestsDirectErrors, AccessRequestsDirectResponse, AccessRequestsDirectResponses, AccessRequestsRemoveDirectData, AccessRequestsRemoveDirectErrors, AccessRequestsRemoveDirectResponses, AccessRequestsResolveData, AccessRequestsResolveErrors, AccessRequestsResolveResponse, AccessRequestsResolveResponses, AccessRequestsSetDirectData, AccessRequestsSetDirectErrors, AccessRequestsSetDirectResponses, AccessRequestsStateData, AccessRequestsStateErrors, AccessRequestsStateResponse, AccessRequestsStateResponses, AccessRequestsSubmitData, AccessRequestsSubmitErrors, AccessRequestsSubmitResponse, AccessRequestsSubmitResponses, AccessRequestState, ActiveCallsResponse, ActiveCallSummary, ActiveMeeting, ActiveMeetingsResponse, ActivityType, AddFavoriteData, AddFavoriteError, AddFavoriteErrors, AddFavoriteRequest, AddFavoriteResponse, AddFavoriteResponses, AddParticipantsData, AddParticipantsError, AddParticipantsErrors, AddParticipantsRequest, AddParticipantsResponses, AddPinHandlerData, AddPinHandlerError, AddPinHandlerErrors, AddPinHandlerResponse, AddPinHandlerResponses, AddPinRequest, Agent, AgentActionId, AgentChannelScope, AgentDmProfile, AgentMcpServer, AgentMcpServers, AgentPullRequestState, AgentSessionFilters, AgentSessionLifecycleEvent, AgentSessionSource, AgentSessionVisibility, AgentTyping, AgentTypingPhase, Anchor, AnchorId, AnchorResponse, AnnotationIncrementalUpdate, Answer, ApiActivity, ApiAttachmentChannelReference, ApiAttachmentCommentReference, ApiAttachmentEntityReference, ApiAttachmentGenericReference, ApiChannelAttachment, ApiChannelAttachmentsPage, ApiChannelDetail, ApiChannelListMessage, ApiChannelListPage, ApiChannelListParticipant, ApiChannelListType, ApiChannelParticipant, ApiChannelWithLatest, ApiEntityFilterAst, ApiGroupByField, ApiGroupMeta, ApiParticipantListRole, ApiParticipantRole, ApiPropertyEntityType, AppliedOps, ApplyCrmPipelineOpsData, ApplyCrmPipelineOpsResponse, ApplyCrmPipelineOpsResponses, ApplyDatabaseOpsData, ApplyDatabaseOpsError, ApplyDatabaseOpsErrors, ApplyDatabaseOpsResponse, ApplyDatabaseOpsResponses, ApplyOpsRequest, ApplyOpsResponse, ApproveHarnessPairingData, ApproveHarnessPairingError, ApproveHarnessPairingErrors, ApproveHarnessPairingResponse, ApproveHarnessPairingResponses, ApprovePairingRequest, AttachmentChange, AttendeeResponseStatus, Audience, Awareness, AwarenessRelay, BasicDocument, BasicDocumentSubType, BomPart, BookingTarget, Bot, BotChannel, BotChannelType, BotId, BotKind, BotOwner, BotOwnerProfile, BotSenderProfile, BotToken, BranchNameResponse, BTreeMap, BulkWakeupRequest, BulkWakeupResponse, BulkWakeupSyncServiceDocumentsData, BulkWakeupSyncServiceDocumentsErrors, BulkWakeupSyncServiceDocumentsResponse, BulkWakeupSyncServiceDocumentsResponses, CalendarAttendee, CalendarEvent, CalendarEventFilters, CalendarEventSourceContent, CalendarJoinRequest, CalendarJoinRequestApiError, CalendarJoinRequestErrorCode, CalendarJoinRequestsResponse, CalendarJoinRequestStatus, CalendarMentionEvent, CalendarMentionPreviewItem, CalendarMentionPreviewKind, CalendarMentionPreviewRequest, CalendarMentionPreviewRequestItem, CalendarMentionPreviewResponse, CalendarMentionViewerCopy, CalendarOccurrence, CalendarOccurrenceItem, CalendarOccurrenceResponse, CalendarSyncStatus, CallActiveResponse, CallFilters, CallProvider, CallRecord, CallRecordGuest, CallRecordParticipant, CallRecordPreview, CallRecordPreviewData, CallRecordSource, CallRecordTranscriptSegment, CallStatus, CallTokenResponse, CallWebhookData, CallWebhookError, CallWebhookErrors, CallWebhookResponses, CancelSlackImportData, CancelSlackImportErrors, CancelSlackImportResponse, CancelSlackImportResponses, CardPosition, CastVerdict, CellValue, CellWrite, ChangedFileDto, ChangesetDto, ChangesetSourceDto, Channel, ChannelCreatedMetadata, ChannelDeletedMetadata, ChannelFilters, ChannelJoinCodeResponse, ChannelLabel, ChannelLabelRule, ChannelLabelsList, ChannelMessage, ChannelParticipant, ChannelParticipantAddedMetadata, ChannelParticipantRemovedMetadata, ChannelPictureChangedMetadata, ChannelPreview, ChannelPreviewData, ChannelSender, ChannelSharePermission, ChannelThreadFilters, ChannelTopicEvent, ChannelType, ChannelUpdatedMetadata, ChannelWebhookRequest, ChannelWebhookResponse, ChannelWithParticipants, Chat, ChatFilters, CheckActiveCallData, CheckActiveCallError, CheckActiveCallErrors, CheckActiveCallResponse, CheckActiveCallResponses, ClaimedPairing, ClaimHarnessPairingData, ClaimHarnessPairingError, ClaimHarnessPairingErrors, ClaimHarnessPairingResponse, ClaimHarnessPairingResponses, ClaimPairingRequest, ClientOptions, CloudStorageItemType, CollaborateFormData, CollaborateFormError, CollaborateFormErrors, CollaborateFormResponse, CollaborateFormResponses, CollabSurfaceResponse, CollabSurfaceTokenResponse, Column, ColumnCast, ColumnChange, ColumnChangeKind, ColumnConfig, ColumnConversion, ColumnConversionRequest, ColumnDetail, ColumnId, ColumnKind, ColumnProtection, ColumnResult, CommandFailure, CommandRejectedMetadata, CommittedChange, CompleteSlackImportUploadsData, CompleteSlackImportUploadsErrors, CompleteSlackImportUploadsResponse, CompleteSlackImportUploadsResponses, CompleteUploads, ConferenceProvider, Conjunction, ConversationId, ConversationKind, ConversationMetadata, ConversationProgress, ConversationSeal, ConversationStatus, ConvertDatabaseColumnData, ConvertDatabaseColumnError, ConvertDatabaseColumnErrors, ConvertDatabaseColumnResponse, ConvertDatabaseColumnResponses, ConvertedCell, CopyDocumentData, CopyDocumentError, CopyDocumentErrors, CopyDocumentQueryParams, CopyDocumentRequest, CopyDocumentResponse, CopyDocumentResponse2, CopyDocumentResponses, CountedReaction, CreateAgentData, CreateAgentError, CreateAgentErrors, CreateAgentRequest, CreateAgentResponse, CreateAgentResponses, CreateAnchorData, CreateAnchorError, CreateAnchorErrors, CreateAnchorResponse, CreateAnchorResponses, CreateBotRequest, CreateBulkDocumentResponse, CreateBulkDocumentResponseData, CreateCanvasDocumentRequest, CreateCanvasDocumentResponse, CreateCanvasHandlerData, CreateCanvasHandlerError, CreateCanvasHandlerErrors, CreateCanvasHandlerResponse, CreateCanvasHandlerResponses, CreateChannelData, CreateChannelError, CreateChannelErrors, CreateChannelLabelData, CreateChannelLabelError, CreateChannelLabelErrors, CreateChannelLabelRequest, CreateChannelLabelResponse, CreateChannelLabelResponses, CreateChannelRequest, CreateChannelResponse, CreateChannelResponse2, CreateChannelResponses, CreateChannelScopedBotData, CreateChannelScopedBotError, CreateChannelScopedBotErrors, CreateChannelScopedBotRequest, CreateChannelScopedBotResponse, CreateChannelScopedBotResponse2, CreateChannelScopedBotResponses, CreateCollabSurfaceTokenData, CreateCollabSurfaceTokenError, CreateCollabSurfaceTokenErrors, CreateCollabSurfaceTokenResponse, CreateCollabSurfaceTokenResponses, CreateCrmCompanyData, CreateCrmCompanyError, CreateCrmCompanyErrors, CreateCrmCompanyRequest, CreateCrmCompanyResponse, CreateCrmCompanyResponses, CreateCrmContactData, CreateCrmContactError, CreateCrmContactErrors, CreateCrmContactRequest, CreateCrmContactResponse, CreateCrmContactResponses, CreateCrmPipelineData, CreateCrmPipelineResponse, CreateCrmPipelineResponses, CreateDatabaseData, CreateDatabaseError, CreateDatabaseErrors, CreateDatabaseRequest, CreateDatabaseResponse, CreateDatabaseResponses, CreateDatabaseWebhookData, CreateDatabaseWebhookError, CreateDatabaseWebhookErrors, CreateDatabaseWebhookRequest, CreateDatabaseWebhookResponse, CreateDatabaseWebhookResponses, CreatedDatabaseWebhookResponse, CreateDocumentData, CreateDocumentError, CreateDocumentErrors, CreateDocumentRequest, CreateDocumentResponse, CreateDocumentResponseData, CreateDocumentResponses, CreatedPairing, CreatedUserApiKey, CreateEntityMentionData, CreateEntityMentionError, CreateEntityMentionErrors, CreateEntityMentionRequest, CreateEntityMentionResponse, CreateEntityMentionResponse2, CreateEntityMentionResponses, CreateForm, CreateFormData, CreateFormError, CreateFormErrors, CreateFormResponse, CreateFormResponses, CreateHarnessPairingData, CreateHarnessPairingError, CreateHarnessPairingErrors, CreateHarnessPairingResponse, CreateHarnessPairingResponses, CreateImport, CreateInitiativeData, CreateInitiativeError, CreateInitiativeErrors, CreateInitiativeRequest, CreateInitiativeResponse, CreateInitiativeResponses, CreateInstructionsDocumentResponse, CreateInstructionsHandlerData, CreateInstructionsHandlerError, CreateInstructionsHandlerErrors, CreateInstructionsHandlerResponse, CreateInstructionsHandlerResponses, CreateMarkdownDocumentRequest, CreateMarkdownDocumentResponse, CreateMarkdownHandlerData, CreateMarkdownHandlerError, CreateMarkdownHandlerErrors, CreateMarkdownHandlerResponse, CreateMarkdownHandlerResponses, CreateMeetingRequest, CreatePairingRequest, CreatePipeline, CreateProjectHandlerData, CreateProjectHandlerError, CreateProjectHandlerErrors, CreateProjectHandlerResponse, CreateProjectHandlerResponses, CreateProjectRequest, CreateProjectResponse, CreateSkillHandlerData, CreateSkillHandlerError, CreateSkillHandlerErrors, CreateSkillHandlerResponse, CreateSkillHandlerResponses, CreateSkillRequest, CreateSkillResponse, CreateSlackImportData, CreateSlackImportErrors, CreateSlackImportResponse, CreateSlackImportResponses, CreateSnippetHandlerData, CreateSnippetHandlerError, CreateSnippetHandlerErrors, CreateSnippetHandlerResponse, CreateSnippetHandlerResponses, CreateSnippetRequest, CreateSnippetResponse, CreateTaskHandlerData, CreateTaskHandlerError, CreateTaskHandlerErrors, CreateTaskHandlerResponse, CreateTaskHandlerResponses, CreateTaskRequest, CreateTaskResponse, CreateToken, CreateUnthreadedAnchorRequest, CreateUnthreadedAnchorResponse, CreateUnthreadedPdfAnchorRequest, CreateUserApiKeyData, CreateUserApiKeyError, CreateUserApiKeyErrors, CreateUserApiKeyRequest, CreateUserApiKeyResponse, CreateUserApiKeyResponses, CreateViewHandlerData, CreateViewHandlerError, CreateViewHandlerErrors, CreateViewHandlerResponse, CreateViewHandlerResponses, CreateViewRequest, CreateWebhookData, CreateWebhookError, CreateWebhookErrors, CreateWebhookRequest, CreateWebhookResponse, CreateWebhookResponse2, CreateWebhookResponses, CrmAssociation, CrmCompanyFilters, CrmCompanyResponse, CrmContactResponse, CrmDomainResponse, CrmPermissionRole, CrmStageInput, CrmStageResponse, CrmStagesResponse, CrmTeamSettingsResponse, CustomSpeakerAssignment, Database, DatabaseDetail, DatabaseId, DatabaseOp, DatabaseQueryRequest, DatabaseView, DatabaseWebhookDeliveryResponse, DatabaseWebhookPayloadProblem, DatabaseWebhookResponse, DataType, DateOperator, DateRange, DateRangeOperator, DeclineCallData, DeclineCallError, DeclineCallErrors, DeclineCallResponse, DeclineCallResponses, DeclineRingData, DeclineRingError, DeclineRingErrors, DeclineRingResponse, DeclineRingResponses, DeleteAnchorData, DeleteAnchorError, DeleteAnchorErrors, DeleteAnchorResponse, DeleteAnchorResponses, DeleteCallRecordData, DeleteCallRecordError, DeleteCallRecordErrors, DeleteCallRecordResponse, DeleteCallRecordResponses, DeleteChannelData, DeleteChannelError, DeleteChannelErrors, DeleteChannelLabelData, DeleteChannelLabelError, DeleteChannelLabelErrors, DeleteChannelLabelResponse, DeleteChannelLabelResponses, DeleteChannelResponse, DeleteChannelResponses, DeleteCollabSurfaceData, DeleteCollabSurfaceError, DeleteCollabSurfaceErrors, DeleteCollabSurfaceResponse, DeleteCollabSurfaceResponses, DeleteDatabaseWebhookData, DeleteDatabaseWebhookError, DeleteDatabaseWebhookErrors, DeleteDatabaseWebhookResponse, DeleteDatabaseWebhookResponses, DeleteDocumentData, DeleteDocumentError, DeleteDocumentErrors, DeleteDocumentResponse, DeleteDocumentResponses, DeleteEntityMentionData, DeleteEntityMentionError, DeleteEntityMentionErrors, DeleteEntityMentionResponse, DeleteEntityMentionResponse2, DeleteEntityMentionResponses, DeleteHarnessData, DeleteHarnessError, DeleteHarnessErrors, DeleteHarnessResponse, DeleteHarnessResponses, DeleteHistoryHandlerData, DeleteHistoryHandlerError, DeleteHistoryHandlerErrors, DeleteHistoryHandlerResponse, DeleteHistoryHandlerResponses, DeleteInitiativeData, DeleteInitiativeError, DeleteInitiativeErrors, DeleteInitiativeResponse, DeleteInitiativeResponses, DeleteProjectHandlerData, DeleteProjectHandlerError, DeleteProjectHandlerErrors, DeleteProjectHandlerResponse, DeleteProjectHandlerResponses, DeleteSelfHarnessData, DeleteSelfHarnessError, DeleteSelfHarnessErrors, DeleteSelfHarnessResponse, DeleteSelfHarnessResponses, DeleteUnthreadedAnchorRequest, DeleteUnthreadedAnchorResponse, DeleteUnthreadedPdfAnchorRequest, DeleteUserApiKeyData, DeleteUserApiKeyError, DeleteUserApiKeyErrors, DeleteUserApiKeyResponse, DeleteUserApiKeyResponses, DeleteUserDocumentViewLocationData, DeleteUserDocumentViewLocationError, DeleteUserDocumentViewLocationErrors, DeleteUserDocumentViewLocationResponse, DeleteUserDocumentViewLocationResponses, DeleteViewHandlerData, DeleteViewHandlerError, DeleteViewHandlerErrors, DeleteViewHandlerResponses, DeleteWebhookData, DeleteWebhookError, DeleteWebhookErrors, DeleteWebhookResponse, DeleteWebhookResponses, DeliverDatabaseWebhookData, DeliverDatabaseWebhookError, DeliverDatabaseWebhookErrors, DeliverDatabaseWebhookResponse, DeliverDatabaseWebhookResponses, DirectAccess, DocumentBasic, DocumentContent, DocumentContentLocation, DocumentContentState, DocumentContentUploadedMetadata, DocumentCopiedMetadata, DocumentCreatedMetadata, DocumentDeletedMetadata, DocumentFilters, DocumentId, DocumentInteractionMetadata, DocumentMetadata, DocumentMetadataWithContent, DocumentPermissionsToken, DocumentPermissionsTokenRequest, DocumentPermissionsTokenResponse, DocumentPreview, DocumentPreviewData, DocumentPreviewDataSubType, DocumentPurgedMetadata, DocumentResponse, DocumentResponseMetadata, DocumentResponseMetadataWithContent, DocumentStorageServiceApiVersion, DocumentSubType, DocumentSyncContentUpdatedMetadata, DocumentSyncEditor, DocumentTeamShareResponse, DocumentTextContent, DocumentTopicEvent, DocumentUpdatedMetadata, EditAnchorData, EditAnchorError, EditAnchorErrors, EditAnchorRequest, EditAnchorResponse, EditAnchorResponse2, EditAnchorResponses, EditCallRecordData, EditCallRecordError, EditCallRecordErrors, EditCallRecordRequest, EditCallRecordResponse, EditCallRecordResponses, EditCallTranscriptData, EditCallTranscriptError, EditCallTranscriptErrors, EditCallTranscriptRequest, EditCallTranscriptResponse, EditCallTranscriptResponses, EditDocumentData, EditDocumentError, EditDocumentErrors, EditDocumentResponse, EditDocumentResponse2, EditDocumentResponses, EditDocumentServiceArgs, EditMyFormResponseData, EditMyFormResponseError, EditMyFormResponseErrors, EditMyFormResponseResponse, EditMyFormResponseResponses, EditPdfAnchorRequest, EditPdfPlaceableCommentAnchorRequest, EditProjectV2Data, EditProjectV2Error, EditProjectV2Errors, EditProjectV2Response, EditProjectV2Responses, EditThreadV2Data, EditThreadV2Error, EditThreadV2Errors, EditThreadV2Response, EditThreadV2Responses, EmailFilters, EmailFollowup, EmailFollowupCommand, EmailFollowupResponse, EmailReminderCondition, EmailReminderPage, EmailReminderSummary, EmptyResponse, EnsureCollabSurfaceData, EnsureCollabSurfaceError, EnsureCollabSurfaceErrors, EnsureCollabSurfaceRequest, EnsureCollabSurfaceResponse, EnsureCollabSurfaceResponses, EnsureStarterHandlerData, EnsureStarterHandlerErrors, EnsureStarterHandlerResponse, EnsureStarterHandlerResponses, EntityFilters, EntityKind, EntityMessageCreateData, EntityMessageCreateResponse, EntityMessageCreateResponses, EntityMessageDeleteMessageData, EntityMessageDeleteMessageResponse, EntityMessageDeleteMessageResponses, EntityMessageDeleteThreadData, EntityMessageDeleteThreadResponse, EntityMessageDeleteThreadResponses, EntityMessageEditData, EntityMessageEditResponse, EntityMessageEditResponses, EntityMessageGetMessageData, EntityMessageGetMessageResponse, EntityMessageGetMessageResponses, EntityMessageGetThreadData, EntityMessageGetThreadResponse, EntityMessageGetThreadResponses, EntityMessageLegacyData, EntityMessageLegacyResponse, EntityMessageLegacyResponses, EntityMessagePatchThreadData, EntityMessagePatchThreadResponse, EntityMessagePatchThreadResponses, EntityMessageReactData, EntityMessageReactResponse, EntityMessageReactResponses, EntityMessageTypingData, EntityMessageTypingResponse, EntityMessageTypingResponses, EntityPermission, EntityPermissionResponse, EntityRef, EntityReference, EntityType, ErrorResponse, EventIcsData, EventIcsErrors, EventIcsResponse, EventIcsResponses, EventReminderOverride, EventReminders, EventStatus, EventTime, EventTransparency, EventType, EventVisibility, ExcludedDefaultView, ExcludeDefaultViewHandlerData, ExcludeDefaultViewHandlerError, ExcludeDefaultViewHandlerErrors, ExcludeDefaultViewHandlerResponses, ExcludeDefaultViewRequest, ExportDocumentData, ExportDocumentError, ExportDocumentErrors, ExportDocumentResponse, ExportDocumentResponse2, ExportDocumentResponses, ExternalChatAdd, ExternalChatAddData, ExternalChatAdded, ExternalChatAddResponse, ExternalChatAddResponses, ExternalChatAttachment, ExternalChatAttachmentState, ExternalChatBackfill, ExternalChatBackfillState, ExternalChatCall, ExternalChatCallOutcome, ExternalChatCapabilities, ExternalChatCommunity, ExternalChatContactCard, ExternalChatContacts, ExternalChatData, ExternalChatDeliveryData, ExternalChatDeliveryResponse, ExternalChatDeliveryResponses, ExternalChatDeliveryState, ExternalChatDetail, ExternalChatEvent, ExternalChatKind, ExternalChatLocation, ExternalChatMediaKind, ExternalChatMediaPresentation, ExternalChatMembers, ExternalChatMention, ExternalChatMessage, ExternalChatMessageAttachments, ExternalChatMessageAttachmentsData, ExternalChatMessageAttachmentsResponse, ExternalChatMessageAttachmentsResponses, ExternalChatMessageData, ExternalChatMessageKind, ExternalChatMessageResponse, ExternalChatMessageResponses, ExternalChatMessages, ExternalChatMessagesData, ExternalChatMessagesResponse, ExternalChatMessagesResponses, ExternalChatMutation, ExternalChatParticipant, ExternalChatPermissionsData, ExternalChatPermissionsResponse, ExternalChatPermissionsResponses, ExternalChatPersonRef, ExternalChatPoll, ExternalChatPollOption, ExternalChatProvider, ExternalChatReaction, ExternalChatReadData, ExternalChatReadResponse, ExternalChatReadResponses, ExternalChatReference, ExternalChatRemoveData, ExternalChatRemoveResponse, ExternalChatRemoveResponses, ExternalChatReplyBlock, ExternalChatReplyContent, ExternalChatResponse, ExternalChatResponses, ExternalChatRichContent, ExternalChatsData, ExternalChatSendData, ExternalChatSender, ExternalChatSendErrors, ExternalChatSendProgress, ExternalChatSendReply, ExternalChatSendResponse, ExternalChatSendResponses, ExternalChatSendsData, ExternalChatSendsResponse, ExternalChatSendsResponses, ExternalChatsResponse, ExternalChatsResponses, ExternalChatSummary, ExternalChatSystemAction, ExternalChatSystemLine, ExternalChatUpdatePermissionsData, ExternalChatUpdatePermissionsResponse, ExternalChatUpdatePermissionsResponses, ExternalChatUploadData, ExternalChatUploadedAttachment, ExternalChatUploadRequest, ExternalChatUploadResponse, ExternalChatUploadResponses, Favorite, FavoriteEntityRef, FavoritesList, FileChangeKindDto, FileSystemNodeWithIds, FileType, FileTypeUpdate, FilterCondition, FilterGroup, FilterNode, FilterTest, FinalizeSlackImportData, FinalizeSlackImportErrors, FinalizeSlackImportResponse, FinalizeSlackImportResponses, FolderItem, FollowupState, ForeignEntity, ForeignEntityFilters, Form, FormAccess, FormCollaboration, FormDetail, FormErrorCode, FormErrorResponse, FormLayout, FormPublicationProblem, FormQuestionDetail, FormResponse, FormSection, FormSectionDetail, FormSource, FormStatus, FormTally, Formula, GenericErrorResponse, GenericResponse, GenericSuccessResponse, GetActiveCallsData, GetActiveCallsError, GetActiveCallsErrors, GetActiveCallsResponse, GetActiveCallsResponses, GetActivityData, GetActivityError, GetActivityErrors, GetActivityResponse, GetActivityResponses, GetAttachmentReferencesData, GetAttachmentReferencesError, GetAttachmentReferencesErrors, GetAttachmentReferencesResponse, GetAttachmentReferencesResponse2, GetAttachmentReferencesResponses, GetBatchCallRecordPreviewData, GetBatchCallRecordPreviewError, GetBatchCallRecordPreviewErrors, GetBatchCallRecordPreviewRequest, GetBatchCallRecordPreviewResponse, GetBatchCallRecordPreviewResponse2, GetBatchCallRecordPreviewResponses, GetBatchChannelPreviewData, GetBatchChannelPreviewError, GetBatchChannelPreviewErrors, GetBatchChannelPreviewRequest, GetBatchChannelPreviewResponse, GetBatchChannelPreviewResponse2, GetBatchChannelPreviewResponses, GetBatchPreviewHandlerData, GetBatchPreviewHandlerError, GetBatchPreviewHandlerErrors, GetBatchPreviewHandlerResponse, GetBatchPreviewHandlerResponses, GetBatchPreviewRequest, GetBatchPreviewResponse, GetBatchProjectPreviewData, GetBatchProjectPreviewError, GetBatchProjectPreviewErrors, GetBatchProjectPreviewRequest, GetBatchProjectPreviewResponse, GetBatchProjectPreviewResponse2, GetBatchProjectPreviewResponses, GetBotOwnerProfilesData, GetBotOwnerProfilesError, GetBotOwnerProfilesErrors, GetBotOwnerProfilesResponse, GetBotOwnerProfilesResponses, GetCallRecordData, GetCallRecordError, GetCallRecordErrors, GetCallRecordResponse, GetCallRecordResponses, GetChannelAttachmentsData, GetChannelAttachmentsError, GetChannelAttachmentsErrors, GetChannelAttachmentsResponse, GetChannelAttachmentsResponses, GetChannelData, GetChannelError, GetChannelErrors, GetChannelJoinLinkData, GetChannelJoinLinkError, GetChannelJoinLinkErrors, GetChannelJoinLinkResponse, GetChannelJoinLinkResponses, GetChannelParticipantsData, GetChannelParticipantsError, GetChannelParticipantsErrors, GetChannelParticipantsResponse, GetChannelParticipantsResponses, GetChannelResponse, GetChannelResponses, GetChannelsData, GetChannelsError, GetChannelsErrors, GetChannelsResponse, GetChannelsResponses, GetCollabSurfaceData, GetCollabSurfaceError, GetCollabSurfaceErrors, GetCollabSurfaceResponse, GetCollabSurfaceResponses, GetCompanyData, GetCompanyError, GetCompanyErrors, GetCompanyResponse, GetCompanyResponses, GetContactByEmailData, GetContactByEmailError, GetContactByEmailErrors, GetContactByEmailResponse, GetContactByEmailResponse2, GetContactByEmailResponses, GetContactData, GetContactError, GetContactErrors, GetContactResponse, GetContactResponses, GetCrmPipelineData, GetCrmPipelinePermissionsData, GetCrmPipelinePermissionsResponse, GetCrmPipelinePermissionsResponses, GetCrmPipelineResponse, GetCrmPipelineResponses, GetCrmPipelineRowsData, GetCrmPipelineRowsResponse, GetCrmPipelineRowsResponses, GetCrmPipelineTableData, GetCrmPipelineTableResponse, GetCrmPipelineTableResponses, GetCrmTeamSettingsData, GetCrmTeamSettingsError, GetCrmTeamSettingsErrors, GetCrmTeamSettingsResponse, GetCrmTeamSettingsResponses, GetDatabaseData, GetDatabaseError, GetDatabaseErrors, GetDatabasePermissionsData, GetDatabasePermissionsError, GetDatabasePermissionsErrors, GetDatabasePermissionsResponse, GetDatabasePermissionsResponses, GetDatabaseQueryData, GetDatabaseQueryError, GetDatabaseQueryErrors, GetDatabaseQueryResponse, GetDatabaseQueryResponses, GetDatabaseResponse, GetDatabaseResponses, GetDatabaseRowHistoryData, GetDatabaseRowHistoryError, GetDatabaseRowHistoryErrors, GetDatabaseRowHistoryResponse, GetDatabaseRowHistoryResponses, GetDatabaseTableChangesData, GetDatabaseTableChangesError, GetDatabaseTableChangesErrors, GetDatabaseTableChangesResponse, GetDatabaseTableChangesResponses, GetDatabaseViewPositionsData, GetDatabaseViewPositionsError, GetDatabaseViewPositionsErrors, GetDatabaseViewPositionsResponse, GetDatabaseViewPositionsResponses, GetDocumentAnchorsData, GetDocumentAnchorsError, GetDocumentAnchorsErrors, GetDocumentAnchorsResponse, GetDocumentAnchorsResponses, GetDocumentBranchNameData, GetDocumentBranchNameError, GetDocumentBranchNameErrors, GetDocumentBranchNameResponse, GetDocumentBranchNameResponses, GetDocumentByTeamSlugData, GetDocumentByTeamSlugError, GetDocumentByTeamSlugErrors, GetDocumentByTeamSlugResponse, GetDocumentByTeamSlugResponses, GetDocumentData, GetDocumentError, GetDocumentErrors, GetDocumentGithubPullRequestsData, GetDocumentGithubPullRequestsError, GetDocumentGithubPullRequestsErrors, GetDocumentGithubPullRequestsResponse, GetDocumentGithubPullRequestsResponses, GetDocumentKeyResponse, GetDocumentKeyResponseData, GetDocumentListHandlerData, GetDocumentListHandlerError, GetDocumentListHandlerErrors, GetDocumentListHandlerResponse, GetDocumentListHandlerResponses, GetDocumentListResult, GetDocumentLocationV3Data, GetDocumentLocationV3Error, GetDocumentLocationV3Errors, GetDocumentLocationV3Response, GetDocumentLocationV3Responses, GetDocumentPermissionsResponseDataV2, GetDocumentPermissionsTokenData, GetDocumentPermissionsTokenError, GetDocumentPermissionsTokenErrors, GetDocumentPermissionsTokenResponse, GetDocumentPermissionsTokenResponses, GetDocumentPermissionsV2Data, GetDocumentPermissionsV2Error, GetDocumentPermissionsV2Errors, GetDocumentPermissionsV2Response, GetDocumentPermissionsV2Responses, GetDocumentProcessingResult, GetDocumentProcessingResultData, GetDocumentProcessingResultError, GetDocumentProcessingResultErrors, GetDocumentProcessingResultResponse, GetDocumentProcessingResultResponse2, GetDocumentProcessingResultResponses, GetDocumentResponse, GetDocumentResponse2, GetDocumentResponseData, GetDocumentResponses, GetDocumentSearchResponse, GetDocumentShortIdData, GetDocumentShortIdError, GetDocumentShortIdErrors, GetDocumentShortIdResponse, GetDocumentShortIdResponses, GetDocumentsResponse, GetDocumentTeamShareData, GetDocumentTeamShareError, GetDocumentTeamShareErrors, GetDocumentTeamShareResponse, GetDocumentTeamShareResponses, GetDocumentTextContentData, GetDocumentTextContentErrors, GetDocumentTextContentResponse, GetDocumentTextContentResponses, GetDocumentUserAccessLevelResponse, GetDocumentVersionData, GetDocumentVersionError, GetDocumentVersionErrors, GetDocumentVersionResponse, GetDocumentVersionResponses, GetDocumentViewsHandlerData, GetDocumentViewsHandlerError, GetDocumentViewsHandlerErrors, GetDocumentViewsHandlerResponse, GetDocumentViewsHandlerResponses, GetEmailFollowupData, GetEmailFollowupError, GetEmailFollowupErrors, GetEmailFollowupResponse, GetEmailFollowupResponses, GetEntityPermissionData, GetEntityPermissionErrors, GetEntityPermissionResponse, GetEntityPermissionResponses, GetForeignEntityBySourceData, GetForeignEntityBySourceError, GetForeignEntityBySourceErrors, GetForeignEntityBySourceResponse, GetForeignEntityBySourceResponses, GetForeignEntityData, GetForeignEntityError, GetForeignEntityErrors, GetForeignEntityResponse, GetForeignEntityResponses, GetFormData, GetFormError, GetFormErrors, GetFormPermissionsData, GetFormPermissionsError, GetFormPermissionsErrors, GetFormPermissionsResponse, GetFormPermissionsResponses, GetFormResponse, GetFormResponses, GetFormResponseSummaryData, GetFormResponseSummaryError, GetFormResponseSummaryErrors, GetFormResponseSummaryResponse, GetFormResponseSummaryResponses, GetFormTallyData, GetFormTallyError, GetFormTallyErrors, GetFormTallyResponse, GetFormTallyResponses, GetGithubPullRequestChangesData, GetGithubPullRequestChangesError, GetGithubPullRequestChangesErrors, GetGithubPullRequestChangesPatchData, GetGithubPullRequestChangesPatchError, GetGithubPullRequestChangesPatchErrors, GetGithubPullRequestChangesPatchResponse, GetGithubPullRequestChangesPatchResponses, GetGithubPullRequestChangesResponse, GetGithubPullRequestChangesResponses, GetGithubPullRequestData, GetGithubPullRequestError, GetGithubPullRequestErrors, GetGithubPullRequestFacetsData, GetGithubPullRequestFacetsError, GetGithubPullRequestFacetsErrors, GetGithubPullRequestFacetsResponse, GetGithubPullRequestFacetsResponses, GetGithubPullRequestResponse, GetGithubPullRequestResponses, GetGithubPullRequestTasksData, GetGithubPullRequestTasksError, GetGithubPullRequestTasksErrors, GetGithubPullRequestTasksResponse, GetGithubPullRequestTasksResponses, GetHarnessPairingData, GetHarnessPairingError, GetHarnessPairingErrors, GetHarnessPairingResponse, GetHarnessPairingResponses, GetHistoryHandlerData, GetHistoryHandlerError, GetHistoryHandlerErrors, GetHistoryHandlerResponse, GetHistoryHandlerResponses, GetInitiativeData, GetInitiativeError, GetInitiativeErrors, GetInitiativeResponse, GetInitiativeResponses, GetInstructionsDocumentResponse, GetInstructionsHandlerData, GetInstructionsHandlerError, GetInstructionsHandlerErrors, GetInstructionsHandlerResponse, GetInstructionsHandlerResponses, GetItemsSoupData, GetItemsSoupError, GetItemsSoupErrors, GetItemsSoupResponse, GetItemsSoupResponses, GetLocationHandlerData, GetLocationHandlerError, GetLocationHandlerErrors, GetLocationHandlerResponse, GetLocationHandlerResponses, GetMyFormResponseData, GetMyFormResponseError, GetMyFormResponseErrors, GetMyFormResponseResponse, GetMyFormResponseResponses, GetOrCreateAction, GetOrCreateCallData, GetOrCreateCallError, GetOrCreateCallErrors, GetOrCreateCallResponse, GetOrCreateCallResponses, GetOrCreateChannelResponse, GetOrCreateDmData, GetOrCreateDmError, GetOrCreateDmErrors, GetOrCreateDmRequest, GetOrCreateDmResponse, GetOrCreateDmResponses, GetOrCreatePrivateData, GetOrCreatePrivateError, GetOrCreatePrivateErrors, GetOrCreatePrivateRequest, GetOrCreatePrivateResponse, GetOrCreatePrivateResponses, GetPendingProjectsHandlerData, GetPendingProjectsHandlerError, GetPendingProjectsHandlerErrors, GetPendingProjectsHandlerResponse, GetPendingProjectsHandlerResponses, GetPinsHandlerData, GetPinsHandlerError, GetPinsHandlerErrors, GetPinsHandlerResponse, GetPinsHandlerResponses, GetPinsResponse, GetProjectContentHandlerData, GetProjectContentHandlerError, GetProjectContentHandlerErrors, GetProjectContentHandlerResponse, GetProjectContentHandlerResponses, GetProjectContentResponse, GetProjectHandlerData, GetProjectHandlerError, GetProjectHandlerErrors, GetProjectHandlerResponse, GetProjectHandlerResponses, GetProjectPermissionsV2Data, GetProjectPermissionsV2Error, GetProjectPermissionsV2Errors, GetProjectPermissionsV2Response, GetProjectPermissionsV2Responses, GetProjectResponse, GetProjectResponseData, GetProjectsHandlerData, GetProjectsHandlerError, GetProjectsHandlerErrors, GetProjectsHandlerResponse, GetProjectsHandlerResponses, GetProjectsResponse, GetProjectUserAccessLevelData, GetProjectUserAccessLevelError, GetProjectUserAccessLevelErrors, GetProjectUserAccessLevelResponse, GetProjectUserAccessLevelResponses, GetRingStatusData, GetRingStatusError, GetRingStatusErrors, GetRingStatusResponse, GetRingStatusResponses, GetSelfBotData, GetSelfBotError, GetSelfBotErrors, GetSelfBotResponse, GetSelfBotResponses, GetSelfHarnessData, GetSelfHarnessError, GetSelfHarnessErrors, GetSelfHarnessResponse, GetSelfHarnessResponses, GetSlackImportData, GetSlackImportErrors, GetSlackImportResponse, GetSlackImportResponses, GetSystemSkillsHandlerData, GetSystemSkillsHandlerError, GetSystemSkillsHandlerErrors, GetSystemSkillsHandlerResponse, GetSystemSkillsHandlerResponses, GetUserDocumentsHandlerData, GetUserDocumentsHandlerError, GetUserDocumentsHandlerErrors, GetUserDocumentsHandlerResponse, GetUserDocumentsHandlerResponses, GetUserDocumentViewLocationData, GetUserDocumentViewLocationError, GetUserDocumentViewLocationErrors, GetUserDocumentViewLocationResponse, GetUserDocumentViewLocationResponses, GetUserHistoryResponse, GetViewsHandlerData, GetViewsHandlerError, GetViewsHandlerErrors, GetViewsHandlerResponse, GetViewsHandlerResponses, GetWebhookData, GetWebhookError, GetWebhookErrors, GetWebhookResponse, GetWebhookResponses, GithubLabelFacet, GithubPullRequest, GithubPullRequestChangesPatchResponse, GithubPullRequestChangesResponse, GithubPullRequestCheckRun, GithubPullRequestComment, GithubPullRequestFacets, GithubPullRequestLabel, GithubPullRequestReview, GithubPullRequestReviewDecision, GithubPullRequestReviewState, GithubPullRequestsResponse, GithubPullRequestTasks, GithubPullRequestTasksRequest, GithubPullRequestTasksResponse, GithubPullRequestUser, GithubRepositoryFacet, GithubUserFacet, GitRefDto, GroupedInitialParams, GroupedPageParams, GroupedSoupGroupPage, GroupedSoupInitialPage, GroupedSoupPage, GroupedSoupSort, GuestCallChatPostData, GuestCallChatPostErrors, GuestCallChatPostResponse, GuestCallChatPostResponses, GuestCallChatReadData, GuestCallChatReadErrors, GuestCallChatReadResponse, GuestCallChatReadResponses, GuestChatMessage, GuestChatPage, GuestChatPost, GuestId, GuestJoinRequest, GuestPolicy, HandlerData, HandlerError, HandlerErrors, HandlerResponse, HandlerResponses, Harness, HarnessAgent, HarnessId, HarnessOwner, HarnessSession, HashMap, HealthHandlerData, HealthHandlerResponse, HealthHandlerResponses, HighlightType, ImportCounters, ImportDatabaseTableData, ImportDatabaseTableError, ImportDatabaseTableErrors, ImportDatabaseTableResponse, ImportDatabaseTableResponses, ImportedAuthor, ImportError, ImportLimits, ImportPage, ImportProgress, ImportTable, ImportWarning, InferColumnTypeOutcome, InferColumnTypeRequest, InferDatabaseColumnTypeData, InferDatabaseColumnTypeError, InferDatabaseColumnTypeErrors, InferDatabaseColumnTypeResponse, InferDatabaseColumnTypeResponses, InFlightTurnSummary, IngestTranscriptData, IngestTranscriptError, IngestTranscriptErrors, IngestTranscriptResponses, InitializeUserDocumentsData, InitializeUserDocumentsError, InitializeUserDocumentsErrors, InitializeUserDocumentsResponse, InitializeUserDocumentsResponses, InitialPropertyValue, InitiativeDetail, InitiativeFilters, InitiativeId, InitiativeList, InitiativeSummary, InputReceivedMetadata, InstallSyncData, InstallSyncErrors, InteractionReason, InvalidDatabaseWebhookPayloadResponse, InviteMeetingRequest, InviteMeetingUsersRequest, Item, ItemWithUserAccessLevel, JobId, JobProcessingResultHandlerData, JobProcessingResultHandlerError, JobProcessingResultHandlerErrors, JobProcessingResultHandlerResponse, JobProcessingResultHandlerResponses, JobStatus, JoinChannelByCodeData, JoinChannelByCodeError, JoinChannelByCodeErrors, JoinChannelByCodeResponses, JoinChannelData, JoinChannelError, JoinChannelErrors, JoinChannelResponses, KeySegment, Lane, LaneKey, LatestMessage, LayoutProblem, LeaveCallResponse, LeaveChannelData, LeaveChannelError, LeaveChannelErrors, LeaveChannelResponses, LeaveOrEndCallData, LeaveOrEndCallError, LeaveOrEndCallErrors, LeaveOrEndCallResponse, LeaveOrEndCallResponses, LinkShare, ListAccessibleFormsData, ListAccessibleFormsError, ListAccessibleFormsErrors, ListAccessibleFormsResponse, ListAccessibleFormsResponses, ListAgentsData, ListAgentsError, ListAgentsErrors, ListAgentsResponse, ListAgentsResponses, ListBotChannelsData, ListBotChannelsError, ListBotChannelsErrors, ListBotChannelsResponse, ListBotChannelsResponses, ListChannelLabelsData, ListChannelLabelsError, ListChannelLabelsErrors, ListChannelLabelsResponse, ListChannelLabelsResponses, ListCompanyContactsData, ListCompanyContactsError, ListCompanyContactsErrors, ListCompanyContactsResponse, ListCompanyContactsResponses, ListCrmPipelinesData, ListCrmPipelinesResponse, ListCrmPipelinesResponses, ListDatabaseColumnCastsData, ListDatabaseColumnCastsError, ListDatabaseColumnCastsErrors, ListDatabaseColumnCastsResponse, ListDatabaseColumnCastsResponses, ListDatabasesData, ListDatabasesError, ListDatabasesErrors, ListDatabasesResponse, ListDatabasesResponses, ListDatabaseWebhooksData, ListDatabaseWebhooksError, ListDatabaseWebhooksErrors, ListDatabaseWebhooksResponse, ListDatabaseWebhooksResponse2, ListDatabaseWebhooksResponses, ListedDatabase, ListedForm, ListEmailRemindersData, ListEmailRemindersError, ListEmailRemindersErrors, ListEmailRemindersResponse, ListEmailRemindersResponses, ListFavoritesData, ListFavoritesError, ListFavoritesErrors, ListFavoritesResponse, ListFavoritesResponses, ListFormsData, ListFormsError, ListFormsErrors, ListFormsResponse, ListFormsResponses, ListHarnessAgentsData, ListHarnessAgentsError, ListHarnessAgentsErrors, ListHarnessAgentsResponse, ListHarnessAgentsResponses, ListHarnessesData, ListHarnessesError, ListHarnessesErrors, ListHarnessesResponse, ListHarnessesResponses, ListHarnessSessionsData, ListHarnessSessionsError, ListHarnessSessionsErrors, ListHarnessSessionsResponse, ListHarnessSessionsResponses, ListInitiativesData, ListInitiativesError, ListInitiativesErrors, ListInitiativesResponse, ListInitiativesResponses, ListJoinRequestsData, ListJoinRequestsError, ListJoinRequestsErrors, ListJoinRequestsResponse, ListJoinRequestsResponses, ListOccurrencesData, ListOccurrencesErrors, ListOccurrencesResponse, ListOccurrencesResponses, ListSlackImportsData, ListSlackImportsResponse, ListSlackImportsResponses, ListTeamCalendarData, ListTeamCalendarResponse, ListTeamCalendarResponses, ListTeamOutOfOfficeData, ListTeamOutOfOfficeErrors, ListTeamOutOfOfficeResponse, ListTeamOutOfOfficeResponses, ListUserApiKeysData, ListUserApiKeysError, ListUserApiKeysErrors, ListUserApiKeysResponse, ListUserApiKeysResponses, ListWebhooksData, ListWebhooksError, ListWebhooksErrors, ListWebhooksResponse, ListWebhooksResponse2, ListWebhooksResponses, LocationResponseData, LocationResponseV3, MacroUserIdStr, MarkRead, Meeting, MeetingCancelData, MeetingCancelError, MeetingCancelErrors, MeetingCancelPreparationData, MeetingCancelPreparationError, MeetingCancelPreparationErrors, MeetingCancelPreparationResponse, MeetingCancelPreparationResponses, MeetingCancelResponse, MeetingCancelResponses, MeetingCreateData, MeetingCreateError, MeetingCreateErrors, MeetingCreateResponse, MeetingCreateResponses, MeetingGuestJoinData, MeetingGuestJoinError, MeetingGuestJoinErrors, MeetingGuestJoinResponse, MeetingGuestJoinResponses, MeetingGuestParticipantsData, MeetingGuestParticipantsError, MeetingGuestParticipantsErrors, MeetingGuestParticipantsResponse, MeetingGuestParticipantsResponses, MeetingInviteData, MeetingInviteError, MeetingInviteErrors, MeetingInvitePermissions, MeetingInvitePermissionsData, MeetingInvitePermissionsError, MeetingInvitePermissionsErrors, MeetingInvitePermissionsResponse, MeetingInvitePermissionsResponses, MeetingInviteResponse, MeetingInviteResponses, MeetingInviteUsersData, MeetingInviteUsersError, MeetingInviteUsersErrors, MeetingInviteUsersResponse, MeetingInviteUsersResponses, MeetingJoinData, MeetingJoinError, MeetingJoinErrors, MeetingJoinResponse, MeetingJoinResponses, MeetingLeaveData, MeetingLeaveError, MeetingLeaveErrors, MeetingLeaveResponse, MeetingLeaveResponses, MeetingListActiveData, MeetingListActiveError, MeetingListActiveErrors, MeetingListActiveResponse, MeetingListActiveResponses, MeetingListData, MeetingListError, MeetingListErrors, MeetingListResponse, MeetingListResponses, MeetingLookupData, MeetingLookupError, MeetingLookupErrors, MeetingLookupResponse, MeetingLookupResponses, MeetingParticipant, MeetingParticipants, MeetingParticipantsData, MeetingParticipantsError, MeetingParticipantsErrors, MeetingParticipantsResponse, MeetingParticipantsResponses, MeetingPreparation, MeetingPrepareData, MeetingPrepareError, MeetingPrepareErrors, MeetingPrepareResponse, MeetingPrepareResponses, MeetingShareData, MeetingShareError, MeetingShareErrors, MeetingShareResponse, MeetingShareResponses, MeetingsResponse, MeetingToken, MeetingUpdateData, MeetingUpdateError, MeetingUpdateErrors, MeetingUpdateResponse, MeetingUpdateResponses, MentionPreviewsData, MentionPreviewsErrors, MentionPreviewsResponse, MentionPreviewsResponses, Message, MessageAttachment, MessageAttachmentCreatedMetadata, MessageAttachmentRemovedMetadata, MessageChange, MessageCursor, MessageDeletedMetadata, MessageDirection, MessageEvent, MessageEventAttachment, MessageListItem, MessageMentionedMetadata, MessagePage, MessageParent, MessagePatch, MessagePatchedMetadata, MessagePostedMetadata, MessageThread, MessageThreadPreview, MessageTimelineData, MessageTimelineEntriesData, MessageTimelineEntriesResponse, MessageTimelineEntriesResponses, MessageTimelineEntry, MessageTimelinePage, MessageTimelineQuery, MessageTimelineResponse, MessageTimelineResponses, MessageTopicEvent, MyResponse, NewAttachment, NewColumn, NewOption, NewThreadAnchor, NewView, NotificationFilters, NotificationState, NumberOperator, OpBatch, Operator, OpRefusalResponse, OpResult, OptionId, OptionRef, PairingDetails, Params, ParticipantRole, PatchBotRequest, PatchChannelData, PatchChannelError, PatchChannelErrors, PatchChannelRequest, PatchChannelResponse, PatchChannelResponses, PatchMessageNotificationPolicy, PatchProjectRequestV2, PatchThreadRequestV2, PatchViewHandlerData, PatchViewHandlerError, PatchViewHandlerErrors, PatchViewHandlerResponses, PatchWebhookData, PatchWebhookError, PatchWebhookErrors, PatchWebhookRequest, PatchWebhookResponse, PatchWebhookResponses, PdfAnchor, PdfAnchorId, PdfHighlightAnchor, PdfHighlightAnchorRequest, PdfHighlightRect, PdfHighlightRectAnchorRequest, PdfPlaceableCommentAnchor, PendingClaimResponse, PermanentlyDeleteDocumentData, PermanentlyDeleteDocumentError, PermanentlyDeleteDocumentErrors, PermanentlyDeleteDocumentResponse, PermanentlyDeleteDocumentResponses, PermanentlyDeleteProjectData, PermanentlyDeleteProjectError, PermanentlyDeleteProjectErrors, PermanentlyDeleteProjectResponse, PermanentlyDeleteProjectResponses, PinnedItem, PinRequest, Pipeline, PipelineRecordType, PipelineSharing, PostActivityData, PostActivityError, PostActivityErrors, PostActivityRequest, PostActivityResponse, PostActivityResponses, PostChannelBotWebhookData, PostChannelBotWebhookError, PostChannelBotWebhookErrors, PostChannelBotWebhookResponse, PostChannelBotWebhookResponses, PostGroupedSoupAstGroupPageRequest, PostGroupedSoupAstInitialRequest, PostGroupedSoupAstRequest, PostItemsSoupAstData, PostItemsSoupAstError, PostItemsSoupAstErrors, PostItemsSoupAstGroupedData, PostItemsSoupAstGroupedError, PostItemsSoupAstGroupedErrors, PostItemsSoupAstGroupedResponse, PostItemsSoupAstGroupedResponses, PostItemsSoupAstResponse, PostItemsSoupAstResponses, PostItemsSoupData, PostItemsSoupError, PostItemsSoupErrors, PostItemsSoupResponse, PostItemsSoupResponses, PostMessage, PostMessageNotificationPolicy, PostSoupAstRequest, PostSoupRequest, PresaveDocumentHandlerData, PresaveDocumentHandlerError, PresaveDocumentHandlerErrors, PresaveDocumentHandlerResponse, PresaveDocumentHandlerResponses, PreSaveDocumentRequest, PreSaveDocumentResponse, PreSaveDocumentResponseData, PresenceOperator, PresignedUrl, PreviewSmartTagData, PreviewSmartTagError, PreviewSmartTagErrors, PreviewSmartTagResponse, PreviewSmartTagResponses, Project, ProjectDeleteResponseData, ProjectDocumentStatus, ProjectFilters, ProjectPreview, ProjectPreviewData, PropertyBucketing, PropertyDateFilterRange, PropertyDateRange, PropertyDateRanges, PropertyDefinition, PropertyDefinitionWithOptions, PropertyFilter, PropertyInput, PropertyOption, PropertyOptionValue, PropertyOwner, PropertyValue, PutCrmTeamSettingsData, PutCrmTeamSettingsError, PutCrmTeamSettingsErrors, PutCrmTeamSettingsResponse, PutCrmTeamSettingsResponses, PutCrmTeamStagesData, PutCrmTeamStagesError, PutCrmTeamStagesErrors, PutCrmTeamStagesResponse, PutCrmTeamStagesResponses, PutFormLayoutData, PutFormLayoutError, PutFormLayoutErrors, PutFormLayoutResponse, PutFormLayoutResponses, QueryCrmPipelineRowsData, QueryCrmPipelineRowsResponse, QueryCrmPipelineRowsResponses, QueryDatabasesData, QueryDatabasesError, QueryDatabasesErrors, QueryDatabasesResponse, QueryDatabasesResponses, QueryDefinition, QuestionLayout, QuestionOption, QuestionTally, ReactionInput, RecentlyDeletedData, RecentlyDeletedError, RecentlyDeletedErrors, RecentlyDeletedResponse, RecentlyDeletedResponseData, RecentlyDeletedResponses, RegisterSlackImportUploadsData, RegisterSlackImportUploadsErrors, RegisterSlackImportUploadsResponse, RegisterSlackImportUploadsResponses, RegisterUploads, RemoveBotFromChannelByBotData, RemoveBotFromChannelByBotError, RemoveBotFromChannelByBotErrors, RemoveBotFromChannelByBotResponse, RemoveBotFromChannelByBotResponses, RemoveFavoriteByEntityData, RemoveFavoriteByEntityError, RemoveFavoriteByEntityErrors, RemoveFavoriteByEntityResponses, RemoveParticipantsData, RemoveParticipantsError, RemoveParticipantsErrors, RemoveParticipantsRequest, RemoveParticipantsResponses, RemovePinHandlerData, RemovePinHandlerError, RemovePinHandlerErrors, RemovePinHandlerResponse, RemovePinHandlerResponses, RenameChannelLabelData, RenameChannelLabelError, RenameChannelLabelErrors, RenameChannelLabelRequest, RenameChannelLabelResponse, RenameChannelLabelResponses, RenameCrmPipelineData, RenameCrmPipelineResponse, RenameCrmPipelineResponses, RenamePipeline, ReorderFavoritesData, ReorderFavoritesError, ReorderFavoritesErrors, ReorderFavoritesRequest, ReorderFavoritesResponses, ReorderPinRequest, ReorderPinsHandlerData, ReorderPinsHandlerError, ReorderPinsHandlerErrors, ReorderPinsHandlerResponse, ReorderPinsHandlerResponses, ReplaceCrmStagesRequest, RequestAccess, RequestedHarnessScope, RequestedLayout, RequestStatus, RequestToJoinData, RequestToJoinError, RequestToJoinErrors, RequestToJoinResponse, RequestToJoinResponses, ResetCrmTeamStagesData, ResetCrmTeamStagesError, ResetCrmTeamStagesErrors, ResetCrmTeamStagesResponse, ResetCrmTeamStagesResponses, ResolveRequest, ResponseStatus, ResponseSummary, ResultColumn, ResultSet, RevertDeleteDocumentData, RevertDeleteDocumentError, RevertDeleteDocumentErrors, RevertDeleteDocumentResponse, RevertDeleteDocumentResponses, RevertDeleteProjectData, RevertDeleteProjectError, RevertDeleteProjectErrors, RevertDeleteProjectResponse, RevertDeleteProjectResponses, RingStatus, RingStatusResponse, RowChange, RowChangeKind, RowChanges, RowHistoryEntry, RowHistoryResponse, RowId, RowsChange, RowsResult, S3ObjectInfo, SaveBomPart, SaveDatabaseQueryData, SaveDatabaseQueryError, SaveDatabaseQueryErrors, SaveDatabaseQueryResponse, SaveDatabaseQueryResponses, SaveDocumentHandlerData, SaveDocumentHandlerError, SaveDocumentHandlerErrors, SaveDocumentHandlerResponse, SaveDocumentHandlerResponses, SaveDocumentRequest, SaveDocumentResponse, SaveDocumentResponseData, SavedQuery, SaveQueryRequest, SearchContactsData, SearchContactsError, SearchContactsErrors, SearchContactsResponse, SearchContactsResponse2, SearchContactsResponses, SearchState, SectionCount, SessionDeletedMetadata, SessionIdentity, SessionMentionedMetadata, SessionOpenedMetadata, SessionRenamedMetadata, SessionSettledMetadata, SessionSource, SessionStoppedMetadata, SetChannelLabelData, SetChannelLabelError, SetChannelLabelErrors, SetChannelLabelRequest, SetChannelLabelResponse, SetChannelLabelResponses, SetChannelPictureData, SetChannelPictureError, SetChannelPictureErrors, SetChannelPictureRequest, SetChannelPictureResponse, SetChannelPictureResponses, SetCompanyHiddenData, SetCompanyHiddenError, SetCompanyHiddenErrors, SetCompanyHiddenRequest, SetCompanyHiddenResponse, SetCompanyHiddenResponses, SetCompanyNameRequest, SetContactHiddenData, SetContactHiddenError, SetContactHiddenErrors, SetContactHiddenRequest, SetContactHiddenResponse, SetContactHiddenResponses, SetContactNameRequest, SetCrmCompanyNameData, SetCrmCompanyNameError, SetCrmCompanyNameErrors, SetCrmCompanyNameResponse, SetCrmCompanyNameResponses, SetCrmContactNameData, SetCrmContactNameError, SetCrmContactNameErrors, SetCrmContactNameResponse, SetCrmContactNameResponses, SetDirectAccess, SetDocumentTeamShareData, SetDocumentTeamShareError, SetDocumentTeamShareErrors, SetDocumentTeamShareRequest, SetDocumentTeamShareResponse, SetDocumentTeamShareResponses, SetEmailFollowupData, SetEmailFollowupError, SetEmailFollowupErrors, SetEmailFollowupResponse, SetEmailFollowupResponses, SetEmailSyncData, SetEmailSyncError, SetEmailSyncErrors, SetEmailSyncRequest, SetEmailSyncResponse, SetEmailSyncResponses, SetOperator, SetPropertyValue, Sha256Digest, ShareCrmPipelineData, ShareCrmPipelineResponse, ShareCrmPipelineResponses, ShareDatabaseAwarenessData, ShareDatabaseAwarenessError, ShareDatabaseAwarenessErrors, ShareDatabaseAwarenessResponse, ShareDatabaseAwarenessResponses, SharedEmailFilter, SharedExternalChatReference, ShareEntity, ShareEntityType, SharePermissionV2, SharePipeline, ShortIdResponse, SimpleMention, SimpleSaveData, SimpleSaveError, SimpleSaveErrors, SimpleSaveResponse, SimpleSaveResponses, SkippedCell, SlackCompleteRequest, SlackCreateRequest, SlackRegisterRequest, SlackTimestamp, SlackUserId, SmartTagChannelMatch, SmartTagPreview, SortDirection, SortKey, SoupAgentSessionSoupPropertiesField, SoupApiItem, SoupApiSort, SoupApiSortDirection, SoupAttachment, SoupCalendarEventSoupPropertiesField, SoupCalendarEventTime, SoupCallRecordGuest, SoupCallRecordParticipant, SoupCallRecordSoupPropertiesField, SoupChannel, SoupChannelThread, SoupChatSoupPropertiesField, SoupContact, SoupCountedReaction, SoupCrmCompanySoupPropertiesField, SoupCrmContactSoupPropertiesField, SoupCrmDomain, SoupDatabaseRowSoupPropertiesField, SoupDocumentSoupPropertiesField, SoupDocumentSubType, SoupEmailThreadPreview, SoupEnrichedEmailThreadPreviewSoupPropertiesField, SoupForeignEntity, SoupInitiativeSoupPropertiesField, SoupItem, SoupLabel, SoupLabelListVisibility, SoupLabelType, SoupMessageAttachment, SoupMessageListVisibility, SoupMessageSender, SoupMessageSenderType, SoupPage, SoupProjectSoupPropertiesField, SoupPropertiesField, SoupProperty, SoupThreadInfo, SoupThreadReply, SourceBinding, SourceId, SourceIdentity, SqlCell, SqlEntityKind, SqlOutcome, SqlOutcomeKind, SqlSelectOption, SqlStatement, StarterDatabase, StarterDocumentsResponse, StorageRow, StorageRows, StorageRowsQuery, StoredGithubPullRequest, StreamEventsData, StreamEventsError, StreamEventsErrors, StreamEventsResponse, StreamEventsResponses, String, Submission, SubmissionOutcome, SubmitFormResponseData, SubmitFormResponseError, SubmitFormResponseErrors, SubmitFormResponseResponse, SubmitFormResponseResponses, SuccessResponse, SurfaceState, SyncServiceVersionId, SystemSkillSummary, Table, TableChange, TableChanged, TableChanges, TableDetail, TableId, TableResult, TableVersion, TagFilterMode, TakenId, TallyBucket, TallyValue, TaskFilters, TaskSimilarityResult, TaskSimilaritySearchHandlerData, TaskSimilaritySearchHandlerError, TaskSimilaritySearchHandlerErrors, TaskSimilaritySearchHandlerResponse, TaskSimilaritySearchHandlerResponses, TaskSimilaritySearchRequest, TaskSimilaritySearchResponse, TeamCalendarContent, TeamCalendarCoverage, TeamCalendarDetails, TeamCalendarItem, TeamCalendarMember, TeamCalendarPage, TeamCalendarSharing, TeamOutOfOfficeItem, TeamOutOfOfficeResponse, TeamRole, TextOperator, ThreadAnchor, ThreadOrigin, ThreadPatch, ThreadState, TimelineActivity, ToggleShareWithTeamData, ToggleShareWithTeamError, ToggleShareWithTeamErrors, ToggleShareWithTeamResponse, ToggleShareWithTeamResponses, TouchedColumn, TouchedRow, TranscribeDictationData, TranscribeDictationError, TranscribeDictationErrors, TranscribeDictationResponse, TranscribeDictationResponses, TranscribeResponse, TranscriptSegmentRequest, TrashCrmPipelineData, TrashCrmPipelineResponse, TrashCrmPipelineResponses, TrashPipeline, TurnEndedMetadata, TurnStartedMetadata, TurnSummary, TypedSuccessResponse, TypedSuccessResponseGetDocumentResponseData, TypingInput, UndoChangeResponse, UndoDatabaseChangeData, UndoDatabaseChangeError, UndoDatabaseChangeErrors, UndoDatabaseChangeResponse, UndoDatabaseChangeResponses, UndoOutcome, UndoRefusal, UnlockedBooking, UpdateAgentData, UpdateAgentError, UpdateAgentErrors, UpdateAgentRequest, UpdateAgentResponse, UpdateAgentResponses, UpdateChannelSharePermission, UpdateCrmPipelinePermissionsData, UpdateCrmPipelinePermissionsResponse, UpdateCrmPipelinePermissionsResponses, UpdateCrmTeamSettingsRequest, UpdateDatabasePermissionsData, UpdateDatabasePermissionsError, UpdateDatabasePermissionsErrors, UpdateDatabasePermissionsResponse, UpdateDatabasePermissionsResponses, UpdateForm, UpdateFormData, UpdateFormError, UpdateFormErrors, UpdateFormPermissionsData, UpdateFormPermissionsError, UpdateFormPermissionsErrors, UpdateFormPermissionsResponse, UpdateFormPermissionsResponses, UpdateFormResponse, UpdateFormResponses, UpdateInitiativeData, UpdateInitiativeError, UpdateInitiativeErrors, UpdateInitiativeRequest, UpdateInitiativeResponse, UpdateInitiativeResponses, UpdateMeetingRequest, UpdateOperation, UpdateSharePermissionRequestV2, UploadDescriptor, UploadDocumentStatus, UploadExtractFolderHandlerData, UploadExtractFolderHandlerError, UploadExtractFolderHandlerErrors, UploadExtractFolderHandlerResponse, UploadExtractFolderHandlerResponses, UploadExtractFolderRequest, UploadFolderHandlerData, UploadFolderHandlerError, UploadFolderHandlerErrors, UploadFolderHandlerResponse, UploadFolderHandlerResponses, UploadFolderRequest, UploadGrant, UploadId, UpsertHistoryHandlerData, UpsertHistoryHandlerError, UpsertHistoryHandlerErrors, UpsertHistoryHandlerResponse, UpsertHistoryHandlerResponses, UpsertUserDocumentViewLocationData, UpsertUserDocumentViewLocationError, UpsertUserDocumentViewLocationErrors, UpsertUserDocumentViewLocationRequest, UpsertUserDocumentViewLocationResponse, UpsertUserDocumentViewLocationResponses, UserApiKeyId, UserApiKeyInfo, UserApiKeysList, UserDocumentsResponse, UserDocumentViewLocation, UserDocumentViewLocationResponse, UserPinsResponse, UserViewsResponse, ValidateDocumentPermissionsTokenData, ValidateDocumentPermissionsTokenError, ValidateDocumentPermissionsTokenErrors, ValidateDocumentPermissionsTokenResponse, ValidateDocumentPermissionsTokenResponses, ValidateWebhookData, ValidateWebhookError, ValidateWebhookErrors, ValidateWebhookResponse, ValidateWebhookResponse2, ValidateWebhookResponses, Vec, VersionedTable, View, ViewChange, ViewColumn, ViewerCapabilities, ViewLayout, ViewPatch, ViewPosition, ViewPositionsResponse, ViewQuery, ViewResult, ViewsResponse, WaitingForInputMetadata, Webhook, WebhookEvent, WebhookFilter, WebhookScope, WebhookStatus, WebhookValidationTestEvent, WhatsAppAccount, WhatsappAccountData, WhatsappAccountResponse, WhatsappAccountResponses, WhatsAppAccountState, WhatsAppAccountView, WhatsappCancelPairingData, WhatsappCancelPairingResponse, WhatsappCancelPairingResponses, WhatsAppCannotAdd, WhatsAppChat, WhatsAppChats, WhatsappChatsData, WhatsappChatsResponse, WhatsappChatsResponses, WhatsAppConnect, WhatsappConnectData, WhatsappConnectResponse, WhatsappConnectResponses, WhatsAppDisconnect, WhatsappDisconnectData, WhatsAppDisconnectRequest, WhatsappDisconnectResponse, WhatsappDisconnectResponses, WhatsAppHistoryImport, WhatsappImportHistoryData, WhatsappImportHistoryResponse, WhatsappImportHistoryResponses, WhatsAppLookup, WhatsappLookupData, WhatsAppLookupRequest, WhatsappLookupResponse, WhatsappLookupResponses, WhatsAppLookupState, WhatsAppPairing, WhatsappPairingData, WhatsappPairingResponse, WhatsappPairingResponses, WhatsAppPairingState, WhatsAppPairState, WhatsappPasskeyData, WhatsappPasskeyResponse, WhatsappPasskeyResponses, WhatsappStartLookupData, WhatsappStartLookupResponse, WhatsappStartLookupResponses, Widget, WithCallId, WithChannelId, WithDocumentId, WithProjectId } from './types.gen';diff --git a/packages/sdk/generated/storage/types.gen.ts b/packages/sdk/generated/storage/types.gen.tsindex 4c56c6a6f2..02b2e548f5 100644--- a/packages/sdk/generated/storage/types.gen.ts+++ b/packages/sdk/generated/storage/types.gen.ts@@ -998,6 +998,7 @@ export type ApiGroupByField = 'date' | 'entity_type' | 'project' | {* Group by a property value (e.g., status, priority, or custom properties)*/property: {+ bucketing?: null | PropertyBucketing;entity_type?: null | ApiPropertyEntityType;/*** The property definition UUID to group by@@ -1053,7 +1054,7 @@ export type ApiParticipantRole = 'owner' | 'admin' | 'member';/*** Entity type for property lookups (API representation).*/-export type ApiPropertyEntityType = 'CHANNEL' | 'CHAT' | 'COMPANY' | 'DOCUMENT' | 'PROJECT' | 'TASK' | 'THREAD' | 'USER';+export type ApiPropertyEntityType = 'CALL_RECORD' | 'CALENDAR_EVENT' | 'DATABASE_ROW' | 'INITIATIVE' | 'CHANNEL' | 'CHAT' | 'COMPANY' | 'DOCUMENT' | 'PROJECT' | 'TASK' | 'THREAD' | 'USER';/*** What a committed batch answers: a result per op, and the journal's change@@ -8922,7 +8923,12 @@ export type GroupedInitialParams = {* Limit the number of items returned per group. Defaults to 20. Max 500.*/per_group_limit?: number | null;+ sort_direction?: null | SoupApiSortDirection;sort_method?: null | GroupedSoupSort;+ /**+ * Property definition selected for numeric property sorting.+ */+ sort_property_definition_id?: string | null;};/**@@ -8941,7 +8947,12 @@ export type GroupedPageParams = {* Limit the number of items returned. Defaults to 20. Max 500.*/limit?: number | null;+ sort_direction?: null | SoupApiSortDirection;sort_method?: null | GroupedSoupSort;+ /**+ * Property definition selected for numeric property sorting.+ */+ sort_property_definition_id?: string | null;};/**@@ -8991,7 +9002,7 @@ export type GroupedSoupPage = (GroupedSoupInitialPage & {/*** Sort method for grouped queries (frecency not supported).*/-export type GroupedSoupSort = 'viewed_at' | 'created_at' | 'updated_at' | 'viewed_updated';+export type GroupedSoupSort = 'viewed_at' | 'created_at' | 'updated_at' | 'viewed_updated' | 'property';/*** Guest-safe message projection: no account identities, attachments, or entity grants.@@ -11102,6 +11113,10 @@ export type Params = {limit?: number | null;sort_direction?: null | SoupApiSortDirection;sort_method?: null | SoupApiSort;+ /**+ * Property definition selected for numeric property sorting.+ */+ sort_property_definition_id?: string | null;};/**@@ -11602,6 +11617,59 @@ export type ProjectPreviewData = {updatedAt?: string | null;};+/**+ * Caller-defined, ordered UTC date ranges and a separate missing-value key.+ */+export type PropertyBucketing = PropertyDateRanges & {+ type: 'date_ranges';+};++/**+ * UTC timestamp interval. Lower bounds are inclusive; upper bounds are exclusive.+ */+export type PropertyDateFilterRange = {+ /**+ * Exclusive UTC upper bound, omitted for an open end.+ */+ end?: string | null;+ /**+ * Inclusive UTC lower bound, omitted for an open start.+ */+ start?: string | null;+};++/**+ * A half-open UTC interval. An absent start or end extends to infinity.+ */+export type PropertyDateRange = {+ /**+ * Exclusive end, or positive infinity.+ */+ end?: string | null;+ /**+ * Unique caller-supplied group key.+ */+ key: string;+ /**+ * Inclusive start, or negative infinity.+ */+ start?: string | null;+};++/**+ * A complete partition of present dates plus one bucket for absent values.+ */+export type PropertyDateRanges = {+ /**+ * Caller-supplied group key for entities with no date value.+ */+ missing_value_bucket_key: string;+ /**+ * Ordered, contiguous ranges covering every present date.+ */+ ranges: Array<PropertyDateRange>;+};+/*** Property definition model (service representation).*/@@ -11642,6 +11710,7 @@ export type PropertyDefinitionWithOptions = {* Multiple filters are AND'd together.*/export type PropertyFilter = {+ date_range?: null | PropertyDateFilterRange;/*** Entity reference IDs to match. Multiple values are OR'd together.*/@@ -11651,6 +11720,10 @@ export type PropertyFilter = {* When None, matches across all entity types.*/entity_type?: string | null;+ /**+ * Flat Soup/search presence filter: true expands to an open date range, false to its negation.+ */+ has_date?: boolean | null;/*** Select option UUIDs to match. Multiple values are OR'd together.*/@@ -13036,7 +13109,7 @@ export type SoupApiItem = SoupItem & {/*** Sort options accepted by non-grouped soup API endpoints.*/-export type SoupApiSort = 'viewed_at' | 'created_at' | 'updated_at' | 'viewed_updated' | 'frecency' | 'touched_by_me' | 'notified_at';+export type SoupApiSort = 'viewed_at' | 'created_at' | 'updated_at' | 'viewed_updated' | 'frecency' | 'touched_by_me' | 'notified_at' | 'property';/*** Sort direction accepted by non-grouped soup API endpoints.@@ -23255,20 +23328,22 @@ export type GetItemsSoupData = {*/limit?: number;/**- * Sort method. Options are viewed_at, created_at, updated_at,- * viewed_updated, frecency, touched_by_me, notified_at. Defaults to- * viewed_at.+ * Sort method. Property ordering supports DATE, NUMBER, BOOLEAN, SELECT and TAG.+ * Missing definitions, unsupported types, and mismatched values sort as missing.+ * Flat property sorts omit calendar events, email, channels, calls, companies, and agent sessions.+ * Defaults to viewed_at.*/sort_method?: SoupApiSort;+ /**+ * Property definition selected for numeric property sorting.+ */+ sort_property_definition_id?: string;/*** Sort direction. Options are asc, desc. Defaults to desc.*- * Re-send this with every page: it is not carried in the cursor.- *- * Applies to the timestamp sort methods only. `asc` combined with- * `frecency` is rejected rather than ignored: frecency pages are ordered- * by relevance score and the cursor comparison assumes descending, so- * there is no ascending frecency order to give.+ * Timestamp sorts require this parameter again on each page. Property+ * cursors preserve their direction and always put missing values last.+ * Ascending frecency, touched-by-me, and notified-at sorts are unsupported.*/sort_direction?: SoupApiSortDirection;/**diff --git a/packages/sdk/specs/search.json b/packages/sdk/specs/search.jsonindex b1c5c04691..0fd06fda62 100644--- a/packages/sdk/specs/search.json+++ b/packages/sdk/specs/search.json@@ -3064,6 +3064,22 @@}}},+ "PropertyDateFilterRange": {+ "type": "object",+ "description": "UTC timestamp interval. Lower bounds are inclusive; upper bounds are exclusive.",+ "properties": {+ "end": {+ "type": ["string", "null"],+ "format": "date-time",+ "description": "Exclusive UTC upper bound, omitted for an open end."+ },+ "start": {+ "type": ["string", "null"],+ "format": "date-time",+ "description": "Inclusive UTC lower bound, omitted for an open start."+ }+ }+ },"PropertyDefinition": {"type": "object","description": "Property definition model (service representation).",@@ -3129,6 +3145,17 @@"description": "A single property-based filter condition.\n\nEach filter targets a specific property definition on entities of a given type,\nmatching against select option UUIDs or entity reference IDs.\nMultiple values within a single filter are OR'd together.\nMultiple filters are AND'd together.","required": ["property_definition_id"],"properties": {+ "date_range": {+ "oneOf": [+ {+ "type": "null"+ },+ {+ "$ref": "#/components/schemas/PropertyDateFilterRange",+ "description": "UTC range for Soup/search: inclusive start, exclusive end; both open matches any date."+ }+ ]+ },"entity_ids": {"type": "array","items": {@@ -3140,6 +3167,10 @@"type": ["string", "null"],"description": "The entity type for the property lookup (e.g., \"TASK\", \"DOCUMENT\", \"PROJECT\").\nWhen None, matches across all entity types."},+ "has_date": {+ "type": ["boolean", "null"],+ "description": "Flat Soup/search presence filter: true expands to an open date range, false to its negation."+ },"option_ids": {"type": "array","items": {diff --git a/packages/sdk/specs/storage.json b/packages/sdk/specs/storage.jsonindex d0ea9c33ff..b377f726eb 100644--- a/packages/sdk/specs/storage.json+++ b/packages/sdk/specs/storage.json@@ -15729,16 +15729,26 @@{"name": "sort_method","in": "query",- "description": "Sort method. Options are viewed_at, created_at, updated_at,\nviewed_updated, frecency, touched_by_me, notified_at. Defaults to\nviewed_at.",+ "description": "Sort method. Property ordering supports DATE, NUMBER, BOOLEAN, SELECT and TAG.\nMissing definitions, unsupported types, and mismatched values sort as missing.\nFlat property sorts omit calendar events, email, channels, calls, companies, and agent sessions.\nDefaults to viewed_at.","required": false,"schema": {"$ref": "#/components/schemas/SoupApiSort"}},+ {+ "name": "sort_property_definition_id",+ "in": "query",+ "description": "Property definition selected for numeric property sorting.",+ "required": false,+ "schema": {+ "type": "string",+ "format": "uuid"+ }+ },{"name": "sort_direction","in": "query",- "description": "Sort direction. Options are asc, desc. Defaults to desc.\n\nRe-send this with every page: it is not carried in the cursor.\n\nApplies to the timestamp sort methods only. `asc` combined with\n`frecency` is rejected rather than ignored: frecency pages are ordered\nby relevance score and the cursor comparison assumes descending, so\nthere is no ascending frecency order to give.",+ "description": "Sort direction. Options are asc, desc. Defaults to desc.\n\nTimestamp sorts require this parameter again on each page. Property\ncursors preserve their direction and always put missing values last.\nAscending frecency, touched-by-me, and notified-at sorts are unsupported.","required": false,"schema": {"$ref": "#/components/schemas/SoupApiSortDirection"@@ -21091,7 +21101,7 @@},{"$ref": "#/components/schemas/CrmAssociation",- "description": "Restrict every entity type to items associated with this CRM record\n(wire key `crma`): its Companies or Contacts property names the\nrecord, or it references the record. A company also matches through\nits contacts. Unknown or inaccessible records answer 404; requests\nthat are not expanded or not timestamp-sorted answer 400."+ "description": "Restrict every entity type to items associated with this CRM record\n(wire key `crma`): its Companies or Contacts property names the\nrecord, or it references the record. A company also matches through\nits contacts. Unknown or inaccessible records answer 404; requests\nrequire expanded queries sorted by a timestamp or selected numeric property."}]},@@ -21169,6 +21179,17 @@"description": "Group by a property value (e.g., status, priority, or custom properties)","required": ["property_definition_id"],"properties": {+ "bucketing": {+ "oneOf": [+ {+ "type": "null"+ },+ {+ "$ref": "#/components/schemas/PropertyBucketing",+ "description": "Caller-defined date partition; non-DATE values enter the missing bucket."+ }+ ]+ },"entity_type": {"oneOf": [{@@ -21244,6 +21265,10 @@"type": "string","description": "Entity type for property lookups (API representation).","enum": [+ "CALL_RECORD",+ "CALENDAR_EVENT",+ "DATABASE_ROW",+ "INITIATIVE","CHANNEL","CHAT","COMPANY",@@ -33357,6 +33382,17 @@"description": "Limit the number of items returned per group. Defaults to 20. Max 500.","minimum": 0},+ "sort_direction": {+ "oneOf": [+ {+ "type": "null"+ },+ {+ "$ref": "#/components/schemas/SoupApiSortDirection",+ "description": "Direction of property values. Defaults to descending."+ }+ ]+ },"sort_method": {"oneOf": [{@@ -33367,6 +33403,11 @@"description": "Sort method. Defaults to viewed_updated."}]+ },+ "sort_property_definition_id": {+ "type": ["string", "null"],+ "format": "uuid",+ "description": "Property definition selected for numeric property sorting."}}},@@ -33389,6 +33430,17 @@"description": "Limit the number of items returned. Defaults to 20. Max 500.","minimum": 0},+ "sort_direction": {+ "oneOf": [+ {+ "type": "null"+ },+ {+ "$ref": "#/components/schemas/SoupApiSortDirection",+ "description": "Direction of property values. Defaults to descending."+ }+ ]+ },"sort_method": {"oneOf": [{@@ -33399,6 +33451,11 @@"description": "Sort method. Defaults to viewed_updated."}]+ },+ "sort_property_definition_id": {+ "type": ["string", "null"],+ "format": "uuid",+ "description": "Property definition selected for numeric property sorting."}}},@@ -33418,8 +33475,7 @@"$ref": "#/components/schemas/SoupApiItem"},"propertyNames": {- "type": "string",- "format": "uuid"+ "type": "string"}}}@@ -33443,8 +33499,7 @@"$ref": "#/components/schemas/SoupApiItem"},"propertyNames": {- "type": "string",- "format": "uuid"+ "type": "string"}}}@@ -33495,7 +33550,13 @@"GroupedSoupSort": {"type": "string","description": "Sort method for grouped queries (frecency not supported).",- "enum": ["viewed_at", "created_at", "updated_at", "viewed_updated"]+ "enum": [+ "viewed_at",+ "created_at",+ "updated_at",+ "viewed_updated",+ "property"+ ]},"GuestChatMessage": {"type": "object",@@ -36737,7 +36798,7 @@},{"$ref": "#/components/schemas/SoupApiSortDirection",- "description": "Sort direction. Options are asc, desc. Defaults to desc.\n\nRe-send this with every page: it is not carried in the cursor.\n\nApplies to the timestamp sort methods only. `asc` combined with\n`frecency` is rejected rather than ignored: frecency pages are ordered\nby relevance score and the cursor comparison assumes descending, so\nthere is no ascending frecency order to give."+ "description": "Sort direction. Options are asc, desc. Defaults to desc.\n\nTimestamp sorts require this parameter again on each page. Property\ncursors preserve their direction and always put missing values last.\nAscending frecency, touched-by-me, and notified-at sorts are unsupported."}]},@@ -36748,9 +36809,14 @@},{"$ref": "#/components/schemas/SoupApiSort",- "description": "Sort method. Options are viewed_at, created_at, updated_at,\nviewed_updated, frecency, touched_by_me, notified_at. Defaults to\nviewed_at."+ "description": "Sort method. Property ordering supports DATE, NUMBER, BOOLEAN, SELECT and TAG.\nMissing definitions, unsupported types, and mismatched values sort as missing.\nFlat property sorts omit calendar events, email, channels, calls, companies, and agent sessions.\nDefaults to viewed_at."}]+ },+ "sort_property_definition_id": {+ "type": ["string", "null"],+ "format": "uuid",+ "description": "Property definition selected for numeric property sorting."}}},@@ -37787,6 +37853,85 @@}}},+ "PropertyBucketing": {+ "oneOf": [+ {+ "allOf": [+ {+ "$ref": "#/components/schemas/PropertyDateRanges",+ "description": "Caller-defined, ordered UTC date ranges and a separate missing-value key."+ },+ {+ "type": "object",+ "required": ["type"],+ "properties": {+ "type": {+ "type": "string",+ "enum": ["date_ranges"]+ }+ }+ }+ ],+ "description": "Caller-defined, ordered UTC date ranges and a separate missing-value key."+ }+ ],+ "description": "Optional transformation of a selected property's stored value into group keys."+ },+ "PropertyDateFilterRange": {+ "type": "object",+ "description": "UTC timestamp interval. Lower bounds are inclusive; upper bounds are exclusive.",+ "properties": {+ "end": {+ "type": ["string", "null"],+ "format": "date-time",+ "description": "Exclusive UTC upper bound, omitted for an open end."+ },+ "start": {+ "type": ["string", "null"],+ "format": "date-time",+ "description": "Inclusive UTC lower bound, omitted for an open start."+ }+ }+ },+ "PropertyDateRange": {+ "type": "object",+ "description": "A half-open UTC interval. An absent start or end extends to infinity.",+ "required": ["key"],+ "properties": {+ "end": {+ "type": ["string", "null"],+ "format": "date-time",+ "description": "Exclusive end, or positive infinity."+ },+ "key": {+ "type": "string",+ "description": "Unique caller-supplied group key."+ },+ "start": {+ "type": ["string", "null"],+ "format": "date-time",+ "description": "Inclusive start, or negative infinity."+ }+ }+ },+ "PropertyDateRanges": {+ "type": "object",+ "description": "A complete partition of present dates plus one bucket for absent values.",+ "required": ["ranges", "missing_value_bucket_key"],+ "properties": {+ "missing_value_bucket_key": {+ "type": "string",+ "description": "Caller-supplied group key for entities with no date value."+ },+ "ranges": {+ "type": "array",+ "items": {+ "$ref": "#/components/schemas/PropertyDateRange"+ },+ "description": "Ordered, contiguous ranges covering every present date."+ }+ }+ },"PropertyDefinition": {"type": "object","description": "Property definition model (service representation).",@@ -37868,6 +38013,17 @@"description": "A single property-based filter condition.\n\nEach filter targets a specific property definition on entities of a given type,\nmatching against select option UUIDs or entity reference IDs.\nMultiple values within a single filter are OR'd together.\nMultiple filters are AND'd together.","required": ["property_definition_id"],"properties": {+ "date_range": {+ "oneOf": [+ {+ "type": "null"+ },+ {+ "$ref": "#/components/schemas/PropertyDateFilterRange",+ "description": "UTC range for Soup/search: inclusive start, exclusive end; both open matches any date."+ }+ ]+ },"entity_ids": {"type": "array","items": {@@ -37879,6 +38035,10 @@"type": ["string", "null"],"description": "The entity type for the property lookup (e.g., \"TASK\", \"DOCUMENT\", \"PROJECT\").\nWhen None, matches across all entity types."},+ "has_date": {+ "type": ["boolean", "null"],+ "description": "Flat Soup/search presence filter: true expands to an open date range, false to its negation."+ },"option_ids": {"type": "array","items": {@@ -40117,7 +40277,8 @@"viewed_updated","frecency","touched_by_me",- "notified_at"+ "notified_at",+ "property"]},"SoupApiSortDirection": {diff --git a/services/document_storage_service/AGENTS.md b/services/document_storage_service/AGENTS.mdindex 49fca96cd6..b87e036165 100644--- a/services/document_storage_service/AGENTS.md+++ b/services/document_storage_service/AGENTS.md@@ -68,7 +68,7 @@ threads, pins, recents, notifications, folders, activity.- Add a Soup GraphQL field: resolver/loader in `crates/graphql_soup` →`src/api/graphql_soup.rs` if wiring changes.- Add a REST route: `src/api/<area>.rs` → `src/api.rs` (router) →- `src/openapi.rs`.+ `src/api/swagger.rs`.- Add a config value or feature-gated behavior: `src/config.rs` → the`[features]` table in `Cargo.toml` if it should be independently toggleable.@@ -81,6 +81,8 @@ threads, pins, recents, notifications, folders, activity.## Gotchas+- Compose Soup without a separate property-definition reader; REST and GraphQL validate DATE range inputs before calling the service.+- Several behaviors are Cargo-feature-gated (`connection_gateway`,`delete_document_worker`, `location_check`, all on by `default`) — a featuredisabled locally can hide a bug that only shows in deployed builds.diff --git a/services/document_storage_service/src/api/swagger.rs b/services/document_storage_service/src/api/swagger.rsindex 58d1736d9d..01e389ecce 100644--- a/services/document_storage_service/src/api/swagger.rs+++ b/services/document_storage_service/src/api/swagger.rs@@ -199,8 +199,8 @@ use soup::domain::models::{SoupItemWithProperties, SoupPropertiesField};use soup::inbound::axum_router::{ApiGroupByField, ApiGroupMeta, GroupedSoupGroupPage, GroupedSoupInitialPage, GroupedSoupPage,PostGroupedSoupAstGroupPageRequest, PostGroupedSoupAstInitialRequest,- PostGroupedSoupAstRequest, PostSoupAstRequest, PostSoupRequest, SoupApiItem, SoupApiSort,- SoupPage,+ PostGroupedSoupAstRequest, PostSoupAstRequest, PostSoupRequest, PropertyBucketing,+ PropertyDateRange, PropertyDateRanges, SoupApiItem, SoupApiSort, SoupPage,};use user_api_key::domain::models::{CreatedUserApiKey, UserApiKeyInfo};use user_api_key::inbound::axum_router::{CreateUserApiKeyRequest, UserApiKeysList};@@ -823,6 +823,9 @@ use utoipa::OpenApi;PostGroupedSoupAstInitialRequest,PostGroupedSoupAstGroupPageRequest,PostGroupedSoupAstRequest,+ PropertyBucketing,+ PropertyDateRange,+ PropertyDateRanges,ApiGroupByField,ApiGroupMeta,GroupedSoupInitialPage,diff --git a/static_assets/schema.graphql b/static_assets/schema.graphqlindex f3764b5f0a..e7d1304d9d 100644--- a/static_assets/schema.graphql+++ b/static_assets/schema.graphql@@ -3632,6 +3632,24 @@ input GraphqlDatabaseRowLiteral @oneOf {id: ID}+"""+One named half-open UTC interval.+"""+input GraphqlDateBucketRange {+ """+ Unique group key.+ """+ key: String!+ """+ Inclusive RFC 3339 UTC start; null means negative infinity.+ """+ start: String+ """+ Exclusive RFC 3339 UTC end; null means positive infinity.+ """+ end: String+}+"""GraphQL input representing the date literal."""@@ -3791,8 +3809,8 @@ input GraphqlDocumentLiteral @oneOf {emailAttachmentParticipant: GraphqlEmailValue"""Associated with a CRM record through its Companies or Contacts- property or a reference to the record. Requires an expanded,- timestamp-sorted query.+ property or a reference to the record. Requires an expanded query+ sorted by a timestamp or task due date."""crmAssociated: GraphqlCrmAssociation"""@@ -4360,7 +4378,7 @@ input GraphqlEntityFilterAst {"""Restrict every entity type to items associated with this CRM record,or to activity across visible CRM-enabled teams.- Requires an expanded, timestamp-sorted query.+ Requires an expanded query sorted by a timestamp or selected property."""crmAssociation: GraphqlCrmAssociation"""@@ -4778,6 +4796,10 @@ input GraphqlFilterPropertyMatchValue @oneOf {Entity reference id to match."""entityRef: ID+ """+ Match a DATE property in a UTC range.+ """+ dateRange: GraphqlPropertyDateRange}"""@@ -5514,6 +5536,10 @@ input GraphqlGroupByInput {Optional property entity type restriction."""entityType: GraphqlPropertyEntityType+ """+ Optional caller-defined date ranges; requires PROPERTY grouping.+ """+ bucketing: GraphqlPropertyBucketing}"""@@ -6227,6 +6253,35 @@ type GraphqlProperty {value: GraphqlPropertyValue}+"""+Transform the selected DATE property into caller-defined ranges.+Non-DATE values use the missing-value bucket.+"""+input GraphqlPropertyBucketing {+ """+ Bucketing transformation.+ """+ type: GraphqlPropertyBucketingType!+ """+ Ordered, contiguous UTC ranges covering every present date.+ """+ ranges: [GraphqlDateBucketRange!]!+ """+ Key for entities whose selected property is absent or cleared.+ """+ missingValueBucketKey: String!+}++"""+Supported property-value transformations.+"""+enum GraphqlPropertyBucketingType {+ """+ Caller-defined half-open UTC date ranges.+ """+ DATE_RANGES+}+"""A property definition's supported value type."""@@ -6273,6 +6328,20 @@ enum GraphqlPropertyDataType {LINK}+"""+Explicit UTC bounds for a DATE property.+"""+input GraphqlPropertyDateRange {+ """+ Inclusive UTC start, or no lower bound.+ """+ start: String+ """+ Exclusive UTC end, or no upper bound.+ """+ end: String+}+"""A globally identified property definition, independent of any assignment."""@@ -7115,7 +7184,7 @@ enum GraphqlSharedEmailFilter {}"""-GraphQL representation of supported Soup sorts.+GraphQL representation of Soup timestamp, notification, and selected-property sorts."""enum GraphqlSimpleSortMethod {"""@@ -7139,6 +7208,12 @@ enum GraphqlSimpleSortMethod {notified first. Descending `soup` only; not supported by `groupSoup`."""NOTIFIED_AT+ """+ Sort by the selected property key, missing last, then newest update and ID.+ Missing definitions and unsupported types use update-time ordering.+ Email, channels, calls, companies, and agent sessions never appear.+ """+ PROPERTY}"""@@ -7341,6 +7416,10 @@ type GraphqlSoupBin {"""totalCount: Int!"""+ Stored option order or calendar bucket order, when available.+ """+ displayOrder: Int+ """Opaque cursor for the next page in this bin, if one exists."""nextCursor: String@@ -9742,9 +9821,18 @@ input GroupedSoupInitialInput {limit: Int"""Sort order within each bin. Defaults to `VIEWED_UPDATED`.+ Grouped PROPERTY reads retain calendar events; flat PROPERTY reads do not."""sortMethod: GraphqlSimpleSortMethod"""+ Property definition selected for numeric property sorting.+ """+ sortPropertyDefinitionId: ID+ """+ Direction of property values. Defaults to DESC.+ """+ sortDirection: GraphqlSortDirection+ """AST-shaped filters applied to each Soup entity type."""filters: GraphqlEntityFilterAst@@ -10577,11 +10665,16 @@ input SoupInitialInput {"""expand: Boolean"""- Simple timestamp sort. Defaults to VIEWED_AT. Frecency is intentionally- not supported by this initial GraphQL adapter.+ Timestamp or selected numeric property sort. Defaults to VIEWED_AT.+ Frecency is not supported by this GraphQL adapter.+ Flat PROPERTY reads omit calendar events, email, channels, calls, companies, and agent sessions."""sortMethod: GraphqlSimpleSortMethod"""+ Property definition selected for numeric property sorting.+ """+ sortPropertyDefinitionId: ID+ """Email preview view used when hydrating email Soup items."""emailView: GraphqlEmailViewdiff --git a/tooling/pii/scan.py b/tooling/pii/scan.pyindex e4e8f2b357..52c0a0f0b3 100755--- a/tooling/pii/scan.py+++ b/tooling/pii/scan.py@@ -1,9 +1,10 @@#!/usr/bin/env python3"""Scan added lines for customer PII and high-signal secrets.-Default mode reads `git diff --cached` so the pre-commit hook stays on the-staged hunk only. `--changed` covers the same scope as `just check`. `--text`-scans a PR title/body or other free text.+Default mode reads staged additions. During a merge, it scans only lines added+relative to every parent, excluding unchanged imported content. `--changed`+covers the same scope as `just check`. `--text` scans a PR title/body or other+free text.Only humans should add `tooling/pii/exceptions` entries, unless they ask anagent to.@@ -220,12 +221,34 @@ def git(*args: str) -> subprocess.CompletedProcess[str]:)-def staged_diff() -> str:- result = git("diff", "--cached", "-U0", "--diff-filter=AMR", "--no-color")+def staged_diff(parent: str | None = None) -> str:+ args = ["diff", "--cached", "-U0", "--diff-filter=AMR", "--no-color"]+ if parent is not None:+ args.extend([parent, "--"])+ result = git(*args)result.check_returncode()return result.stdout+def staged_findings(exceptions: Exceptions) -> list[Finding]:+ """Keep only staged findings on lines newly added relative to every parent."""+ findings = list(iter_diff_findings(staged_diff(), exceptions))+ result = git("rev-parse", "--git-path", "MERGE_HEAD")+ result.check_returncode()+ merge_head = ROOT / result.stdout.strip()+ if not merge_head.exists():+ return findings+ parents = merge_head.read_text(encoding="utf-8").splitlines()+ if not parents:+ raise ValueError("MERGE_HEAD contains no parents")+ for parent in parents:+ verified = git("rev-parse", "--verify", "--end-of-options", f"{parent}^{{commit}}")+ verified.check_returncode()+ parent_findings = set(iter_diff_findings(staged_diff(verified.stdout.strip()), exceptions))+ findings = [finding for finding in findings if finding in parent_findings]+ return findings++def merge_base() -> str:result = git("merge-base", "HEAD", "origin/main")return result.stdout.strip()@@ -323,7 +346,7 @@ def main(argv: list[str] | None = None) -> int:findings.extend(untracked_findings(exceptions))return report(findings)- findings = list(iter_diff_findings(staged_diff(), exceptions))+ findings = staged_findings(exceptions)status = report(findings)if status != 0 or args.skip_gitleaks:return statusdiff --git a/tooling/pii/test_scan.py b/tooling/pii/test_scan.pyindex 4323d02d01..8447c3684c 100644--- a/tooling/pii/test_scan.py+++ b/tooling/pii/test_scan.py@@ -155,6 +155,67 @@ class GitDiffTest(unittest.TestCase):findings = list(iter_diff_findings(diff, Exceptions(set(), set(), set())))self.assertEqual([(f.path, f.kind) for f in findings], [("renamed.md", "email")])+ def test_merge_scans_new_resolution_lines_not_unchanged_parent_content(self):+ with tempfile.TemporaryDirectory() as tmp:+ root = Path(tmp)+ subprocess.run(["git", "init", "-q", tmp], check=True)+ subprocess.run(["git", "-C", tmp, "config", "user.name", "Test"], check=True)+ subprocess.run(["git", "-C", tmp, "config", "user.email", "[email protected]"], check=True)+ subprocess.run(["git", "-C", tmp, "config", "core.hooksPath", "/dev/null"], check=True)+ shared = root / "shared.md"+ shared.write_text("base\n", encoding="utf-8")+ subprocess.run(["git", "-C", tmp, "add", "."], check=True)+ subprocess.run(["git", "-C", tmp, "commit", "-qm", "initial"], check=True)+ subprocess.run(["git", "-C", tmp, "branch", "incoming"], check=True)+ shared.write_text("[email protected]\n", encoding="utf-8")+ subprocess.run(["git", "-C", tmp, "add", "."], check=True)+ subprocess.run(["git", "-C", tmp, "commit", "-qm", "local changes"], check=True)+ local = subprocess.check_output(["git", "-C", tmp, "rev-parse", "HEAD"], text=True).strip()+ subprocess.run(["git", "-C", tmp, "checkout", "-q", "incoming"], check=True)+ shared.write_text("[email protected]\n", encoding="utf-8")+ imported = root / "imported.md"+ imported.write_text("[email protected]\n", encoding="utf-8")+ subprocess.run(["git", "-C", tmp, "add", "."], check=True)+ subprocess.run(["git", "-C", tmp, "commit", "-qm", "incoming changes"], check=True)+ subprocess.run(["git", "-C", tmp, "checkout", "-q", local], check=True)+ merge = subprocess.run(+ ["git", "-C", tmp, "merge", "--no-commit", "incoming"],+ text=True, capture_output=True,+ )+ self.assertEqual(merge.returncode, 1)+ key = "-----BEGIN " + "RSA PRIVATE KEY-----"+ shared.write_text(+ f"[email protected]\n{key}\n",+ encoding="utf-8",+ )+ imported.write_text("[email protected]\[email protected]\n", encoding="utf-8")+ (root / "copy.md").write_text("[email protected]\n", encoding="utf-8")+ subprocess.run(["git", "-C", tmp, "add", "."], check=True)+ # Unstaged edits do not change the staged merge result.+ imported.write_text("[email protected]\n", encoding="utf-8")+ with patch.object(scan, "ROOT", root):+ findings = scan.staged_findings(Exceptions(set(), set(), set()))+ self.assertEqual(+ {(f.path, f.line_no, f.kind) for f in findings},+ {+ ("copy.md", 1, "email"),+ ("imported.md", 2, "email"),+ ("shared.md", 3, "email"),+ ("shared.md", 4, "secret"),+ },+ )+ merge_head = root / ".git" / "MERGE_HEAD"+ merge_head.write_text("imported.md\n", encoding="utf-8")+ with self.assertRaises(subprocess.CalledProcessError):+ scan.staged_findings(Exceptions(set(), set(), set()))+ merge_head.write_text("not-a-commit\n", encoding="utf-8")+ with self.assertRaises(subprocess.CalledProcessError):+ scan.staged_findings(Exceptions(set(), set(), set()))+ merge_head.write_text("", encoding="utf-8")+ with self.assertRaises(ValueError):+ scan.staged_findings(Exceptions(set(), set(), set()))+def test_git_errors_fail_the_scan(self):with tempfile.TemporaryDirectory() as tmp, patch.object(scan, "ROOT", Path(tmp)):with self.assertRaises(subprocess.CalledProcessError):