Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

feat(saved-views): add reusable shared task views (#8779)

dev-rb506f6ed80448
diff --git a/.agents/rules/web/architecture.md b/.agents/rules/web/architecture.md
index 54e7379a77..83eb9278c4 100644
--- a/.agents/rules/web/architecture.md
+++ b/.agents/rules/web/architecture.md
@@ -91,6 +91,7 @@ Module layout, layering, and TypeScript conventions.
## TypeScript
+- 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`, never
a hand-written `switch`.
- **FE-47** Blocks are a legacy integration pattern we live with, not an
diff --git a/.agents/rules/web/design-system.md b/.agents/rules/web/design-system.md
index 43f9a1deb5..ca07aa70e2 100644
--- a/.agents/rules/web/design-system.md
+++ b/.agents/rules/web/design-system.md
@@ -68,6 +68,7 @@ construction. Browse them at `/app/component/ui` (Foundations → Controls).
`bg-menu-glass` by ast-grep `tsx-overlay-canonical-surface`, CI error; the
reply composer, mobile drawer, call controls, and fullscreen media viewers
are the documented exceptions.
+- Reuse the same styled items and padded groups for dropdown and context menus; vary only their root, trigger, and content composition.
- **FE-68** Loading placeholders use the shared shimmer: `ListSkeleton.Bar`
(a pill; pass size and radius) or `skeleton-shimmer bg-skeleton`. A view's
skeleton is built from `ViewSkeleton` and mirrors its header (title, view
diff --git a/.github/workspace-dep-closures.json b/.github/workspace-dep-closures.json
index d32e57bc69..d300553216 100644
--- a/.github/workspace-dep-closures.json
+++ b/.github/workspace-dep-closures.json
@@ -4158,6 +4158,7 @@
"crates/remote_env_var",
"crates/roles_and_permissions",
"crates/s3_key",
+ "crates/saved_views",
"crates/scheduled_action",
"crates/secretsmanager_client",
"crates/share_permission_db_utils",
diff --git a/.sqlx/query-0ff07d54c6e92656442e5a3ca1705d9f0a04b645f8ee47d9b421c1e4a9332611.json b/.sqlx/query-0ff07d54c6e92656442e5a3ca1705d9f0a04b645f8ee47d9b421c1e4a9332611.json
new file mode 100644
index 0000000000..0941788851
--- /dev/null
+++ b/.sqlx/query-0ff07d54c6e92656442e5a3ca1705d9f0a04b645f8ee47d9b421c1e4a9332611.json
@@ -0,0 +1,17 @@
+{
+ "db_name": "PostgreSQL",
+ "query": "UPDATE saved_view SET name = COALESCE($3, name),\n config = CASE WHEN $4::jsonb IS NULL THEN config ELSE config || $4 END,\n revision = revision + 1, updated_at = NOW()\n WHERE id = $1 AND user_id = $2",
+ "describe": {
+ "columns": [],
+ "parameters": {
+ "Left": [
+ "Uuid",
+ "Text",
+ "Text",
+ "Jsonb"
+ ]
+ },
+ "nullable": []
+ },
+ "hash": "0ff07d54c6e92656442e5a3ca1705d9f0a04b645f8ee47d9b421c1e4a9332611"
+}
diff --git a/.sqlx/query-14f0507004b3076a625e1a10ab8de9b4f09cf2a0480dbca99952cf0d8b78b177.json b/.sqlx/query-14f0507004b3076a625e1a10ab8de9b4f09cf2a0480dbca99952cf0d8b78b177.json
deleted file mode 100644
index b4f92836bd..0000000000
--- a/.sqlx/query-14f0507004b3076a625e1a10ab8de9b4f09cf2a0480dbca99952cf0d8b78b177.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "DELETE FROM saved_view WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "14f0507004b3076a625e1a10ab8de9b4f09cf2a0480dbca99952cf0d8b78b177"
-}
diff --git a/.sqlx/query-1eecfd6a6960454a52892ac03e393600f185c05548b1a4bc29b4f26b3b4e0eba.json b/.sqlx/query-1eecfd6a6960454a52892ac03e393600f185c05548b1a4bc29b4f26b3b4e0eba.json
new file mode 100644
index 0000000000..01085b5fd8
--- /dev/null
+++ b/.sqlx/query-1eecfd6a6960454a52892ac03e393600f185c05548b1a4bc29b4f26b3b4e0eba.json
@@ -0,0 +1,69 @@
+{
+ "db_name": "PostgreSQL",
+ "query": "SELECT id, user_id, name, config, created_at, updated_at, revision, shared_team_id\n FROM saved_view\n WHERE (user_id = $1 OR shared_team_id = ANY($2::uuid[]))\n AND ($3::text IS NULL OR config->>'kind' = $3)\n AND ($4::timestamptz IS NULL OR (created_at, id) > ($4, $5))\n ORDER BY created_at, id LIMIT $6",
+ "describe": {
+ "columns": [
+ {
+ "ordinal": 0,
+ "name": "id",
+ "type_info": "Uuid"
+ },
+ {
+ "ordinal": 1,
+ "name": "user_id",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 2,
+ "name": "name",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 3,
+ "name": "config",
+ "type_info": "Jsonb"
+ },
+ {
+ "ordinal": 4,
+ "name": "created_at",
+ "type_info": "Timestamptz"
+ },
+ {
+ "ordinal": 5,
+ "name": "updated_at",
+ "type_info": "Timestamptz"
+ },
+ {
+ "ordinal": 6,
+ "name": "revision",
+ "type_info": "Int8"
+ },
+ {
+ "ordinal": 7,
+ "name": "shared_team_id",
+ "type_info": "Uuid"
+ }
+ ],
+ "parameters": {
+ "Left": [
+ "Text",
+ "UuidArray",
+ "Text",
+ "Timestamptz",
+ "Uuid",
+ "Int8"
+ ]
+ },
+ "nullable": [
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ true
+ ]
+ },
+ "hash": "1eecfd6a6960454a52892ac03e393600f185c05548b1a4bc29b4f26b3b4e0eba"
+}
diff --git a/.sqlx/query-3c81999a63b256699617d64e8428b25f072106f90cc9a3b7b3c42a873cec4f0f.json b/.sqlx/query-3c81999a63b256699617d64e8428b25f072106f90cc9a3b7b3c42a873cec4f0f.json
new file mode 100644
index 0000000000..2073315a2a
--- /dev/null
+++ b/.sqlx/query-3c81999a63b256699617d64e8428b25f072106f90cc9a3b7b3c42a873cec4f0f.json
@@ -0,0 +1,69 @@
+{
+ "db_name": "PostgreSQL",
+ "query": "UPDATE saved_view SET name = COALESCE($4, name), config = COALESCE($5, config),\n shared_team_id = $6,\n revision = revision + 1, updated_at = NOW()\n WHERE id = $1 AND user_id = $2 AND revision = $3\n RETURNING id, user_id, name, config, created_at, updated_at, revision, shared_team_id",
+ "describe": {
+ "columns": [
+ {
+ "ordinal": 0,
+ "name": "id",
+ "type_info": "Uuid"
+ },
+ {
+ "ordinal": 1,
+ "name": "user_id",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 2,
+ "name": "name",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 3,
+ "name": "config",
+ "type_info": "Jsonb"
+ },
+ {
+ "ordinal": 4,
+ "name": "created_at",
+ "type_info": "Timestamptz"
+ },
+ {
+ "ordinal": 5,
+ "name": "updated_at",
+ "type_info": "Timestamptz"
+ },
+ {
+ "ordinal": 6,
+ "name": "revision",
+ "type_info": "Int8"
+ },
+ {
+ "ordinal": 7,
+ "name": "shared_team_id",
+ "type_info": "Uuid"
+ }
+ ],
+ "parameters": {
+ "Left": [
+ "Uuid",
+ "Text",
+ "Int8",
+ "Text",
+ "Jsonb",
+ "Uuid"
+ ]
+ },
+ "nullable": [
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ true
+ ]
+ },
+ "hash": "3c81999a63b256699617d64e8428b25f072106f90cc9a3b7b3c42a873cec4f0f"
+}
diff --git a/.sqlx/query-5711df4486f2e4d0ca71ea5d2d92ce33b9b6fa102a7b07325f05128d8388483b.json b/.sqlx/query-5711df4486f2e4d0ca71ea5d2d92ce33b9b6fa102a7b07325f05128d8388483b.json
new file mode 100644
index 0000000000..0532273670
--- /dev/null
+++ b/.sqlx/query-5711df4486f2e4d0ca71ea5d2d92ce33b9b6fa102a7b07325f05128d8388483b.json
@@ -0,0 +1,16 @@
+{
+ "db_name": "PostgreSQL",
+ "query": "DELETE FROM saved_view WHERE id = $1 AND user_id = $2 AND revision = $3",
+ "describe": {
+ "columns": [],
+ "parameters": {
+ "Left": [
+ "Uuid",
+ "Text",
+ "Int8"
+ ]
+ },
+ "nullable": []
+ },
+ "hash": "5711df4486f2e4d0ca71ea5d2d92ce33b9b6fa102a7b07325f05128d8388483b"
+}
diff --git a/.sqlx/query-68ad8e75246fed44a1e258483299257bc04def00c6417bee80f7816d1a085578.json b/.sqlx/query-62050b4348a2f47cddeb71cddeb290360be93a3d37fb30c7a72243e4fff039ac.json
similarity index 69%
rename from .sqlx/query-68ad8e75246fed44a1e258483299257bc04def00c6417bee80f7816d1a085578.json
rename to .sqlx/query-62050b4348a2f47cddeb71cddeb290360be93a3d37fb30c7a72243e4fff039ac.json
index ae58693603..518b38ff9e 100644
--- a/.sqlx/query-68ad8e75246fed44a1e258483299257bc04def00c6417bee80f7816d1a085578.json
+++ b/.sqlx/query-62050b4348a2f47cddeb71cddeb290360be93a3d37fb30c7a72243e4fff039ac.json
@@ -1,6 +1,6 @@
{
"db_name": "PostgreSQL",
- "query": "SELECT id, user_id, name, config, created_at, updated_at FROM saved_view WHERE user_id = $1",
+ "query": "SELECT id, user_id, name, config, created_at, updated_at, revision, shared_team_id FROM saved_view WHERE user_id = $1",
"describe": {
"columns": [
{
@@ -32,6 +32,16 @@
"ordinal": 5,
"name": "updated_at",
"type_info": "Timestamptz"
+ },
+ {
+ "ordinal": 6,
+ "name": "revision",
+ "type_info": "Int8"
+ },
+ {
+ "ordinal": 7,
+ "name": "shared_team_id",
+ "type_info": "Uuid"
}
],
"parameters": {
@@ -45,8 +55,10 @@
false,
false,
false,
- false
+ false,
+ false,
+ true
]
},
- "hash": "68ad8e75246fed44a1e258483299257bc04def00c6417bee80f7816d1a085578"
+ "hash": "62050b4348a2f47cddeb71cddeb290360be93a3d37fb30c7a72243e4fff039ac"
}
diff --git a/.sqlx/query-79776fe0771f21f626dd890b6e89c53686eb2a83644fe50560183f0019179cf7.json b/.sqlx/query-79776fe0771f21f626dd890b6e89c53686eb2a83644fe50560183f0019179cf7.json
new file mode 100644
index 0000000000..a1d6d4487c
--- /dev/null
+++ b/.sqlx/query-79776fe0771f21f626dd890b6e89c53686eb2a83644fe50560183f0019179cf7.json
@@ -0,0 +1,22 @@
+{
+ "db_name": "PostgreSQL",
+ "query": "SELECT EXISTS(SELECT 1 FROM saved_view_tombstone WHERE id = $1) AS \"exists!\"",
+ "describe": {
+ "columns": [
+ {
+ "ordinal": 0,
+ "name": "exists!",
+ "type_info": "Bool"
+ }
+ ],
+ "parameters": {
+ "Left": [
+ "Uuid"
+ ]
+ },
+ "nullable": [
+ null
+ ]
+ },
+ "hash": "79776fe0771f21f626dd890b6e89c53686eb2a83644fe50560183f0019179cf7"
+}
diff --git a/.sqlx/query-d20c082d3cea0215d43fba8023c43c48e9ad8b934613ece6777e4948e18572bc.json b/.sqlx/query-856742e5c0c103ddd4952863dc950a83f78d7161aa6d9d08ea85bb778c6b4a05.json
similarity index 69%
rename from .sqlx/query-d20c082d3cea0215d43fba8023c43c48e9ad8b934613ece6777e4948e18572bc.json
rename to .sqlx/query-856742e5c0c103ddd4952863dc950a83f78d7161aa6d9d08ea85bb778c6b4a05.json
index c6a7deabe5..ea9333f813 100644
--- a/.sqlx/query-d20c082d3cea0215d43fba8023c43c48e9ad8b934613ece6777e4948e18572bc.json
+++ b/.sqlx/query-856742e5c0c103ddd4952863dc950a83f78d7161aa6d9d08ea85bb778c6b4a05.json
@@ -1,6 +1,6 @@
{
"db_name": "PostgreSQL",
- "query": "SELECT id, user_id, name, config, created_at, updated_at FROM saved_view WHERE id = $1",
+ "query": "SELECT id, user_id, name, config, created_at, updated_at, revision, shared_team_id FROM saved_view WHERE id = $1",
"describe": {
"columns": [
{
@@ -32,6 +32,16 @@
"ordinal": 5,
"name": "updated_at",
"type_info": "Timestamptz"
+ },
+ {
+ "ordinal": 6,
+ "name": "revision",
+ "type_info": "Int8"
+ },
+ {
+ "ordinal": 7,
+ "name": "shared_team_id",
+ "type_info": "Uuid"
}
],
"parameters": {
@@ -45,8 +55,10 @@
false,
false,
false,
- false
+ false,
+ false,
+ true
]
},
- "hash": "d20c082d3cea0215d43fba8023c43c48e9ad8b934613ece6777e4948e18572bc"
+ "hash": "856742e5c0c103ddd4952863dc950a83f78d7161aa6d9d08ea85bb778c6b4a05"
}
diff --git a/.sqlx/query-92639962d99b3f9eaca601f326639140db4354abde0cb745f1a3c04093a8fff0.json b/.sqlx/query-92639962d99b3f9eaca601f326639140db4354abde0cb745f1a3c04093a8fff0.json
new file mode 100644
index 0000000000..3d29ff7140
--- /dev/null
+++ b/.sqlx/query-92639962d99b3f9eaca601f326639140db4354abde0cb745f1a3c04093a8fff0.json
@@ -0,0 +1,15 @@
+{
+ "db_name": "PostgreSQL",
+ "query": "DELETE FROM saved_view WHERE id = $1 AND user_id = $2",
+ "describe": {
+ "columns": [],
+ "parameters": {
+ "Left": [
+ "Uuid",
+ "Text"
+ ]
+ },
+ "nullable": []
+ },
+ "hash": "92639962d99b3f9eaca601f326639140db4354abde0cb745f1a3c04093a8fff0"
+}
diff --git a/.sqlx/query-cbd8fd7362c56f8c1a5bb9db32538a0d4a1716f4d311683cc07f488d33fecad7.json b/.sqlx/query-a47dbde3687469c33336ff0802799a221523e59345273c3429ac838da62e716d.json
similarity index 67%
rename from .sqlx/query-cbd8fd7362c56f8c1a5bb9db32538a0d4a1716f4d311683cc07f488d33fecad7.json
rename to .sqlx/query-a47dbde3687469c33336ff0802799a221523e59345273c3429ac838da62e716d.json
index 32a9748280..b3e1ce1ea0 100644
--- a/.sqlx/query-cbd8fd7362c56f8c1a5bb9db32538a0d4a1716f4d311683cc07f488d33fecad7.json
+++ b/.sqlx/query-a47dbde3687469c33336ff0802799a221523e59345273c3429ac838da62e716d.json
@@ -1,6 +1,6 @@
{
"db_name": "PostgreSQL",
- "query": "INSERT INTO excluded_default_view (id, user_id, default_view_id) \n VALUES ($1, $2, $3)",
+ "query": "INSERT INTO excluded_default_view (id, user_id, default_view_id)\n VALUES ($1, $2, $3)",
"describe": {
"columns": [],
"parameters": {
@@ -12,5 +12,5 @@
},
"nullable": []
},
- "hash": "cbd8fd7362c56f8c1a5bb9db32538a0d4a1716f4d311683cc07f488d33fecad7"
+ "hash": "a47dbde3687469c33336ff0802799a221523e59345273c3429ac838da62e716d"
}
diff --git a/.sqlx/query-5a175ba3589c494d31510ec831a37d0febf04a956ff09e0a57665211118e876a.json b/.sqlx/query-c138e67e998dcb2f92520133c2b0a98e593cdad75451794b98459199b2c1e25b.json
similarity index 55%
rename from .sqlx/query-5a175ba3589c494d31510ec831a37d0febf04a956ff09e0a57665211118e876a.json
rename to .sqlx/query-c138e67e998dcb2f92520133c2b0a98e593cdad75451794b98459199b2c1e25b.json
index cd933c59fc..fa35b5de39 100644
--- a/.sqlx/query-5a175ba3589c494d31510ec831a37d0febf04a956ff09e0a57665211118e876a.json
+++ b/.sqlx/query-c138e67e998dcb2f92520133c2b0a98e593cdad75451794b98459199b2c1e25b.json
@@ -1,6 +1,6 @@
{
"db_name": "PostgreSQL",
- "query": "INSERT INTO saved_view (id, user_id, name, config, created_at, updated_at) \n VALUES ($1, $2, $3, $4, $5, $6)",
+ "query": "INSERT INTO saved_view (id, user_id, name, config, created_at, updated_at, shared_team_id)\n VALUES ($1, $2, $3, $4, $5, $6, $7) ON CONFLICT (id) DO NOTHING",
"describe": {
"columns": [],
"parameters": {
@@ -10,10 +10,11 @@
"Text",
"Jsonb",
"Timestamptz",
- "Timestamptz"
+ "Timestamptz",
+ "Uuid"
]
},
"nullable": []
},
- "hash": "5a175ba3589c494d31510ec831a37d0febf04a956ff09e0a57665211118e876a"
+ "hash": "c138e67e998dcb2f92520133c2b0a98e593cdad75451794b98459199b2c1e25b"
}
diff --git a/.sqlx/query-ea674f0a9d53a37775cee691aaa387db892d3902606258ac7c1e87652eba76e7.json b/.sqlx/query-ea674f0a9d53a37775cee691aaa387db892d3902606258ac7c1e87652eba76e7.json
deleted file mode 100644
index 9107558690..0000000000
--- a/.sqlx/query-ea674f0a9d53a37775cee691aaa387db892d3902606258ac7c1e87652eba76e7.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n UPDATE saved_view\n SET \n name = COALESCE($2, name),\n config = CASE \n WHEN $3::jsonb IS NOT NULL THEN config || $3 \n ELSE config \n END,\n updated_at = NOW()\n WHERE id = $1\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text",
- "Jsonb"
- ]
- },
- "nullable": []
- },
- "hash": "ea674f0a9d53a37775cee691aaa387db892d3902606258ac7c1e87652eba76e7"
-}
diff --git a/CLAUDE.md b/CLAUDE.md
index ff017822b1..14cce16414 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -75,6 +75,7 @@ Real files live in `.agents/`; tool-specific directories only symlink to it.
asking. Never commit to `main`. Push or open a PR only when asked.
Once authorized, finish in-scope review fixes and follow-up pushes without
per-fix confirmation.
+- Keep each feature's development, validation, and local preview on one branch/worktree.
- Flag real risks; once the user decides, act on it.
- Disagree when they're wrong. No flattery.
- Answer simple questions directly.
diff --git a/CODING.md b/CODING.md
index f66eede28b..ccf9059448 100644
--- a/CODING.md
+++ b/CODING.md
@@ -24,9 +24,9 @@ files; the [style guide](docs/development/style-guide.md) indexes them.
- No macros or helpers just to save a few lines.
- Use native APIs and existing libraries. No polyfills, no homemade crypto.
- Keep types and traits small.
-- Name things for what they are. No jargon or slang.
+- Name things for what they are or do; avoid jargon, slang, and vague labels such as `candidates`.
- Use explicit branches instead of deeply nested ternaries.
-- Compatibility only at deployed boundaries (migrations, persisted formats).
+- Keep compatibility only at deployed boundaries; reject obsolete unreleased formats instead of adding upgrade paths.
## Correctness
diff --git a/Cargo.lock b/Cargo.lock
index 4a479264b9..9cc39cf8dc 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -4783,6 +4783,7 @@ dependencies = [
"notification",
"predicate-index",
"rootcause",
+ "saved_views",
"scheduled_action",
"serde",
"serde_json",
@@ -17124,11 +17125,16 @@ dependencies = [
name = "saved_views"
version = "0.1.0"
dependencies = [
+ "async-trait",
"chrono",
+ "macro_db_migrator",
"macro_uuid",
+ "rootcause",
"serde",
"serde_json",
"sqlx",
+ "thiserror 2.0.18",
+ "tokio",
"tracing",
"utoipa",
"uuid",
diff --git a/apps/web/AGENTS.md b/apps/web/AGENTS.md
index 37210202e6..8ec0d85c8c 100644
--- a/apps/web/AGENTS.md
+++ b/apps/web/AGENTS.md
@@ -150,6 +150,7 @@ ownership. Cancel, logout, and the ten-minute timeout retire pending callbacks.
- Share URL recognition with `packages/lexical-core/utils/auto-link.ts`; preserve explicit unlink markers when saving and rendering messages. See `packages/lexical-core/README.md` at the repository root.
- Empty human DMs use the shared centered conversations graphic and explain email delivery to nonusers; keep this state out of agent DMs, loading/error states, and populated timelines.
+- Main Tasks mounts reusable GraphQL saved views; keep embedded Project/CRM task lists unchanged. Read `src/features/tasks-view/AGENTS.md` for filter, draft, navigation, and browser checks.
- Enable persisted email/calendar review controls only for the review’s saved acting account; historical reviews fall back to the session owner. Require session edit access on desktop and mobile.
- Email draft reads compare server generations before choosing cached delivery state over a restored working copy; only a definitive first-submission rejection permits local send recovery without server cancellation.
- Compose settings pages with `features/settings/primitives.tsx` so section headings,
diff --git a/apps/web/src/components/app/mobile/PillTabs.tsx b/apps/web/src/components/app/mobile/PillTabs.tsx
index 1b708a6232..2cb80a080b 100644
--- a/apps/web/src/components/app/mobile/PillTabs.tsx
+++ b/apps/web/src/components/app/mobile/PillTabs.tsx
@@ -2,6 +2,7 @@ import DotsThreeIcon from '@icon/system/regular/dots-three.svg';
import { createElementSize } from '@solid-primitives/resize-observer';
import { cn } from '@ui';
import {
+ type ComponentProps,
createEffect,
createMemo,
createSignal,
@@ -10,6 +11,7 @@ import {
on,
onCleanup,
Show,
+ splitProps,
} from 'solid-js';
import { MobileDockButton } from './MobileDockButton';
import { MobileDockIsland } from './MobileDockIsland';
@@ -83,6 +85,8 @@ type PillTabsProps<T extends string> = {
* logic accounts for a sticky leading element's width.
*/
leading?: JSXElement;
+ /** Scrollable variant only: content after the built-in pills. */
+ trailing?: JSXElement;
};
/**
@@ -105,33 +109,31 @@ export function PillTabs<T extends string>(props: PillTabsProps<T>) {
);
}
-function PillButton<T extends string>(props: {
- item: PillTabItem<T>;
- active: boolean;
- onSelect: () => void;
-}) {
+export function PillButton(
+ props: ComponentProps<'button'> & { active: boolean; iconOnly?: boolean }
+) {
+ const [local, rest] = splitProps(props, ['active', 'iconOnly', 'class']);
return (
<button
type="button"
- data-checked={props.active ? '' : undefined}
- aria-pressed={props.active}
- aria-label={props.item.ariaLabel}
+ data-checked={local.active ? '' : undefined}
+ aria-pressed={local.active}
class={cn(
PILL_CLASS,
- props.item.iconOnly && ICON_PILL_CLASS,
- props.active
+ local.iconOnly && ICON_PILL_CLASS,
+ local.active
? 'bg-accent text-surface'
- : 'bg-chrome text-ink-extra-muted'
+ : 'bg-chrome text-ink-extra-muted',
+ local.class
)}
+ {...rest}
onPointerDown={(e) => {
e.preventDefault();
+ const handler = rest.onPointerDown;
+ if (typeof handler === 'function') handler(e);
+ else if (handler) handler[0](handler[1], e);
}}
- onClick={() => {
- props.onSelect();
- }}
- >
- {props.item.label}
- </button>
+ />
);
}
@@ -336,12 +338,16 @@ function ScrollablePillTabs<T extends string>(props: PillTabsProps<T>) {
<For each={props.items}>
{(item) => (
<PillButton
- item={item}
active={props.value === item.value}
- onSelect={() => props.onChange(item.value)}
- />
+ iconOnly={item.iconOnly}
+ aria-label={item.ariaLabel}
+ onClick={() => props.onChange(item.value)}
+ >
+ {item.label}
+ </PillButton>
)}
</For>
+ {props.trailing}
</div>
</div>
);
@@ -446,10 +452,13 @@ function MenuOverflowPillTabs<T extends string>(props: PillTabsProps<T>) {
<For each={visibleItems()}>
{(item) => (
<PillButton
- item={item}
active={props.value === item.value}
- onSelect={() => props.onChange(item.value)}
- />
+ iconOnly={item.iconOnly}
+ aria-label={item.ariaLabel}
+ onClick={() => props.onChange(item.value)}
+ >
+ {item.label}
+ </PillButton>
)}
</For>
<Show when={overflowItems().length > 0}>
diff --git a/apps/web/src/components/view-shell/ListDropdowns.tsx b/apps/web/src/components/view-shell/ListDropdowns.tsx
index b1d4d28fcb..f474264c7b 100644
--- a/apps/web/src/components/view-shell/ListDropdowns.tsx
+++ b/apps/web/src/components/view-shell/ListDropdowns.tsx
@@ -217,6 +217,7 @@ export type ListFilterDropdownProps<
clearLabel?: string;
class?: string;
contentClass?: string;
+ footer?: JSX.Element;
} & ListDropdownOpenProps;
/**
@@ -403,6 +404,7 @@ export function ListFilterDropdown<
</Dropdown.Group>
)}
</Show>
+ {props.footer}
</Dropdown.Content>
</Dropdown>
);
diff --git a/apps/web/src/components/view-shell/MobileFilterDrawer.tsx b/apps/web/src/components/view-shell/MobileFilterDrawer.tsx
index 82d13c8f85..f752783e36 100644
--- a/apps/web/src/components/view-shell/MobileFilterDrawer.tsx
+++ b/apps/web/src/components/view-shell/MobileFilterDrawer.tsx
@@ -8,9 +8,11 @@ import CheckIcon from '@icon/system/regular/check.svg';
import SlidersHorizontalIcon from '@icon/system/regular/sliders-horizontal.svg?component-solid';
import XIcon from '@icon/system/regular/x.svg';
import { Accordion } from '@kobalte/core/accordion';
+import { createElementSize } from '@solid-primitives/resize-observer';
import { Button, cn } from '@ui';
import {
type Accessor,
+ children,
createContext,
createSignal,
type JSX,
@@ -29,13 +31,20 @@ type MobileFilterDrawerProps = {
class?: string;
open?: boolean;
onOpenChange?: (open: boolean) => void;
- /** Active filter chips or other controls beside Clear all. */
+ onContentPresentChange?: (present: boolean) => void;
+ /** Overlays the bottom of the scroll content, immediately above the footer. */
+ contentOverlay?: () => JSX.Element;
+ /** Additional controls beside Clear all, also shown without active filters. */
footer?: JSX.Element;
+ /** Trailing actions rendered within the drawer's dialog scope. */
+ footerEnd?: () => JSX.Element;
};
/** Presentation only; callers own filter state and compose the drawer contents. */
function Root(props: MobileFilterDrawerProps) {
const [scrollRef, setScrollRef] = createSignal<HTMLElement>();
+ const [overlayRef, setOverlayRef] = createSignal<HTMLDivElement>();
+ const overlaySize = createElementSize(overlayRef);
const [trigger, setTrigger] = createSignal<HTMLButtonElement>();
return (
@@ -43,6 +52,7 @@ function Root(props: MobileFilterDrawerProps) {
side="bottom"
open={props.open}
onOpenChange={props.onOpenChange}
+ onContentPresentChange={props.onContentPresentChange}
preventScroll={false}
preventScrollbarShift={false}
breakPoints={[0.85]}
@@ -94,34 +104,72 @@ function Root(props: MobileFilterDrawerProps) {
<div
ref={setScrollRef}
onFocusIn={(e) => scrollToFocusedInput(e)}
- class="h-full overflow-y-auto pb-3 scrollbar-hidden"
+ class="h-full overflow-y-auto scrollbar-hidden"
+ style={{
+ 'padding-bottom': `calc(${overlaySize.height ?? 0}px + 0.75rem)`,
+ 'scroll-padding-bottom': `${overlaySize.height ?? 0}px`,
+ }}
>
<ScrollContext.Provider value={scrollRef}>
{props.children}
</ScrollContext.Provider>
</div>
- </div>
- <Show when={props.activeCount > 0}>
- <div class="shrink-0 px-6 pt-3 pb-2">
- <div class="flex flex-wrap items-center gap-2">
- {props.footer}
- <Button
- variant="ghost"
- size="sm"
- class="min-h-10 px-4 text-failure-ink not-touch:not-disabled:hover:text-failure-ink"
- onClick={() => props.onClear()}
- >
- Clear all
- </Button>
- </div>
+ <div
+ ref={setOverlayRef}
+ class="absolute inset-x-0 bottom-0 z-10 bg-menu"
+ >
+ {props.contentOverlay?.()}
</div>
- </Show>
+ </div>
+ <Footer
+ activeCount={props.activeCount}
+ onClear={props.onClear}
+ footer={props.footer}
+ footerEnd={props.footerEnd}
+ />
</MobileDrawer.Content>
</MobileDrawer.Portal>
</MobileDrawer>
);
}
+function Footer(
+ props: Pick<
+ MobileFilterDrawerProps,
+ 'activeCount' | 'onClear' | 'footer' | 'footerEnd'
+ >
+) {
+ const footer = children(() => props.footer);
+ const end = children(() => props.footerEnd?.());
+ return (
+ <Show
+ when={
+ props.activeCount > 0 ||
+ footer.toArray().length > 0 ||
+ end.toArray().length > 0
+ }
+ >
+ <div class="shrink-0 px-6 pt-3 pb-2">
+ <div class="flex flex-wrap items-center gap-2">
+ {footer()}
+ <Show when={props.activeCount > 0}>
+ <Button
+ variant="ghost"
+ size="sm"
+ class="min-h-10 px-4 text-failure-ink not-touch:not-disabled:hover:text-failure-ink"
+ onClick={() => props.onClear()}
+ >
+ Clear all
+ </Button>
+ </Show>
+ <div class="ml-auto flex flex-wrap items-center justify-end gap-2">
+ {end()}
+ </div>
+ </div>
+ </div>
+ </Show>
+ );
+}
function Section(props: {
value: string;
label: string;
diff --git a/apps/web/src/features/saved-views/AGENTS.md b/apps/web/src/features/saved-views/AGENTS.md
new file mode 100644
index 0000000000..befa145242
--- /dev/null
+++ b/apps/web/src/features/saved-views/AGENTS.md
@@ -0,0 +1,45 @@
+# Saved views
+
+## What it is
+
+Reusable named view definitions. The first consumer is main Tasks; the generic feature does not interpret consumer configuration.
+
+## Start here
+
+- `core/saved-view.ts`: resource vocabulary, without transport or UI types.
+- `context/saved-views-source.ts`: independent list and detail read contracts.
+- `queries/saved-views.ts`: `useSavedViews` for cursor paging and `useSavedView` for one definition; compose them at the host.
+- `queries/saved-view-actions.ts`: independent create, update, and delete hooks using the shared GraphQL client, native mutation state, authoritative confirmation, and cursor reconciliation.
+- `views/saved-view-dialogs.tsx`: one create/edit dialog owns separate mutation hooks, a shared wide responsive form, and lifetime checks; deletion keeps its confirmation.
+- `components/`: presentational forms/confirmation, compound list, shared styled context/overflow items, and mobile picker.
+
+## Boundaries
+
+- Keep Task filters, navigation, and configuration decoding in `features/tasks-view`.
+- Do not migrate CRM's legacy personal views or team settings into this consumer.
+- Share definitions, not access to their matching entities; the backend owns authorization.
+- Rebuild loaded cursor chains after confirmed membership changes; never invent permission state or splice a full page.
+- Keep consumer edits on failed saves; only confirmed writes replace the baseline.
+- Keep sharing guidance beside the checkbox as a focusable info control; support hover and tap without toggling sharing.
+- Identify the saved view by name in edit and delete dialog titles; wrap long names on narrow screens.
+- Snapshot saved configuration when adapting query data; reconciled Solid stores must not mutate a confirmed draft baseline.
+- Mount picker menus inside the drawer portal scope, close menus before opening dialogs, then close the drawer and restore focus before opening another dialog.
+- Render the mobile picker trigger with the shared pill button and preserve the selected state supplied by its consumer.
+- Compose unsaved list entries with the draft row; keep draft lifecycle and confirmed-record reconciliation in the consumer.
+- Bind deferred picker actions to the opening account and discard them after an account change.
+- Validate the response viewer before exposing cached reads after an account change.
+- Keep list and detail hooks independent; pass mutation dialogs a refresh callback, not an aggregate read source.
+- Resolve the shared GraphQL client reactively inside read and mutation hooks; do not require callers to pass a client or mount a feature-local `UrqlProvider`.
+
+## Checks
+
+Run from `apps/web`:
+
+- `bun run test src/features/saved-views src/features/tasks-view`
+- `bun run type-check`
+- `bun run gen-graphql` after schema or document changes.
+
+## Related
+
+- `docs/design/saved-views.md` at the repository root.
+- `docs/architecture/frontend-features.md` and `docs/guides/add-graphql-field.md`.
diff --git a/apps/web/src/features/saved-views/CLAUDE.md b/apps/web/src/features/saved-views/CLAUDE.md
new file mode 120000
index 0000000000..47dc3e3d86
--- /dev/null
+++ b/apps/web/src/features/saved-views/CLAUDE.md
@@ -0,0 +1 @@
+AGENTS.md
\ No newline at end of file
diff --git a/apps/web/src/features/saved-views/components/saved-view-dialog.tsx b/apps/web/src/features/saved-views/components/saved-view-dialog.tsx
new file mode 100644
index 0000000000..f08b31107e
--- /dev/null
+++ b/apps/web/src/features/saved-views/components/saved-view-dialog.tsx
@@ -0,0 +1,174 @@
+import { Popover } from '@kobalte/core/popover';
+import InfoIcon from '@phosphor/info.svg';
+import {
+ Button,
+ Checkbox,
+ ConfirmDialog,
+ Dialog,
+ Input,
+ type ManagedDialogProps,
+} from '@ui';
+import { createSignal, type JSX, Show } from 'solid-js';
+
+type FormStatus = Pick<ManagedDialogProps, 'onOpenChange'> & {
+ pending: boolean;
+ error?: string;
+};
+
+const SHARING_DESCRIPTION =
+ 'Teammates can use these filters on items they can already access. Only you can edit this view.';
+
+function SharingInfo() {
+ const [open, setOpen] = createSignal(false);
+ const [trigger, setTrigger] = createSignal<HTMLButtonElement>();
+ const closeOnEscape = (event: KeyboardEvent) => {
+ if (event.key !== 'Escape' || !open()) return;
+ // Keep Escape from also dismissing the containing mobile drawer.
+ event.preventDefault();
+ event.stopPropagation();
+ setOpen(false);
+ };
+ return (
+ <Popover open={open()} onOpenChange={setOpen} modal={false} placement="top">
+ <Popover.Trigger
+ ref={setTrigger}
+ as={Button}
+ variant="ghost"
+ size="icon-xs"
+ label="About team sharing"
+ tooltip={SHARING_DESCRIPTION}
+ tooltipDisabled={open()}
+ onKeyDown={closeOnEscape}
+ >
+ <InfoIcon class="size-3.5" />
+ </Popover.Trigger>
+ <Popover.Portal
+ mount={trigger()?.closest<HTMLElement>('.portal-scope') ?? undefined}
+ >
+ <Popover.Content
+ class="menu-surface z-action-menu max-w-72 p-3 text-xs outline-none"
+ onKeyDown={closeOnEscape}
+ >
+ <Popover.Title class="sr-only">About team sharing</Popover.Title>
+ <Popover.Description>{SHARING_DESCRIPTION}</Popover.Description>
+ </Popover.Content>
+ </Popover.Portal>
+ </Popover>
+ );
+}
+
+export function SavedViewForm(
+ props: FormStatus & {
+ name: string;
+ sharedTeamId?: string | null;
+ title?: string;
+ submitLabel?: string;
+ summary?: JSX.Element;
+ team?: { id: string; name: string };
+ onSave: (name: string, team: string | null) => void;
+ }
+) {
+ const [name, setName] = createSignal(props.name);
+ const [shared, setShared] = createSignal(Boolean(props.sharedTeamId));
+ return (
+ <form
+ class="flex flex-col gap-5 p-6"
+ onSubmit={(event) => {
+ event.preventDefault();
+ props.onSave(
+ name().trim(),
+ shared() ? (props.sharedTeamId ?? props.team?.id ?? null) : null
+ );
+ }}
+ >
+ <Dialog.Title class="text-lg font-medium wrap-anywhere">
+ {props.title ?? 'Save view'}
+ </Dialog.Title>
+ <label class="flex flex-col gap-2 text-sm">
+ Name
+ <Input
+ value={name()}
+ onInput={(event) => setName(event.currentTarget.value)}
+ maxLength={120}
+ required
+ disabled={props.pending}
+ placeholder="e.g. Needs review"
+ />
+ </label>
+ <Show when={props.summary}>
+ <div class="flex flex-col gap-2 text-xs text-ink-muted">
+ {props.summary}
+ </div>
+ </Show>
+ <Show when={props.team || props.sharedTeamId}>
+ <div class="flex items-center gap-1.5">
+ <Checkbox
+ checked={shared()}
+ onChange={setShared}
+ disabled={props.pending}
+ >
+ <Checkbox.Control />
+ <Checkbox.Label>
+ Share with{' '}
+ {props.sharedTeamId && props.sharedTeamId !== props.team?.id
+ ? 'team'
+ : props.team?.name}
+ </Checkbox.Label>
+ </Checkbox>
+ <SharingInfo />
+ </div>
+ </Show>
+ <Show when={props.error}>
+ <p role="alert" class="text-sm text-failure-ink">
+ {props.error}
+ </p>
+ </Show>
+ <div class="flex justify-end gap-2">
+ <Button
+ variant="ghost"
+ disabled={props.pending}
+ onClick={() => props.onOpenChange(false)}
+ >
+ Cancel
+ </Button>
+ <Button
+ type="submit"
+ variant="strong"
+ disabled={props.pending || !name().trim()}
+ >
+ {props.pending ? 'Saving…' : (props.submitLabel ?? 'Save view')}
+ </Button>
+ </div>
+ </form>
+ );
+}
+
+export function DeleteSavedViewConfirmation(
+ props: ManagedDialogProps &
+ FormStatus & { name: string; onDelete: () => void }
+) {
+ return (
+ <ConfirmDialog
+ open={props.open}
+ onOpenChange={(open) => {
+ if (!props.pending) props.onOpenChange(open);
+ }}
+ title={<span class="wrap-anywhere">Delete “{props.name}”?</span>}
+ body={
+ <>
+ <p>
+ This removes the view for you and anyone it is shared with. Items
+ are not deleted.
+ </p>
+ <Show when={props.error}>
+ <p role="alert">{props.error}</p>
+ </Show>
+ </>
+ }
+ confirmLabel="Delete view"
+ tone="danger"
+ pending={props.pending}
+ onConfirm={props.onDelete}
+ />
+ );
+}
diff --git a/apps/web/src/features/saved-views/components/saved-view-list.tsx b/apps/web/src/features/saved-views/components/saved-view-list.tsx
new file mode 100644
index 0000000000..a084ba1fa0
--- /dev/null
+++ b/apps/web/src/features/saved-views/components/saved-view-list.tsx
@@ -0,0 +1,169 @@
+import { CollapsibleSection, ViewSidebar } from '@app/components/view-shell';
+import {
+ ContextMenuContent,
+ ContextMenuTrigger,
+} from '@core/component/ContextMenu';
+import { ContextMenu } from '@kobalte/core/context-menu';
+import BookmarkIcon from '@phosphor/bookmark-simple.svg';
+import DotsIcon from '@phosphor/dots-three.svg';
+import PlusIcon from '@phosphor/plus.svg';
+import UsersIcon from '@phosphor/users.svg';
+import { Dropdown } from '@ui';
+import { createSignal, type JSX, onCleanup, Show } from 'solid-js';
+import type { SavedView } from '../core/saved-view';
+
+function Root(props: {
+ open: boolean;
+ onOpenChange: (open: boolean) => void;
+ children: JSX.Element;
+}) {
+ return (
+ <CollapsibleSection.Root
+ open={props.open}
+ onOpenChange={props.onOpenChange}
+ >
+ {props.children}
+ </CollapsibleSection.Root>
+ );
+}
+
+function Header(props: { onCreate: () => void }) {
+ return (
+ <CollapsibleSection.Header>
+ <CollapsibleSection.Trigger>
+ <span class="min-w-0 truncate">Saved views</span>
+ <CollapsibleSection.Indicator />
+ </CollapsibleSection.Trigger>
+ <CollapsibleSection.Action
+ label="New saved view"
+ onClick={props.onCreate}
+ >
+ <PlusIcon class="size-3.5" />
+ </CollapsibleSection.Action>
+ </CollapsibleSection.Header>
+ );
+}
+
+function Content(props: { children: JSX.Element }) {
+ return (
+ <CollapsibleSection.Content>{props.children}</CollapsibleSection.Content>
+ );
+}
+
+function Items(props: { children: JSX.Element }) {
+ return (
+ <ViewSidebar.Nav aria-label="Saved task views">
+ {props.children}
+ </ViewSidebar.Nav>
+ );
+}
+
+function Draft(props: { onSelect: () => void }) {
+ return (
+ <ViewSidebar.Item
+ active
+ onClick={props.onSelect}
+ title="New view, draft"
+ aria-label="New view, draft"
+ >
+ <ViewSidebar.Icon>
+ <BookmarkIcon class="size-4" />
+ </ViewSidebar.Icon>
+ <span class="truncate italic">New view</span>
+ <span class="ml-auto text-xs text-ink-muted">Draft</span>
+ </ViewSidebar.Item>
+ );
+}
+
+export const SavedViewList = { Root, Header, Content, Items, Draft };
+
+/** A row accepts its consumer's menus without owning CRUD or viewer state. */
+export function SavedViewListRow(props: {
+ view: SavedView;
+ selected: boolean;
+ onSelect: () => void;
+ scopeKey: string | undefined;
+ menu: (defer: (action: () => void) => void) => JSX.Element;
+}) {
+ const [menuAnchor, setMenuAnchor] = createSignal<HTMLElement>();
+ let pending: { scopeKey: string | undefined; run: () => void } | undefined;
+ let disposed = false;
+ onCleanup(() => {
+ disposed = true;
+ pending = undefined;
+ });
+ const defer = (run: () => void) => {
+ pending = { scopeKey: props.scopeKey, run };
+ };
+ const finishMenuClose = (event: Event) => {
+ const action = pending;
+ pending = undefined;
+ if (!action) return;
+ event.preventDefault();
+ queueMicrotask(() => {
+ if (disposed || action.scopeKey !== props.scopeKey) return;
+ menuAnchor()
+ ?.querySelector<HTMLElement>('button')
+ ?.focus({ preventScroll: true });
+ action.run();
+ });
+ };
+ const label = () =>
+ props.view.sharedTeamId
+ ? `${props.view.name}, shared with team`
+ : props.view.name;
+ return (
+ <ContextMenu>
+ <ContextMenuTrigger
+ as="div"
+ ref={setMenuAnchor}
+ class="group relative min-w-0"
+ >
+ <ViewSidebar.Item
+ active={props.selected}
+ onClick={props.onSelect}
+ class="pr-10"
+ title={label()}
+ aria-label={label()}
+ >
+ <ViewSidebar.Icon>
+ <BookmarkIcon class="size-4" />
+ </ViewSidebar.Icon>
+ <span class="truncate">{props.view.name}</span>
+ <Show when={props.view.sharedTeamId}>
+ <ViewSidebar.Trailing>
+ <UsersIcon class="size-3.5" />
+ </ViewSidebar.Trailing>
+ </Show>
+ </ViewSidebar.Item>
+ <div class="absolute right-(--sidebar-action-inset) top-1/2 -translate-y-1/2 opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 touch:opacity-100">
+ <Dropdown placement="bottom-end">
+ <Dropdown.Trigger
+ as={ViewSidebar.Control}
+ label={`Actions for ${props.view.name}`}
+ >
+ <DotsIcon class="size-4" />
+ </Dropdown.Trigger>
+ <Dropdown.Content
+ class="min-w-44"
+ portalScope="local"
+ onCloseAutoFocus={finishMenuClose}
+ >
+ {props.menu(defer)}
+ </Dropdown.Content>
+ </Dropdown>
+ </div>
+ </ContextMenuTrigger>
+ <ContextMenu.Portal
+ mount={menuAnchor()?.closest<HTMLElement>('.portal-scope') ?? undefined}
+ >
+ <ContextMenuContent
+ class="min-w-44 p-0"
+ onCloseAutoFocus={finishMenuClose}
+ >
+ {props.menu(defer)}
+ </ContextMenuContent>
+ </ContextMenu.Portal>
+ </ContextMenu>
+ );
+}
diff --git a/apps/web/src/features/saved-views/components/saved-view-menu.tsx b/apps/web/src/features/saved-views/components/saved-view-menu.tsx
new file mode 100644
index 0000000000..2ff14511c9
--- /dev/null
+++ b/apps/web/src/features/saved-views/components/saved-view-menu.tsx
@@ -0,0 +1,48 @@
+import CopyIcon from '@phosphor/copy.svg';
+import LinkIcon from '@phosphor/link.svg';
+import PencilIcon from '@phosphor/pencil-simple.svg';
+import TrashIcon from '@phosphor/trash.svg';
+import { Dropdown } from '@ui';
+import { Show } from 'solid-js';
+
+export function SavedViewMenuItems(props: {
+ owned: boolean;
+ disabled?: boolean;
+ onEdit: () => void;
+ onDuplicate: () => void;
+ onCopyLink: () => void;
+ onDelete: () => void;
+}) {
+ return (
+ <div class="flex w-full flex-col divide-y divide-edge-divider">
+ <Dropdown.Group>
+ <Show when={props.owned}>
+ <Dropdown.Item disabled={props.disabled} onSelect={props.onEdit}>
+ <PencilIcon class="size-4" />
+ Edit
+ </Dropdown.Item>
+ </Show>
+ <Dropdown.Item disabled={props.disabled} onSelect={props.onDuplicate}>
+ <CopyIcon class="size-4" />
+ Duplicate
+ </Dropdown.Item>
+ <Dropdown.Item onSelect={props.onCopyLink}>
+ <LinkIcon class="size-4" />
+ Copy link
+ </Dropdown.Item>
+ </Dropdown.Group>
+ <Show when={props.owned}>
+ <Dropdown.Group>
+ <Dropdown.Item
+ class="text-failure-ink"
+ disabled={props.disabled}
+ onSelect={props.onDelete}
+ >
+ <TrashIcon class="size-4" />
+ Delete view
+ </Dropdown.Item>
+ </Dropdown.Group>
+ </Show>
+ </div>
+ );
+}
diff --git a/apps/web/src/features/saved-views/components/saved-view-picker.tsx b/apps/web/src/features/saved-views/components/saved-view-picker.tsx
new file mode 100644
index 0000000000..5e6c91b58b
--- /dev/null
+++ b/apps/web/src/features/saved-views/components/saved-view-picker.tsx
@@ -0,0 +1,75 @@
+import { MobileDrawer } from '@components/app/mobile/MobileDrawer';
+import { PillButton } from '@components/app/mobile/PillTabs';
+import CaretDownIcon from '@phosphor/caret-down.svg';
+import { createSignal, type JSX, onCleanup } from 'solid-js';
+
+/** Restores the picker focus before opening a row's next dialog or view. */
+export function SavedViewPicker(props: {
+ label: string;
+ active: boolean;
+ scopeKey: string | undefined;
+ children: (onAction: (action: () => void) => void) => JSX.Element;
+}) {
+ const [open, setOpen] = createSignal(false);
+ const [trigger, setTrigger] = createSignal<HTMLButtonElement>();
+ let pendingAction:
+ | { scopeKey: string | undefined; run: () => void }
+ | undefined;
+ let disposed = false;
+ onCleanup(() => {
+ disposed = true;
+ pendingAction = undefined;
+ });
+ const afterClose = (present: boolean) => {
+ if (present || open()) return;
+ // Let Corvu finish its presence update before restoring focus and opening
+ // another focus trap, matching other drawer-to-dialog handoffs.
+ queueMicrotask(() => {
+ if (disposed || open()) return;
+ trigger()?.focus({ preventScroll: true });
+ queueMicrotask(() => {
+ if (disposed || open()) return;
+ const action = pendingAction;
+ pendingAction = undefined;
+ if (action && action.scopeKey === props.scopeKey) action.run();
+ });
+ });
+ };
+ return (
+ <MobileDrawer
+ open={open()}
+ onOpenChange={(next) => {
+ if (next) pendingAction = undefined;
+ setOpen(next);
+ }}
+ restoreFocus={false}
+ onContentPresentChange={afterClose}
+ >
+ <MobileDrawer.Trigger
+ ref={setTrigger}
+ as={PillButton}
+ active={props.active}
+ class="flex max-w-64 items-center gap-1.5"
+ aria-label={props.label}
+ >
+ <span class="truncate">{props.label}</span>
+ <CaretDownIcon class="size-3.5 shrink-0" />
+ </MobileDrawer.Trigger>
+ <MobileDrawer.Portal>
+ <MobileDrawer.Overlay />
+ <MobileDrawer.Content>
+ <MobileDrawer.Handle />
+ <MobileDrawer.Title class="px-6 pb-3 text-base font-medium">
+ Saved views
+ </MobileDrawer.Title>
+ <MobileDrawer.ScrollBody class="px-3">
+ {props.children((action) => {
+ pendingAction = { scopeKey: props.scopeKey, run: action };
+ setOpen(false);
+ })}
+ </MobileDrawer.ScrollBody>
+ </MobileDrawer.Content>
+ </MobileDrawer.Portal>
+ </MobileDrawer>
+ );
+}
diff --git a/apps/web/src/features/saved-views/context/saved-views-source.ts b/apps/web/src/features/saved-views/context/saved-views-source.ts
new file mode 100644
index 0000000000..d89640536c
--- /dev/null
+++ b/apps/web/src/features/saved-views/context/saved-views-source.ts
@@ -0,0 +1,23 @@
+import type { Accessor } from 'solid-js';
+import type { SavedView } from '../core/saved-view';
+
+/** A paginated list of accessible definitions, independent of selection. */
+export type SavedViewsSource = {
+ items: Accessor<readonly SavedView[] | undefined>;
+ error: Accessor<unknown>;
+ loading: Accessor<boolean>;
+ hasMore: Accessor<boolean>;
+ loadingMore: Accessor<boolean>;
+ loadMore: () => Promise<unknown>;
+ refresh: () => Promise<unknown>;
+};
+
+/** Undefined data means loading; null means the definition is unavailable. */
+export type SavedViewSource = {
+ data: Accessor<SavedView | null | undefined>;
+ /** Viewer identity returned with the current data, not the requested identity. */
+ viewerId: Accessor<string | undefined>;
+ error: Accessor<unknown>;
+ loading: Accessor<boolean>;
+ refresh: () => Promise<unknown>;
+};
diff --git a/apps/web/src/features/saved-views/core/saved-view.ts b/apps/web/src/features/saved-views/core/saved-view.ts
new file mode 100644
index 0000000000..34bb846261
--- /dev/null
+++ b/apps/web/src/features/saved-views/core/saved-view.ts
@@ -0,0 +1,21 @@
+/** A saved definition grants access to its filters, never to matching items. */
+export type SavedView = {
+ id: string;
+ ownerId: string;
+ name: string;
+ config: unknown;
+ sharedTeamId: string | null;
+ revision: number;
+};
+
+export type SavedViewError = { code: string; message: string };
+export type CreateSavedView = {
+ id: string;
+ name: string;
+ config: unknown;
+ sharedTeamId: string | null;
+};
+export type UpdateSavedView = Omit<CreateSavedView, 'sharedTeamId'> & {
+ sharedTeamId?: string | null;
+ expectedRevision: number;
+};
diff --git a/apps/web/src/features/saved-views/queries/saved-view-actions.ts b/apps/web/src/features/saved-views/queries/saved-view-actions.ts
new file mode 100644
index 0000000000..aa27803c94
--- /dev/null
+++ b/apps/web/src/features/saved-views/queries/saved-view-actions.ts
@@ -0,0 +1,113 @@
+import { createUrqlMutation } from '@app/lib/urql-solid/create-urql-mutation';
+import { fireAndForget } from '@core/util/fireAndForget';
+import { Telemetry } from '@macro-inc/observability';
+import {
+ CreateSavedViewDocument,
+ type CreateSavedViewMutation,
+ type CreateSavedViewMutationVariables,
+ DeleteSavedViewDocument,
+ type DeleteSavedViewMutation,
+ type DeleteSavedViewMutationVariables,
+ UpdateSavedViewDocument,
+ type UpdateSavedViewMutation,
+ type UpdateSavedViewMutationVariables,
+} from '@service-storage/graphql/generated/graphql';
+import { getGraphqlSoupClient } from '@service-storage/graphql-soup';
+import { CombinedError } from '@urql/core';
+import type { CreateSavedView, UpdateSavedView } from '../core/saved-view';
+
+type Options = { refresh: () => Promise<unknown> };
+const unconfirmed = () =>
+ new CombinedError({
+ networkError: new Error(
+ 'The server did not confirm the saved view change.'
+ ),
+ });
+export const savedViewErrorMessage = (error: CombinedError | null) =>
+ error?.graphQLErrors[0]?.message ?? error?.message;
+
+export function useCreateSavedView(options: Options) {
+ return createUrqlMutation<
+ CreateSavedViewMutation,
+ CreateSavedViewMutationVariables,
+ CreateSavedView
+ >(() => ({
+ client: getGraphqlSoupClient(),
+ mutation: CreateSavedViewDocument,
+ execute: ({ client, input, context }) =>
+ Telemetry.span('saved_view.create', async (span) => {
+ span.setAttr('saved_view.id', input.id);
+ const result = await client
+ .mutation(CreateSavedViewDocument, { input }, context)
+ .toPromise();
+ if (!result.error && !result.data?.createSavedView)
+ result.error = unconfirmed();
+ if (result.error) span.error('Saved view create failed');
+ else if (client === getGraphqlSoupClient())
+ fireAndForget(options.refresh(), 'saved-views');
+ return result;
+ }),
+ }));
+}
+
+export function useUpdateSavedView(options: Options) {
+ return createUrqlMutation<
+ UpdateSavedViewMutation,
+ UpdateSavedViewMutationVariables,
+ UpdateSavedView
+ >(() => ({
+ client: getGraphqlSoupClient(),
+ mutation: UpdateSavedViewDocument,
+ execute: ({ client, input, context }) =>
+ Telemetry.span('saved_view.update', async (span) => {
+ span.setAttr('saved_view.id', input.id);
+ const result = await client
+ .mutation(
+ UpdateSavedViewDocument,
+ {
+ input: {
+ id: input.id,
+ name: input.name,
+ config: input.config,
+ expectedRevision: input.expectedRevision,
+ sharing:
+ input.sharedTeamId === undefined
+ ? undefined
+ : { teamId: input.sharedTeamId },
+ },
+ },
+ context
+ )
+ .toPromise();
+ if (!result.error && !result.data?.updateSavedView)
+ result.error = unconfirmed();
+ if (result.error) span.error('Saved view update failed');
+ else if (client === getGraphqlSoupClient())
+ fireAndForget(options.refresh(), 'saved-views');
+ return result;
+ }),
+ }));
+}
+
+export function useDeleteSavedView(options: Options) {
+ return createUrqlMutation<
+ DeleteSavedViewMutation,
+ DeleteSavedViewMutationVariables,
+ DeleteSavedViewMutationVariables['input']
+ >(() => ({
+ client: getGraphqlSoupClient(),
+ mutation: DeleteSavedViewDocument,
+ execute: ({ client, input, context }) =>
+ Telemetry.span('saved_view.delete', async (span) => {
+ span.setAttr('saved_view.id', input.id);
+ const result = await client
+ .mutation(DeleteSavedViewDocument, { input }, context)
+ .toPromise();
+ if (!result.error && !result.data) result.error = unconfirmed();
+ if (result.error) span.error('Saved view delete failed');
+ else if (client === getGraphqlSoupClient())
+ fireAndForget(options.refresh(), 'saved-views');
+ return result;
+ }),
+ }));
+}
diff --git a/apps/web/src/features/saved-views/queries/saved-views.ts b/apps/web/src/features/saved-views/queries/saved-views.ts
new file mode 100644
index 0000000000..c34b08e4f8
--- /dev/null
+++ b/apps/web/src/features/saved-views/queries/saved-views.ts
@@ -0,0 +1,156 @@
+import { createUrqlInfiniteQuery } from '@app/lib/urql-solid/create-urql-infinite-query';
+import { fireAndForget } from '@core/util/fireAndForget';
+import { createLiveQuery } from '@graphql-cache/solid/create-live-query';
+import {
+ SavedViewDocument,
+ type SavedViewFieldsFragment,
+ SavedViewsDocument,
+ type SavedViewsQuery,
+ type SavedViewsQueryVariables,
+} from '@service-storage/graphql/generated/graphql';
+import { getGraphqlSoupClient } from '@service-storage/graphql-soup';
+import {
+ type Accessor,
+ createEffect,
+ createMemo,
+ on,
+ onCleanup,
+ onMount,
+} from 'solid-js';
+import { unwrap } from 'solid-js/store';
+import type {
+ SavedViewSource,
+ SavedViewsSource,
+} from '../context/saved-views-source';
+import type { SavedView } from '../core/saved-view';
+
+export function toSavedView(view: SavedViewFieldsFragment): SavedView {
+ return {
+ id: view.id,
+ ownerId: view.ownerId,
+ name: view.name,
+ config: structuredClone(unwrap(view.config)),
+ sharedTeamId: view.sharedTeamId ?? null,
+ revision: view.revision,
+ };
+}
+
+/** Revalidate server-side access when returning to a view or changing accounts. */
+function revalidateSavedViewQuery(
+ viewerId: Accessor<string | undefined>,
+ refresh: () => Promise<unknown>
+) {
+ let lastViewer = viewerId();
+ createEffect(
+ on(viewerId, (viewer) => {
+ if (!viewer) return;
+ if (lastViewer && lastViewer !== viewer)
+ fireAndForget(refresh(), 'saved-views');
+ lastViewer = viewer;
+ })
+ );
+ onMount(() => {
+ const foreground = () => {
+ if (document.visibilityState !== 'visible') return;
+ fireAndForget(refresh(), 'saved-views');
+ };
+ window.addEventListener('focus', foreground);
+ document.addEventListener('visibilitychange', foreground);
+ onCleanup(() => {
+ window.removeEventListener('focus', foreground);
+ document.removeEventListener('visibilitychange', foreground);
+ });
+ });
+}
+
+/** Cursor-paginated definitions, independent of any selected view. */
+export function useSavedViews(options: {
+ viewerId: Accessor<string | undefined>;
+ kind: string;
+}): SavedViewsSource {
+ const client = createMemo(getGraphqlSoupClient);
+ const list = createUrqlInfiniteQuery<
+ SavedViewsQuery,
+ SavedViewsQueryVariables,
+ string | null,
+ { viewerId: string | undefined; items: SavedView[] }
+ >(() => ({
+ query: SavedViewsDocument,
+ client: client(),
+ enabled: Boolean(options.viewerId()),
+ initialPageParam: null,
+ variables: (cursor) => ({
+ kind: options.kind,
+ first: 50,
+ after: cursor,
+ }),
+ getNextPageParam: (page) => page.user.savedViews.nextCursor ?? undefined,
+ select: ({ pages }) => ({
+ viewerId: pages[0]?.user.id,
+ items: [
+ ...new Map(
+ pages
+ .filter((page) => page.user.id === pages[0]?.user.id)
+ .flatMap((page) =>
+ page.user.savedViews.nodes.map(
+ (view) => [view.id, toSavedView(view)] as const
+ )
+ )
+ ).values(),
+ ],
+ }),
+ keepPreviousData: false,
+ requestPolicy: 'cache-and-network',
+ }));
+ const refresh = async () => {
+ await list.refetch({ requestPolicy: 'network-only' });
+ };
+ revalidateSavedViewQuery(options.viewerId, refresh);
+ return {
+ items: () =>
+ list.data?.viewerId === options.viewerId() ? list.data?.items : undefined,
+ loading: () => list.isPending || list.data?.viewerId !== options.viewerId(),
+ error: () => list.error,
+ hasMore: () => list.hasNextPage,
+ loadingMore: () => list.isFetchingNextPage,
+ loadMore: () => list.fetchNextPage(),
+ refresh,
+ };
+}
+
+/** One authorized definition, including views outside the loaded list pages. */
+export function useSavedView(options: {
+ viewerId: Accessor<string | undefined>;
+ id: Accessor<string | undefined>;
+}): SavedViewSource {
+ const client = createMemo(getGraphqlSoupClient);
+ const detail = createLiveQuery(
+ SavedViewDocument,
+ () => {
+ const id = options.id();
+ return id && options.viewerId() ? { id } : undefined;
+ },
+ () => ({
+ client: client(),
+ requestPolicy: 'cache-and-network',
+ keepPreviousData: false,
+ })
+ );
+ const refresh = async () => {
+ if (options.id()) await detail.refetch({ requestPolicy: 'network-only' });
+ };
+ revalidateSavedViewQuery(options.viewerId, refresh);
+ return {
+ data: () =>
+ detail.data?.user.id === options.viewerId()
+ ? detail.data?.user.savedView
+ ? toSavedView(detail.data.user.savedView)
+ : null
+ : undefined,
+ viewerId: () => detail.data?.user.id,
+ loading: () =>
+ detail.isPending || detail.data?.user.id !== options.viewerId(),
+ error: () => detail.error,
+ refresh,
+ };
+}
diff --git a/apps/web/src/features/saved-views/views/saved-view-dialogs.tsx b/apps/web/src/features/saved-views/views/saved-view-dialogs.tsx
new file mode 100644
index 0000000000..f98f1afa30
--- /dev/null
+++ b/apps/web/src/features/saved-views/views/saved-view-dialogs.tsx
@@ -0,0 +1,155 @@
+import { fireAndForget } from '@core/util/fireAndForget';
+import { Dialog, type ManagedDialogProps } from '@ui';
+import { type Accessor, createEffect, type JSX, on, onCleanup } from 'solid-js';
+import {
+ DeleteSavedViewConfirmation,
+ SavedViewForm,
+} from '../components/saved-view-dialog';
+import type { SavedView } from '../core/saved-view';
+import {
+ savedViewErrorMessage,
+ useCreateSavedView,
+ useDeleteSavedView,
+ useUpdateSavedView,
+} from '../queries/saved-view-actions';
+import { toSavedView } from '../queries/saved-views';
+
+type Scope = ManagedDialogProps & {
+ refresh: () => Promise<unknown>;
+ viewerId: Accessor<string | undefined>;
+ isCurrent: () => boolean;
+};
+
+// Closing a dialog cancels its UI completion, not a server write already sent.
+function createDialogLifetime(props: Scope, ownerId?: string) {
+ const viewer = props.viewerId();
+ let alive = true;
+ const sameAccount = () => Boolean(viewer) && props.viewerId() === viewer;
+ const current = () =>
+ alive &&
+ sameAccount() &&
+ (!ownerId || ownerId === viewer) &&
+ props.isCurrent();
+ createEffect(
+ on(current, (valid) => {
+ if (!valid) props.onOpenChange(false);
+ })
+ );
+ onCleanup(() => {
+ alive = false;
+ });
+ return { current, sameAccount, viewer };
+}
+
+export function SavedViewDialog(
+ props: Scope & {
+ summary?: JSX.Element;
+ team?: { id: string; name: string };
+ title?: string;
+ submitLabel?: string;
+ onSaved: (record: SavedView) => void;
+ } & (
+ | { mode: 'create'; id: string; name: string; config: unknown }
+ | { mode: 'edit'; record: SavedView }
+ )
+) {
+ const lifetime = createDialogLifetime(
+ props,
+ props.mode === 'edit' ? props.record.ownerId : undefined
+ );
+ const create = useCreateSavedView({ refresh: props.refresh });
+ const update = useUpdateSavedView({ refresh: props.refresh });
+ const mutation = () => (props.mode === 'edit' ? update : create);
+ const save = async (name: string, sharedTeamId: string | null) => {
+ if (!lifetime.current() || mutation().isPending) return;
+ let record: SavedView | undefined;
+ if (props.mode === 'edit') {
+ const result = await update.mutateAsync({
+ id: props.record.id,
+ name,
+ config: props.record.config,
+ expectedRevision: props.record.revision,
+ sharedTeamId:
+ sharedTeamId === props.record.sharedTeamId ? undefined : sharedTeamId,
+ });
+ if (!result.error && result.data?.updateSavedView)
+ record = toSavedView(result.data.updateSavedView);
+ } else {
+ const result = await create.mutateAsync({
+ id: props.id,
+ name,
+ config: props.config,
+ sharedTeamId,
+ });
+ if (!result.error && result.data?.createSavedView)
+ record = toSavedView(result.data.createSavedView);
+ }
+ if (record && lifetime.current()) {
+ props.onSaved(record);
+ props.onOpenChange(false);
+ }
+ };
+ return (
+ <Dialog
+ open={props.open}
+ position="center"
+ class="w-150"
+ onOpenChange={(open) => {
+ if (!mutation().isPending) props.onOpenChange(open);
+ }}
+ >
+ <SavedViewForm
+ {...props}
+ name={props.mode === 'edit' ? props.record.name : props.name}
+ sharedTeamId={props.mode === 'edit' ? props.record.sharedTeamId : null}
+ title={
+ props.title ??
+ (props.mode === 'edit' ? `Edit “${props.record.name}”` : 'Save view')
+ }
+ submitLabel={
+ props.submitLabel ??
+ (props.mode === 'edit' ? 'Save changes' : 'Save view')
+ }
+ pending={mutation().isPending}
+ error={savedViewErrorMessage(mutation().error)}
+ onSave={(name, team) => fireAndForget(save(name, team), 'saved-views')}
+ />
+ </Dialog>
+ );
+}
+
+export function DeleteSavedViewDialog(
+ props: Scope & {
+ record: SavedView;
+ onDeleted: (record: SavedView, viewer: string) => void;
+ }
+) {
+ const lifetime = createDialogLifetime(props, props.record.ownerId);
+ const mutation = useDeleteSavedView({ refresh: props.refresh });
+ const remove = async () => {
+ if (!lifetime.current() || mutation.isPending) return;
+ const result = await mutation.mutateAsync({
+ id: props.record.id,
+ expectedRevision: props.record.revision,
+ });
+ if (
+ !result.error &&
+ result.data &&
+ lifetime.sameAccount() &&
+ lifetime.viewer
+ ) {
+ // A confirmed delete also applies when navigation selected this record while pending.
+ props.onDeleted(props.record, lifetime.viewer);
+ props.onOpenChange(false);
+ }
+ };
+ return (
+ <DeleteSavedViewConfirmation
+ {...props}
+ name={props.record.name}
+ pending={mutation.isPending}
+ error={savedViewErrorMessage(mutation.error)}
+ onDelete={() => fireAndForget(remove(), 'saved-views')}
+ />
+ );
+}
diff --git a/apps/web/src/features/tasks-view/AGENTS.md b/apps/web/src/features/tasks-view/AGENTS.md
new file mode 100644
index 0000000000..2d7f384de0
--- /dev/null
+++ b/apps/web/src/features/tasks-view/AGENTS.md
@@ -0,0 +1,50 @@
+# Tasks view
+
+## Scope
+
+Main Tasks and reusable task-list hosts. Projects and CRM embed `TasksViewProvider`; only `TasksView` mounts saved-view sources, without a feature-local GraphQL provider.
+
+## Start here
+
+- `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.
+- `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.
+
+## Gotchas
+
+- 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.
+- 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.
+- 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.
+- 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.
+- Place the saved-view picker after Filters and before built-in mobile tabs; show rows without a duplicate section header or create button inside its drawer.
+- Keep mobile pills in a flex wrapper inside the header so their shadow margins cannot collapse the header and overlap task content.
+- Show one local New view draft row after creation starts; prefill its save dialog with New view, replace the row on confirmed save, and remove it on cancellation or navigation without adding fake cached records.
+- Close the selected-view menu before opening a dialog, discard deferred actions after account or selection changes, and close dialogs after account, saved-view, or built-in-tab navigation.
+- Own mobile action dialogs outside closing drawers; finish drawer closure before opening a dialog, and reopen filters after cancellation only within the same navigation scope.
+- Honor confirmed deletion when the same account selects the target while deletion is pending; never apply completion to another account.
+- Keep malformed mutation responses separate from selected-view availability, preserve ordinary-create facets, and reject creation completions after the selected revision changes.
+- Apply supported saved filters immediately and show a danger banner above results for skipped conditions; show unfiltered tasks if none apply, and never rewrite the original on load.
+- Let owners explicitly remove skipped conditions from the warning banner; save only supported stored filters with revision checks, preserving temporary edits and sharing.
+- Reject update completions older than either the draft or selected-detail revision, including while temporary filters are dirty.
+- Default older definitions without grouping to the All Tasks default, Priority; warn on unknown grouping and block ordinary definition saves until explicit cleanup.
+- Preserve the raw saved layout during mobile or flag fallbacks; capture that layout instead of the displayed list fallback.
+- Block ordinary definition saves while unsupported settings remain; only explicit banner cleanup removes them, and metadata writes leave the definition unchanged.
+
+## Checks
+
+Run from `apps/web`:
+
+- `bun run test src/features/tasks-view`
+- `bun run type-check`
+
+## Related
+
+- `docs/agent-guide/tasks.md` and `docs/design/saved-views.md` at the repository root.
diff --git a/apps/web/src/features/tasks-view/CLAUDE.md b/apps/web/src/features/tasks-view/CLAUDE.md
new file mode 120000
index 0000000000..47dc3e3d86
--- /dev/null
+++ b/apps/web/src/features/tasks-view/CLAUDE.md
@@ -0,0 +1 @@
+AGENTS.md
\ No newline at end of file
diff --git a/apps/web/src/features/tasks-view/components/TasksFilterDrawer.tsx b/apps/web/src/features/tasks-view/components/TasksFilterDrawer.tsx
index 1bd6e1c9aa..fd4190825f 100644
--- a/apps/web/src/features/tasks-view/components/TasksFilterDrawer.tsx
+++ b/apps/web/src/features/tasks-view/components/TasksFilterDrawer.tsx
@@ -1,22 +1,82 @@
import { MobileFilterDrawer } from '@app/components/view-shell/MobileFilterDrawer';
import { MobileDrawer } from '@components/app/mobile/MobileDrawer';
+import { fireAndForget } from '@core/util/fireAndForget';
import { Accordion } from '@kobalte/core/accordion';
-import { createMemo, For } from 'solid-js';
+import type { DialogHandle } from '@ui';
+import { createMemo, createSignal, For, getOwner, onCleanup } 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';
+import {
+ TaskSavedViewActions,
+ TaskSavedViewCreateBanner,
+} from '../views/task-saved-views';
export function TasksFilterDrawer() {
- const { state, setPrimarySort, setState } = useTasksView();
+ const { state, setPrimarySort, setState, savedViews, savedViewScope } =
+ useTasksView();
const filters = useTaskFilters();
+ const [open, setOpen] = createSignal(false);
+ const owner = getOwner();
+ let disposed = false;
+ let pending:
+ | {
+ create: () => DialogHandle | undefined;
+ scope: ReturnType<typeof savedViewScope>;
+ }
+ | undefined;
+ onCleanup(() => {
+ disposed = true;
+ pending = undefined;
+ });
+ const onCreate = (create: () => DialogHandle | undefined) => {
+ pending = { create, scope: savedViewScope() };
+ setOpen(false);
+ };
+ const reopen = async (
+ dialog: DialogHandle,
+ scope: ReturnType<typeof savedViewScope>
+ ) => {
+ await dialog.closed;
+ if (!disposed && scope === savedViewScope()) setOpen(true);
+ };
+ const afterClose = (present: boolean) => {
+ if (present || open()) return;
+ const action = pending;
+ pending = undefined;
+ if (!action) return;
+ queueMicrotask(() =>
+ queueMicrotask(() => {
+ if (disposed || open() || action.scope !== savedViewScope()) return;
+ const dialog = action.create();
+ if (dialog) fireAndForget(reopen(dialog, action.scope), 'saved-views');
+ else setOpen(true);
+ })
+ );
+ };
const primarySort = () => state.sort[0]?.id ?? 'updated_at';
+ const editingSavedView = () => {
+ const view = savedViews?.view();
+ return view?.kind === 'saved' && view.dirty;
+ };
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
@@ -88,13 +148,14 @@ export function TasksFilterDrawer() {
<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.label}
+ {option.content?.() ?? option.label}
</MobileFilterDrawer.Option>
)}
</For>
diff --git a/apps/web/src/features/tasks-view/components/TasksHeader.tsx b/apps/web/src/features/tasks-view/components/TasksHeader.tsx
index 0cbc780eb6..49d60a17f7 100644
--- a/apps/web/src/features/tasks-view/components/TasksHeader.tsx
+++ b/apps/web/src/features/tasks-view/components/TasksHeader.tsx
@@ -9,10 +9,17 @@ import {
} from '@app/components/view-shell/ListHeader';
import { useSplitPanelOrThrow } from '@components/app/split-layout/layoutUtils';
import { isTouchDevice } from '@core/mobile/isTouchDevice';
+import BookmarkIcon from '@phosphor/bookmark-simple.svg';
import { Show } from 'solid-js';
import { TASK_TABS } from '../constants';
+import { taskSavedViewTitle } from '../primitives/create-task-saved-view-draft';
import { TasksCreateAction } from '../tasks-create-action';
import { useTasksView } from '../tasks-view-context';
+import {
+ TaskSavedViewActions,
+ TaskSavedViewMenu,
+ TaskSaveViewButton,
+} from '../views/task-saved-views';
import { TasksControls } from './TasksControls';
import { TasksMobileTabs } from './TasksMobileTabs';
@@ -22,9 +29,11 @@ export type TasksHeaderProps = {
};
export function TaskViewBreadcrumbItem() {
- const { state } = useTasksView();
+ const { state, savedViews } = useTasksView();
const tabTitle = () =>
- TASK_TABS.find((tab) => tab.id === state.tab)?.label ?? 'Tasks';
+ state.savedViewActive && savedViews
+ ? taskSavedViewTitle(savedViews.view())
+ : (TASK_TABS.find((tab) => tab.id === state.tab)?.label ?? 'Tasks');
return (
<ViewBreadcrumbs.Item
@@ -37,7 +46,11 @@ export function TaskViewBreadcrumbItem() {
isActive={item.isActive()}
onClick={item.onSelect}
tooltip={tabTitle()}
+ class="gap-2"
>
+ <Show when={state.savedViewActive}>
+ <BookmarkIcon class="size-4 shrink-0" aria-hidden="true" />
+ </Show>
<span class="truncate">{tabTitle()}</span>
</ViewBreadcrumbs.ReturnButton>
)}
@@ -66,8 +79,15 @@ export function TasksHeader(props: TasksHeaderProps) {
when={isTouchDevice()}
fallback={
<ListHeader
- title={<ViewBreadcrumbs.Outlet aria-label="Task location" />}
+ title={
+ <div class="flex min-w-0 items-center gap-1">
+ <ViewBreadcrumbs.Outlet aria-label="Task location" />
+ <TaskSavedViewMenu />
+ </div>
+ }
>
+ <TaskSaveViewButton />
+ <TaskSavedViewActions />
<TasksControls />
<TasksCreateAction
presentation="toolbar"
@@ -86,7 +106,7 @@ export function TasksHeader(props: TasksHeaderProps) {
}
>
<ViewShell.Header>
- <div class="flex min-w-0 flex-col @max-[720px]/view-shell:gap-3">
+ <div class="flex min-w-0 flex-col">
<TasksMobileTabs />
</div>
</ViewShell.Header>
diff --git a/apps/web/src/features/tasks-view/components/TasksMobileTabs.tsx b/apps/web/src/features/tasks-view/components/TasksMobileTabs.tsx
index 13d5164c96..b502e774ca 100644
--- a/apps/web/src/features/tasks-view/components/TasksMobileTabs.tsx
+++ b/apps/web/src/features/tasks-view/components/TasksMobileTabs.tsx
@@ -3,6 +3,7 @@ import { type JSX, Show } from 'solid-js';
import { TASK_TABS, type TaskTabItem } from '../constants';
import { useTasksView } from '../tasks-view-context';
import type { TasksTab } from '../types';
+import { TaskSavedViewsPicker } from '../views/task-saved-views';
import { TasksFilterDrawer } from './TasksFilterDrawer';
const toPill = (tab: TaskTabItem): PillTabItem<TasksTab> => ({
@@ -24,14 +25,17 @@ export function TasksMobileTabs(props: { leading?: JSX.Element }) {
class="-ml-(--mobile-chrome-gutter) w-[calc(100%+2*var(--mobile-chrome-gutter))] max-w-none flex-none"
contentClass="px-(--mobile-chrome-gutter)"
leading={
- props.leading ?? (
- <Show when={state.tab !== 'projects'}>
- <TasksFilterDrawer />
- </Show>
- )
+ <>
+ {props.leading ?? (
+ <Show when={state.tab !== 'projects'}>
+ <TasksFilterDrawer />
+ </Show>
+ )}
+ <TaskSavedViewsPicker />
+ </>
}
items={items()}
- value={state.tab}
+ value={state.savedViewActive ? undefined : state.tab}
onChange={setTab}
/>
</div>
diff --git a/apps/web/src/features/tasks-view/components/TasksSidebar.tsx b/apps/web/src/features/tasks-view/components/TasksSidebar.tsx
index e358ebc164..a36dbc73af 100644
--- a/apps/web/src/features/tasks-view/components/TasksSidebar.tsx
+++ b/apps/web/src/features/tasks-view/components/TasksSidebar.tsx
@@ -32,6 +32,7 @@ import { Dynamic } from 'solid-js/web';
import { TasksCreateAction } from '../tasks-create-action';
import { useTasksView } from '../tasks-view-context';
import type { TasksTab } from '../types';
+import { TaskSavedViewsList } from '../views/task-saved-views';
const TASK_NAV_ITEMS = [
{ id: 'my-tasks', label: 'My Tasks', icon: CheckSquareIcon },
@@ -52,7 +53,7 @@ export function TasksNavigation(props: { onNavigate?: () => void }) {
>
{(item) => (
<ViewSidebar.Item
- active={state.tab === item.id}
+ active={!state.savedViewActive && state.tab === item.id}
onClick={() => {
setTab(item.id);
props.onNavigate?.();
@@ -203,6 +204,7 @@ export function TasksSidebar() {
<ViewSidebar.Content>
<TasksNavigation />
+ <TaskSavedViewsList />
<TaskFavorites
open={isSidebarSectionOpen('favorites')}
diff --git a/apps/web/src/features/tasks-view/filters/task-facets.ts b/apps/web/src/features/tasks-view/filters/task-facets.ts
index 9862cc4e71..252fa92921 100644
--- a/apps/web/src/features/tasks-view/filters/task-facets.ts
+++ b/apps/web/src/features/tasks-view/filters/task-facets.ts
@@ -17,8 +17,16 @@ import {
getTaskStatusOptionId,
} from '@entity/utils/task-properties';
import { PROPERTY_OPTION_IDS, SYSTEM_PROPERTY_IDS } from '@property/constants';
+import { z } from 'zod';
-export type TaskFacetContext = TagFacetContext;
+export const TASK_VIEWER = '@viewer';
+
+export type TaskFacetContext = TagFacetContext & { viewerId?: string };
+
+export const resolveTaskPersonId = (id: string, context: TaskFacetContext) =>
+ id === TASK_VIEWER
+ ? (context.viewerId ?? '00000000-0000-0000-0000-000000000000')
+ : id;
export const EMPTY_TASK_FACET_CONTEXT: TaskFacetContext =
EMPTY_TAG_FACET_CONTEXT;
@@ -133,10 +141,34 @@ export const TASK_FACETS: Facet<
TaskFacetContext,
TaskFacetOption
>[] = [
- { id: 'status', mode: 'or', options: TASK_STATUS_OPTIONS },
- { id: 'priority', mode: 'or', options: TASK_PRIORITY_OPTIONS },
- { id: 'assignees', mode: 'or', options: assigneeOption },
- { id: 'created-by', mode: 'or', options: creatorOption },
+ {
+ id: 'status',
+ mode: 'or',
+ options: (id) =>
+ TASK_STATUS_OPTIONS.find((option) => option.id === id) ??
+ (z.string().guid().safeParse(id).success
+ ? statusOption(id, 'Unavailable status', id)
+ : undefined),
+ },
+ {
+ id: 'priority',
+ mode: 'or',
+ options: (id) =>
+ TASK_PRIORITY_OPTIONS.find((option) => option.id === id) ??
+ (z.string().guid().safeParse(id).success
+ ? priorityOption(id, 'Unavailable priority', id)
+ : undefined),
+ },
+ {
+ id: 'assignees',
+ mode: 'or',
+ options: (id, context) => assigneeOption(resolveTaskPersonId(id, context)),
+ },
+ {
+ id: 'created-by',
+ mode: 'or',
+ options: (id, context) => creatorOption(resolveTaskPersonId(id, context)),
+ },
{ id: TAG_FACET_ID, mode: 'or', options: tagOption },
];
diff --git a/apps/web/src/features/tasks-view/filters/task-predicates.ts b/apps/web/src/features/tasks-view/filters/task-predicates.ts
index 3f7d56fa3c..1201151d3a 100644
--- a/apps/web/src/features/tasks-view/filters/task-predicates.ts
+++ b/apps/web/src/features/tasks-view/filters/task-predicates.ts
@@ -39,10 +39,8 @@ export function taskMatchesView(
) {
if (!taskMatchesTab(task, context.tab, context.userId)) return false;
- return testFacets(
- context.facets,
- TASK_FACETS,
- task,
- context.facetContext ?? EMPTY_TASK_FACET_CONTEXT
- );
+ return testFacets(context.facets, TASK_FACETS, task, {
+ ...(context.facetContext ?? EMPTY_TASK_FACET_CONTEXT),
+ viewerId: context.userId,
+ });
}
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.ts
new file mode 100644
index 0000000000..ce981e6130
--- /dev/null
+++ b/apps/web/src/features/tasks-view/filters/task-saved-view.ts
@@ -0,0 +1,380 @@
+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 type { TasksViewState, TaskTab } from '../types';
+import {
+ TASK_PRIORITY_OPTIONS,
+ TASK_STATUS_OPTIONS,
+ TASK_VIEWER,
+ type TaskFacetContext,
+} from './task-facets';
+
+const personSchema = z.discriminatedUnion('type', [
+ z.object({ type: z.literal('viewer') }).strict(),
+ z
+ .object({
+ type: z.literal('user'),
+ id: z
+ .string()
+ .min(1)
+ .max(1024)
+ .refine((id) => id !== TASK_VIEWER),
+ })
+ .strict(),
+]);
+const identifierSchema = z
+ .string()
+ .guid()
+ .transform((id) => id.toLowerCase());
+const idsSchema = z.array(identifierSchema).max(100);
+const filtersSchema = z
+ .object({
+ statusOptionIds: idsSchema,
+ priorityOptionIds: idsSchema,
+ // Built-in tabs can add the viewer to 100 explicitly selected people.
+ assignees: z.array(personSchema).max(101),
+ creators: z.array(personSchema).max(101),
+ tags: z
+ .array(
+ z
+ .object({
+ propertyDefinitionId: identifierSchema,
+ optionId: identifierSchema,
+ })
+ .strict()
+ )
+ .max(100),
+ })
+ .strict();
+const layoutSchema = z.enum(['list', 'board', 'gantt']);
+const groupBySchema = z.enum([
+ 'none',
+ 'status',
+ 'priority',
+ 'assignee',
+ 'project',
+ 'date',
+]);
+const sortItemSchema = z
+ .object({
+ id: z.enum(['updated_at', 'created_at', 'viewed_at']),
+ reversed: z.boolean().default(false),
+ })
+ .strict();
+const sortSchema = z.array(sortItemSchema).max(3);
+const taskSavedViewSchema = z
+ .object({
+ kind: z.literal('tasks'),
+ version: z.literal(1),
+ filters: filtersSchema,
+ layout: layoutSchema.default('list'),
+ groupBy: groupBySchema.default(TASK_DEFAULT_GROUP_BY['team-tasks']),
+ sort: sortSchema.default([{ id: 'updated_at', reversed: false }]),
+ })
+ .strict();
+const readableTaskSavedViewSchema = taskSavedViewSchema
+ .pick({
+ kind: true,
+ version: true,
+ })
+ .extend({ filters: z.record(z.string(), z.unknown()) })
+ .loose();
+const SAVED_TASK_FACET_IDS: readonly string[] = [
+ 'status',
+ 'priority',
+ 'assignees',
+ 'created-by',
+ 'tags',
+];
+
+export type TaskSavedViewConfig = z.infer<typeof taskSavedViewSchema>;
+
+function uniqueSorted<T>(values: T[], key: (value: T) => string): T[] {
+ return [...new Map(values.map((value) => [key(value), value])).entries()]
+ .sort(([left], [right]) => left.localeCompare(right))
+ .map(([, value]) => value);
+}
+
+function canonical(config: TaskSavedViewConfig): TaskSavedViewConfig {
+ const filters = config.filters;
+ return {
+ kind: 'tasks',
+ version: 1,
+ layout: config.layout,
+ groupBy: config.groupBy,
+ sort: config.sort.map((item) => ({ ...item, reversed: !!item.reversed })),
+ filters: {
+ statusOptionIds: uniqueSorted(filters.statusOptionIds, String),
+ priorityOptionIds: uniqueSorted(filters.priorityOptionIds, String),
+ assignees: uniqueSorted(filters.assignees, JSON.stringify),
+ creators: uniqueSorted(filters.creators, JSON.stringify),
+ tags: uniqueSorted(filters.tags, (tag) => tag.optionId),
+ },
+ };
+}
+
+/** Rejects unknown fields and ambiguous bindings rather than dropping clauses. */
+export function decodeTaskSavedView(
+ value: unknown
+): Result<TaskSavedViewConfig, string> {
+ const parsed = taskSavedViewSchema.safeParse(value);
+ if (!parsed.success)
+ return err('This view contains unsupported or invalid task filters.');
+ const definitions = new Map<string, string>();
+ for (const tag of parsed.data.filters.tags) {
+ const previous = definitions.get(tag.optionId);
+ if (previous && previous !== tag.propertyDefinitionId)
+ return err('This view contains conflicting tag filters.');
+ definitions.set(tag.optionId, tag.propertyDefinitionId);
+ }
+ return ok(canonical(parsed.data));
+}
+
+export type TaskSavedViewIssue = {
+ path: string[];
+ message: string;
+};
+
+export type TaskSavedViewRead = {
+ config: TaskSavedViewConfig;
+ issues: TaskSavedViewIssue[];
+};
+
+/** Applies understood filters and reports anything omitted from the saved definition. */
+export function readTaskSavedView(value: unknown): TaskSavedViewRead {
+ const parsed = taskSavedViewSchema.safeParse(value);
+ const issues: TaskSavedViewIssue[] = parsed.success
+ ? []
+ : parsed.error.issues.flatMap((issue) =>
+ issue.code === 'unrecognized_keys'
+ ? issue.keys.map((key) => ({
+ path: [...issue.path.map(String), key],
+ message: 'This field is not supported.',
+ }))
+ : [{ path: issue.path.map(String), message: issue.message }]
+ );
+ const readable = readableTaskSavedViewSchema.safeParse(value);
+ if (!readable.success)
+ return {
+ issues,
+ config: {
+ kind: 'tasks',
+ version: 1,
+ layout: 'list',
+ groupBy: TASK_DEFAULT_GROUP_BY['team-tasks'],
+ sort: [{ id: 'updated_at', reversed: false }],
+ filters: {
+ statusOptionIds: [],
+ priorityOptionIds: [],
+ assignees: [],
+ creators: [],
+ tags: [],
+ },
+ },
+ };
+ const layout = layoutSchema.safeParse(readable.data.layout ?? 'list');
+ const groupBy = groupBySchema.safeParse(
+ readable.data.groupBy ?? TASK_DEFAULT_GROUP_BY['team-tasks']
+ );
+ const sort =
+ readable.data.sort === undefined
+ ? [{ id: 'updated_at' as const, reversed: false }]
+ : readSort(readable.data.sort);
+ const filters = readable.data.filters;
+
+ function readSort(value: unknown) {
+ if (!Array.isArray(value))
+ return [{ id: 'updated_at' as const, reversed: false }];
+ const supported = value
+ .flatMap((item) => {
+ const parsed = sortItemSchema.safeParse(item);
+ return parsed.success ? [parsed.data] : [];
+ })
+ .slice(0, 3);
+ return value.length && !supported.length
+ ? [{ id: 'updated_at' as const, reversed: false }]
+ : supported;
+ }
+ const readEntries = <T>(
+ values: unknown,
+ item: z.ZodType<T>,
+ limit: number
+ ): T[] =>
+ Array.isArray(values)
+ ? uniqueSorted(
+ values.flatMap((value) => {
+ const parsed = item.safeParse(value);
+ return parsed.success ? [parsed.data] : [];
+ }),
+ JSON.stringify
+ ).slice(0, limit)
+ : [];
+ const tags = readEntries(
+ filters.tags,
+ filtersSchema.shape.tags.element,
+ Number.POSITIVE_INFINITY
+ );
+ const definitions = new Map<string, Set<string>>();
+ for (const tag of tags) {
+ const ids = definitions.get(tag.optionId) ?? new Set<string>();
+ ids.add(tag.propertyDefinitionId);
+ definitions.set(tag.optionId, ids);
+ }
+ const conflicting = new Set(
+ [...definitions].filter(([, ids]) => ids.size > 1).map(([id]) => id)
+ );
+ if (Array.isArray(filters.tags)) {
+ filters.tags.forEach((tag, index) => {
+ const parsed = filtersSchema.shape.tags.element.safeParse(tag);
+ if (parsed.success && conflicting.has(parsed.data.optionId))
+ issues.push({
+ path: ['filters', 'tags', String(index)],
+ message: 'This tag has conflicting property definitions.',
+ });
+ });
+ }
+ return {
+ issues,
+ config: canonical({
+ kind: 'tasks',
+ version: 1,
+ layout: layout.success ? layout.data : 'list',
+ groupBy: groupBy.success
+ ? groupBy.data
+ : TASK_DEFAULT_GROUP_BY['team-tasks'],
+ sort,
+ filters: {
+ statusOptionIds: readEntries(
+ filters.statusOptionIds,
+ identifierSchema,
+ 100
+ ),
+ priorityOptionIds: readEntries(
+ filters.priorityOptionIds,
+ identifierSchema,
+ 100
+ ),
+ assignees: readEntries(filters.assignees, personSchema, 101),
+ creators: readEntries(filters.creators, personSchema, 101),
+ tags: tags
+ .filter((tag) => !conflicting.has(tag.optionId))
+ .slice(0, 100),
+ },
+ }),
+ };
+}
+
+const optionId = (id: string, options: typeof TASK_STATUS_OPTIONS): string =>
+ options.find((option) => option.id === id)?.propertyOptionId ?? id;
+
+/** Folds a built-in tab into ordinary person alternatives without losing other filters. */
+export function withTaskTabFilters(
+ tab: TaskTab,
+ facets: FacetSelection
+): FacetSelection {
+ if (tab === 'my-tasks')
+ return {
+ ...facets,
+ assignees: [...new Set([...(facets.assignees ?? []), TASK_VIEWER])],
+ };
+ if (tab === 'created-by-me')
+ return {
+ ...facets,
+ 'created-by': [
+ ...new Set([...(facets['created-by'] ?? []), TASK_VIEWER]),
+ ],
+ };
+ return facets;
+}
+
+/** Captures filters, layout, grouping, and sort; text search stays local. */
+export function captureTaskSavedView(input: {
+ tab: TaskTab;
+ facets: FacetSelection;
+ layout?: TasksViewState['layout'];
+ groupBy?: TasksViewState['groupBy'];
+ sort?: TasksViewState['sort'];
+ context: TaskFacetContext;
+}): Result<TaskSavedViewConfig, string> {
+ if (input.tab === 'projects')
+ return err('Open a task list to save its filters.');
+ if (
+ Object.keys(input.facets).some((id) => !SAVED_TASK_FACET_IDS.includes(id))
+ )
+ return err('These task filters cannot be saved yet.');
+ const tags = [];
+ for (const id of input.facets.tags ?? []) {
+ const definition = input.context.tagPropertyDefinitionByOptionId.get(id);
+ if (!definition)
+ return err('A selected tag is unavailable. Remove it before saving.');
+ tags.push({ optionId: id, propertyDefinitionId: definition });
+ }
+ const facets = withTaskTabFilters(input.tab, input.facets);
+ const people = (values: string[]) =>
+ values.map((id) =>
+ id === TASK_VIEWER
+ ? { type: 'viewer' as const }
+ : { type: 'user' as const, id }
+ );
+ return decodeTaskSavedView({
+ kind: 'tasks',
+ version: 1,
+ layout: input.layout,
+ groupBy: input.groupBy,
+ sort: input.sort,
+ filters: {
+ statusOptionIds: (input.facets.status ?? []).map((id) =>
+ optionId(id, TASK_STATUS_OPTIONS)
+ ),
+ priorityOptionIds: (input.facets.priority ?? []).map((id) =>
+ optionId(id, TASK_PRIORITY_OPTIONS)
+ ),
+ assignees: people(facets.assignees ?? []),
+ creators: people(facets['created-by'] ?? []),
+ tags,
+ },
+ });
+}
+
+export function materializeTaskSavedView(config: TaskSavedViewConfig): {
+ tab: TaskTab;
+ facets: FacetSelection;
+ tagBindings: ReadonlyMap<string, string>;
+ layout: TasksViewState['layout'];
+ groupBy: TasksViewState['groupBy'];
+ sort: TasksViewState['sort'];
+} {
+ const filters = config.filters;
+ const selectionId = (id: string, options: typeof TASK_STATUS_OPTIONS) =>
+ options.find((option) => option.propertyOptionId === id)?.id ?? id;
+ const people = (values: TaskSavedViewConfig['filters']['assignees']) =>
+ values.map((value) => (value.type === 'viewer' ? TASK_VIEWER : value.id));
+ return {
+ tab: 'team-tasks',
+ layout: config.layout,
+ groupBy: config.groupBy,
+ sort: config.sort.map((item) => ({ ...item })),
+ facets: {
+ status: filters.statusOptionIds.map((id) =>
+ selectionId(id, TASK_STATUS_OPTIONS)
+ ),
+ priority: filters.priorityOptionIds.map((id) =>
+ selectionId(id, TASK_PRIORITY_OPTIONS)
+ ),
+ assignees: people(filters.assignees),
+ 'created-by': people(filters.creators),
+ tags: filters.tags.map((tag) => tag.optionId),
+ },
+ tagBindings: new Map(
+ filters.tags.map((tag) => [tag.optionId, tag.propertyDefinitionId])
+ ),
+ };
+}
+
+export function taskSavedViewsEqual(
+ left: TaskSavedViewConfig,
+ right: TaskSavedViewConfig
+): boolean {
+ return JSON.stringify(canonical(left)) === JSON.stringify(canonical(right));
+}
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.tsx
index 5ba3b08186..442705e748 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
@@ -9,12 +9,17 @@ import { idToDisplayName } from '@core/user/util';
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 { match } from 'ts-pattern';
import { requestAiTaskFilterPlan } from '../queries/ai-task-filter-plan';
import { useTasksView } from '../tasks-view-context';
import type { AiTaskFilterCatalog } from './ai-task-filter';
-import { TASK_PRIORITY_OPTIONS, TASK_STATUS_OPTIONS } from './task-facets';
+import {
+ TASK_PRIORITY_OPTIONS,
+ TASK_STATUS_OPTIONS,
+ TASK_VIEWER,
+} from './task-facets';
const AI_FILTER_UNAVAILABLE_MESSAGE =
'AI filtering is unavailable right now. Try again in a moment.';
@@ -31,7 +36,7 @@ export type TaskFilterGroupId =
| 'tags';
export function useTaskFilters() {
- const { state, setFacets, setState } = useTasksView();
+ const { state, setFacets, setState, savedViews } = useTasksView();
const contacts = useContacts();
const currentUserId = useUserId();
const tagGroup = useTagFilterGroup();
@@ -45,7 +50,7 @@ export function useTaskFilters() {
people.unshift({ id: me, email: '', name: idToDisplayName(me) });
}
- return people.map((person) => ({
+ const options = people.map((person) => ({
id: person.id,
label:
person.id === me
@@ -63,49 +68,98 @@ export function useTaskFilters() {
/>
),
}));
+ return savedViews
+ ? [
+ {
+ id: TASK_VIEWER,
+ label: 'Me',
+ content: () => (
+ <Tooltip label="Matches whoever opens this saved view." as="span">
+ Me
+ </Tooltip>
+ ),
+ icon: () => (
+ <UserIcon
+ id={me ?? ''}
+ size="sm"
+ class="size-3.5"
+ suppressClick
+ showTooltip={false}
+ />
+ ),
+ },
+ ...options,
+ ]
+ : options;
});
+ const withUnavailable = (
+ id: TaskFilterGroupId,
+ options: ListFilterGroup<TaskFilterGroupId, string>['options']
+ ) => [
+ ...options,
+ ...(state.facets[id] ?? [])
+ .filter((selected) => !options.some((option) => option.id === selected))
+ .map((selected) => ({
+ id: selected,
+ label: `Unavailable ${id === 'tags' ? 'tag' : 'option'}`,
+ })),
+ ];
+
const groups = createMemo(
(): ListFilterGroup<TaskFilterGroupId, string>[] => [
{
id: 'status',
label: 'Status',
- options: TASK_STATUS_OPTIONS.map((option) => ({
- ...option,
- icon: () => (
- <PropertyValueIcon
- optionId={option.propertyOptionId}
- class="size-3.5"
- />
- ),
- })),
+ options: withUnavailable(
+ 'status',
+ TASK_STATUS_OPTIONS.map((option) => ({
+ ...option,
+ icon: () => (
+ <PropertyValueIcon
+ optionId={option.propertyOptionId}
+ class="size-3.5"
+ />
+ ),
+ }))
+ ),
},
{
id: 'priority',
label: 'Priority',
- options: TASK_PRIORITY_OPTIONS.map((option) => ({
- ...option,
- icon: () => (
- <PropertyValueIcon
- optionId={option.propertyOptionId}
- class="size-3.5"
- />
- ),
- })),
+ options: withUnavailable(
+ 'priority',
+ TASK_PRIORITY_OPTIONS.map((option) => ({
+ ...option,
+ icon: () => (
+ <PropertyValueIcon
+ optionId={option.propertyOptionId}
+ class="size-3.5"
+ />
+ ),
+ }))
+ ),
},
{
id: 'assignees',
label: 'Assignee',
searchPlaceholder: 'Search assignees...',
- options: peopleOptions(),
+ options: withUnavailable('assignees', peopleOptions()),
},
{
id: 'created-by',
label: 'Created by',
searchPlaceholder: 'Search creators...',
- options: peopleOptions(),
+ options: withUnavailable('created-by', peopleOptions()),
},
- ...(tagGroup().options.length > 0 ? [tagGroup()] : []),
+ ...(tagGroup().options.length > 0 || (state.facets.tags?.length ?? 0) > 0
+ ? [
+ {
+ ...tagGroup(),
+ options: withUnavailable('tags', tagGroup().options),
+ },
+ ]
+ : []),
]
);
diff --git a/apps/web/src/features/tasks-view/persistence.ts b/apps/web/src/features/tasks-view/persistence.ts
index 393ef79526..6d035ce2ae 100644
--- a/apps/web/src/features/tasks-view/persistence.ts
+++ b/apps/web/src/features/tasks-view/persistence.ts
@@ -86,11 +86,13 @@ function selectEntryState(state: TasksViewState): TasksEntryState {
return {
version: 1,
layout: state.layout,
- tab: state.tab,
- search: state.search,
+ tab: state.savedViewActive ? 'my-tasks' : state.tab,
+ search: state.savedViewActive ? '' : state.search,
groupBy: state.groupBy,
sort: state.sort.map((item) => ({ ...item })),
- facets: normalizeFacetSelection(state.facets),
+ facets: normalizeFacetSelection(
+ state.savedViewActive ? DEFAULT_TASK_FACET_SELECTION : state.facets
+ ),
collapsedGroupIds: [...state.collapsedGroupIds],
};
}
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.ts
new file mode 100644
index 0000000000..b90e032612
--- /dev/null
+++ b/apps/web/src/features/tasks-view/primitives/create-task-saved-view-draft.ts
@@ -0,0 +1,268 @@
+import {
+ type Accessor,
+ batch,
+ createEffect,
+ createMemo,
+ createSignal,
+ on,
+} from 'solid-js';
+import type { SavedViewSource } from '../../saved-views/context/saved-views-source';
+import type { SavedView } from '../../saved-views/core/saved-view';
+import { TASK_DEFAULT_GROUP_BY } from '../constants';
+import {
+ DEFAULT_TASK_FACET_SELECTION,
+ type TaskFacetContext,
+} from '../filters/task-facets';
+import {
+ captureTaskSavedView,
+ decodeTaskSavedView,
+ materializeTaskSavedView,
+ readTaskSavedView,
+ type TaskSavedViewConfig,
+ type TaskSavedViewIssue,
+ type TaskSavedViewRead,
+ taskSavedViewsEqual,
+} from '../filters/task-saved-view';
+import type { TasksViewState } from '../types';
+
+export type TaskSavedViewSelection =
+ | { kind: 'default'; changed: boolean }
+ | { kind: 'new'; changed: boolean }
+ | { kind: 'loading' }
+ | { kind: 'unavailable'; message: string }
+ | {
+ kind: 'saved';
+ record: SavedView;
+ dirty: boolean;
+ issues: TaskSavedViewIssue[];
+ };
+
+export function taskSavedViewTitle(view: TaskSavedViewSelection): string {
+ if (view.kind === 'saved') return view.record.name;
+ return view.kind === 'new' ? 'New view' : 'Saved view';
+}
+
+type ConfirmedTaskSavedView = TaskSavedViewRead & {
+ record: SavedView;
+ viewerId: string | undefined;
+};
+
+/** Keeps confirmed settings separate from edits; navigation and writes belong to the host. */
+export function createTaskSavedViewDraft(options: {
+ source: SavedViewSource;
+ selectedId: Accessor<string | undefined>;
+ viewerId: Accessor<string | undefined>;
+ creating: Accessor<boolean>;
+ state: Pick<TasksViewState, 'tab' | 'facets' | 'layout' | 'groupBy' | 'sort'>;
+ facetContext: Accessor<TaskFacetContext>;
+ apply: (
+ settings: Pick<TasksViewState, 'facets' | 'layout' | 'groupBy' | 'sort'>
+ ) => void;
+}) {
+ const [confirmed, setConfirmed] = createSignal<ConfirmedTaskSavedView>();
+ const [retainedDrafts, setRetainedDrafts] = createSignal<
+ { id: string | undefined; viewerId: string | undefined }[]
+ >([]);
+ const retain = () => {
+ const owner = { id: options.selectedId(), viewerId: options.viewerId() };
+ setRetainedDrafts((drafts) => [...drafts, owner]);
+ return () =>
+ setRetainedDrafts((drafts) => drafts.filter((draft) => draft !== owner));
+ };
+ let latestRevision = 0;
+ const tagBindings = createMemo<ReadonlyMap<string, string>>(
+ () =>
+ new Map(
+ confirmed()?.config.filters.tags.map((tag) => [
+ tag.optionId,
+ tag.propertyDefinitionId,
+ ])
+ )
+ );
+ const capture = () =>
+ captureTaskSavedView({
+ tab: options.state.tab,
+ facets: options.state.facets,
+ layout: options.state.layout,
+ groupBy: options.state.groupBy,
+ sort: options.state.sort,
+ context: options.facetContext(),
+ });
+ const current = createMemo(() => {
+ const result = capture();
+ return result.isOk() ? result.value : undefined;
+ });
+ const dirty = () => {
+ const baseline = confirmed()?.config;
+ const definition = current();
+ return Boolean(
+ baseline && (!definition || !taskSavedViewsEqual(baseline, definition))
+ );
+ };
+ const apply = (config: TaskSavedViewConfig) =>
+ options.apply(materializeTaskSavedView(config));
+ const install = (record: SavedView, parsed: TaskSavedViewRead) =>
+ setConfirmed({ record, viewerId: options.viewerId(), ...parsed });
+
+ createEffect(
+ on(
+ () => [options.selectedId(), options.viewerId()] as const,
+ ([id, viewer]) => {
+ latestRevision = 0;
+ setRetainedDrafts([]);
+ const previous = confirmed();
+ if (previous?.record.id !== id || previous?.viewerId !== viewer)
+ setConfirmed(undefined);
+ }
+ )
+ );
+ createEffect(
+ on(
+ () =>
+ [
+ options.selectedId(),
+ options.viewerId(),
+ options.creating(),
+ options.source.data(),
+ options.source.error(),
+ options.source.viewerId(),
+ retainedDrafts(),
+ ] as const,
+ ([id, viewer, creating, record, error, detailViewer]) => {
+ if (!id || !viewer || creating || error || !record || record.id !== id)
+ return;
+ if (detailViewer !== undefined && detailViewer !== viewer) return;
+ latestRevision = Math.max(
+ latestRevision,
+ record.revision,
+ confirmed()?.record.id === id
+ ? (confirmed()?.record.revision ?? 0)
+ : 0
+ );
+ if (record.revision < latestRevision) return;
+ if (
+ confirmed()?.record.id === id &&
+ (dirty() ||
+ retainedDrafts().some(
+ (draft) => draft.id === id && draft.viewerId === viewer
+ ))
+ )
+ return;
+ batch(() => {
+ const parsed = readTaskSavedView(record.config);
+ install(record, parsed);
+ apply(parsed.config);
+ });
+ }
+ )
+ );
+
+ const revision = () => {
+ const id = options.selectedId();
+ const local = confirmed()?.record;
+ const remote = options.source.data();
+ return Math.max(
+ latestRevision,
+ local && local.id === id ? local.revision : 0,
+ remote && remote.id === id ? remote.revision : 0
+ );
+ };
+ const view = createMemo<TaskSavedViewSelection>(() => {
+ const id = options.selectedId();
+ if (options.creating() || !id) {
+ const base = captureTaskSavedView({
+ tab: options.state.tab,
+ facets: DEFAULT_TASK_FACET_SELECTION,
+ groupBy: TASK_DEFAULT_GROUP_BY[options.state.tab],
+ context: options.facetContext(),
+ });
+ const definition = current();
+ return {
+ kind: options.creating() ? 'new' : 'default',
+ changed: Boolean(
+ definition &&
+ base.isOk() &&
+ !taskSavedViewsEqual(definition, base.value)
+ ),
+ };
+ }
+ const detailViewer = options.source.viewerId();
+ if (
+ (detailViewer === undefined || detailViewer === options.viewerId()) &&
+ (options.source.error() || options.source.data() === null)
+ ) {
+ return {
+ kind: 'unavailable',
+ message: 'This saved view is unavailable or you no longer have access.',
+ };
+ }
+ const snapshot = confirmed();
+ return options.viewerId() && snapshot?.record.id === id
+ ? {
+ kind: 'saved',
+ record: snapshot.record,
+ dirty: dirty(),
+ issues: snapshot.issues,
+ }
+ : { kind: 'loading' };
+ });
+ const reset = (record?: SavedView) => {
+ if (record) {
+ if (record.id !== options.selectedId() || record.revision < revision())
+ return;
+ latestRevision = Math.max(latestRevision, record.revision);
+ install(record, readTaskSavedView(record.config));
+ }
+ if (options.creating()) {
+ options.apply({
+ facets: DEFAULT_TASK_FACET_SELECTION,
+ layout: 'list',
+ groupBy: TASK_DEFAULT_GROUP_BY['team-tasks'],
+ sort: [{ id: 'updated_at' }],
+ });
+ return;
+ }
+ const baseline = confirmed()?.config;
+ if (baseline) apply(baseline);
+ };
+
+ // A write advances the baseline, never the settings the viewer is currently editing.
+ const acceptConfirmed = (record: SavedView) => {
+ const previous = confirmed();
+ if (record.id === options.selectedId() && record.revision < revision())
+ return false;
+ if (
+ previous?.record.id === record.id &&
+ record.revision < previous.record.revision
+ )
+ return false;
+ const decoded = decodeTaskSavedView(record.config);
+ if (decoded.isOk()) {
+ if (record.id === options.selectedId())
+ latestRevision = Math.max(latestRevision, record.revision);
+ install(record, { config: decoded.value, issues: [] });
+ return true;
+ }
+ // Rename/share retain skipped clauses and their existing filter baseline.
+ if (
+ previous?.record.id === record.id &&
+ JSON.stringify(previous.record.config) === JSON.stringify(record.config)
+ ) {
+ install(record, { config: previous.config, issues: previous.issues });
+ return true;
+ }
+ return false;
+ };
+
+ return {
+ view,
+ tagBindings,
+ capture,
+ revision,
+ reset,
+ acceptConfirmed,
+ retain,
+ };
+}
+
+export type TaskSavedViewDraft = ReturnType<typeof createTaskSavedViewDraft>;
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.ts
index 443999160d..fda3b7792d 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
@@ -1,8 +1,12 @@
import { type Accessor, createRoot, createSignal } from 'solid-js';
import { createStore } from 'solid-js/store';
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 type { TasksTabSearchParams } from '../tasks-tab-search';
import type { TasksTab, TasksViewState } from '../types';
+import { createTaskSavedViewDraft } from './create-task-saved-view-draft';
import { createTasksViewSearch } from './create-tasks-view-search';
const disposers: (() => void)[] = [];
@@ -206,3 +210,206 @@ it('falls back from restored board entries and from desktop boards when mobile a
desktop.setState('layout', 'board');
expect(desktop.state.layout).toBe('board');
});
+
+it.each(['board', 'gantt'] as const)(
+ 'keeps saved %s layout in raw state and URL during mobile fallback',
+ (layout) => {
+ const [nonListLayoutsEnabled, setNonListLayoutsEnabled] =
+ createSignal(true);
+ const view = setup({
+ state: { layout, savedViewActive: true },
+ search: {
+ savedView: '10000000-0000-4000-8000-000000000001',
+ layout,
+ },
+ nonListLayoutsEnabled,
+ });
+ expect(view.state.layout).toBe(layout);
+ expect(view.writeSearch).not.toHaveBeenCalled();
+
+ setNonListLayoutsEnabled(false);
+ expect(view.state.layout).toBe(layout);
+ expect(view.search.layout).toBe(layout);
+ expect(view.writeSearch).not.toHaveBeenCalled();
+
+ setNonListLayoutsEnabled(true);
+ expect(view.state.layout).toBe(layout);
+ expect(view.search.layout).toBe(layout);
+ }
+);
+
+it('retains saved secondary sorts while synchronizing matching URL controls', () => {
+ const savedSort = [
+ { id: 'created_at' as const, reversed: true },
+ { id: 'viewed_at' as const, reversed: false },
+ ];
+ const view = setup({
+ state: { savedViewActive: true, layout: 'board', sort: savedSort },
+ search: {
+ savedView: '10000000-0000-4000-8000-000000000001',
+ sort: 'created_at',
+ sortReversed: 'true',
+ },
+ });
+ expect(view.state.sort).toEqual(savedSort);
+ view.setSearch('groupBy', 'date');
+ expect(view.state.sort).toEqual(savedSort);
+ view.setSearch('layout', 'gantt');
+ expect(view.state.sort).toEqual(savedSort);
+ view.setSearch('sortReversed', 'true');
+ expect(view.state.sort).toEqual(savedSort);
+ expect(view.state.layout).toBe('gantt');
+});
+
+it('keeps saved scope and draft filters when changing presentation', () => {
+ const view = setup({
+ state: {
+ tab: 'team-tasks',
+ savedViewActive: true,
+ facets: { priority: ['urgent'] },
+ },
+ search: {
+ tab: 'my-tasks',
+ savedView: '10000000-0000-4000-8000-000000000001',
+ },
+ });
+ view.setState('layout', 'board');
+ view.setState('groupBy', 'assignee');
+ view.setPrimarySort('created_at');
+ expect(view.state.tab).toBe('team-tasks');
+ expect(view.state.facets).toEqual({ priority: ['urgent'] });
+ expect(view.search.savedView).toBe('10000000-0000-4000-8000-000000000001');
+});
+
+it('restores the requested built-in scope after leaving a saved view', () => {
+ const view = setup({
+ state: {
+ tab: 'team-tasks',
+ savedViewActive: true,
+ facets: { priority: ['urgent'] },
+ },
+ search: { savedView: '10000000-0000-4000-8000-000000000001' },
+ });
+ view.setSearch({ savedView: undefined, tab: 'created-by-me' });
+ view.setState('savedViewActive', false);
+ expect(view.state.tab).toBe('created-by-me');
+ expect(view.state.facets.priority).toBeUndefined();
+});
+
+it('keeps edits reverted during a save until confirmed presentation is explicitly reset', () => {
+ const fixture = createRoot((dispose) => {
+ disposers.push(dispose);
+ const record: SavedView = {
+ id: 'saved-view',
+ ownerId: 'viewer',
+ name: 'Saved view',
+ sharedTeamId: null,
+ revision: 1,
+ config: {
+ kind: 'tasks',
+ version: 1,
+ layout: 'list',
+ sort: [{ id: 'updated_at', reversed: false }],
+ filters: {
+ statusOptionIds: [],
+ priorityOptionIds: [],
+ assignees: [],
+ creators: [],
+ tags: [],
+ },
+ },
+ };
+ const [source, setSource] = createSignal(record);
+ const [state, setState] = createStore<TasksViewState>({
+ layout: 'list',
+ tab: 'team-tasks',
+ search: '',
+ groupBy: 'none',
+ sort: [{ id: 'updated_at' }],
+ facets: {},
+ collapsedGroupIds: [],
+ collapsedSidebarSectionIds: [],
+ });
+ const draft = createTaskSavedViewDraft({
+ source: {
+ data: source,
+ viewerId: () => 'viewer',
+ error: () => undefined,
+ loading: () => false,
+ refresh: async () => undefined,
+ },
+ selectedId: () => record.id,
+ viewerId: () => 'viewer',
+ creating: () => false,
+ state,
+ facetContext: () => ({ tagPropertyDefinitionByOptionId: new Map() }),
+ apply: (settings) => setState(settings),
+ });
+ return { state, setState, draft, record, setSource };
+ });
+ 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('layout', 'list');
+ fixture.setState('groupBy', 'priority');
+ const confirmed = { ...fixture.record, revision: 2, config: submitted.value };
+ fixture.setSource(confirmed);
+ expect(fixture.state.layout).toBe('list');
+ expect(fixture.draft.acceptConfirmed(confirmed)).toBe(true);
+ release();
+ expect(fixture.state.layout).toBe('list');
+ expect(fixture.state.groupBy).toBe('priority');
+ expect(fixture.draft.view()).toMatchObject({ kind: 'saved', dirty: true });
+ fixture.draft.reset();
+ expect(fixture.state.layout).toBe('board');
+ expect(fixture.state.groupBy).toBe('assignee');
+ expect(fixture.draft.view()).toMatchObject({ kind: 'saved', dirty: false });
+});
+
+it.each(['my-tasks', 'created-by-me', 'team-tasks'] as const)(
+ 'compares presentation against the %s base defaults',
+ (tab) => {
+ const fixture = createRoot((dispose) => {
+ disposers.push(dispose);
+ const [state, setState] = createStore<TasksViewState>({
+ layout: 'list',
+ tab,
+ search: '',
+ groupBy: TASK_DEFAULT_GROUP_BY[tab],
+ sort: [{ id: 'updated_at', reversed: false }],
+ facets: DEFAULT_TASK_FACET_SELECTION,
+ collapsedGroupIds: [],
+ collapsedSidebarSectionIds: [],
+ });
+ const draft = createTaskSavedViewDraft({
+ source: {
+ data: () => undefined,
+ viewerId: () => 'viewer',
+ error: () => undefined,
+ loading: () => false,
+ refresh: async () => undefined,
+ },
+ selectedId: () => undefined,
+ viewerId: () => 'viewer',
+ creating: () => false,
+ state,
+ facetContext: () => ({ tagPropertyDefinitionByOptionId: new Map() }),
+ apply: (settings) => setState(settings),
+ });
+ return { state, setState, draft };
+ });
+ expect(fixture.draft.view()).toEqual({ kind: 'default', changed: false });
+ fixture.setState('groupBy', 'date');
+ expect(fixture.draft.view()).toEqual({ kind: 'default', changed: true });
+ fixture.setState('groupBy', TASK_DEFAULT_GROUP_BY[tab]);
+ expect(fixture.draft.view()).toEqual({ kind: 'default', changed: false });
+ fixture.setState('sort', [{ id: 'created_at' }]);
+ 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('layout', 'board');
+ expect(fixture.draft.view()).toEqual({ kind: 'default', changed: true });
+ }
+);
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.ts
index d5bfed390c..50e9928fb0 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
@@ -36,14 +36,24 @@ export function createTasksViewSearch(options: {
search.sortReversed,
search.groupBy,
options.nonListLayoutsEnabled?.() ?? true,
+ search.savedView,
+ state.savedViewActive,
] as const,
([tab, layout, sort, sortReversed, groupBy, nonListLayoutsEnabled]) => {
if (!options.enabled) return;
- const requestedLayout = layout ?? entryLayout;
+ const savedViewActive = Boolean(
+ search.savedView || state.savedViewActive
+ );
+ const requestedLayout =
+ layout ?? (savedViewActive ? state.layout : entryLayout);
options.setState(
produce((draft) => {
- if (draft.tab !== tab) {
+ if (
+ !search.savedView &&
+ !draft.savedViewActive &&
+ draft.tab !== tab
+ ) {
draft.tab = tab;
draft.facets = normalizeFacetSelection(
DEFAULT_TASK_FACET_SELECTION
@@ -51,17 +61,36 @@ export function createTasksViewSearch(options: {
draft.collapsedGroupIds = [];
}
- draft.layout = nonListLayoutsEnabled ? requestedLayout : 'list';
+ draft.layout =
+ savedViewActive || nonListLayoutsEnabled
+ ? requestedLayout
+ : 'list';
draft.groupBy =
groupBy ??
- (tab === entryTab ? entryGroupBy : TASK_DEFAULT_GROUP_BY[tab]);
- draft.sort = sort
- ? [{ id: sort, reversed: sortReversed === 'true' }]
- : entrySort.map((item) => ({ ...item }));
+ (draft.savedViewActive || search.savedView
+ ? draft.groupBy
+ : tab === entryTab
+ ? entryGroupBy
+ : TASK_DEFAULT_GROUP_BY[tab]);
+ if (!savedViewActive) {
+ draft.sort = sort
+ ? [{ id: sort, reversed: sortReversed === 'true' }]
+ : entrySort.map((item) => ({ ...item }));
+ } else if (
+ sort &&
+ (draft.sort[0]?.id !== sort ||
+ !!draft.sort[0]?.reversed !== (sortReversed === 'true'))
+ ) {
+ draft.sort = [{ id: sort, reversed: sortReversed === 'true' }];
+ }
})
);
- if (!nonListLayoutsEnabled && requestedLayout !== 'list') {
+ if (
+ !savedViewActive &&
+ !nonListLayoutsEnabled &&
+ requestedLayout !== 'list'
+ ) {
options.setSearch({ layout: 'list' }, { history: 'replace' });
}
}
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.ts
index 3bade61edb..d59280cb05 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,4 +1,10 @@
import { describe, expect, it, vi } from 'vitest';
+import {
+ captureTaskSavedView,
+ decodeTaskSavedView,
+ materializeTaskSavedView,
+ readTaskSavedView,
+} from '../filters/task-saved-view';
import { type BuildTaskQueryOptions, buildTaskQuery } from './task-query';
import { buildTaskSearchRequest } from './task-search';
@@ -106,3 +112,332 @@ it('uses the initiative Project property for board columns without changing lega
sort_direction: 'asc',
});
});
+
+describe('saved task presentation', () => {
+ it('round-trips layout, grouping, and ordered sorts through capture, read, and materialization', () => {
+ const captured = captureTaskSavedView({
+ tab: 'team-tasks',
+ facets: {},
+ layout: 'gantt',
+ groupBy: 'project',
+ sort: [
+ { id: 'created_at', reversed: true },
+ { id: 'viewed_at', reversed: false },
+ ],
+ context: { tagPropertyDefinitionByOptionId: new Map() },
+ });
+ expect(captured.isOk()).toBe(true);
+ if (captured.isErr()) return;
+
+ const { config, issues } = readTaskSavedView(captured.value);
+ expect(issues).toEqual([]);
+ expect(config.layout).toBe('gantt');
+ expect(config.groupBy).toBe('project');
+ expect(config.sort).toEqual([
+ { id: 'created_at', reversed: true },
+ { id: 'viewed_at', reversed: false },
+ ]);
+ const restored = materializeTaskSavedView(config);
+ expect(restored.layout).toBe('gantt');
+ expect(restored.groupBy).toBe('project');
+ expect(buildTaskQuery({ ...options, ...restored }).groupBy).toEqual({
+ type: 'project',
+ });
+ expect(restored.sort).toEqual(config.sort);
+ expect(
+ buildTaskQuery({ ...options, ...restored, groupBy: 'none' }).params
+ ).toMatchObject({ sort_method: 'created_at', sort_direction: 'asc' });
+ });
+
+ it('uses the first saved sort and its direction rather than later sorts', () => {
+ const { config } = readTaskSavedView({
+ kind: 'tasks',
+ version: 1,
+ filters: {
+ statusOptionIds: [],
+ priorityOptionIds: [],
+ assignees: [],
+ creators: [],
+ tags: [],
+ },
+ layout: 'board',
+ sort: [
+ { id: 'viewed_at', reversed: false },
+ { id: 'created_at', reversed: true },
+ ],
+ });
+ const restored = materializeTaskSavedView(config);
+ expect(restored.layout).toBe('board');
+ expect(
+ buildTaskQuery({ ...options, ...restored, groupBy: 'none' }).params
+ ).toMatchObject({ sort_method: 'viewed_at', sort_direction: 'desc' });
+ });
+
+ it('keeps supported filters and sorts when future presentation settings are malformed', () => {
+ const status = '30000000-0000-4000-8000-000000000001';
+ const { config, issues } = readTaskSavedView({
+ kind: 'tasks',
+ version: 1,
+ filters: {
+ statusOptionIds: [status],
+ priorityOptionIds: [],
+ assignees: [],
+ creators: [],
+ tags: [],
+ },
+ layout: 'timeline',
+ groupBy: 'future_group',
+ sort: [
+ { id: 'future_sort', reversed: true },
+ { id: 'created_at', reversed: true },
+ { id: 'viewed_at', reversed: 'yes' },
+ ],
+ });
+ expect(issues.map(({ path }) => path.join('.'))).toEqual(
+ expect.arrayContaining([
+ 'layout',
+ 'groupBy',
+ 'sort.0.id',
+ 'sort.2.reversed',
+ ])
+ );
+ const restored = materializeTaskSavedView(config);
+ expect(restored.layout).toBe('list');
+ 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' });
+ expect(JSON.stringify(query.body.propf)).toContain(status);
+ expect(query.params).toMatchObject({
+ sort_method: 'created_at',
+ sort_direction: 'asc',
+ });
+ });
+
+ it('defaults missing optional layout, grouping, and sort settings', () => {
+ const saved = {
+ kind: 'tasks',
+ version: 1,
+ filters: {
+ statusOptionIds: [],
+ priorityOptionIds: [],
+ assignees: [],
+ creators: [],
+ tags: [],
+ },
+ };
+ const decoded = decodeTaskSavedView(saved);
+ expect(decoded.isOk()).toBe(true);
+ const { config, issues } = readTaskSavedView(saved);
+ expect(issues).toEqual([]);
+ expect(config.layout).toBe('list');
+ expect(config.groupBy).toBe('priority');
+ expect(config.sort).toEqual([{ id: 'updated_at', reversed: false }]);
+ expect(materializeTaskSavedView(config)).toMatchObject({
+ layout: 'list',
+ groupBy: 'priority',
+ sort: [{ id: 'updated_at', reversed: false }],
+ });
+ });
+});
+
+describe('saved task filter execution', () => {
+ it('captures built-in person restrictions as OR filters for each viewer', () => {
+ for (const { tab, facets } of [
+ {
+ tab: 'my-tasks' as const,
+ facets: { assignees: ['macro|[email protected]'] },
+ },
+ {
+ tab: 'created-by-me' as const,
+ facets: { 'created-by': ['macro|[email protected]'] },
+ },
+ ]) {
+ const captured = captureTaskSavedView({
+ tab,
+ facets,
+ context: { tagPropertyDefinitionByOptionId: new Map() },
+ });
+ expect(captured.isOk()).toBe(true);
+ if (captured.isErr()) continue;
+ const restored = materializeTaskSavedView(captured.value);
+ for (const viewer of ['macro|[email protected]', 'macro|[email protected]']) {
+ const query = buildTaskQuery({
+ ...options,
+ ...restored,
+ userId: viewer,
+ });
+ const search = buildTaskSearchRequest({
+ ...restored,
+ query: 'review',
+ matchType: 'partial',
+ userId: viewer,
+ });
+ if (tab === 'my-tasks') {
+ expect(query.body.df).toEqual({ l: { dst: 'task' } });
+ expect(query.body.propf).toEqual({
+ '|': [
+ {
+ l: {
+ pd: '00000001-0000-0000-0000-000000000001',
+ v: { er: viewer },
+ },
+ },
+ {
+ l: {
+ pd: '00000001-0000-0000-0000-000000000001',
+ v: { er: 'macro|[email protected]' },
+ },
+ },
+ ],
+ });
+ expect(
+ search.body.filters?.property_filters?.[0]?.entity_ids
+ ).toEqual(['macro|[email protected]', viewer]);
+ } else {
+ expect(query.body.df).toEqual({
+ '&': [
+ { l: { dst: 'task' } },
+ {
+ '|': [
+ { l: { o: viewer } },
+ { l: { o: 'macro|[email protected]' } },
+ ],
+ },
+ ],
+ });
+ expect(search.body.filters?.document_filters?.owners).toEqual([
+ viewer,
+ ]);
+ }
+ }
+ }
+ });
+ it('applies supported saved filters while omitting malformed entries and conflicting bindings', () => {
+ const { config, issues } = readTaskSavedView({
+ kind: 'tasks',
+ version: 1,
+ filters: {
+ statusOptionIds: ['invalid'],
+ priorityOptionIds: [],
+ assignees: [{ type: 'viewer' }, { type: 'robot' }],
+ creators: [],
+ tags: [
+ {
+ optionId: '20000000-0000-4000-8000-000000000001',
+ propertyDefinitionId: '10000000-0000-4000-8000-000000000001',
+ },
+ {
+ optionId: '20000000-0000-4000-8000-000000000001',
+ propertyDefinitionId: '10000000-0000-4000-8000-000000000002',
+ },
+ ],
+ futureFilter: ['unsupported'],
+ },
+ });
+ const restored = materializeTaskSavedView(config);
+ const query = buildTaskQuery({ ...options, ...restored });
+ const search = buildTaskSearchRequest({
+ ...restored,
+ userId: 'user',
+ query: 'review',
+ matchType: 'partial',
+ });
+ expect(query.body.df).toEqual({ l: { dst: 'task' } });
+ expect(query.body.propf).toEqual({
+ l: { pd: '00000001-0000-0000-0000-000000000001', v: { er: 'user' } },
+ });
+ expect(search.body.filters?.property_filters?.[0]?.entity_ids).toEqual([
+ 'user',
+ ]);
+ expect(config.filters.tags).toEqual([]);
+ expect(issues.map(({ path }) => path.join('.'))).toEqual(
+ expect.arrayContaining([
+ 'filters.statusOptionIds.0',
+ 'filters.assignees.1.type',
+ 'filters.tags.0',
+ 'filters.tags.1',
+ 'filters.futureFilter',
+ ])
+ );
+ });
+
+ it.each([
+ null,
+ {
+ kind: 'tasks',
+ version: 99,
+ filters: { assignees: [{ type: 'viewer' }] },
+ },
+ {
+ kind: 'tasks',
+ version: 1,
+ filters: {
+ statusOptionIds: ['invalid'],
+ priorityOptionIds: [],
+ assignees: [{ type: 'robot' }],
+ creators: [],
+ tags: [],
+ },
+ },
+ ])(
+ 'shows unfiltered tasks when no saved filters can be applied: %j',
+ (value) => {
+ const { config, issues } = readTaskSavedView(value);
+ const restored = materializeTaskSavedView(config);
+ const query = buildTaskQuery({ ...options, ...restored });
+ expect(query.body.df).toEqual({ l: { dst: 'task' } });
+ expect(query.body.propf).toBeUndefined();
+ expect(Object.values(restored.facets).flat()).toEqual([]);
+ expect(issues.length).toBeGreaterThan(0);
+ }
+ );
+
+ it('resolves relative people separately for every viewer in lists and searches', () => {
+ for (const viewer of ['macro|[email protected]', 'macro|[email protected]']) {
+ const facets = { assignees: ['@viewer'], 'created-by': ['@viewer'] };
+ const query = buildTaskQuery({ ...options, userId: viewer, facets });
+ const search = buildTaskSearchRequest({
+ query: 'review',
+ matchType: 'partial',
+ tab: 'team-tasks',
+ userId: viewer,
+ facets,
+ });
+ expect(query.body.propf).toEqual({
+ l: { pd: '00000001-0000-0000-0000-000000000001', v: { er: viewer } },
+ });
+ expect(search.body.filters?.document_filters?.owners).toEqual([viewer]);
+ expect(search.body.filters?.property_filters?.[0]?.entity_ids).toEqual([
+ viewer,
+ ]);
+ }
+ });
+
+ it('keeps stored tag and unknown status clauses when viewer metadata is unavailable', () => {
+ const tag = '20000000-0000-4000-8000-000000000001';
+ const property = '10000000-0000-4000-8000-000000000001';
+ const status = '30000000-0000-4000-8000-000000000001';
+ const facets = { tags: [tag], status: [status] };
+ const facetContext = {
+ tagPropertyDefinitionByOptionId: new Map([[tag, property]]),
+ };
+ const query = buildTaskQuery({ ...options, facets, facetContext });
+ const search = buildTaskSearchRequest({
+ query: 'review',
+ matchType: 'partial',
+ tab: 'team-tasks',
+ userId: 'viewer',
+ facets,
+ facetContext,
+ });
+ expect(JSON.stringify(query.body.propf)).toContain(tag);
+ expect(JSON.stringify(query.body.propf)).toContain(property);
+ expect(JSON.stringify(query.body.propf)).toContain(status);
+ expect(search.body.filters?.tag_option_ids).toEqual([tag]);
+ expect(search.body.filters?.property_filters?.[0]?.option_ids).toEqual([
+ status,
+ ]);
+ });
+});
diff --git a/apps/web/src/features/tasks-view/queries/task-query.ts b/apps/web/src/features/tasks-view/queries/task-query.ts
index 3bb6b06fb0..c3249e9f75 100644
--- a/apps/web/src/features/tasks-view/queries/task-query.ts
+++ b/apps/web/src/features/tasks-view/queries/task-query.ts
@@ -137,11 +137,10 @@ export function buildTaskQuery(
if (primarySort?.reversed) sortDirection = 'asc';
- const compiledFacets = compileFacets(
- options.facets,
- TASK_FACETS,
- options.facetContext ?? EMPTY_TASK_FACET_CONTEXT
- );
+ const compiledFacets = compileFacets(options.facets, TASK_FACETS, {
+ ...(options.facetContext ?? EMPTY_TASK_FACET_CONTEXT),
+ viewerId: options.userId,
+ });
const properties = propertyScope(
options.tab,
diff --git a/apps/web/src/features/tasks-view/queries/task-search.ts b/apps/web/src/features/tasks-view/queries/task-search.ts
index 68eb709c30..9951162228 100644
--- a/apps/web/src/features/tasks-view/queries/task-search.ts
+++ b/apps/web/src/features/tasks-view/queries/task-search.ts
@@ -12,6 +12,7 @@ import type {
import {
EMPTY_TASK_FACET_CONTEXT,
getTaskFacetOption,
+ resolveTaskPersonId,
type TaskFacetContext,
} from '../filters/task-facets';
import type { TaskReferenceScope, TaskTab } from '../types';
@@ -33,7 +34,16 @@ const selectedCreators = (
tab: TaskTab,
userId: string | undefined
): string[] | undefined => {
- const selected = [...new Set(selection['created-by'] ?? [])];
+ const selected = [
+ ...new Set(
+ (selection['created-by'] ?? []).map((id) =>
+ resolveTaskPersonId(id, {
+ ...EMPTY_TASK_FACET_CONTEXT,
+ viewerId: userId,
+ })
+ )
+ ),
+ ];
if (tab !== 'created-by-me') {
return selected.length > 0 ? selected : undefined;
}
@@ -86,7 +96,10 @@ export function buildTaskSearchRequest(options: {
facetContext?: TaskFacetContext;
reference?: TaskReferenceScope;
}): SearchSoupQueryArgs {
- const facetContext = options.facetContext ?? EMPTY_TASK_FACET_CONTEXT;
+ const facetContext = {
+ ...(options.facetContext ?? EMPTY_TASK_FACET_CONTEXT),
+ viewerId: options.userId,
+ };
const propertyFilters = selectedPropertyFilters(options.facets, facetContext);
if (options.tab === 'my-tasks') {
@@ -105,7 +118,7 @@ export function buildTaskSearchRequest(options: {
}
const owners = selectedCreators(options.facets, options.tab, options.userId);
- // Like the list query, a selected tag that no longer exists stops filtering.
+ // Saved views supply stored bindings even when tag labels are unavailable.
const tagOptionIds = [...new Set(options.facets.tags ?? [])].filter((id) =>
facetContext.tagPropertyDefinitionByOptionId.has(id)
);
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.ts
index e0fcc1b13d..37ff4ba3cc 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
@@ -45,13 +45,15 @@ import { buildTaskSearchRequest } from './task-search';
export type TasksDataSourceInput = Pick<
TasksViewState,
- 'tab' | 'search' | 'groupBy' | 'sort' | 'facets'
+ 'tab' | 'search' | 'groupBy' | 'sort' | 'facets' | 'savedViewActive'
>;
export type UseTasksDataSourceOptions = {
userId: Accessor<string | undefined>;
tagSets: Accessor<readonly TagSetResponse[]>;
tagSetsReady: Accessor<boolean>;
+ /** Saved definitions supply stable tag bindings and viewer-relative people. */
+ facetContext?: Accessor<TaskFacetContext>;
isGroupExpanded: (groupId: string) => boolean;
/** Only tasks whose property references this entity. */
reference?: Accessor<TaskReferenceScope>;
@@ -121,12 +123,18 @@ export function useTasksDataSource(
withEntityNotifications(entity, notificationSource);
const facetContext = createMemo(
- (): TaskFacetContext => createTagFacetContext(options.tagSets())
+ (): TaskFacetContext =>
+ options.facetContext?.() ?? {
+ ...createTagFacetContext(options.tagSets()),
+ viewerId: options.userId(),
+ }
);
const facetOptionsReady = () =>
(options.enabled?.() ?? true) &&
state.tab !== 'projects' &&
- tagFacetReady(state.facets, options.tagSetsReady());
+ (state.savedViewActive
+ ? Boolean(options.userId())
+ : tagFacetReady(state.facets, options.tagSetsReady()));
const queryArgsFor = (nameContains?: string) =>
buildTaskQuery({
diff --git a/apps/web/src/features/tasks-view/tasks-tab-search.ts b/apps/web/src/features/tasks-view/tasks-tab-search.ts
index 8d2666c894..8dd5d8649f 100644
--- a/apps/web/src/features/tasks-view/tasks-tab-search.ts
+++ b/apps/web/src/features/tasks-view/tasks-tab-search.ts
@@ -11,6 +11,11 @@ export const tasksTabSearch = {
namespace: 'tasks',
schema: z.object({
tab: z.enum(['my-tasks', 'created-by-me', 'team-tasks', 'projects']),
+ savedView: z
+ .string()
+ .uuid()
+ .transform((id) => id.toLowerCase())
+ .optional(),
layout: z.enum(['list', 'board', 'gantt']).optional(),
sort: z.enum(['updated_at', 'created_at', 'viewed_at']).optional(),
sortReversed: z.enum(['true', 'false']).optional(),
@@ -20,6 +25,7 @@ export const tasksTabSearch = {
}),
defaults: {
tab: 'my-tasks' as TasksTab,
+ savedView: undefined as string | undefined,
layout: undefined as TasksViewState['layout'] | undefined,
sort: undefined as TaskSortId | undefined,
sortReversed: undefined as 'true' | 'false' | undefined,
diff --git a/apps/web/src/features/tasks-view/tasks-view-context.tsx b/apps/web/src/features/tasks-view/tasks-view-context.tsx
index b3ad2cf6a3..8c459d56e6 100644
--- a/apps/web/src/features/tasks-view/tasks-view-context.tsx
+++ b/apps/web/src/features/tasks-view/tasks-view-context.tsx
@@ -6,7 +6,12 @@ import {
listOwnedSlotName,
} from '@app/components/list';
import { setSidebarSectionCollapsed } from '@app/components/view-shell';
+import type {
+ SavedViewSource,
+ SavedViewsSource,
+} from '@app/features/saved-views/context/saved-views-source';
import { normalizeFacetSelection } from '@app/features/soup';
+import { createTagFacetContext } from '@app/features/soup/filters/facets/tag-facet';
import { useFeatureFlag } from '@app/lib/analytics/posthog';
import {
enableGantt,
@@ -36,8 +41,10 @@ import { useTagSets, useTagSetsReady } from '@property/tags/tag-sets-context';
import type { ContextProviderProps } from '@solid-primitives/context';
import {
type Accessor,
+ batch,
createEffect,
createMemo,
+ createSignal,
mergeProps,
on,
onCleanup,
@@ -51,8 +58,13 @@ import {
} from 'solid-js/store';
import { TASK_DEFAULT_GROUP_BY } from './constants';
import { toTaskBoardGrouping } from './core/task-board';
+import type { TaskFacetContext } from './filters/task-facets';
import { DEFAULT_TASK_FACET_SELECTION } from './filters/task-facets';
import { createTasksViewPersistence } from './persistence';
+import {
+ createTaskSavedViewDraft,
+ type TaskSavedViewDraft,
+} from './primitives/create-task-saved-view-draft';
import { createTasksViewSearch } from './primitives/create-tasks-view-search';
import {
type TasksDataSource,
@@ -87,6 +99,12 @@ export type TasksViewProviderProps = ContextProviderProps & {
onCloseTask?: () => void;
/** Host-owned task creation, including scope and permissions for embedded views. */
onCreateTask?: (options?: TaskCreateOptions) => void;
+ savedViewTeam?: Accessor<{ id: string; name: string } | undefined>;
+ /** Main Tasks supplies independent queries; embedded lists leave them out. */
+ savedViewsSource?: () => SavedViewsSource;
+ savedViewSource?: (
+ selectedId: Accessor<string | undefined>
+ ) => SavedViewSource;
};
export type TasksListActivationMetadata = {
@@ -102,6 +120,18 @@ type TasksListController = ListController<
export type TasksViewContext = {
scopeKey?: string;
state: Store<TasksViewState>;
+ savedViews?: TaskSavedViewDraft;
+ savedViewsList?: SavedViewsSource;
+ savedViewSource?: SavedViewSource;
+ savedViewScope: Accessor<
+ { id: string | undefined; viewerId: string | undefined } | undefined
+ >;
+ startSavedView: () => void;
+ selectSavedView: (id: string) => void;
+ selectCreatedSavedView: (id: string) => void;
+ leaveSavedView: () => void;
+ savedViewTeam?: Accessor<{ id: string; name: string } | undefined>;
+ facetContext: Accessor<TaskFacetContext>;
createTask?: TasksViewProviderProps['onCreateTask'];
projectsEnabled: Accessor<boolean>;
ganttEnabled: Accessor<boolean>;
@@ -156,6 +186,8 @@ export const [TasksViewProvider, useTasksView] = createAssertedContextProvider<
const userId = useUserId();
const tagSets = useTagSets();
const tagSetsReady = useTagSetsReady();
+ const [newSavedView, setNewSavedView] = createSignal<boolean | string>(false);
+ const [savedViewNavigation, setSavedViewNavigation] = createSignal({});
const projectsFlag = useFeatureFlag(enableProjects);
const projectsEnabled = () => projectsFlag().enabled;
const ganttFlag = useFeatureFlag(enableGantt);
@@ -198,6 +230,11 @@ export const [TasksViewProvider, useTasksView] = createAssertedContextProvider<
: createState();
// Rollout fallbacks must not overwrite saved tab or layout selections.
const state = mergeProps(persistedState, {
+ get savedViewActive() {
+ return Boolean(
+ props.savedViewSource && (newSavedView() || tabSearch.savedView)
+ );
+ },
get layout() {
if (
isTouchDevice() ||
@@ -241,8 +278,12 @@ export const [TasksViewProvider, useTasksView] = createAssertedContextProvider<
const currentSearch = () =>
tasksTabSearchCodec.serialize({
tab: state.tab,
- // Preserve a rollout-hidden Gantt selection across task navigation.
- layout: isTouchDevice() ? 'list' : persistedState.layout,
+ savedView: tabSearch.savedView,
+ // Saved views retain their desktop layout through mobile task navigation.
+ layout:
+ isTouchDevice() && !state.savedViewActive
+ ? 'list'
+ : persistedState.layout,
sort: state.sort[0]?.id,
sortReversed: state.sort[0]
? state.sort[0].reversed
@@ -255,12 +296,158 @@ export const [TasksViewProvider, useTasksView] = createAssertedContextProvider<
const isGroupExpanded = (groupId: string) =>
!state.collapsedGroupIds.includes(groupId);
+ let savedViews: TaskSavedViewDraft | undefined;
+ const facetContext = (): TaskFacetContext => {
+ const tags = new Map(
+ createTagFacetContext(tagSets()).tagPropertyDefinitionByOptionId
+ );
+ for (const [option, property] of savedViews?.tagBindings() ?? [])
+ tags.set(option, property);
+ return { tagPropertyDefinitionByOptionId: tags, viewerId: userId() };
+ };
+ const savedViewsList = props.savedViewsSource?.();
+ const savedView = props.savedViewSource?.(() => tabSearch.savedView);
+ const applyTaskFacets = (tab: TasksTab, facets: TasksViewState['facets']) =>
+ setState(
+ produce((draft) => {
+ draft.tab = tab;
+ draft.facets = normalizeFacetSelection(facets);
+ draft.collapsedGroupIds = [];
+ })
+ );
+ const navigateSavedView = (id: string | undefined) => {
+ setSavedViewNavigation({});
+ setTabSearch(
+ {
+ savedView: id,
+ tab: persistedState.tab,
+ layout: persistedState.layout,
+ groupBy: persistedState.groupBy,
+ sort: persistedState.sort[0]?.id,
+ sortReversed: persistedState.sort[0]?.reversed ? 'true' : 'false',
+ },
+ { history: 'replace' }
+ );
+ closeTask();
+ };
+ const selectSavedView = (id: string) =>
+ batch(() => {
+ setNewSavedView(false);
+ navigateSavedView(id);
+ });
+ const selectCreatedSavedView = (id: string) =>
+ batch(() => {
+ // Keep the created draft active until the router installs its ID.
+ setNewSavedView(id);
+ navigateSavedView(id);
+ });
+ const startSavedView = () =>
+ batch(() => {
+ setNewSavedView(true);
+ applyTaskFacets('team-tasks', DEFAULT_TASK_FACET_SELECTION);
+ setState('search', '');
+ navigateSavedView(undefined);
+ });
+ const leaveSavedView = () =>
+ batch(() => {
+ savedViews?.reset();
+ setNewSavedView(false);
+ applyTaskFacets('my-tasks', DEFAULT_TASK_FACET_SELECTION);
+ navigateSavedView(undefined);
+ });
+ if (savedView) {
+ savedViews = createTaskSavedViewDraft({
+ source: savedView,
+ selectedId: () => tabSearch.savedView,
+ viewerId: userId,
+ creating: () => Boolean(newSavedView()),
+ state: persistedState,
+ facetContext,
+ apply: ({ facets, layout, groupBy, sort }) =>
+ batch(() => {
+ applyTaskFacets('team-tasks', facets);
+ setState('layout', layout);
+ setState('groupBy', groupBy);
+ setState(
+ 'sort',
+ sort.map((item) => ({ ...item }))
+ );
+ setTabSearch(
+ {
+ layout,
+ groupBy,
+ sort: sort[0]?.id,
+ sortReversed: sort[0]?.reversed ? 'true' : 'false',
+ },
+ { history: 'replace' }
+ );
+ }),
+ });
+ }
+ let disposed = false;
+ onCleanup(() => {
+ disposed = true;
+ });
+ const requestScope = createMemo(() => ({
+ id: tabSearch.savedView,
+ viewerId: userId(),
+ taskId: routeParams.taskId,
+ tab: state.tab,
+ creating: newSavedView(),
+ navigation: savedViewNavigation(),
+ }));
+ const savedViewScope = () => (disposed ? undefined : requestScope());
+ let priorSavedView: string | undefined;
+ let priorSavedViewViewer: string | undefined;
+ createEffect(
+ on(
+ () => [tabSearch.savedView, userId(), newSavedView()] as const,
+ ([id, viewer, creating]) => {
+ const accountChanged =
+ priorSavedViewViewer !== undefined && viewer !== priorSavedViewViewer;
+ if (accountChanged) setNewSavedView(false);
+ if (creating && !accountChanged) {
+ if (creating !== id) return;
+ setNewSavedView(false);
+ }
+ const changed =
+ id !== priorSavedView || viewer !== priorSavedViewViewer;
+ const wasSelected = Boolean(priorSavedView);
+ priorSavedView = id;
+ priorSavedViewViewer = viewer;
+ if (changed) setState('search', '');
+ if (accountChanged || (!id && wasSelected)) {
+ applyTaskFacets(
+ accountChanged ? 'my-tasks' : state.tab,
+ DEFAULT_TASK_FACET_SELECTION
+ );
+ }
+ }
+ )
+ );
+ createEffect(
+ on(
+ () => routeParams.taskId,
+ (id, previous) => {
+ if (id === previous || !state.savedViewActive) return;
+ if (typeof newSavedView() !== 'string') savedViews?.reset();
+ if (id === undefined && savedView)
+ fireAndForget(savedView.refresh(), 'saved-views');
+ }
+ )
+ );
+
const source = withSplitPanelOwner(ownedSlot('data-source'), () =>
(props.sourceFactory ?? useTasksDataSource)(state, {
userId,
tagSets,
tagSetsReady,
isGroupExpanded,
+ facetContext,
+ enabled: () => {
+ const kind = savedViews?.view().kind;
+ return kind !== 'loading' && kind !== 'unavailable';
+ },
board: () => state.layout === 'board',
})
);
@@ -396,7 +583,9 @@ export const [TasksViewProvider, useTasksView] = createAssertedContextProvider<
const setTab = (tab: TasksTab) => {
if (tab === 'projects' && !projectsEnabled()) return;
- if (persistedState.tab === tab) {
+ const leavingSavedView = state.savedViewActive;
+ if (leavingSavedView) leaveSavedView();
+ if (persistedState.tab === tab && !leavingSavedView) {
closeTask();
return;
}
@@ -437,6 +626,16 @@ export const [TasksViewProvider, useTasksView] = createAssertedContextProvider<
return {
scopeKey: props.scopeKey,
+ savedViews,
+ savedViewsList,
+ savedViewSource: savedView,
+ savedViewScope,
+ startSavedView,
+ selectSavedView,
+ selectCreatedSavedView,
+ leaveSavedView,
+ savedViewTeam: props.savedViewTeam,
+ facetContext,
get createTask() {
return props.onCreateTask;
},
diff --git a/apps/web/src/features/tasks-view/tasks-view.tsx b/apps/web/src/features/tasks-view/tasks-view.tsx
index 10c79ca17e..9ca980f975 100644
--- a/apps/web/src/features/tasks-view/tasks-view.tsx
+++ b/apps/web/src/features/tasks-view/tasks-view.tsx
@@ -1,15 +1,22 @@
import { ViewBreadcrumbs, ViewShell } from '@app/components/view-shell';
import { openProject } from '@app/features/projects/open-project';
import { ProjectsTab } from '@app/features/projects/projects';
+import {
+ useSavedView,
+ useSavedViews,
+} from '@app/features/saved-views/queries/saved-views';
import { ViewTour, ViewTourAction } from '@app/features/tours/ViewTour';
import { SplitRouter, useNavigate, useParams } from '@app/lib/split-router';
import { projectDetailRoute } from '@app/routes/routes';
import { useSplitLayout } from '@components/app/split-layout/layout';
import { useSplitPanelOrThrow } from '@components/app/split-layout/layoutUtils';
import { SplitPanel } from '@components/app/split-panel';
+import { useUserId } from '@core/context/user';
import { isTouchDevice } from '@core/mobile/isTouchDevice';
import { fireAndForget } from '@core/util/fireAndForget';
import { ListEntityMetadataQueryProvider } from '@entity';
+import { queryReadyGate } from '@queries/gate';
+import { useCurrentTeamQuery } from '@queries/team/teams';
import {
createSignal,
onMount,
@@ -24,6 +31,10 @@ import { TasksContent, TasksLoading } from './tasks-content';
import { TasksViewProvider, useTasksView } from './tasks-view-context';
import { tasksTour } from './tour';
import type { TasksViewStateOptions } from './types';
+import {
+ TaskSavedViewFailure,
+ TaskSavedViewWarning,
+} from './views/task-saved-views';
export type TasksViewProps = {
/** Explicit navigation state. When present, it wins over entry restoration. */
@@ -84,10 +95,18 @@ function ImportLinearAction() {
function TasksViewRoot() {
const panel = useSplitPanelOrThrow();
- const { state, setState, projectsEnabled } = useTasksView();
+ const { state, setState, projectsEnabled, savedViews } = useTasksView();
const navigate = useNavigate();
const layout = useSplitLayout();
const [listElement, setListElement] = createSignal<HTMLDivElement>();
+ const savedViewReady = () => {
+ const kind = savedViews?.view().kind;
+ return kind !== 'loading' && kind !== 'unavailable';
+ };
+ const unavailable = () => {
+ const view = savedViews?.view();
+ return view?.kind === 'unavailable' ? view.message : undefined;
+ };
onMount(() => panel.handle.setDisplayName('Tasks'));
@@ -95,8 +114,20 @@ function TasksViewRoot() {
<>
<TasksHeader onSearchEscape={() => listElement()?.focus()} />
<ViewTour tour={tasksTour} actions={<ImportLinearAction />} />
- <ViewShell.Content>
- <TasksContent ref={setListElement} />
+ <ViewShell.Content class="flex flex-col">
+ <Show
+ when={savedViewReady()}
+ fallback={
+ <Show when={unavailable()} fallback={<TasksLoading />}>
+ <TaskSavedViewFailure />
+ </Show>
+ }
+ >
+ <TaskSavedViewWarning />
+ <div class="min-h-0 flex-1">
+ <TasksContent ref={setListElement} />
+ </div>
+ </Show>
</ViewShell.Content>
</>
);
@@ -118,7 +149,11 @@ function TasksViewRoot() {
<SplitRouter.Outlet
fallback={() => (
<Show
- when={state.tab === 'projects' && projectsEnabled()}
+ when={
+ state.tab === 'projects' &&
+ projectsEnabled() &&
+ !state.savedViewActive
+ }
fallback={taskList()}
>
<Show when={isTouchDevice()}>
@@ -166,9 +201,25 @@ function TasksViewRoot() {
/** Production Tasks view. */
export function TasksView(props: TasksViewProps) {
+ const viewerId = useUserId();
+ const teamQuery = useCurrentTeamQuery();
return (
<ListEntityMetadataQueryProvider>
- <TasksViewProvider initialState={props.initialState}>
+ <TasksViewProvider
+ initialState={props.initialState}
+ savedViewsSource={() =>
+ useSavedViews({
+ viewerId,
+ kind: 'tasks',
+ })
+ }
+ savedViewSource={(id) => useSavedView({ viewerId, id })}
+ savedViewTeam={() => {
+ if (!queryReadyGate(teamQuery)) return;
+ const team = teamQuery.data?.team;
+ return team ? { id: team.id, name: team.name } : undefined;
+ }}
+ >
<TasksViewBreadcrumbs>
<TasksViewRoot />
</TasksViewBreadcrumbs>
diff --git a/apps/web/src/features/tasks-view/types.ts b/apps/web/src/features/tasks-view/types.ts
index 4d55ad1120..3f3b037cc9 100644
--- a/apps/web/src/features/tasks-view/types.ts
+++ b/apps/web/src/features/tasks-view/types.ts
@@ -49,6 +49,8 @@ export type TasksViewState = {
facets: FacetSelection;
collapsedGroupIds: string[];
collapsedSidebarSectionIds: string[];
+ /** Transient marker: never persist saved-view filter drafts in entry history. */
+ savedViewActive?: boolean;
};
export type TasksViewStateOptions = Partial<TasksViewState>;
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.tsx
new file mode 100644
index 0000000000..b37f90def9
--- /dev/null
+++ b/apps/web/src/features/tasks-view/views/task-saved-views.tsx
@@ -0,0 +1,823 @@
+import { replacePaneSearchParams } from '@app/lib/split-router';
+import { HeaderActionGroup } from '@components/app/HeaderActionGroup';
+import { toast } from '@core/component/Toast/Toast';
+import { useUserId } from '@core/context/user';
+import { writeClipboardData } from '@core/util/dataTransfer';
+import { fireAndForget } from '@core/util/fireAndForget';
+import BookmarkIcon from '@phosphor/bookmark-simple.svg';
+import DotsIcon from '@phosphor/dots-three.svg';
+import InfoIcon from '@phosphor/info.svg';
+import WarningIcon from '@phosphor/warning-circle.svg';
+import { Button, type DialogHandle, Dropdown, openDialog } from '@ui';
+import { ok } from 'neverthrow';
+import { batch, For, getOwner, type Owner, onCleanup, Show } from 'solid-js';
+import { v4 as uuid } from 'uuid';
+import {
+ SavedViewList,
+ SavedViewListRow,
+} from '../../saved-views/components/saved-view-list';
+import { SavedViewMenuItems } from '../../saved-views/components/saved-view-menu';
+import { SavedViewPicker } from '../../saved-views/components/saved-view-picker';
+import type { SavedView } from '../../saved-views/core/saved-view';
+import {
+ savedViewErrorMessage,
+ useUpdateSavedView,
+} from '../../saved-views/queries/saved-view-actions';
+import { toSavedView } from '../../saved-views/queries/saved-views';
+import {
+ DeleteSavedViewDialog,
+ SavedViewDialog,
+} from '../../saved-views/views/saved-view-dialogs';
+import { TASK_GROUP_OPTIONS, TASK_SORT_OPTIONS } from '../constants';
+import {
+ decodeTaskSavedView,
+ materializeTaskSavedView,
+ readTaskSavedView,
+ type TaskSavedViewConfig,
+ type TaskSavedViewIssue,
+ withTaskTabFilters,
+} from '../filters/task-saved-view';
+import { useTaskFilters } from '../filters/use-task-filters';
+import { taskSavedViewTitle } from '../primitives/create-task-saved-view-draft';
+import { tasksTabSearch, tasksTabSearchCodec } from '../tasks-tab-search';
+import { useTasksView } from '../tasks-view-context';
+
+const LAYOUT_LABELS = { list: 'List', board: 'Board', gantt: 'Gantt' };
+
+function TaskSavedViewSummary(props: {
+ config: TaskSavedViewConfig;
+ omittedFilters?: TaskSavedViewIssue[];
+}) {
+ const { state } = useTasksView();
+ const filters = useTaskFilters();
+ const selection = () => materializeTaskSavedView(props.config);
+ return (
+ <>
+ <Show when={props.omittedFilters?.length}>
+ <p role="alert" class="rounded-lg bg-failure-bg p-3 text-failure-ink">
+ Unsupported filters or view settings will not be copied. If no filters
+ are supported, the copy will be unfiltered. The original view stays
+ unchanged.
+ </p>
+ </Show>
+ <For each={filters.groups()}>
+ {(group) => (
+ <Show when={(selection().facets[group.id] ?? []).length}>
+ <p>
+ {group.label}:{' '}
+ {(selection().facets[group.id] ?? [])
+ .map(
+ (id) =>
+ group.options.find((option) => option.id === id)?.label ??
+ 'Unavailable option'
+ )
+ .join(', ')}
+ </p>
+ </Show>
+ )}
+ </For>
+ <p>Layout: {LAYOUT_LABELS[props.config.layout]}</p>
+ <p>
+ Group by:{' '}
+ {
+ TASK_GROUP_OPTIONS.find(
+ (option) => option.id === props.config.groupBy
+ )?.label
+ }
+ </p>
+ <p>
+ Sort:{' '}
+ {props.config.sort
+ .map(
+ (sort) =>
+ `${TASK_SORT_OPTIONS.find((option) => option.id === sort.id)?.label} (${sort.reversed ? 'oldest first' : 'newest first'})`
+ )
+ .join(', ') || 'Default'}
+ </p>
+ <Show when={state.search.trim()}>
+ <p>Search text is not included.</p>
+ </Show>
+ </>
+ );
+}
+
+/** The host scope survives menu handoffs and expires on navigation or disposal. */
+function useTaskSavedViewRequest() {
+ const { savedViews, savedViewScope } = useTasksView();
+ return () => {
+ const scope = savedViewScope();
+ return {
+ revision: savedViews?.revision() ?? 0,
+ isCurrent: (id?: string) =>
+ Boolean(
+ scope && scope === savedViewScope() && (!id || id === scope.id)
+ ),
+ };
+ };
+}
+
+function useReloadTaskSavedView() {
+ const { savedViews, savedViewSource } = useTasksView();
+ const captureRequest = useTaskSavedViewRequest();
+ return async () => {
+ if (!savedViews || !savedViewSource) return;
+ const request = captureRequest();
+ await savedViewSource.refresh();
+ const record = savedViewSource.data();
+ if (record && request.isCurrent(record.id)) savedViews.reset(record);
+ };
+}
+/** Creation is shared by capture, duplication, and the unsaved-view toolbar. */
+function useCreateTaskSavedViewDialog(owner = getOwner()) {
+ const {
+ savedViews,
+ savedViewsList,
+ savedViewTeam,
+ state,
+ setState,
+ selectCreatedSavedView,
+ } = useTasksView();
+ const captureRequest = useTaskSavedViewRequest();
+ const viewerId = useUserId();
+ return (record?: SavedView) => {
+ if (!savedViews || !savedViewsList) return;
+ const selection = savedViews.view();
+ const stored = record ? readTaskSavedView(record.config) : undefined;
+ const definition =
+ stored &&
+ !(selection.kind === 'saved' && selection.record.id === record?.id)
+ ? ok(stored.config)
+ : savedViews.capture();
+ if (definition.isErr()) {
+ toast.failure(definition.error);
+ return;
+ }
+ const config = definition.value;
+ const id = uuid();
+ const request = captureRequest();
+ return openDialog(
+ SavedViewDialog,
+ () => ({
+ refresh: savedViewsList.refresh,
+ viewerId,
+ isCurrent: request.isCurrent,
+ mode: 'create' as const,
+ id,
+ name: record ? `${record.name.slice(0, 113)} (copy)` : 'New view',
+ config,
+ title: record ? 'Duplicate saved view' : 'Save view',
+ submitLabel: record ? 'Duplicate' : 'Save view',
+ team: savedViewTeam?.(),
+ summary: (
+ <TaskSavedViewSummary
+ config={config}
+ omittedFilters={stored?.issues}
+ />
+ ),
+ onSaved: (created: SavedView) => {
+ const decoded = decodeTaskSavedView(created.config);
+ if (decoded.isErr()) {
+ toast.failure(decoded.error);
+ return;
+ }
+ if (
+ !request.isCurrent() ||
+ savedViews.revision() !== request.revision
+ )
+ return;
+ const facets = withTaskTabFilters(state.tab, state.facets);
+ batch(() => {
+ if (!savedViews.acceptConfirmed(created)) return;
+ setState('tab', 'team-tasks');
+ setState(
+ 'facets',
+ record ? materializeTaskSavedView(decoded.value).facets : facets
+ );
+ if (record) {
+ const restored = materializeTaskSavedView(decoded.value);
+ setState({
+ layout: restored.layout,
+ groupBy: restored.groupBy,
+ sort: restored.sort,
+ });
+ }
+ selectCreatedSavedView(created.id);
+ });
+ },
+ }),
+ { owner }
+ );
+ };
+}
+
+function TaskSavedViewMenuItems(props: {
+ record: SavedView;
+ owner: Owner | null;
+ defer: (action: () => void) => void;
+}) {
+ const {
+ savedViews,
+ savedViewsList,
+ savedViewTeam,
+ savedViewScope,
+ leaveSavedView,
+ } = useTasksView();
+ const captureRequest = useTaskSavedViewRequest();
+ const viewerId = useUserId();
+ const create = useCreateTaskSavedViewDialog(props.owner);
+ const edit = () => {
+ if (!savedViews || !savedViewsList) return;
+ const record = props.record;
+ const request = captureRequest();
+ props.defer(() =>
+ openDialog(
+ SavedViewDialog,
+ () => ({
+ mode: 'edit' as const,
+ refresh: savedViewsList.refresh,
+ viewerId,
+ record,
+ team: savedViewTeam?.(),
+ isCurrent: request.isCurrent,
+ onSaved: (updated) => {
+ if (request.isCurrent(updated.id))
+ savedViews.acceptConfirmed(updated);
+ },
+ }),
+ { owner: props.owner }
+ )
+ );
+ };
+ const remove = () => {
+ if (!savedViews || !savedViewsList) return;
+ const record = props.record;
+ const request = captureRequest();
+ props.defer(() =>
+ openDialog(
+ DeleteSavedViewDialog,
+ {
+ refresh: savedViewsList.refresh,
+ viewerId,
+ record,
+ isCurrent: request.isCurrent,
+ onDeleted: (deleted, viewer) => {
+ const scope = savedViewScope();
+ if (scope?.id === deleted.id && scope.viewerId === viewer)
+ leaveSavedView();
+ },
+ },
+ { owner: props.owner }
+ )
+ );
+ };
+ return (
+ <SavedViewMenuItems
+ owned={props.record.ownerId === viewerId()}
+ onEdit={edit}
+ onDelete={remove}
+ onDuplicate={() => {
+ const record = props.record;
+ props.defer(() => create(record));
+ }}
+ onCopyLink={() =>
+ fireAndForget(copySavedViewLink(props.record.id), 'saved-views')
+ }
+ />
+ );
+}
+
+export function TaskSavedViewsList() {
+ const {
+ savedViews,
+ savedViewsList,
+ startSavedView,
+ isSidebarSectionOpen,
+ setSidebarSectionOpen,
+ } = useTasksView();
+ return (
+ <Show when={savedViews && savedViewsList}>
+ <SavedViewList.Root
+ open={isSidebarSectionOpen('saved-views')}
+ onOpenChange={(open) => setSidebarSectionOpen('saved-views', open)}
+ >
+ <SavedViewList.Header
+ onCreate={() => {
+ setSidebarSectionOpen('saved-views', true);
+ startSavedView();
+ }}
+ />
+ <SavedViewList.Content>
+ <TaskSavedViewRows />
+ </SavedViewList.Content>
+ </SavedViewList.Root>
+ </Show>
+ );
+}
+
+function TaskSavedViewRows(props: {
+ onAction?: (action: () => void) => void;
+ dialogOwner?: Owner | null;
+}) {
+ const { savedViews, savedViewsList, selectSavedView, closeTask } =
+ useTasksView();
+ const viewerId = useUserId();
+ const owner = props.dialogOwner ?? getOwner();
+ const selectedId = () => {
+ const view = savedViews?.view();
+ return view?.kind === 'saved' ? view.record.id : undefined;
+ };
+ const creating = () => savedViews?.view().kind === 'new';
+ const items = () => {
+ const records = savedViewsList?.items();
+ const selection = savedViews?.view();
+ // Keep confirmed creations visible without restoring a revoked shared view.
+ if (
+ selection?.kind === 'saved' &&
+ selection.record.ownerId === viewerId() &&
+ !records?.some((record) => record.id === selection.record.id)
+ )
+ return [selection.record, ...(records ?? [])];
+ return records;
+ };
+ const run = (action: () => void) =>
+ props.onAction ? props.onAction(action) : action();
+ return (
+ <Show when={savedViews && savedViewsList}>
+ {(views) => (
+ <>
+ <SavedViewList.Items>
+ <Show when={creating()}>
+ <SavedViewList.Draft onSelect={() => run(closeTask)} />
+ </Show>
+ <For each={items()}>
+ {(record) => (
+ <SavedViewListRow
+ view={record}
+ selected={selectedId() === record.id}
+ scopeKey={viewerId()}
+ onSelect={() => run(() => selectSavedView(record.id))}
+ menu={(defer) => (
+ <TaskSavedViewMenuItems
+ record={record}
+ owner={owner}
+ defer={(action) => defer(() => run(action))}
+ />
+ )}
+ />
+ )}
+ </For>
+ </SavedViewList.Items>
+ <Show when={views().loading() && !items()}>
+ <p class="px-3 py-2 text-xs text-ink-muted" role="status">
+ Loading views…
+ </p>
+ </Show>
+ <Show
+ when={!creating() && !views().loading() && items()?.length === 0}
+ >
+ <p class="px-3 py-2 text-xs text-ink-muted">
+ Save a set of filters to return to it.
+ </p>
+ </Show>
+ <Show when={views().error()}>
+ <Button
+ size="sm"
+ variant="ghost"
+ onClick={() => fireAndForget(views().refresh(), 'saved-views')}
+ >
+ Retry loading views
+ </Button>
+ </Show>
+ <Show when={views().hasMore()}>
+ <Button
+ size="sm"
+ variant="ghost"
+ disabled={views().loadingMore()}
+ onClick={() => fireAndForget(views().loadMore(), 'saved-views')}
+ >
+ Load more views
+ </Button>
+ </Show>
+ </>
+ )}
+ </Show>
+ );
+}
+
+export function TaskSavedViewsPicker() {
+ const { savedViews, state } = useTasksView();
+ const viewerId = useUserId();
+ // The drawer closes before its action opens a dialog; retain the outer owner.
+ const owner = getOwner();
+ return (
+ <Show when={savedViews}>
+ {(views) => (
+ <SavedViewPicker
+ active={state.savedViewActive ?? false}
+ scopeKey={viewerId()}
+ label={
+ views().view().kind === 'default'
+ ? 'Saved views'
+ : taskSavedViewTitle(views().view())
+ }
+ >
+ {(onAction) => (
+ <TaskSavedViewRows onAction={onAction} dialogOwner={owner} />
+ )}
+ </SavedViewPicker>
+ )}
+ </Show>
+ );
+}
+
+async function copySavedViewLink(id: string) {
+ const params = tasksTabSearchCodec.serialize({
+ ...tasksTabSearch.defaults,
+ savedView: id,
+ });
+ if (!params) return;
+ const url = new URL('/app/component/tasks', window.location.origin);
+ replacePaneSearchParams(url.searchParams, [
+ { [tasksTabSearch.namespace]: params },
+ ]);
+ if (await writeClipboardData({ 'text/plain': url.toString() }))
+ toast.success('Link copied');
+ else toast.failure('Could not copy link');
+}
+
+export function TaskSaveViewButton() {
+ const { savedViews } = useTasksView();
+ const create = useCreateTaskSavedViewDialog();
+ const visible = () => {
+ const view = savedViews?.view();
+ return view?.kind === 'default' && view.changed;
+ };
+ return (
+ <Show when={visible()}>
+ <HeaderActionGroup label="Save task view">
+ <Button size="md" variant="cta" onClick={() => create()}>
+ Save view
+ </Button>
+ </HeaderActionGroup>
+ </Show>
+ );
+}
+
+type TaskSavedViewDialogProps = {
+ dialogOwner?: Owner | null;
+ onCreate?: (create: () => DialogHandle | undefined) => void;
+};
+export function TaskSavedViewCreateBanner(props: TaskSavedViewDialogProps) {
+ const { savedViews, leaveSavedView } = useTasksView();
+ const create = useCreateTaskSavedViewDialog(props.dialogOwner ?? getOwner());
+ const showCreate = () => (props.onCreate ? props.onCreate(create) : create());
+ const creating = () => savedViews?.view().kind === 'new';
+ const visible = () => {
+ const view = savedViews?.view();
+ return (view?.kind === 'default' || view?.kind === 'new') && view.changed;
+ };
+ return (
+ <Show when={visible()}>
+ <div
+ role="status"
+ class="flex shrink-0 items-center gap-2 bg-accent-bg px-3 py-2 text-sm"
+ >
+ <InfoIcon class="size-4 shrink-0 text-accent" aria-hidden="true" />
+ <span class="min-w-0 flex-1">Save these filters as a view</span>
+ <Button size="sm" variant="cta" onClick={showCreate}>
+ <BookmarkIcon class="size-4" aria-hidden="true" />
+ Save view
+ </Button>
+ <Show when={creating()}>
+ <Button size="sm" variant="ghost" onClick={leaveSavedView}>
+ Cancel
+ </Button>
+ </Show>
+ </div>
+ </Show>
+ );
+}
+
+export function TaskSavedViewMenu() {
+ const { savedViews } = useTasksView();
+ const viewerId = useUserId();
+ const owner = getOwner();
+ let trigger: HTMLButtonElement | undefined;
+ let menuOpen = false;
+ let disposed = false;
+ let pending:
+ | { viewer: string | undefined; recordId: string; run: () => void }
+ | undefined;
+ onCleanup(() => {
+ disposed = true;
+ pending = undefined;
+ });
+ const selected = () => {
+ const view = savedViews?.view();
+ return view?.kind === 'saved' ? view.record : undefined;
+ };
+ const defer = (run: () => void) => {
+ const record = selected();
+ if (record) pending = { viewer: viewerId(), recordId: record.id, run };
+ };
+ const finish = (event: Event) => {
+ const action = pending;
+ pending = undefined;
+ if (!action) return;
+ event.preventDefault();
+ queueMicrotask(() => {
+ if (
+ disposed ||
+ menuOpen ||
+ action.viewer !== viewerId() ||
+ action.recordId !== selected()?.id
+ )
+ return;
+ trigger?.focus({ preventScroll: true });
+ action.run();
+ });
+ };
+ return (
+ <Show when={selected()}>
+ {(record) => (
+ <Dropdown
+ placement="bottom-start"
+ onOpenChange={(open) => {
+ menuOpen = open;
+ if (open) pending = undefined;
+ }}
+ >
+ <Dropdown.Trigger
+ ref={trigger}
+ size="icon-md"
+ variant="ghost"
+ label="Saved view actions"
+ >
+ <DotsIcon class="size-4" />
+ </Dropdown.Trigger>
+ <Dropdown.Content class="min-w-44" onCloseAutoFocus={finish}>
+ <TaskSavedViewMenuItems
+ record={record()}
+ owner={owner}
+ defer={defer}
+ />
+ </Dropdown.Content>
+ </Dropdown>
+ )}
+ </Show>
+ );
+}
+
+export function TaskSavedViewActions(props: TaskSavedViewDialogProps = {}) {
+ const { savedViews, savedViewsList, leaveSavedView } = useTasksView();
+ const captureRequest = useTaskSavedViewRequest();
+ const reload = useReloadTaskSavedView();
+ if (!savedViews || !savedViewsList) return null;
+ const viewerId = useUserId();
+ const create = useCreateTaskSavedViewDialog(props.dialogOwner ?? getOwner());
+ const showCreate = (record?: SavedView) =>
+ props.onCreate ? props.onCreate(() => create(record)) : create(record);
+ const update = useUpdateSavedView({
+ refresh: savedViewsList.refresh,
+ });
+ const selected = () => {
+ const view = savedViews?.view();
+ return view?.kind === 'saved' ? view : undefined;
+ };
+ let lastRequest: ReturnType<typeof captureRequest> | undefined;
+ const save = async () => {
+ const view = selected();
+ if (
+ !savedViews ||
+ !view ||
+ update.isPending ||
+ view.record.ownerId !== viewerId() ||
+ view.issues.length > 0
+ )
+ return;
+ const config = savedViews.capture();
+ if (config.isErr()) {
+ toast.failure(config.error);
+ return;
+ }
+ const request = captureRequest();
+ lastRequest = request;
+ const release = savedViews.retain();
+ try {
+ const result = await update.mutateAsync({
+ id: view.record.id,
+ name: view.record.name,
+ config: config.value,
+ expectedRevision: view.record.revision,
+ });
+ if (
+ !result.error &&
+ result.data?.updateSavedView &&
+ request.isCurrent(view.record.id)
+ )
+ savedViews.acceptConfirmed(toSavedView(result.data.updateSavedView));
+ } finally {
+ release();
+ }
+ };
+ const failure = () => {
+ const error = update.error;
+ const pending = update.isPending;
+ return !pending && selected()?.dirty && lastRequest?.isCurrent()
+ ? error
+ : null;
+ };
+ return (
+ <>
+ <Show when={savedViews?.view().kind === 'new' || selected()?.dirty}>
+ <HeaderActionGroup label="Saved view actions">
+ <Show
+ when={savedViews?.view().kind === 'new'}
+ fallback={
+ <>
+ <Show when={selected()?.record.ownerId === viewerId()}>
+ <Button
+ size="md"
+ variant="cta"
+ class="touch:order-last"
+ disabled={update.isPending || !!selected()?.issues.length}
+ title={
+ selected()?.issues.length
+ ? 'Update the app or remove unsupported settings before saving.'
+ : undefined
+ }
+ onClick={() => fireAndForget(save(), 'saved-views')}
+ >
+ Save changes
+ </Button>
+ </Show>
+ <Button
+ size="md"
+ variant="ghost"
+ onClick={() => savedViews?.reset()}
+ >
+ Reset
+ </Button>
+ </>
+ }
+ >
+ <Button size="md" variant="cta" onClick={() => showCreate()}>
+ Save view
+ </Button>
+ <Button size="md" variant="ghost" onClick={leaveSavedView}>
+ Cancel
+ </Button>
+ </Show>
+ </HeaderActionGroup>
+ </Show>
+ <Show when={failure()}>
+ {(error) => (
+ <HeaderActionGroup label="Saved view save error">
+ <span
+ role="alert"
+ class="max-w-48 truncate text-xs text-failure-ink"
+ title={savedViewErrorMessage(error())}
+ >
+ {savedViewErrorMessage(error())}
+ </span>
+ <Show
+ when={error().graphQLErrors[0]?.extensions.code === 'CONFLICT'}
+ >
+ <Button
+ size="sm"
+ variant="ghost"
+ onClick={() => fireAndForget(reload(), 'saved-views')}
+ >
+ Reload saved view
+ </Button>
+ </Show>
+ <Button
+ size="sm"
+ variant="ghost"
+ onClick={() => showCreate(selected()?.record)}
+ >
+ Duplicate
+ </Button>
+ </HeaderActionGroup>
+ )}
+ </Show>
+ </>
+ );
+}
+
+/** Missing or unauthorized definitions never fall back to an unfiltered list. */
+export function TaskSavedViewFailure() {
+ const { savedViews, setTab } = useTasksView();
+ const message = () => {
+ const view = savedViews?.view();
+ return view?.kind === 'unavailable' ? view.message : undefined;
+ };
+ return (
+ <div class="flex h-full flex-col items-center justify-center gap-4 p-6 text-sm">
+ <p role="alert">{message()}</p>
+ <Button onClick={() => setTab('my-tasks')}>Return to Tasks</Button>
+ </div>
+ );
+}
+
+export function TaskSavedViewWarning() {
+ const { savedViews, savedViewsList } = useTasksView();
+ const captureRequest = useTaskSavedViewRequest();
+ const reload = useReloadTaskSavedView();
+ if (!savedViews || !savedViewsList) return null;
+ const viewerId = useUserId();
+ const update = useUpdateSavedView({ refresh: savedViewsList.refresh });
+ const selected = () => {
+ const view = savedViews.view();
+ return view.kind === 'saved' ? view : undefined;
+ };
+ const issues = () => selected()?.issues ?? [];
+ let lastRequest: ReturnType<typeof captureRequest> | undefined;
+ const removeUnsupported = async () => {
+ const view = selected();
+ if (
+ !view?.issues.length ||
+ update.isPending ||
+ view.record.ownerId !== viewerId()
+ )
+ return;
+ const request = captureRequest();
+ lastRequest = request;
+ const result = await update.mutateAsync({
+ id: view.record.id,
+ name: view.record.name,
+ config: readTaskSavedView(view.record.config).config,
+ expectedRevision: view.record.revision,
+ });
+ if (
+ !result.error &&
+ result.data?.updateSavedView &&
+ request.isCurrent(view.record.id)
+ )
+ savedViews.acceptConfirmed(toSavedView(result.data.updateSavedView));
+ };
+ const failure = () =>
+ !update.isPending && lastRequest?.isCurrent() ? update.error : null;
+ const labels: Record<string, string> = {
+ statusOptionIds: 'Status',
+ priorityOptionIds: 'Priority',
+ assignees: 'Assignee',
+ creators: 'Created by',
+ tags: 'Tags',
+ kind: 'View type',
+ version: 'View version',
+ filters: 'Filters',
+ layout: 'Layout',
+ groupBy: 'Group by',
+ sort: 'Sort',
+ };
+ const skipped = () =>
+ [
+ ...new Set(
+ issues().map(({ path }) => {
+ const field = path[0] === 'filters' ? (path[1] ?? path[0]) : path[0];
+ return labels[field] ?? field ?? 'Saved definition';
+ })
+ ),
+ ].join(', ');
+ return (
+ <Show when={issues().length}>
+ <div
+ role="alert"
+ class="flex shrink-0 items-start gap-2 border-b border-failure/30 bg-failure-bg px-4 py-3 text-sm text-failure-ink"
+ >
+ <WarningIcon class="mt-0.5 size-4 shrink-0" />
+ <div class="min-w-0 flex-1">
+ <p class="font-medium">Some saved settings were skipped.</p>
+ <p class="break-words">Skipped settings: {skipped()}</p>
+ <Show when={failure()}>
+ {(error) => <p>{savedViewErrorMessage(error())}</p>}
+ </Show>
+ </div>
+ <Show when={selected()?.record.ownerId === viewerId()}>
+ <div class="flex shrink-0 flex-col items-end gap-2">
+ <Button
+ size="sm"
+ variant="ghost"
+ disabled={update.isPending}
+ onClick={() => fireAndForget(removeUnsupported(), 'saved-views')}
+ >
+ {update.isPending ? 'Saving…' : 'Remove & save'}
+ </Button>
+ <Show
+ when={failure()?.graphQLErrors[0]?.extensions.code === 'CONFLICT'}
+ >
+ <Button
+ size="sm"
+ variant="ghost"
+ onClick={() => fireAndForget(reload(), 'saved-views')}
+ >
+ Reload saved view
+ </Button>
+ </Show>
+ </div>
+ </Show>
+ </div>
+ </Show>
+ );
+}
diff --git a/apps/web/src/lib/graphql-cache/generated/entity-resolver-schema.ts b/apps/web/src/lib/graphql-cache/generated/entity-resolver-schema.ts
index 303d467f78..2a09431280 100644
--- a/apps/web/src/lib/graphql-cache/generated/entity-resolver-schema.ts
+++ b/apps/web/src/lib/graphql-cache/generated/entity-resolver-schema.ts
@@ -2,6 +2,13 @@
export const entityResolverSchema = {
CompleteMutationRoot: {
+ createSavedView: {
+ targets: ['GraphqlSavedView'],
+ argumentPaths: [
+ ['input', 'id'],
+ ['input', 'sharedTeamId'],
+ ],
+ },
markEmailThreadSeen: {
targets: ['GraphqlSoupEmailThread'],
argumentPaths: [['input', 'threadId']],
@@ -45,6 +52,13 @@ export const entityResolverSchema = {
targets: ['GraphqlSoupInitiative'],
argumentPaths: [['initiativeId']],
},
+ updateSavedView: {
+ targets: ['GraphqlSavedView'],
+ argumentPaths: [
+ ['input', 'id'],
+ ['input', 'sharing', 'teamId'],
+ ],
+ },
},
GraphqlUser: {
agentSession: {
@@ -59,6 +73,10 @@ export const entityResolverSchema = {
targets: ['GraphqlSoupInitiative'],
argumentPaths: [['initiativeId']],
},
+ savedView: {
+ targets: ['GraphqlSavedView'],
+ argumentPaths: [['id']],
+ },
soupEntity: {
targets: [
'GraphqlSoupAgentSession',
@@ -86,6 +104,7 @@ export type GeneratedEntityResolverSchema = typeof entityResolverSchema;
export type GeneratedEntityResolverTarget =
| 'GraphqlChannelActivity'
| 'GraphqlProperty'
+ | 'GraphqlSavedView'
| 'GraphqlSoupAgentSession'
| 'GraphqlSoupCalendarEvent'
| 'GraphqlSoupCall'
@@ -102,12 +121,16 @@ export type GeneratedEntityResolverTarget =
| 'GraphqlSoupProject'
| 'GraphqlSoupReminder';
export type GeneratedEntityResolverArgumentPath =
+ | readonly ['id']
| readonly ['initiativeId']
| readonly ['input', 'channelId']
| readonly ['input', 'entityId']
+ | readonly ['input', 'id']
| readonly ['input', 'labelId']
| readonly ['input', 'messageId']
| readonly ['input', 'propertyDefinitionId']
+ | readonly ['input', 'sharedTeamId']
+ | readonly ['input', 'sharing', 'teamId']
| readonly ['input', 'threadId']
| readonly ['input', 'value', 'entityReference', 'specificMessageId']
| readonly ['input', 'value', 'selectOption']
diff --git a/apps/web/src/lib/queries/mutation-coverage.test.ts b/apps/web/src/lib/queries/mutation-coverage.test.ts
index 39201c120a..b56a8f70e1 100644
--- a/apps/web/src/lib/queries/mutation-coverage.test.ts
+++ b/apps/web/src/lib/queries/mutation-coverage.test.ts
@@ -14,6 +14,12 @@ import { soupOptimisticResolvers } from './optimistic-resolvers';
// New documents must choose a strategy. Exceptions describe a real server-owned
// outcome; adding an empty optimistic response does not satisfy this gate.
const policies = {
+ CreateSavedView:
+ 'authoritative: server owns sharing; revalidate the loaded cursor chain',
+ UpdateSavedView:
+ 'authoritative: revision and sharing need server confirmation',
+ DeleteSavedView:
+ 'authoritative: revision-checked deletion and collection revalidation',
MarkEmailThreadSeen: 'resolver',
MarkEmailThreadUnread: 'resolver',
SetEmailThreadArchived: 'resolver',
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.ts
index 90da5358a5..d93b801b93 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
@@ -221,6 +221,18 @@ export type CreateInitiativeInput = {
shareWithTeam?: boolean | null | undefined;
};
+/** Inputs for creating a saved view with a stable client-generated identity. */
+export type CreateSavedViewInput = {
+ /** Consumer-owned JSON object, limited to 32 KiB. */
+ config: unknown;
+ /** Client-generated UUID reused when retrying the same creation. */
+ id: string | number;
+ /** Nonempty display name, limited to 120 characters. */
+ name: string;
+ /** Current team to share with, or null for a private definition. */
+ sharedTeamId?: string | number | null | undefined;
+};
+
/** Delete an event, one occurrence, or an occurrence onward. */
export type DeleteCalendarEventInput = {
/**
@@ -250,6 +262,14 @@ export type DeleteEmailDraftInput = {
draftId: string | number;
};
+/** Inputs for a revision-guarded deletion. */
+export type DeleteSavedViewInput = {
+ /** Revision that must still match when the deletion commits. */
+ expectedRevision: number;
+ /** Identity of the definition to delete. */
+ id: string | number;
+};
+
/** One entity duplication in a batch. */
export type DuplicateEntityInput = {
/** Optional display name for the new entity. */
@@ -2033,6 +2053,12 @@ export type SaveEmailDraftInput = {
to?: Array<SaveEmailDraftContactInput> | null | undefined;
};
+/** Explicit sharing action: an omitted input leaves sharing unchanged; null team ID makes it private. */
+export type SavedViewSharingInput = {
+ /** Current team to share with; null explicitly removes sharing. */
+ teamId?: string | number | null | undefined;
+};
+
/** Immutable content approved by the user. */
export type SendEmailAttemptInput = {
/** Completed draft attachment IDs. */
@@ -2237,6 +2263,20 @@ export type UpdateNotificationsInput = {
operation: NotificationUpdateOperation;
};
+/** Inputs for a revision-guarded replacement update. */
+export type UpdateSavedViewInput = {
+ /** Complete replacement configuration; omission preserves current filters. */
+ config?: unknown;
+ /** Revision that must still match when the update commits. */
+ expectedRevision: number;
+ /** Identity of the definition to update. */
+ id: string | number;
+ /** Replacement display name; omission preserves the current name. */
+ name?: string | null | undefined;
+ /** Explicit sharing change; omission preserves the existing share. */
+ sharing?: SavedViewSharingInput | null | undefined;
+};
+
/** One item to mark done. */
export type WorkFeedDoneItemInput = {
/** The item's id. */
@@ -12490,6 +12530,45 @@ export type PropertyAssignmentParentFragment =
| PropertyAssignmentParent_GraphqlSoupReminder_Fragment
;
+export type SavedViewFieldsFragment = { id: string, ownerId: string, name: string, config: unknown, sharedTeamId: string | null, revision: number, createdAt: string, updatedAt: string };
+
+export type SavedViewsQueryVariables = Exact<{
+ kind?: string | null | undefined;
+ first?: number | null | undefined;
+ after?: string | null | undefined;
+}>;
+
+
+export type SavedViewsQuery = { user: { id: string, savedViews: { nextCursor: string | null, nodes: Array<{ id: string, ownerId: string, name: string, config: unknown, sharedTeamId: string | null, revision: number, createdAt: string, updatedAt: string }> } } };
+
+export type SavedViewQueryVariables = Exact<{
+ id: string | number;
+}>;
+
+
+export type SavedViewQuery = { user: { id: string, savedView: { id: string, ownerId: string, name: string, config: unknown, sharedTeamId: string | null, revision: number, createdAt: string, updatedAt: string } | null } };
+
+export type CreateSavedViewMutationVariables = Exact<{
+ input: CreateSavedViewInput;
+}>;
+
+
+export type CreateSavedViewMutation = { createSavedView: { id: string, ownerId: string, name: string, config: unknown, sharedTeamId: string | null, revision: number, createdAt: string, updatedAt: string } };
+
+export type UpdateSavedViewMutationVariables = Exact<{
+ input: UpdateSavedViewInput;
+}>;
+
+
+export type UpdateSavedViewMutation = { updateSavedView: { id: string, ownerId: string, name: string, config: unknown, sharedTeamId: string | null, revision: number, createdAt: string, updatedAt: string } };
+
+export type DeleteSavedViewMutationVariables = Exact<{
+ input: DeleteSavedViewInput;
+}>;
+
+
+export type DeleteSavedViewMutation = { deleteSavedView: string };
+
export type SetEntityPropertyMutationVariables = Exact<{
input: SetEntityPropertyInput;
}>;
@@ -20361,6 +20440,7 @@ export const InitiativeDetailFieldsFragmentDoc = {"kind":"Document","definitions
export const ItemPreviewFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ItemPreviewFields"},"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":"id"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"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":"fileType"}},{"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":"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":"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":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEmailThread"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"emailName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"senderEmail"}},{"kind":"Field","name":{"kind":"Name","value":"senderName"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannel"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelDisplayName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"channelType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupCall"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"customName"}},{"kind":"Field","name":{"kind":"Name","value":"channelName"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupCrmCompany"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"companyName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"domains"}}]}}]}}]} as unknown as DocumentNode<ItemPreviewFieldsFragment, unknown>;
export const ItemPreviewDetailsFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ItemPreviewDetailsFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ItemPreviewFields"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupDocument"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}},{"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":"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":"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":"ItemPreviewFields"},"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":"id"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"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":"fileType"}},{"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":"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":"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":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEmailThread"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"emailName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"senderEmail"}},{"kind":"Field","name":{"kind":"Name","value":"senderName"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannel"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelDisplayName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"channelType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupCall"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"customName"}},{"kind":"Field","name":{"kind":"Name","value":"channelName"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupCrmCompany"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"companyName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"domains"}}]}}]}},{"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"}}]}}]}}]} as unknown as DocumentNode<ItemPreviewDetailsFieldsFragment, unknown>;
export const PropertyAssignmentParentFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PropertyAssignmentParent"},"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":"id"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"propertyDefinitionId"}}]}}]}}]} as unknown as DocumentNode<PropertyAssignmentParentFragment, unknown>;
+export const SavedViewFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SavedViewFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSavedView"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"config"}},{"kind":"Field","name":{"kind":"Name","value":"sharedTeamId"}},{"kind":"Field","name":{"kind":"Name","value":"revision"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]} as unknown as DocumentNode<SavedViewFieldsFragment, unknown>;
export const MailItemFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"MailItemFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupItemFields"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEmailThread"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"mailDraftState"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"EmailDraftStateFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"mailAllPreview"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"MailPreviewFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"mailDraftPreview"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"MailPreviewFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"mailSentPreview"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"MailPreviewFields"}}]}}]}}]}},{"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":"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":"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","alias":{"kind":"Name","value":"entityType"},"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":"GraphqlWhatsappGroupMessageMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"whatsappGroupName"},"name":{"kind":"Name","value":"groupName"}},{"kind":"Field","alias":{"kind":"Name","value":"whatsappMessageId"},"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<MailItemFieldsFragment, unknown>;
export const SoupEntityCoreFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupEntityCoreFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupEntityIdentityFields"}},{"kind":"Field","name":{"kind":"Name","value":"notifications"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupNotificationFields"}}]}}]}},{"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","alias":{"kind":"Name","value":"entityType"},"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":"GraphqlWhatsappGroupMessageMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"whatsappGroupName"},"name":{"kind":"Name","value":"groupName"}},{"kind":"Field","alias":{"kind":"Name","value":"whatsappMessageId"},"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":"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":"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"}}]}}]}}]} as unknown as DocumentNode<SoupEntityCoreFieldsFragment, unknown>;
export const MailAccountFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"MailAccountFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlEmailLink"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"macroId"}},{"kind":"Field","name":{"kind":"Name","value":"provider"}},{"kind":"Field","name":{"kind":"Name","value":"emailAddress"}},{"kind":"Field","name":{"kind":"Name","value":"photoUrl"}},{"kind":"Field","name":{"kind":"Name","value":"isPrimary"}},{"kind":"Field","name":{"kind":"Name","value":"needsReauth"}},{"kind":"Field","name":{"kind":"Name","value":"draftIsSignal"}},{"kind":"Field","name":{"kind":"Name","value":"settings"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"signature"}},{"kind":"Field","name":{"kind":"Name","value":"signatureOnRepliesForwards"}}]}}]}}]} as unknown as DocumentNode<MailAccountFieldsFragment, unknown>;
@@ -20438,6 +20518,11 @@ export const ItemPreviewNameCacheWriteDocument = {"kind":"Document","definitions
export const ItemPreviewFileTypeCacheWriteDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ItemPreviewFileTypeCacheWrite"},"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":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupDocument"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"fileType"}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode<ItemPreviewFileTypeCacheWriteQuery, ItemPreviewFileTypeCacheWriteQueryVariables>;
export const ItemPreviewDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ItemPreview"},"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":"FragmentSpread","name":{"kind":"Name","value":"ItemPreviewFields"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ItemPreviewFields"},"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":"id"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"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":"fileType"}},{"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":"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":"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":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEmailThread"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"emailName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"senderEmail"}},{"kind":"Field","name":{"kind":"Name","value":"senderName"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannel"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelDisplayName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"channelType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupCall"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"customName"}},{"kind":"Field","name":{"kind":"Name","value":"channelName"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupCrmCompany"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"companyName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"domains"}}]}}]}}]} as unknown as DocumentNode<ItemPreviewQuery, ItemPreviewQueryVariables>;
export const ItemPreviewsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ItemPreviews"},"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":"FragmentSpread","name":{"kind":"Name","value":"ItemPreviewDetailsFields"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ItemPreviewFields"},"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":"id"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"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":"fileType"}},{"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":"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":"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":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEmailThread"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"emailName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"senderEmail"}},{"kind":"Field","name":{"kind":"Name","value":"senderName"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannel"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelDisplayName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"channelType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupCall"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"customName"}},{"kind":"Field","name":{"kind":"Name","value":"channelName"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupCrmCompany"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"companyName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"domains"}}]}}]}},{"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":"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":"ItemPreviewDetailsFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ItemPreviewFields"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupDocument"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}},{"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<ItemPreviewsQuery, ItemPreviewsQueryVariables>;
+export const SavedViewsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"SavedViews"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"kind"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"first"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"after"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"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":"savedViews"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"kind"},"value":{"kind":"Variable","name":{"kind":"Name","value":"kind"}}},{"kind":"Argument","name":{"kind":"Name","value":"first"},"value":{"kind":"Variable","name":{"kind":"Name","value":"first"}}},{"kind":"Argument","name":{"kind":"Name","value":"after"},"value":{"kind":"Variable","name":{"kind":"Name","value":"after"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"nodes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SavedViewFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"nextCursor"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SavedViewFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSavedView"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"config"}},{"kind":"Field","name":{"kind":"Name","value":"sharedTeamId"}},{"kind":"Field","name":{"kind":"Name","value":"revision"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]} as unknown as DocumentNode<SavedViewsQuery, SavedViewsQueryVariables>;
+export const SavedViewDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"SavedView"},"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":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"savedView"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SavedViewFields"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SavedViewFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSavedView"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"config"}},{"kind":"Field","name":{"kind":"Name","value":"sharedTeamId"}},{"kind":"Field","name":{"kind":"Name","value":"revision"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]} as unknown as DocumentNode<SavedViewQuery, SavedViewQueryVariables>;
+export const CreateSavedViewDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CreateSavedView"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"CreateSavedViewInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createSavedView"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SavedViewFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SavedViewFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSavedView"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"config"}},{"kind":"Field","name":{"kind":"Name","value":"sharedTeamId"}},{"kind":"Field","name":{"kind":"Name","value":"revision"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]} as unknown as DocumentNode<CreateSavedViewMutation, CreateSavedViewMutationVariables>;
+export const UpdateSavedViewDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateSavedView"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UpdateSavedViewInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateSavedView"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SavedViewFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SavedViewFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSavedView"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"config"}},{"kind":"Field","name":{"kind":"Name","value":"sharedTeamId"}},{"kind":"Field","name":{"kind":"Name","value":"revision"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]} as unknown as DocumentNode<UpdateSavedViewMutation, UpdateSavedViewMutationVariables>;
+export const DeleteSavedViewDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"DeleteSavedView"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"DeleteSavedViewInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"deleteSavedView"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}]}]}}]} as unknown as DocumentNode<DeleteSavedViewMutation, DeleteSavedViewMutationVariables>;
export const SetEntityPropertyDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"SetEntityProperty"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"SetEntityPropertyInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"setEntityProperty"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"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":"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"}}]}}]}}]} as unknown as DocumentNode<SetEntityPropertyMutation, SetEntityPropertyMutationVariables>;
export const SoupMembershipDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"SoupMembership"},"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"}}]}}]}}]}}]}}]} as unknown as DocumentNode<SoupMembershipQuery, SoupMembershipQueryVariables>;
export const SoupUpdatesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"subscription","name":{"kind":"Name","value":"SoupUpdates"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"soupUpdates"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPatchFields"}}]}}]}},{"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":"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":"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","alias":{"kind":"Name","value":"entityType"},"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":"GraphqlWhatsappGroupMessageMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"whatsappGroupName"},"name":{"kind":"Name","value":"groupName"}},{"kind":"Field","alias":{"kind":"Name","value":"whatsappMessageId"},"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"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupPatchFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"SoupPatch"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"SoupUpdated"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"item"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupItemFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlCacheDeletion"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"graphqlTypeName"}},{"kind":"Field","name":{"kind":"Name","value":"entityId"}}]}}]}}]} as unknown as DocumentNode<SoupUpdatesSubscription, SoupUpdatesSubscriptionVariables>;
diff --git a/apps/web/src/lib/service-clients/service-storage/graphql/saved-views.graphql b/apps/web/src/lib/service-clients/service-storage/graphql/saved-views.graphql
new file mode 100644
index 0000000000..0c2d3e8e94
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-storage/graphql/saved-views.graphql
@@ -0,0 +1,39 @@
+fragment SavedViewFields on GraphqlSavedView {
+ id
+ ownerId
+ name
+ config
+ sharedTeamId
+ revision
+ createdAt
+ updatedAt
+}
+
+query SavedViews($kind: String, $first: Int, $after: String) {
+ user {
+ id
+ savedViews(kind: $kind, first: $first, after: $after) {
+ nodes { ...SavedViewFields }
+ nextCursor
+ }
+ }
+}
+
+query SavedView($id: ID!) {
+ user {
+ id
+ savedView(id: $id) { ...SavedViewFields }
+ }
+}
+
+mutation CreateSavedView($input: CreateSavedViewInput!) {
+ createSavedView(input: $input) { ...SavedViewFields }
+}
+
+mutation UpdateSavedView($input: UpdateSavedViewInput!) {
+ updateSavedView(input: $input) { ...SavedViewFields }
+}
+
+mutation DeleteSavedView($input: DeleteSavedViewInput!) {
+ deleteSavedView(input: $input)
+}
diff --git a/crates/complete_graph/AGENTS.md b/crates/complete_graph/AGENTS.md
index f3acccdfa4..67f909cf62 100644
--- a/crates/complete_graph/AGENTS.md
+++ b/crates/complete_graph/AGENTS.md
@@ -121,3 +121,5 @@ Never remove or narrow anything deployed clients send without a dated
deprecation (`Remove after YYYY-MM-DD`, at least 30 days out).
`cargo x graphql-schema-compat` checks the SDL against `origin/main`, and CI runs
it; see [step 8 of the field guide](../../docs/guides/add-graphql-field.md#8-compatibility-and-rollout).
+
+Saved-view definitions live under authenticated `GraphqlUser`; mutations use the authenticated request user and a domain service from request data. Run `cargo test -p complete_graph --lib saved_view_contract` after changing the saved-view contract.
diff --git a/crates/complete_graph/Cargo.toml b/crates/complete_graph/Cargo.toml
index 27c24eb8c8..1242ad7c91 100644
--- a/crates/complete_graph/Cargo.toml
+++ b/crates/complete_graph/Cargo.toml
@@ -58,6 +58,8 @@ tracing = { workspace = true }
uuid = { workspace = true }
workspace-hack = { version = "0.1", path = "../workspace-hack" }
+saved_views = { path = "../saved_views" }
+
[dev-dependencies]
bot_id = { path = "../bot_id" }
crm = { path = "../crm", default-features = false, features = ["ports"] }
diff --git a/crates/complete_graph/src/lib.rs b/crates/complete_graph/src/lib.rs
index 2b4ead7cc6..915636fe02 100644
--- a/crates/complete_graph/src/lib.rs
+++ b/crates/complete_graph/src/lib.rs
@@ -9,6 +9,7 @@
/// Cross-domain fields composed onto Soup entities.
mod edges;
mod realtime;
+mod saved_view;
/// Complete schema types and construction helpers.
mod schema;
#[cfg(test)]
diff --git a/crates/complete_graph/src/saved_view.rs b/crates/complete_graph/src/saved_view.rs
new file mode 100644
index 0000000000..0c0c6a7cdc
--- /dev/null
+++ b/crates/complete_graph/src/saved_view.rs
@@ -0,0 +1,250 @@
+//! GraphQL transport adapter for saved-view definitions.
+use async_graphql::{Context, ErrorExtensions, ID, InputObject, Json, Object, SimpleObject};
+use saved_views::{
+ View,
+ domain::{Cursor, Error, SavedViewApi, ShareChange, Update},
+};
+use std::sync::Arc;
+use uuid::Uuid;
+
+/// A saved filter definition, not a snapshot of matching entities.
+#[derive(SimpleObject)]
+pub struct GraphqlSavedView {
+ /// Stable identity of this saved definition.
+ id: ID,
+ /// User who owns and can edit this definition.
+ owner_id: ID,
+ /// Display name chosen by the owner.
+ name: String,
+ /// Versioned filter configuration interpreted by the consuming feature.
+ config: Json<serde_json::Value>,
+ /// Team with effective access, or null when the definition is private.
+ shared_team_id: Option<ID>,
+ /// Current revision required for conditional updates and deletion.
+ revision: i64,
+ /// Creation timestamp in RFC 3339 format.
+ created_at: String,
+ /// Last update timestamp in RFC 3339 format.
+ updated_at: String,
+}
+
+impl From<View> for GraphqlSavedView {
+ fn from(view: View) -> Self {
+ Self {
+ id: view.id.into(),
+ owner_id: view.user_id.into(),
+ name: view.name,
+ config: Json(view.config),
+ shared_team_id: view.shared_team_id.map(Into::into),
+ revision: view.revision,
+ created_at: view.created_at.to_rfc3339(),
+ updated_at: view.updated_at.to_rfc3339(),
+ }
+ }
+}
+
+/// A page ordered by creation time and ID after effective visibility checks.
+#[derive(SimpleObject)]
+pub struct GraphqlSavedViewPage {
+ /// Definitions the authenticated viewer can currently access.
+ nodes: Vec<GraphqlSavedView>,
+ /// Opaque continuation cursor, or null when the listing is complete.
+ next_cursor: Option<String>,
+}
+
+/// Map domain failures to stable GraphQL error codes without exposing internal details.
+fn error(error: Error) -> async_graphql::Error {
+ let code = match error {
+ Error::NotFound | Error::NotOwner => "NOT_FOUND",
+ Error::Conflict => "CONFLICT",
+ Error::Invalid => "INVALID",
+ Error::NotMember => "FORBIDDEN",
+ Error::Internal(ref e) => {
+ tracing::error!(error = ?e, "saved view failure");
+ "INTERNAL"
+ }
+ };
+ async_graphql::Error::new(error.to_string()).extend_with(|_, ext| ext.set("code", code))
+}
+
+/// Parse a transport ID into the saved-view UUID used by the domain.
+fn parse_id(id: ID) -> async_graphql::Result<Uuid> {
+ Uuid::parse_str(id.as_str()).map_err(|_| async_graphql::Error::new("invalid saved view ID"))
+}
+
+/// Resolve the request-scoped saved-view domain service.
+fn service(ctx: &Context<'_>) -> async_graphql::Result<Arc<dyn SavedViewApi>> {
+ Ok(ctx.data::<Arc<dyn SavedViewApi>>()?.clone())
+}
+
+/// Read a visible page for an authenticated GraphQL user.
+#[tracing::instrument(
+ name = "saved_view.graphql_list",
+ skip_all,
+ fields(first, kind),
+ err(Debug)
+)]
+pub async fn list(
+ ctx: &Context<'_>,
+ viewer: &str,
+ kind: Option<String>,
+ first: Option<i32>,
+ after: Option<String>,
+) -> async_graphql::Result<GraphqlSavedViewPage> {
+ let first = first.unwrap_or(25);
+ if !(1..=50).contains(&first) {
+ return Err(error(Error::Invalid));
+ }
+ let after = after
+ .map(|raw| {
+ serde_json::from_str::<(chrono::DateTime<chrono::Utc>, Uuid)>(&raw)
+ .map(|(created_at, id)| Cursor { created_at, id })
+ .map_err(|_| error(Error::Invalid))
+ })
+ .transpose()?;
+ let page = service(ctx)?
+ .list(viewer, kind.as_deref(), after, first as u32)
+ .await
+ .map_err(error)?;
+ Ok(GraphqlSavedViewPage {
+ nodes: page.views.into_iter().map(Into::into).collect(),
+ next_cursor: page
+ .next
+ .map(|c| serde_json::to_string(&(c.created_at, c.id)))
+ .transpose()
+ .map_err(|_| error(Error::Invalid))?,
+ })
+}
+
+/// Load a view only when the caller still has definition access.
+#[tracing::instrument(name = "saved_view.graphql_get", skip_all, fields(view_id = id.as_str()), err(Debug))]
+pub async fn get(
+ ctx: &Context<'_>,
+ viewer: &str,
+ id: ID,
+) -> async_graphql::Result<Option<GraphqlSavedView>> {
+ match service(ctx)?.get(viewer, parse_id(id)?).await {
+ Ok(view) => Ok(Some(view.into())),
+ Err(Error::NotFound) => Ok(None),
+ Err(err) => Err(error(err)),
+ }
+}
+
+/// Inputs for creating a saved view with a stable client-generated identity.
+#[derive(InputObject)]
+pub struct CreateSavedViewInput {
+ /// Client-generated UUID reused when retrying the same creation.
+ id: ID,
+ /// Nonempty display name, limited to 120 characters.
+ name: String,
+ /// Consumer-owned JSON object, limited to 32 KiB.
+ config: Json<serde_json::Value>,
+ /// Current team to share with, or null for a private definition.
+ shared_team_id: Option<ID>,
+}
+
+/// Explicit sharing action: an omitted input leaves sharing unchanged; null team ID makes it private.
+#[derive(InputObject)]
+pub struct SavedViewSharingInput {
+ /// Current team to share with; null explicitly removes sharing.
+ team_id: Option<ID>,
+}
+
+/// Inputs for a revision-guarded replacement update.
+#[derive(InputObject)]
+pub struct UpdateSavedViewInput {
+ /// Identity of the definition to update.
+ id: ID,
+ /// Revision that must still match when the update commits.
+ expected_revision: i64,
+ /// Replacement display name; omission preserves the current name.
+ name: Option<String>,
+ /// Complete replacement configuration; omission preserves current filters.
+ config: Option<Json<serde_json::Value>>,
+ /// Explicit sharing change; omission preserves the existing share.
+ sharing: Option<SavedViewSharingInput>,
+}
+
+/// Inputs for a revision-guarded deletion.
+#[derive(InputObject)]
+pub struct DeleteSavedViewInput {
+ /// Identity of the definition to delete.
+ id: ID,
+ /// Revision that must still match when the deletion commits.
+ expected_revision: i64,
+}
+
+/// Owner-scoped saved-view mutations.
+#[derive(Default)]
+pub struct SavedViewMutationRoot;
+
+#[Object]
+impl SavedViewMutationRoot {
+ /// Create once; replaying the same owned ID returns its existing record.
+ async fn create_saved_view(
+ &self,
+ ctx: &Context<'_>,
+ input: CreateSavedViewInput,
+ ) -> async_graphql::Result<GraphqlSavedView> {
+ let viewer = ctx.data::<macro_user_id::user_id::MacroUserIdStr<'static>>()?;
+ service(ctx)?
+ .create(
+ viewer.as_ref(),
+ parse_id(input.id)?,
+ input.name,
+ input.config.0,
+ input.shared_team_id.map(parse_id).transpose()?,
+ )
+ .await
+ .map(Into::into)
+ .map_err(error)
+ }
+
+ /// Replace supplied fields only if the caller owns the expected revision.
+ async fn update_saved_view(
+ &self,
+ ctx: &Context<'_>,
+ input: UpdateSavedViewInput,
+ ) -> async_graphql::Result<GraphqlSavedView> {
+ let viewer = ctx.data::<macro_user_id::user_id::MacroUserIdStr<'static>>()?;
+ let share = match input.sharing {
+ None => ShareChange::Unchanged,
+ Some(SavedViewSharingInput { team_id: None }) => ShareChange::Private,
+ Some(SavedViewSharingInput {
+ team_id: Some(team),
+ }) => ShareChange::Team(parse_id(team)?),
+ };
+ service(ctx)?
+ .update(
+ viewer.as_ref(),
+ parse_id(input.id)?,
+ input.expected_revision,
+ Update {
+ name: input.name,
+ config: input.config.map(|c| c.0),
+ share,
+ },
+ )
+ .await
+ .map(Into::into)
+ .map_err(error)
+ }
+
+ /// Delete the expected owned revision; repeating a completed deletion returns the ID.
+ async fn delete_saved_view(
+ &self,
+ ctx: &Context<'_>,
+ input: DeleteSavedViewInput,
+ ) -> async_graphql::Result<ID> {
+ let viewer = ctx.data::<macro_user_id::user_id::MacroUserIdStr<'static>>()?;
+ service(ctx)?
+ .delete(
+ viewer.as_ref(),
+ parse_id(input.id)?,
+ input.expected_revision,
+ )
+ .await
+ .map(Into::into)
+ .map_err(error)
+ }
+}
diff --git a/crates/complete_graph/src/schema.rs b/crates/complete_graph/src/schema.rs
index 3667024d7f..30545adac6 100644
--- a/crates/complete_graph/src/schema.rs
+++ b/crates/complete_graph/src/schema.rs
@@ -5,6 +5,7 @@ use std::{marker::PhantomData, sync::Arc};
use crate::edges::GraphqlAgentSessionLogEntry;
use crate::realtime::AgentSessionLogSubscriptions;
+use crate::saved_view::{GraphqlSavedView, GraphqlSavedViewPage, SavedViewMutationRoot};
use agent_session::domain::model::AgentSessionId;
use async_graphql::{Context, ID, MergedObject, MergedSubscription, Object, Schema, Subscription};
use axum::extract::FromRef;
@@ -105,6 +106,7 @@ pub struct CompleteMutationRoot<
InitiativeMutationRoot<E>,
CalendarMutationRoot,
WorkFeedMutationRoot<E>,
+ SavedViewMutationRoot,
);
impl<
@@ -131,6 +133,7 @@ impl<
InitiativeMutationRoot::<E>::default(),
CalendarMutationRoot,
WorkFeedMutationRoot::<E>::default(),
+ SavedViewMutationRoot,
)
}
}
@@ -698,6 +701,26 @@ where
AR: EntityPermissionEdgeReader,
AcR: ActivityReader,
{
+ /// Visible personal and effectively shared definitions, bounded after visibility checks.
+ async fn saved_views(
+ &self,
+ ctx: &Context<'_>,
+ kind: Option<String>,
+ first: Option<i32>,
+ after: Option<String>,
+ ) -> async_graphql::Result<GraphqlSavedViewPage> {
+ crate::saved_view::list(ctx, self.user_id.as_ref(), kind, first, after).await
+ }
+
+ /// An authorized definition or null when not found or not visible.
+ async fn saved_view(
+ &self,
+ ctx: &Context<'_>,
+ id: ID,
+ ) -> async_graphql::Result<Option<GraphqlSavedView>> {
+ crate::saved_view::get(ctx, self.user_id.as_ref(), id).await
+ }
+
/// Stable id of the authenticated user.
async fn id(&self) -> async_graphql::ID {
async_graphql::ID(self.user_id.to_string())
diff --git a/crates/complete_graph/src/sdl_test.rs b/crates/complete_graph/src/sdl_test.rs
index 0f13f9e8ac..1c27f39bf5 100644
--- a/crates/complete_graph/src/sdl_test.rs
+++ b/crates/complete_graph/src/sdl_test.rs
@@ -917,3 +917,41 @@ fn assert_sdl_line(sdl: &str, expected: &str) {
"schema missing exact line `{expected}`"
);
}
+
+#[test]
+fn saved_view_contract_is_composed_under_authenticated_user_and_mutations() {
+ let sdl = crate::build_schema().sdl();
+ let user = sdl
+ .split_once("type GraphqlUser {")
+ .expect("user type")
+ .1
+ .split_once('}')
+ .unwrap()
+ .0;
+ assert!(
+ user.contains("savedViews(kind: String, first: Int, after: String): GraphqlSavedViewPage!")
+ );
+ assert!(user.contains("savedView(id: ID!): GraphqlSavedView"));
+ for field in [
+ "createSavedView(input: CreateSavedViewInput!): GraphqlSavedView!",
+ "updateSavedView(input: UpdateSavedViewInput!): GraphqlSavedView!",
+ "deleteSavedView(input: DeleteSavedViewInput!): ID!",
+ "expectedRevision: Int!",
+ "sharing: SavedViewSharingInput",
+ "sharedTeamId: ID",
+ "nextCursor: String",
+ ] {
+ assert!(sdl.contains(field), "missing {field}");
+ }
+ let output = sdl
+ .split_once("type GraphqlSavedView {")
+ .unwrap()
+ .1
+ .split_once('}')
+ .unwrap()
+ .0;
+ assert!(
+ !output.contains("membership"),
+ "membership tokens are internal"
+ );
+}
diff --git a/crates/macro_db_client/AGENTS.md b/crates/macro_db_client/AGENTS.md
index 29a1a1ee65..8966b51e16 100644
--- a/crates/macro_db_client/AGENTS.md
+++ b/crates/macro_db_client/AGENTS.md
@@ -83,6 +83,11 @@ unreferenced replicas. These additive tables do not change agent-session claims.
`docs/design/outlook-email-support.md` for failure recovery and deployment order.
- Quote and alias camelCase columns to Rust field names
(`SELECT "userId" AS user_id`); don't guess spelling — check `migrations/`.
+- Saved-view sharing uses current team membership and chronological owner/team indexes.
+ Deploy additive revision and team-share columns before service changes. Keep permanent
+ `saved_view_tombstone` IDs and the deletion trigger to prevent delayed creates
+ from resurrecting deleted definitions. Use a fresh disposable database when
+ checking replacement branch migrations.
- The unmerged WhatsApp migrations define standalone group/message/reaction/attachment/read storage; domain queries live in `whatsapp_linked`.
diff --git a/crates/macro_db_client/migrations/20261025171458_saved_view_revision_and_sharing.sql b/crates/macro_db_client/migrations/20261025171458_saved_view_revision_and_sharing.sql
new file mode 100644
index 0000000000..636fdf2558
--- /dev/null
+++ b/crates/macro_db_client/migrations/20261025171458_saved_view_revision_and_sharing.sql
@@ -0,0 +1,5 @@
+SET LOCAL lock_timeout = '2s';
+ALTER TABLE saved_view ADD COLUMN revision bigint NOT NULL DEFAULT 1;
+ALTER TABLE saved_view ADD COLUMN shared_team_id uuid;
+ALTER TABLE saved_view ADD CONSTRAINT saved_view_shared_team_id_fkey
+ FOREIGN KEY (shared_team_id) REFERENCES team(id) ON DELETE SET NULL NOT VALID;
diff --git a/crates/macro_db_client/migrations/20261025171459_saved_view_owner_created_index.sql b/crates/macro_db_client/migrations/20261025171459_saved_view_owner_created_index.sql
new file mode 100644
index 0000000000..975665fd9a
--- /dev/null
+++ b/crates/macro_db_client/migrations/20261025171459_saved_view_owner_created_index.sql
@@ -0,0 +1,3 @@
+-- no-transaction
+-- Use PGOPTIONS='-c lock_timeout=2s' when running migrations.
+CREATE INDEX CONCURRENTLY saved_view_owner_created_idx ON saved_view (user_id, created_at, id);
diff --git a/crates/macro_db_client/migrations/20261025171460_saved_view_team_created_index.sql b/crates/macro_db_client/migrations/20261025171460_saved_view_team_created_index.sql
new file mode 100644
index 0000000000..810832ba81
--- /dev/null
+++ b/crates/macro_db_client/migrations/20261025171460_saved_view_team_created_index.sql
@@ -0,0 +1,4 @@
+-- no-transaction
+-- Use PGOPTIONS='-c lock_timeout=2s' when running migrations.
+CREATE INDEX CONCURRENTLY saved_view_team_created_idx ON saved_view (shared_team_id, created_at, id)
+ WHERE shared_team_id IS NOT NULL;
diff --git a/crates/macro_db_client/migrations/20261025171461_saved_view_deletion_tombstones.sql b/crates/macro_db_client/migrations/20261025171461_saved_view_deletion_tombstones.sql
new file mode 100644
index 0000000000..60b3138930
--- /dev/null
+++ b/crates/macro_db_client/migrations/20261025171461_saved_view_deletion_tombstones.sql
@@ -0,0 +1,15 @@
+-- Preserve physical deletion for old readers while permanently reserving retired IDs.
+SET LOCAL lock_timeout = '5s';
+CREATE TABLE saved_view_tombstone (id uuid PRIMARY KEY);
+CREATE FUNCTION saved_view_record_deletion() RETURNS trigger
+LANGUAGE plpgsql AS $$
+BEGIN
+ -- DELETE already holds the row lock. Do not acquire the application's
+ -- advisory lock here: legacy deletes take these locks in the reverse order.
+ INSERT INTO saved_view_tombstone (id) VALUES (OLD.id) ON CONFLICT DO NOTHING;
+ RETURN OLD;
+END;
+$$;
+CREATE TRIGGER saved_view_record_deletion
+BEFORE DELETE ON saved_view
+FOR EACH ROW EXECUTE FUNCTION saved_view_record_deletion();
diff --git a/crates/macro_db_client/migrations/20261025171462_saved_view_share_foreign_key_validate.sql b/crates/macro_db_client/migrations/20261025171462_saved_view_share_foreign_key_validate.sql
new file mode 100644
index 0000000000..f66835ddf0
--- /dev/null
+++ b/crates/macro_db_client/migrations/20261025171462_saved_view_share_foreign_key_validate.sql
@@ -0,0 +1,2 @@
+SET LOCAL lock_timeout = '2s';
+ALTER TABLE saved_view VALIDATE CONSTRAINT saved_view_shared_team_id_fkey;
diff --git a/crates/saved_views/AGENTS.md b/crates/saved_views/AGENTS.md
new file mode 100644
index 0000000000..719e23b203
--- /dev/null
+++ b/crates/saved_views/AGENTS.md
@@ -0,0 +1,15 @@
+# saved_views
+
+## Scope
+
+This crate owns saved-view definitions, revisions, effective team sharing, and legacy personal REST storage. Consumers own their versioned JSON configuration; saved views do not execute entity queries.
+
+## Start here
+
+- `src/domain.rs`: authorization, current-membership validation, optimistic writes, bounded visible pagination, and storage/membership ports. Fetch batches with `list_views_for_access_check`, then validate the viewer and owner against one primary-backed member list per distinct team in each batch; recheck previously collected views on later batches.
+- `src/pgsql.rs`: primary-backed SQLx queries, owner/revision guards, and per-ID transaction locks. Physical deletes leave permanent ID-only tombstones; never purge them or bypass the create lock. Deletion triggers must not acquire that lock after locking a row; creation rechecks tombstones after INSERT to catch legacy deletes.
+- `src/storage.rs`: legacy REST PATCH payload and excluded-default storage.
+
+## Checks
+
+Run `cargo test -p saved_views` with a local migrated MacroDB and `SQLX_OFFLINE` unset. Run `nix develop --command just prepare_db` after changing SQL or migrations. Never query `team_user` from this crate; the Teams-owned evidence adapter belongs at composition. For migration checks, use a fresh disposable local database. Run each concurrent-index migration separately with `PGOPTIONS="-c lock_timeout=2s"`. Owner departure disables sharing; owner rejoining restores it.
diff --git a/crates/saved_views/CLAUDE.md b/crates/saved_views/CLAUDE.md
new file mode 120000
index 0000000000..47dc3e3d86
--- /dev/null
+++ b/crates/saved_views/CLAUDE.md
@@ -0,0 +1 @@
+AGENTS.md
\ No newline at end of file
diff --git a/crates/saved_views/Cargo.toml b/crates/saved_views/Cargo.toml
index c274b93be8..21d288f818 100644
--- a/crates/saved_views/Cargo.toml
+++ b/crates/saved_views/Cargo.toml
@@ -14,3 +14,10 @@ tracing = { workspace = true }
utoipa = { workspace = true, features = ["uuid"] }
uuid = { workspace = true }
workspace-hack = { version = "0.1", path = "../workspace-hack" }
+rootcause = { workspace = true }
+thiserror = { workspace = true }
+async-trait = { workspace = true }
+
+[dev-dependencies]
+tokio = { workspace = true }
+macro_db_migrator = { path = "../macro_db_migrator" }
diff --git a/crates/saved_views/fixtures/create_retry_gate.sql b/crates/saved_views/fixtures/create_retry_gate.sql
new file mode 100644
index 0000000000..ca198ba63b
--- /dev/null
+++ b/crates/saved_views/fixtures/create_retry_gate.sql
@@ -0,0 +1,15 @@
+-- The retry releases the arrival signal, then waits until the legacy delete commits.
+CREATE FUNCTION saved_view_retry_gate() RETURNS trigger
+LANGUAGE plpgsql AS $$
+BEGIN
+ IF NEW.name = 'Racing retry' THEN
+ PERFORM pg_advisory_unlock(804722);
+ PERFORM pg_advisory_xact_lock(804721);
+ END IF;
+ RETURN NEW;
+END;
+$$;
+
+CREATE TRIGGER saved_view_retry_gate
+BEFORE INSERT ON saved_view
+FOR EACH ROW EXECUTE FUNCTION saved_view_retry_gate();
diff --git a/crates/saved_views/fixtures/users.sql b/crates/saved_views/fixtures/users.sql
new file mode 100644
index 0000000000..88d18bcb69
--- /dev/null
+++ b/crates/saved_views/fixtures/users.sql
@@ -0,0 +1,11 @@
+INSERT INTO macro_user (id, username, email, stripe_customer_id) VALUES
+('a1111111-1111-1111-1111-111111111111', '[email protected]', '[email protected]', 'cus_owner'),
+('a2222222-2222-2222-2222-222222222222', '[email protected]', '[email protected]', 'cus_viewer');
+INSERT INTO "User" (id, email, name, macro_user_id) VALUES
+('macro|[email protected]', '[email protected]', 'Owner', 'a1111111-1111-1111-1111-111111111111'),
+('macro|[email protected]', '[email protected]', 'Viewer', 'a2222222-2222-2222-2222-222222222222');
+INSERT INTO team (id, name, owner_id) VALUES
+('11111111-1111-1111-1111-111111111111', 'Team', 'macro|[email protected]');
+INSERT INTO team_user (team_id, user_id, team_role) VALUES
+('11111111-1111-1111-1111-111111111111', 'macro|[email protected]', 'owner'),
+('11111111-1111-1111-1111-111111111111', 'macro|[email protected]', 'member');
diff --git a/crates/saved_views/src/domain.rs b/crates/saved_views/src/domain.rs
new file mode 100644
index 0000000000..411b373cab
--- /dev/null
+++ b/crates/saved_views/src/domain.rs
@@ -0,0 +1,567 @@
+//! Saved-view policy and persistence ports. Configurations belong to their consumers.
+use crate::View;
+use serde_json::Value;
+use std::{
+ collections::{HashMap, HashSet},
+ future::Future,
+};
+use uuid::Uuid;
+
+/// Requested sharing change, separate from an omitted update.
+#[derive(Debug, Clone, Copy)]
+pub enum ShareChange {
+ /// Keep the existing share.
+ Unchanged,
+ /// Remove sharing.
+ Private,
+ /// Share with the given team.
+ Team(Uuid),
+}
+
+/// A replacement update; `None` means preserve the field.
+#[derive(Debug)]
+pub struct Update {
+ /// Replacement name.
+ pub name: Option<String>,
+ /// Replacement configuration.
+ pub config: Option<Value>,
+ /// Sharing change.
+ pub share: ShareChange,
+}
+
+/// Validated field changes and requested sharing for a conditional write.
+#[derive(Debug)]
+pub struct ViewChanges<'a> {
+ /// Replacement name; omission preserves the stored name.
+ pub name: Option<&'a str>,
+ /// Replacement configuration; omission preserves the stored configuration.
+ pub config: Option<&'a Value>,
+ /// Resolved team association, or no team for a private definition.
+ pub shared_team_id: Option<Uuid>,
+}
+
+/// Visibility and pagination position ordered by creation time then ID.
+#[derive(Debug, Clone, Copy)]
+pub struct Cursor {
+ /// Creation time of the last seen view.
+ pub created_at: chrono::DateTime<chrono::Utc>,
+ /// ID of the last seen view.
+ pub id: Uuid,
+}
+
+/// Storage for view definitions. Conditional writes enforce authorization atomically.
+pub trait ViewRepository: Send + Sync {
+ /// Repository failure.
+ type Err: std::error::Error + Send + Sync + 'static;
+ /// Load a definition from primary storage.
+ fn get(&self, id: Uuid) -> impl Future<Output = Result<Option<View>, Self::Err>> + Send;
+ /// List legacy personal views without a kind filter.
+ fn legacy_list(
+ &self,
+ viewer: &str,
+ ) -> impl Future<Output = Result<Vec<View>, Self::Err>> + Send;
+ /// Insert once; return the original live record, or None for a deleted ID.
+ fn create(&self, view: &View) -> impl Future<Output = Result<Option<View>, Self::Err>> + Send;
+ /// Read owned and team-shared views for the service to check against current membership.
+ fn list_views_for_access_check(
+ &self,
+ viewer: &str,
+ team_ids: &[Uuid],
+ kind: Option<&str>,
+ after: Option<Cursor>,
+ limit: i64,
+ ) -> impl Future<Output = Result<Vec<View>, Self::Err>> + Send;
+ /// Replace fields only when the owner and revision match.
+ fn update(
+ &self,
+ id: Uuid,
+ owner: &str,
+ revision: i64,
+ changes: ViewChanges<'_>,
+ ) -> impl Future<Output = Result<Option<View>, Self::Err>> + Send;
+ /// Retire the ID and clear content only when the owner and revision match.
+ fn delete(
+ &self,
+ id: Uuid,
+ owner: &str,
+ revision: i64,
+ ) -> impl Future<Output = Result<bool, Self::Err>> + Send;
+ /// Legacy REST PATCH shallow-merges JSON and increments the revision.
+ fn legacy_patch(
+ &self,
+ id: Uuid,
+ owner: &str,
+ name: Option<&str>,
+ config: Option<&Value>,
+ ) -> impl Future<Output = Result<bool, Self::Err>> + Send;
+ /// Legacy REST delete, scoped to the authenticated owner.
+ fn legacy_delete(
+ &self,
+ id: Uuid,
+ owner: &str,
+ ) -> impl Future<Output = Result<bool, Self::Err>> + Send;
+}
+
+/// Authoritative Teams-owned membership evidence, always read from primary storage.
+pub trait MembershipPort: Send + Sync {
+ /// Membership failure.
+ type Err: std::error::Error + Send + Sync + 'static;
+ /// All current teams for the viewer.
+ fn viewer_teams(
+ &self,
+ viewer: &str,
+ ) -> impl Future<Output = Result<Vec<Uuid>, Self::Err>> + Send;
+ /// All current members of a team, including its owner.
+ fn team_members(
+ &self,
+ team: Uuid,
+ ) -> impl Future<Output = Result<HashSet<String>, Self::Err>> + Send;
+}
+
+/// Caller-meaningful saved-view failures.
+#[derive(Debug, thiserror::Error)]
+pub enum Error {
+ /// No authorized record has this ID.
+ #[error("saved view not found")]
+ NotFound,
+ /// Legacy REST preserves its distinct response for another owner’s definition.
+ #[error("You are not authorized to access this")]
+ NotOwner,
+ /// A stale revision was submitted.
+ #[error("saved view revision conflict")]
+ Conflict,
+ /// An input exceeded its validated bounds.
+ #[error("invalid saved view input")]
+ Invalid,
+ /// A share targets a team the owner does not belong to.
+ #[error("not a current team member")]
+ NotMember,
+ /// A storage or membership read failed.
+ #[error("saved view internal error")]
+ Internal(rootcause::Report),
+}
+
+/// Cursor page of effectively visible definitions.
+#[derive(Debug)]
+pub struct Page {
+ /// Visible definitions.
+ pub views: Vec<View>,
+ /// Last scanned view, only set when more visible views remain.
+ pub next: Option<Cursor>,
+}
+
+/// Owns authorization, visibility, write policy and pagination.
+pub struct SavedViewService<R, M> {
+ repo: R,
+ membership: M,
+}
+
+impl<R: ViewRepository, M: MembershipPort> SavedViewService<R, M> {
+ /// Construct the saved-view service from its ports.
+ pub fn new(repo: R, membership: M) -> Self {
+ Self { repo, membership }
+ }
+
+ fn validate(name: &str, config: &Value) -> Result<(), Error> {
+ if name.trim().is_empty()
+ || name.chars().count() > 120
+ || !config.is_object()
+ || serde_json::to_vec(config)
+ .map_err(|_| Error::Invalid)?
+ .len()
+ > 32_768
+ {
+ return Err(Error::Invalid);
+ }
+ Ok(())
+ }
+
+ async fn effective(
+ &self,
+ viewer: &str,
+ views: Vec<View>,
+ viewer_teams: &HashSet<Uuid>,
+ ) -> Result<Vec<View>, Error> {
+ let teams: HashSet<_> = views
+ .iter()
+ .filter_map(|view| view.shared_team_id)
+ .filter(|team| viewer_teams.contains(team))
+ .collect();
+ let mut team_members = HashMap::new();
+ for team in teams {
+ let members = self
+ .membership
+ .team_members(team)
+ .await
+ .map_err(|e| Error::Internal(rootcause::Report::new(e).into_dynamic()))?;
+ team_members.insert(team, members);
+ }
+ Ok(views
+ .into_iter()
+ .filter_map(|mut v| {
+ let shared = v.shared_team_id.filter(|team| {
+ team_members.get(team).is_some_and(|members| {
+ members.contains(viewer) && members.contains(&v.user_id)
+ })
+ });
+ if v.user_id != viewer && shared.is_none() {
+ return None;
+ }
+ v.shared_team_id = shared;
+ Some(v)
+ })
+ .collect())
+ }
+
+ /// Read an authorized definition; an inactive share is private even for the owner.
+ #[tracing::instrument(name = "saved_view.get", skip_all, fields(view_id = %id), err)]
+ pub async fn get(&self, viewer: &str, id: Uuid) -> Result<View, Error> {
+ let view = self
+ .repo
+ .get(id)
+ .await
+ .map_err(|e| Error::Internal(rootcause::Report::new(e).into_dynamic()))?
+ .ok_or(Error::NotFound)?;
+ let teams = self
+ .membership
+ .viewer_teams(viewer)
+ .await
+ .map_err(|e| Error::Internal(rootcause::Report::new(e).into_dynamic()))?;
+ self.effective(viewer, vec![view], &teams.into_iter().collect())
+ .await?
+ .pop()
+ .ok_or(Error::NotFound)
+ }
+
+ /// List a bounded page after applying effective visibility.
+ #[tracing::instrument(name = "saved_view.list", skip_all, fields(limit, kind), err)]
+ pub async fn list(
+ &self,
+ viewer: &str,
+ kind: Option<&str>,
+ after: Option<Cursor>,
+ limit: u32,
+ ) -> Result<Page, Error> {
+ if !(1..=50).contains(&limit) || kind.is_some_and(|s| s.is_empty() || s.len() > 64) {
+ return Err(Error::Invalid);
+ }
+ let teams = self
+ .membership
+ .viewer_teams(viewer)
+ .await
+ .map_err(|e| Error::Internal(rootcause::Report::new(e).into_dynamic()))?;
+ let team_set: HashSet<_> = teams.iter().copied().collect();
+ let mut cursor = after;
+ let mut visible = Vec::new();
+ loop {
+ let batch = self
+ .repo
+ .list_views_for_access_check(viewer, &teams, kind, cursor, 100)
+ .await
+ .map_err(|e| Error::Internal(rootcause::Report::new(e).into_dynamic()))?;
+ let count = batch.len();
+ // Keep raw sharing evidence until the page is complete. Membership can
+ // change between batches, so recheck previously collected views too.
+ let mut effective = self
+ .effective(
+ viewer,
+ visible.iter().chain(&batch).cloned().collect(),
+ &team_set,
+ )
+ .await?;
+ let visible_ids: HashSet<_> = effective.iter().map(|v| v.id).collect();
+ visible.retain(|v: &View| visible_ids.contains(&v.id));
+ for v in batch {
+ let previous = cursor;
+ cursor = Some(Cursor {
+ created_at: v.created_at,
+ id: v.id,
+ });
+ if visible_ids.contains(&v.id) {
+ visible.push(v);
+ if visible.len() > limit as usize {
+ effective.truncate(limit as usize);
+ return Ok(Page {
+ views: effective,
+ next: previous,
+ });
+ }
+ }
+ }
+ if count < 100 {
+ return Ok(Page {
+ views: effective,
+ next: None,
+ });
+ }
+ }
+ }
+
+ /// Create once; the ID is client-generated so a retry cannot duplicate a definition.
+ #[tracing::instrument(name = "saved_view.create", skip_all, fields(view_id = %id), err)]
+ pub async fn create(
+ &self,
+ viewer: &str,
+ id: Uuid,
+ name: String,
+ config: Value,
+ team: Option<Uuid>,
+ ) -> Result<View, Error> {
+ if let Some(existing) = self
+ .repo
+ .get(id)
+ .await
+ .map_err(|e| Error::Internal(rootcause::Report::new(e).into_dynamic()))?
+ {
+ if existing.user_id != viewer {
+ return Err(Error::NotFound);
+ }
+ return self.get(viewer, id).await;
+ }
+ Self::validate(&name, &config)?;
+ if let Some(team) = team {
+ let members = self
+ .membership
+ .team_members(team)
+ .await
+ .map_err(|e| Error::Internal(rootcause::Report::new(e).into_dynamic()))?;
+ if !members.contains(viewer) {
+ return Err(Error::NotMember);
+ }
+ }
+ let mut view = View::new(viewer.to_owned(), name, config);
+ view.id = id;
+ view.shared_team_id = team;
+ let created = self
+ .repo
+ .create(&view)
+ .await
+ .map_err(|e| Error::Internal(rootcause::Report::new(e).into_dynamic()))?
+ .ok_or(Error::NotFound)?;
+ if created.user_id != viewer {
+ return Err(Error::NotFound);
+ }
+ self.get(viewer, id).await
+ }
+
+ /// Replace selected fields using a revision-guarded owner-only write.
+ #[tracing::instrument(name = "saved_view.update", skip_all, fields(view_id = %id, revision), err)]
+ pub async fn update(
+ &self,
+ viewer: &str,
+ id: Uuid,
+ revision: i64,
+ change: Update,
+ ) -> Result<View, Error> {
+ let current = self
+ .repo
+ .get(id)
+ .await
+ .map_err(|e| Error::Internal(rootcause::Report::new(e).into_dynamic()))?
+ .ok_or(Error::NotFound)?;
+ if current.user_id != viewer {
+ return Err(Error::NotFound);
+ }
+ if current.revision != revision {
+ return Err(Error::Conflict);
+ }
+ Self::validate(
+ change.name.as_deref().unwrap_or(&current.name),
+ change.config.as_ref().unwrap_or(&current.config),
+ )?;
+ let team = match change.share {
+ ShareChange::Unchanged => current.shared_team_id,
+ ShareChange::Private => None,
+ ShareChange::Team(team) => {
+ let members = self
+ .membership
+ .team_members(team)
+ .await
+ .map_err(|e| Error::Internal(rootcause::Report::new(e).into_dynamic()))?;
+ if !members.contains(viewer) {
+ return Err(Error::NotMember);
+ }
+ Some(team)
+ }
+ };
+ let saved = self
+ .repo
+ .update(
+ id,
+ viewer,
+ revision,
+ ViewChanges {
+ name: change.name.as_deref(),
+ config: change.config.as_ref(),
+ shared_team_id: team,
+ },
+ )
+ .await
+ .map_err(|e| Error::Internal(rootcause::Report::new(e).into_dynamic()))?
+ .ok_or(Error::Conflict)?;
+ self.get(viewer, saved.id).await
+ }
+
+ /// Delete an owned definition, harmless on a repeated deletion.
+ #[tracing::instrument(name = "saved_view.delete", skip_all, fields(view_id = %id, revision), err)]
+ pub async fn delete(&self, viewer: &str, id: Uuid, revision: i64) -> Result<Uuid, Error> {
+ if !self
+ .repo
+ .delete(id, viewer, revision)
+ .await
+ .map_err(|e| Error::Internal(rootcause::Report::new(e).into_dynamic()))?
+ {
+ let current = self
+ .repo
+ .get(id)
+ .await
+ .map_err(|e| Error::Internal(rootcause::Report::new(e).into_dynamic()))?;
+ if let Some(v) = current {
+ if v.user_id != viewer {
+ return Err(Error::NotFound);
+ }
+ return Err(Error::Conflict);
+ }
+ }
+ Ok(id)
+ }
+
+ /// Legacy REST creation accepts existing CRM configurations unchanged.
+ pub async fn legacy_create(
+ &self,
+ viewer: &str,
+ name: String,
+ config: Value,
+ ) -> Result<View, Error> {
+ let view = View::new(viewer.to_owned(), name, config);
+ self.repo
+ .create(&view)
+ .await
+ .map_err(|e| Error::Internal(rootcause::Report::new(e).into_dynamic()))?
+ .ok_or(Error::NotFound)
+ }
+
+ /// Legacy REST listing includes only the caller's private definitions.
+ pub async fn legacy_list(&self, viewer: &str) -> Result<Vec<View>, Error> {
+ self.repo
+ .legacy_list(viewer)
+ .await
+ .map_err(|e| Error::Internal(rootcause::Report::new(e).into_dynamic()))
+ }
+
+ async fn require_legacy_owner(&self, viewer: &str, id: Uuid) -> Result<(), Error> {
+ let view = self
+ .repo
+ .get(id)
+ .await
+ .map_err(|e| Error::Internal(rootcause::Report::new(e).into_dynamic()))?
+ .ok_or(Error::NotFound)?;
+ if view.user_id != viewer {
+ return Err(Error::NotOwner);
+ }
+ Ok(())
+ }
+
+ /// Legacy REST PATCH, preserving its shallow JSON merge.
+ #[tracing::instrument(name = "saved_view.legacy_patch", skip_all, fields(view_id = %id), err)]
+ pub async fn legacy_patch(
+ &self,
+ viewer: &str,
+ id: Uuid,
+ name: Option<&str>,
+ config: Option<&Value>,
+ ) -> Result<(), Error> {
+ self.require_legacy_owner(viewer, id).await?;
+ self.repo
+ .legacy_patch(id, viewer, name, config)
+ .await
+ .map_err(|e| Error::Internal(rootcause::Report::new(e).into_dynamic()))?
+ .then_some(())
+ .ok_or(Error::NotFound)
+ }
+
+ /// Legacy REST deletion with an atomic owner predicate.
+ #[tracing::instrument(name = "saved_view.legacy_delete", skip_all, fields(view_id = %id), err)]
+ pub async fn legacy_delete(&self, viewer: &str, id: Uuid) -> Result<(), Error> {
+ self.require_legacy_owner(viewer, id).await?;
+ self.repo
+ .legacy_delete(id, viewer)
+ .await
+ .map_err(|e| Error::Internal(rootcause::Report::new(e).into_dynamic()))?
+ .then_some(())
+ .ok_or(Error::NotFound)
+ }
+}
+
+/// Object-safe service facade for GraphQL request context injection.
+/// `async_trait` is needed because the composed GraphQL schema holds a trait object.
+#[async_trait::async_trait]
+pub trait SavedViewApi: Send + Sync {
+ /// Read one authorized view.
+ async fn get(&self, viewer: &str, id: Uuid) -> Result<View, Error>;
+ /// Read a bounded visible page.
+ async fn list(
+ &self,
+ viewer: &str,
+ kind: Option<&str>,
+ after: Option<Cursor>,
+ limit: u32,
+ ) -> Result<Page, Error>;
+ /// Create or replay a view.
+ async fn create(
+ &self,
+ viewer: &str,
+ id: Uuid,
+ name: String,
+ config: Value,
+ team: Option<Uuid>,
+ ) -> Result<View, Error>;
+ /// Update with an expected revision.
+ async fn update(
+ &self,
+ viewer: &str,
+ id: Uuid,
+ revision: i64,
+ change: Update,
+ ) -> Result<View, Error>;
+ /// Delete with an expected revision.
+ async fn delete(&self, viewer: &str, id: Uuid, revision: i64) -> Result<Uuid, Error>;
+}
+
+#[async_trait::async_trait]
+impl<R: ViewRepository, M: MembershipPort> SavedViewApi for SavedViewService<R, M> {
+ async fn get(&self, viewer: &str, id: Uuid) -> Result<View, Error> {
+ SavedViewService::get(self, viewer, id).await
+ }
+ async fn list(
+ &self,
+ viewer: &str,
+ kind: Option<&str>,
+ after: Option<Cursor>,
+ limit: u32,
+ ) -> Result<Page, Error> {
+ SavedViewService::list(self, viewer, kind, after, limit).await
+ }
+ async fn create(
+ &self,
+ viewer: &str,
+ id: Uuid,
+ name: String,
+ config: Value,
+ team: Option<Uuid>,
+ ) -> Result<View, Error> {
+ SavedViewService::create(self, viewer, id, name, config, team).await
+ }
+ async fn update(
+ &self,
+ viewer: &str,
+ id: Uuid,
+ revision: i64,
+ change: Update,
+ ) -> Result<View, Error> {
+ SavedViewService::update(self, viewer, id, revision, change).await
+ }
+ async fn delete(&self, viewer: &str, id: Uuid, revision: i64) -> Result<Uuid, Error> {
+ SavedViewService::delete(self, viewer, id, revision).await
+ }
+}
diff --git a/crates/saved_views/src/lib.rs b/crates/saved_views/src/lib.rs
index ee66bfbd4d..5d06f27730 100644
--- a/crates/saved_views/src/lib.rs
+++ b/crates/saved_views/src/lib.rs
@@ -1,3 +1,4 @@
+pub mod domain;
mod pgsql;
mod storage;
use chrono::{DateTime, Utc};
@@ -7,8 +8,8 @@ use utoipa::ToSchema;
use uuid::Uuid;
pub use pgsql::PgViewStorage;
-pub use storage::{ExcludedDefaultViewStorage, ViewPatch, ViewStorage};
-#[derive(Serialize, Deserialize, Debug, ToSchema)]
+pub use storage::{ExcludedDefaultViewStorage, ViewPatch};
+#[derive(Clone, Serialize, Deserialize, Debug, ToSchema)]
#[serde(rename_all = "camelCase")]
pub struct View {
pub id: Uuid,
@@ -20,6 +21,14 @@ pub struct View {
pub config: serde_json::Value,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
+ /// Optimistic-write revision, omitted from legacy REST responses.
+ #[serde(skip)]
+ #[schema(ignore)]
+ pub revision: i64,
+ /// Requested share; effective visibility is determined by the service.
+ #[serde(skip)]
+ #[schema(ignore)]
+ pub shared_team_id: Option<Uuid>,
}
impl View {
@@ -32,6 +41,8 @@ impl View {
config,
created_at: now,
updated_at: now,
+ revision: 1,
+ shared_team_id: None,
}
}
}
@@ -41,7 +52,7 @@ impl View {
///
/// It is important that the frontend can quickly iterate on default views, for that reason
/// we don't keep track of default views in the database, only those that are explicitly excluded.
-#[derive(Serialize, Deserialize, Debug, ToSchema)]
+#[derive(Clone, Serialize, Deserialize, Debug, ToSchema)]
#[serde(rename_all = "camelCase")]
pub struct ExcludedDefaultView {
id: Uuid,
diff --git a/crates/saved_views/src/pgsql.rs b/crates/saved_views/src/pgsql.rs
index 8cf8892831..e6a59e7634 100644
--- a/crates/saved_views/src/pgsql.rs
+++ b/crates/saved_views/src/pgsql.rs
@@ -1,7 +1,4 @@
-use crate::{
- ExcludedDefaultView, View,
- storage::{ExcludedDefaultViewStorage, ViewPatch, ViewStorage},
-};
+use crate::{ExcludedDefaultView, View, storage::ExcludedDefaultViewStorage};
use sqlx::PgPool;
use uuid::Uuid;
@@ -13,33 +10,35 @@ impl PgViewStorage {
pub fn new(pool: PgPool) -> Self {
Self { pool }
}
+
+ // Serialize first creation and deletion, including IDs without a live row.
+ async fn begin_write(
+ &self,
+ id: Uuid,
+ ) -> Result<sqlx::Transaction<'static, sqlx::Postgres>, sqlx::Error> {
+ let mut tx = self.pool.begin().await?;
+ let key = format!("saved-view:{id}");
+ sqlx::query!("SELECT pg_advisory_xact_lock(hashtextextended($1, 0))", key)
+ .execute(&mut *tx)
+ .await?;
+ Ok(tx)
+ }
}
-impl ViewStorage for PgViewStorage {
+impl ExcludedDefaultViewStorage for PgViewStorage {
type Err = sqlx::Error;
#[tracing::instrument(skip(self), err)]
- async fn get_view(&self, id: Uuid) -> Result<View, Self::Err> {
- sqlx::query_as!(
- View,
- "SELECT id, user_id, name, config, created_at, updated_at FROM saved_view WHERE id = $1",
- id
- )
- .fetch_one(&self.pool)
- .await
- }
-
- #[tracing::instrument(skip(self), err)]
- async fn create_view(&self, view: &View) -> Result<(), Self::Err> {
+ async fn create_excluded_default_view(
+ &self,
+ view: ExcludedDefaultView,
+ ) -> Result<(), Self::Err> {
sqlx::query!(
- "INSERT INTO saved_view (id, user_id, name, config, created_at, updated_at)
- VALUES ($1, $2, $3, $4, $5, $6)",
+ "INSERT INTO excluded_default_view (id, user_id, default_view_id)
+ VALUES ($1, $2, $3)",
view.id,
view.user_id,
- view.name,
- view.config,
- view.created_at,
- view.updated_at
+ view.default_view_id
)
.execute(&self.pool)
.await?;
@@ -47,82 +46,180 @@ impl ViewStorage for PgViewStorage {
Ok(())
}
- #[tracing::instrument(skip(self), err)]
- async fn get_views_for_user(&self, user_id: &str) -> Result<Vec<View>, Self::Err> {
+ async fn get_excluded_default_views_for_user(
+ &self,
+ user_id: &str,
+ ) -> Result<Vec<ExcludedDefaultView>, Self::Err> {
sqlx::query_as!(
- View,
- "SELECT id, user_id, name, config, created_at, updated_at FROM saved_view WHERE user_id = $1",
+ ExcludedDefaultView,
+ "SELECT id, user_id, default_view_id FROM excluded_default_view WHERE user_id = $1",
user_id
)
.fetch_all(&self.pool)
.await
}
+}
+
+impl crate::domain::ViewRepository for PgViewStorage {
+ type Err = sqlx::Error;
#[tracing::instrument(skip(self), err)]
- async fn patch_view(&self, id: Uuid, patch: ViewPatch) -> Result<(), Self::Err> {
+ async fn get(&self, id: Uuid) -> Result<Option<View>, Self::Err> {
+ sqlx::query_as!(View, "SELECT id, user_id, name, config, created_at, updated_at, revision, shared_team_id FROM saved_view WHERE id = $1", id)
+ .fetch_optional(&self.pool).await
+ }
+
+ async fn legacy_list(&self, viewer: &str) -> Result<Vec<View>, Self::Err> {
+ sqlx::query_as!(View,
+ "SELECT id, user_id, name, config, created_at, updated_at, revision, shared_team_id FROM saved_view WHERE user_id = $1",
+ viewer
+ ).fetch_all(&self.pool).await
+ }
+
+ #[tracing::instrument(skip(self, view), fields(view_id = %view.id), err)]
+ async fn create(&self, view: &View) -> Result<Option<View>, Self::Err> {
+ let mut tx = self.begin_write(view.id).await?;
+ let deleted = sqlx::query_scalar!(
+ r#"SELECT EXISTS(SELECT 1 FROM saved_view_tombstone WHERE id = $1) AS "exists!""#,
+ view.id
+ )
+ .fetch_one(&mut *tx)
+ .await?;
+ if deleted {
+ return Ok(None);
+ }
sqlx::query!(
- r#"
- UPDATE saved_view
- SET
- name = COALESCE($2, name),
- config = CASE
- WHEN $3::jsonb IS NOT NULL THEN config || $3
- ELSE config
- END,
- updated_at = NOW()
- WHERE id = $1
- "#,
- id,
- patch.name,
- patch.config as Option<serde_json::Value>
+ "INSERT INTO saved_view (id, user_id, name, config, created_at, updated_at, shared_team_id)
+ VALUES ($1, $2, $3, $4, $5, $6, $7) ON CONFLICT (id) DO NOTHING",
+ view.id, view.user_id, view.name, view.config, view.created_at, view.updated_at,
+ view.shared_team_id,
+ ).execute(&mut *tx).await?;
+ // A legacy delete can commit while INSERT waits on the old row. Check
+ // again in a fresh statement snapshot before making a replacement live.
+ let deleted = sqlx::query_scalar!(
+ r#"SELECT EXISTS(SELECT 1 FROM saved_view_tombstone WHERE id = $1) AS "exists!""#,
+ view.id
)
- .execute(&self.pool)
+ .fetch_one(&mut *tx)
.await?;
-
- Ok(())
+ if deleted {
+ tx.rollback().await?;
+ return Ok(None);
+ }
+ let created = sqlx::query_as!(View, "SELECT id, user_id, name, config, created_at, updated_at, revision, shared_team_id FROM saved_view WHERE id = $1", view.id)
+ .fetch_optional(&mut *tx).await?;
+ tx.commit().await?;
+ Ok(created)
}
- #[tracing::instrument(skip(self), err)]
- async fn delete_view(&self, id: Uuid) -> Result<(), Self::Err> {
- sqlx::query!("DELETE FROM saved_view WHERE id = $1", id)
- .execute(&self.pool)
- .await?;
+ #[tracing::instrument(skip_all, fields(limit, kind), err)]
+ async fn list_views_for_access_check(
+ &self,
+ viewer: &str,
+ team_ids: &[Uuid],
+ kind: Option<&str>,
+ after: Option<crate::domain::Cursor>,
+ limit: i64,
+ ) -> Result<Vec<View>, Self::Err> {
+ sqlx::query_as!(
+ View,
+ "SELECT id, user_id, name, config, created_at, updated_at, revision, shared_team_id
+ FROM saved_view
+ WHERE (user_id = $1 OR shared_team_id = ANY($2::uuid[]))
+ AND ($3::text IS NULL OR config->>'kind' = $3)
+ AND ($4::timestamptz IS NULL OR (created_at, id) > ($4, $5))
+ ORDER BY created_at, id LIMIT $6",
+ viewer,
+ team_ids,
+ kind,
+ after.map(|c| c.created_at),
+ after.map(|c| c.id),
+ limit
+ )
+ .fetch_all(&self.pool)
+ .await
+ }
- Ok(())
+ #[tracing::instrument(skip_all, fields(view_id = %id, revision), err)]
+ async fn update(
+ &self,
+ id: Uuid,
+ owner: &str,
+ revision: i64,
+ changes: crate::domain::ViewChanges<'_>,
+ ) -> Result<Option<View>, Self::Err> {
+ sqlx::query_as!(
+ View,
+ "UPDATE saved_view SET name = COALESCE($4, name), config = COALESCE($5, config),
+ shared_team_id = $6,
+ revision = revision + 1, updated_at = NOW()
+ WHERE id = $1 AND user_id = $2 AND revision = $3
+ RETURNING id, user_id, name, config, created_at, updated_at, revision, shared_team_id",
+ id,
+ owner,
+ revision,
+ changes.name,
+ changes.config,
+ changes.shared_team_id
+ )
+ .fetch_optional(&self.pool)
+ .await
}
-}
-impl ExcludedDefaultViewStorage for PgViewStorage {
- type Err = sqlx::Error;
+ #[tracing::instrument(skip_all, fields(view_id = %id, revision), err)]
+ async fn delete(&self, id: Uuid, owner: &str, revision: i64) -> Result<bool, Self::Err> {
+ let mut tx = self.begin_write(id).await?;
+ let deleted = sqlx::query!(
+ "DELETE FROM saved_view WHERE id = $1 AND user_id = $2 AND revision = $3",
+ id,
+ owner,
+ revision
+ )
+ .execute(&mut *tx)
+ .await?
+ .rows_affected()
+ != 0;
+ tx.commit().await?;
+ Ok(deleted)
+ }
- #[tracing::instrument(skip(self), err)]
- async fn create_excluded_default_view(
+ #[tracing::instrument(skip_all, fields(view_id = %id), err)]
+ async fn legacy_patch(
&self,
- view: ExcludedDefaultView,
- ) -> Result<(), Self::Err> {
- sqlx::query!(
- "INSERT INTO excluded_default_view (id, user_id, default_view_id)
- VALUES ($1, $2, $3)",
- view.id,
- view.user_id,
- view.default_view_id
+ id: Uuid,
+ owner: &str,
+ name: Option<&str>,
+ config: Option<&serde_json::Value>,
+ ) -> Result<bool, Self::Err> {
+ Ok(sqlx::query!(
+ "UPDATE saved_view SET name = COALESCE($3, name),
+ config = CASE WHEN $4::jsonb IS NULL THEN config ELSE config || $4 END,
+ revision = revision + 1, updated_at = NOW()
+ WHERE id = $1 AND user_id = $2",
+ id,
+ owner,
+ name,
+ config
)
.execute(&self.pool)
- .await?;
-
- Ok(())
+ .await?
+ .rows_affected()
+ != 0)
}
- async fn get_excluded_default_views_for_user(
- &self,
- user_id: &str,
- ) -> Result<Vec<ExcludedDefaultView>, Self::Err> {
- sqlx::query_as!(
- ExcludedDefaultView,
- "SELECT id, user_id, default_view_id FROM excluded_default_view WHERE user_id = $1",
- user_id
+ #[tracing::instrument(skip_all, fields(view_id = %id), err)]
+ async fn legacy_delete(&self, id: Uuid, owner: &str) -> Result<bool, Self::Err> {
+ let mut tx = self.begin_write(id).await?;
+ let deleted = sqlx::query!(
+ "DELETE FROM saved_view WHERE id = $1 AND user_id = $2",
+ id,
+ owner
)
- .fetch_all(&self.pool)
- .await
+ .execute(&mut *tx)
+ .await?
+ .rows_affected()
+ != 0;
+ tx.commit().await?;
+ Ok(deleted)
}
}
diff --git a/crates/saved_views/src/storage.rs b/crates/saved_views/src/storage.rs
index ca236cfd24..2870df9b39 100644
--- a/crates/saved_views/src/storage.rs
+++ b/crates/saved_views/src/storage.rs
@@ -1,9 +1,8 @@
use serde::{Deserialize, Serialize};
use std::future::Future;
use utoipa::ToSchema;
-use uuid::Uuid;
-use crate::{ExcludedDefaultView, View};
+use crate::ExcludedDefaultView;
#[derive(Debug, Serialize, Deserialize, ToSchema)]
pub struct ViewPatch {
@@ -11,27 +10,6 @@ pub struct ViewPatch {
pub config: Option<serde_json::Value>,
}
-pub trait ViewStorage {
- type Err;
- /// Get a view by it's id
- fn get_view(&self, id: Uuid) -> impl Future<Output = Result<View, Self::Err>> + Send;
- /// Create a new view
- fn create_view(&self, view: &View) -> impl Future<Output = Result<(), Self::Err>> + Send;
- /// Get all views for a user
- fn get_views_for_user(
- &self,
- user_id: &str,
- ) -> impl Future<Output = Result<Vec<View>, Self::Err>> + Send;
- /// Patch a view
- fn patch_view(
- &self,
- id: Uuid,
- patch: ViewPatch,
- ) -> impl Future<Output = Result<(), Self::Err>> + Send;
- /// Delete a view
- fn delete_view(&self, id: Uuid) -> impl Future<Output = Result<(), Self::Err>> + Send;
-}
-
pub trait ExcludedDefaultViewStorage {
type Err;
/// Create a new view
diff --git a/crates/teams/AGENTS.md b/crates/teams/AGENTS.md
index 9f8043ab1f..f2d4c38924 100644
--- a/crates/teams/AGENTS.md
+++ b/crates/teams/AGENTS.md
@@ -23,7 +23,8 @@ event contract (schema, sanitization, delivery semantics).
deletion side effects (owned-entity transfer, seat release).
- `src/inbound/axum_router.rs` / `src/inbound/toolset.rs`: HTTP routes and AI
tool surface.
-- `src/outbound/team_repo.rs`: the Postgres repository.
+- `src/outbound/team_repo.rs`: the Postgres repository; reads use the supplied pool.
+- `src/domain/team_repo.rs`: reuse `get_user_teams` for viewer teams and `get_all_team_members` for team membership, including owners.
## Scope
diff --git a/docs/agent-guide/tasks.md b/docs/agent-guide/tasks.md
index b2f4d325b1..a5f3d9b4b8 100644
--- a/docs/agent-guide/tasks.md
+++ b/docs/agent-guide/tasks.md
@@ -125,6 +125,32 @@ 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 only
the optimistic tag. Repeat with an existing assignment and with removal.
+## Saved views
+
+Saved views are available on main Tasks, not inside Project or CRM task lists.
+
+- Desktop: use the **Saved views** sidebar section. Its icon-only **+** remains available while collapsed or empty.
+- Mobile: the **Saved views** pill sits after **Filters** and before the built-in task tabs, using the same mobile pill component. It shows the selected view's name and active styling, and opens a drawer of saved-view rows with selection and management menus, without a duplicate section heading or **+** button. Create views from changed filters, layout, grouping, or sort in the filter drawer.
+- 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.
+- 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.
+- 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.
+- **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**.
+- 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>`.
+
+Verify creation without early persistence, explicit save/reset, copy versus owner-only editing, desktop/mobile metadata dialogs, and returning from task detail. Repeat with another teammate, a removed/rejoined owner, an unavailable tag, and a stale revision.
+
+Exercise these flows at desktop, phone, and tablet widths. Verify the mobile pill strip reserves its full height without overlapping task content, including after scrolling and returning from a drawer. Check that the mobile creation banner stays above the footer while filters scroll behind it and that the final filter controls can scroll clear of the banner. Verify it appears for changes to filters, layout, grouping, or sort and disappears when all four match the built-in tab defaults. Check keyboard navigation inside the mobile picker and focus after opening and closing Edit, Duplicate, or Delete. These focused dialogs use the shared imperative dialog host and must close when their owning account or view changes; the picker closes before a management dialog opens. Saving from the filter drawer closes it before opening the name dialog; Cancel or Escape reopens the unchanged filter draft, while a confirmed creation selects the new view without reopening the drawer. Delay a save while navigating or editing filters, and delay a deletion while selecting its target: stale saves must not change the new selection, later filter edits must survive, and confirmed deletion must clear its selected target.
+Also return a malformed definition from create or from another row's update: the selected view must remain accessible. Advance the selected view's revision while a duplicate saves; completion must not navigate away. Ordinary creation retains current facets even if its confirmed definition differs.
+Verify mixed supported and invalid entries, unsupported fields, conflicting tag bindings, and an unknown version. Supported conditions must immediately filter results while the danger banner stays visible. If none apply, verify unfiltered tasks, including closed tasks. Confirm the saved definition is unchanged on load, reset, and navigation, and permission failures still show an unavailable state without querying tasks.
+Verify banner cleanup on desktop and mobile, including an entirely unsupported definition. Confirm that only owners see the action, temporary filter edits stay unsaved, sharing stays unchanged, and failed or conflicting writes retain the original definition and warning.
+Verify layout-only, grouping-only, and sort-only save/reset, duplicate and reload, sort direction, mobile list fallback without overwriting a saved board/Gantt layout, and delayed saves while presentation changes. Older views without grouping default to Priority. A future filter, layout, grouping, sort, or version must warn and block ordinary Save changes without altering the original; explicit cleanup remains available.
+
## Gantt layout
Choose **Gantt** in the **Task layout** group to see task timelines.
@@ -929,7 +955,7 @@ Task navigation uses `My Tasks`, `All Tasks`, and `Created by me`. The desktop
sidebar has the full-width `New` menu and a collapsible list of task favorites;
tag filtering lives in the `Filter` menu. Favorite rows open their tasks.
Normal row and favorite activation replaces the list with the editable task
-document; its originating-tab breadcrumb returns to the list and its
+document; its originating-tab or saved-view breadcrumb returns to the list and its
header exposes Share and the task Details/Properties panel. Shift-click opens
the task in a new split instead. While the list is visible, `J` and `K` move
focus without opening a task until activation. In an open task detail, they
diff --git a/docs/design/saved-views.md b/docs/design/saved-views.md
new file mode 100644
index 0000000000..0c2284ec0b
--- /dev/null
+++ b/docs/design/saved-views.md
@@ -0,0 +1,450 @@
+# Saved views: reusable storage, Tasks first
+
+**Status:** Approved design, implemented on the task-saved-views branch. The
+starting point below describes the code before this change; rollout requires
+the additive migrations and backend GraphQL schema before the frontend.
+
+## Goal and scope
+
+A saved view is a named, reusable filter definition. Opening it queries live
+entities using the current viewer's access, rather than restoring a snapshot of
+results. The backend and CRUD client are reusable; the first UI consumer is the
+main Tasks screen.
+
+### Agreed behavior
+
+| Concern | Decision |
+| --- | --- |
+| Ownership | Personal by default; one creator owns the view. |
+| Sharing | An optional team share makes the definition discoverable to current teammates. |
+| Item access | Sharing never grants access to matching entities. |
+| Management | Only the owner can rename, update, delete, share, or unshare. |
+| Relative people | “Me” means the current viewer; explicitly selected people remain fixed. |
+| Contents | Filters, selected layout, grouping, and ordered sorting, including implicit person conditions. No search text or scroll state. |
+| Editing | Explicit Save changes, Reset, and Duplicate. |
+| Navigation | Leaving discards temporary edits without a confirmation prompt. |
+| Creation | Desktop sidebar `+` starts an unsaved view; mobile creates from changed filters, layout, grouping, or sort in the filter drawer. |
+| Capture | Save view appears left of Filters on desktop and in the mobile overlay banner when filters, layout, grouping, or sort differ from built-in tab defaults. |
+| Mobile | Shared picker pill after Filters and before built-in tabs; its drawer browses/manages views, while the filter drawer owns save/create/reset actions. |
+| Initial surfaces | Main Tasks only; not project or CRM embedded task lists. |
+| Owner departure | Team sharing stops while the owner is absent and resumes if they rejoin the shared team. |
+
+No default-view selection, saved-view list reordering, individual recipients,
+public links, new task filter categories, or CRM migration are included.
+In particular, the current Tasks implementation has no due-date filter;
+this feature does not add one.
+
+## Starting point before this change
+
+- [`saved_views`](../../crates/saved_views/src/lib.rs) already stores `id`,
+ `user_id`, `name`, arbitrary JSON `config`, and timestamps in `saved_view`.
+ Configuration is explicitly consumer-owned.
+- [Its PostgreSQL adapter](../../crates/saved_views/src/pgsql.rs) previously
+ implemented personal CRUD with shallow-merge PATCH. Ownership checks lived in
+ the [DSS REST adapter](../../services/document_storage_service/src/api/saved_views.rs).
+ This change moves policy into the domain service and adds GraphQL operations.
+- [CRM personal views](../../apps/web/src/features/crm/queries/saved-views.ts)
+ use this storage. CRM team views instead live in team CRM settings, and CRM
+ share links encode configuration snapshots. Preserve those existing contracts.
+- [Tasks state](../../apps/web/src/features/tasks-view/types.ts) mixes filters
+ with presentation and navigation state. Do not persist that entire object.
+- [Task query construction](../../apps/web/src/features/tasks-view/queries/task-query.ts)
+ and [client predicates](../../apps/web/src/features/tasks-view/filters/task-predicates.ts)
+ both apply tab scope and facets. My Tasks adds a viewer-relative assignee
+ condition; Created by me adds a viewer-relative creator condition. All Tasks
+ does not add a team-ID restriction.
+- [Tags](../../apps/web/src/features/soup/filters/facets/tag-facet.ts) currently
+ require loaded tag metadata to resolve an option to its property definition.
+ An unresolved tag stops filtering today. Saved views must not inherit that
+ silent broadening behavior.
+
+## Architecture
+
+```text
+Tasks UI
+ -> Tasks filter-definition adapter
+ -> reusable saved-view queries and mutation hooks
+ -> generated GraphQL client
+ -> GraphQL saved-view adapter
+ -> saved_views domain service
+ -> saved-view storage port
+ -> Teams membership port
+
+Opening a definition
+ -> Tasks filter-definition adapter
+ -> existing Task query builder and client predicates
+ -> existing GraphQL Soup queries and authorized entity sources
+```
+
+The saved-view service manages definitions, not result sets. It does not become
+another search service or execute a second filter language. Saved views are not
+new Soup entities and do not need app-wide favorites, properties, or document
+sharing machinery.
+
+Refactor the existing `saved_views` crate in place into domain models, ports,
+service, and PostgreSQL adapter. Put authorization and write policy in the
+service. Both the existing REST adapter and a new GraphQL adapter call it.
+Transport handlers must not retain independent owner or membership policy.
+
+Keep separate create, update, and delete mutation hooks in `features/saved-views`.
+Keep `useSavedViews` (paginated list) and `useSavedView` (single definition)
+independent and compose them in the host. Read and mutation hooks resolve the
+shared GraphQL client reactively; callers supply feature inputs, not clients.
+The Task draft primitive receives only the detail source and owns confirmed
+filter/layout/grouping/sort snapshots, dirty state, diagnostics, and revision-aware
+reconciliation. The Tasks host owns selection, navigation,
+and account/task lifecycle. Task actions capture the host request scope before
+writing or reloading, reject stale completions, and explicitly select created
+views. Mutation dialogs receive a refresh callback, not both query sources.
+Compose the list through compound components and reuse styled menu items across
+its context and overflow menus. The mobile picker shows rows without a duplicate
+section heading or create button; changes from the built-in settings expose creation in
+the filter drawer's overlay banner above the footer and existing-view save/reset
+actions at its footer's right.
+Starting a new view from the desktop sidebar expands the section and shows one
+local, selected New view row labeled Draft in the sidebar and mobile picker.
+Confirmed creation replaces the draft with the named record, including while the
+list refresh is pending. Canceling the draft or leaving its view removes the row;
+closing only the naming dialog retains it. Draft rows never enter the query cache.
+Open the shared create/edit dialog or delete confirmation through the imperative
+dialog system; dialogs own mutation hooks.
+Edit combines the name and team-sharing checkbox in the same responsive form.
+Edit and delete dialog titles identify the saved view by name, wrapping long names.
+Keep sharing guidance in the adjacent info control, available on hover, keyboard
+activation, and tap.
+Duplication reuses creation with a prefilled private copy. Keep Task filters, summaries, drafts,
+navigation, and rendering in `features/tasks-view`; do not make the generic
+feature import Tasks or CRM components.
+
+## Stored filter contract
+
+### Generic resource
+
+Keep the existing JSON `config` column. New consumers use a versioned envelope:
+
+- `kind`: a stable consumer identifier, initially `tasks`.
+- `version`: the consumer's definition version, initially `1` for Tasks.
+- `filters`: that consumer's declarative filter definition.
+- Task-specific `layout`, `groupBy`, and `sort`: selected layout, grouping, and ordered sort fields/directions.
+
+The backend validates generic write bounds and stores the configuration without
+interpreting Task fields. It can filter lists by `config.kind`. The consumer owns
+a versioned reader that applies supported Task filters and reports skipped conditions.
+Existing CRM configurations do not gain mandatory new fields or undergo a rewrite.
+
+This intentionally stores a consumer-owned definition rather than a fully
+compiled Soup AST. A compiled AST bakes in the current user, requires reverse
+parsing to restore editable controls, and couples persisted definitions to query
+transport details. Reuse the existing compiler at execution time instead.
+
+### Task definition v1
+
+The proposed shape below uses explanatory UUID placeholders, not real IDs:
+
+```json
+{
+ "kind": "tasks",
+ "version": 1,
+ "layout": "board",
+ "groupBy": "priority",
+ "sort": [{ "id": "updated_at", "reversed": false }],
+ "filters": {
+ "statusOptionIds": ["<in-progress-option-uuid>"],
+ "priorityOptionIds": [],
+ "assignees": [{ "type": "viewer" }],
+ "creators": [{ "type": "user", "id": "macro|[email protected]" }],
+ "tags": [{
+ "propertyDefinitionId": "<tag-property-uuid>",
+ "optionId": "<tag-option-uuid>"
+ }]
+ }
+}
+```
+
+- Save My Tasks by adding a viewer reference to Assignee; save Created by me by
+ adding one to Created by. All Tasks adds neither. There is no separate Scope
+ control or persisted scope field.
+- Person references are either `{ "type": "viewer" }` or
+ `{ "type": "user", "id": "..." }`. The picker distinguishes the relative
+ **Me** option from a fixed person. Its tooltip reads “Matches whoever opens this
+ saved view.” Do not replace every occurrence of the creator's ID with a viewer token.
+- Within each facet, values are alternatives (OR). Different facets combine
+ with AND. An empty facet adds no restriction.
+- Persist stable status and priority option IDs, not display labels. Persist
+ both tag IDs so inaccessible or deleted tag metadata cannot erase a clause.
+- Capture the actual open-status selection when present. Do not depend on
+ whatever default statuses a future client chooses.
+- Capturing My Tasks with an additional assignee uses normal OR matching: tasks
+ assigned to either person. Created by me follows the same rule for creators.
+- Accept only this final definition format. Earlier experimental Scope-based
+ configurations are not deployed contracts and have no upgrade path.
+
+Materialization always uses the All Tasks tab and restores every restriction as
+an editable facet. Viewer references resolve at query time. The same definition
+must feed list, board, Gantt, client predicates, and temporary text-search
+requests. Search text is not saved, but search results must satisfy every saved
+filter. In particular, search must use stored tag bindings rather than silently
+dropping tags absent from the viewer's metadata. If a search backend cannot
+express a condition, block that search with an explicit unsupported state;
+never run it with fewer conditions. Layout, grouping, and sort changes dirty the
+saved definition and participate in Save changes, Reset, and Duplicate. Missing
+layout, grouping, and sort use List, Priority, and updated-at descending defaults.
+Unsupported layouts fall back to List; unsupported grouping falls back to Priority;
+unsupported sort entries are skipped, preserving supported order,
+with updated-at descending used when no supported sort remains. Mobile and
+feature-flag fallbacks never replace the raw selected layout on save.
+
+Apply supported conditions immediately, omitting unsupported or malformed entries
+and conflicting tag bindings. Show a danger-colored banner above the results that
+identifies skipped filters or view settings without an additional description. If no supported
+conditions remain, show the unfiltered All Tasks list, including closed tasks;
+unknown formats also show this list with the banner. Keep missing or unauthorized
+definitions in the unavailable state, without executing task queries.
+
+Reading never modifies the stored definition and never starts a recovery workflow.
+Ordinary Save changes is disabled while any unsupported or invalid setting
+remains, preventing an older reader from overwriting settings it cannot represent.
+Edit preserves the raw configuration; Duplicate warns before omitting
+unsupported settings. Only explicit Remove & save replaces the original with
+supported settings. Missing person or tag labels retain their exact filter IDs
+because these conditions remain executable. A missing authenticated viewer blocks relative-filter execution.
+
+For dirty-state comparison, deduplicate and order set-valued filters. Reordering
+a selection alone is not a change. One Task codec owns capture, validation,
+materialization, and comparison; do not store both facets and an independently
+editable compiled AST.
+
+### Client-version safety
+
+Keep additions independently readable within a compatible definition version.
+Older guarded clients apply known settings and show a warning for unknown fields.
+Revision checks prevent stale writes, but do not prove a client understands every
+field. Do not rely on them for schema compatibility. Before enabling a breaking
+format or new settings for already-shipped clients without this write guard,
+require a backend write-version check or update those clients first; the generic
+backend currently stores opaque JSON and does not enforce reader capabilities.
+
+## Ownership, sharing, and lifecycle
+
+A caller can read a definition when they own it, or when its effective team share
+is valid and they currently belong to that team. Only the owner can write it.
+The server derives the owner from the authenticated request, never from input.
+Enabling sharing requires the owner to belong to the selected team. A viewer can
+save a personal copy of another person's shared definition.
+
+Every result query still uses the viewer's existing entity permissions. A shared
+All Tasks view can include the viewer's private tasks; team sharing controls who
+can open the definition, not which entities it selects.
+
+### Sharing follows current membership
+
+A share stores only a nullable `shared_team_id`. Both its owner and its viewer
+must currently belong to that team. Owner-only writes and item permissions remain
+independent of this visibility check.
+
+Leaving immediately makes the share ineffective; rejoining the same team restores
+it. A failed membership removal that restores membership has the same effect.
+This follows the existing current-membership sharing pattern, replacing the
+earlier proposed permanent-revocation policy. It needs no membership-lifetime
+column or changes to Teams' join, removal, or compensation flows.
+
+Unsharing explicitly clears `shared_team_id`. A deleted team makes the view
+private, not deleted. When an owner is absent, API responses hide the ineffective
+share without clearing the stored team association.
+
+The Teams-owned `TeamRepository` supplies authoritative current memberships:
+reuse `get_user_teams` to narrow the views fetched for access checks and
+`get_all_team_members` for each distinct team through the saved-view membership
+adapter. The saved-view domain checks that each view's owner and viewer are both
+in that team's member list, including team owners. Saved-view storage owns
+definition persistence. Do not query or mutate `team_user` directly from GraphQL
+resolvers or saved-view storage. Listing fetches batches with
+`list_views_for_access_check`, applies visibility before its public pagination
+limit, and fetches one member list per team in each batch, not per view. Recheck
+previously collected views on later batches; the initial team list only narrows
+the views fetched for access checks.
+
+## Persistence and GraphQL
+
+Add an internal integer revision, starting at one, to `saved_view`. All writes,
+including existing REST writes, advance it. Add owner and shared-team indexes
+with stable created-time/ID ordering; keep optional kind filtering without
+speculative kind-specific indexes. Existing rows remain private and retain their
+configuration. Consolidate unpublished migrations into the minimum safe final
+set, retaining separate concurrent-index statements and lock timeouts.
+
+Expose reads under the authenticated `user`, following the
+[GraphQL field guide](../guides/add-graphql-field.md):
+
+| Operation | Contract |
+| --- | --- |
+| `user.savedViews` | Visible owned and shared definitions; optional kind filter and bounded cursor pagination. |
+| `user.savedView(id)` | An authorized definition, or not found. |
+| `createSavedView` | Stable client-generated ID, name, config, and optional team share; private by default. |
+| `updateSavedView` | ID, expected revision, and optional name, replacement config, or explicit sharing change. |
+| `deleteSavedView` | ID and expected revision; returns the deleted ID. |
+
+The normalized output object has `id: ID!`, owner ID, name, config, effective
+shared team ID, revision, and timestamps. Generate the GraphQL envelope types and
+SDL; the frontend-owned JSON schema is not a second handwritten GraphQL DTO.
+
+Updates distinguish omission from clearing. Omitted fields stay unchanged;
+private sharing is explicit. A submitted config replaces the whole definition.
+Retain legacy REST shallow-merge behavior through an explicit domain update
+operation, rather than changing CRM's existing PATCH semantics.
+
+Stale revisions return a terminal conflict and preserve the newer record. Keep
+the draft so the user can reload or save a separate copy. Retried creation with
+the same owned ID returns the existing resource without overwriting it; retried
+deletion of an absent ID is harmless. A permanent ID-only tombstone prevents a
+late create retry from resurrecting a deleted view. Keep physical deletion so
+older REST readers still see absence, not an empty soft-deleted row. Serialize
+create/delete in upgraded writers with the same per-ID transaction lock. The
+deletion trigger captures old REST deletes and account cascades without taking
+that advisory lock after its row lock. Creation rechecks tombstones after INSERT
+and rolls back if a legacy deletion committed while INSERT waited. Tombstones
+contain no names, filters, or owner foreign key, and must not be purged. GraphQL
+permission, conflict, and validation errors must not become transport retries
+that block the mutation queue.
+
+Return authoritative records from create/update and the deleted identity from
+delete. Reconcile affected collection membership in the shared GraphQL cache;
+normalizing a record alone does not insert or remove connection edges. Preserve
+cursor-page boundaries when inserting, removing, or moving a record between
+kind-filtered collections, including when the first page is full. Do not
+optimistically invent sharing permission. Use the established live-query and
+mutation-policy machinery, not a second TanStack persistence path for Tasks.
+
+Mutation responses use primary-backed data. Membership evidence also requires
+authoritative reads, not a stale replica or browser cache. Revalidate collections
+on opening/foregrounding the surface. V1 does not introduce a dedicated realtime
+subscription; cross-client changes appear on revalidation. Every server operation
+still checks current access, irrespective of cached UI state.
+
+## UI and navigation
+
+### Desktop
+
+Add a **Saved views** section to `TasksSidebar`, after the built-in navigation.
+Keep the heading and its accessible, icon-only `+` available when the section is
+empty, collapsed, loading, or in an error state. Rows show the name, active state,
+and a team-sharing indicator where applicable. Use the existing sidebar and
+control primitives.
+
+The desktop main pane displays the selected view's bookmark icon before its name
+and its unframed ghost overflow button immediately after it, plus the normal Task
+controls.
+Provide matching sidebar context/overflow and selected-view overflow menus with
+Edit, Duplicate, Copy link, and confirmed Delete.
+Wrap menu items in the existing padded groups. Non-owners get only actions they
+can perform; backend enforcement remains authoritative. Edit updates the name
+and sharing together, preserving temporary filters, layout, grouping, and sort without saving
+them. Create and Edit use the same 600px-wide dialog, capped to the viewport;
+unchanged sharing is omitted from updates.
+
+On desktop, show **Save view** immediately left of Filters when filters, layout,
+grouping, or sort differ from the built-in tab defaults. It captures structured
+filters, implicit person conditions, layout, grouping, and ordered sorting,
+excluding search. Show a short reminder when search is active so the saved definition is
+not mistaken for the visible search results.
+
+### Drafts and explicit saving
+
+- The desktop sidebar's `+` starts a transient New view with no person
+ restrictions and the normal open-status filters. Nothing is persisted until
+ Save view succeeds.
+- Reuse the Task filter controls to configure it. Saving prefills the name with
+ New view, which can be edited, and offers optional team sharing. Cancel restores
+ normal navigation without persistence.
+- Opening a saved view replaces the prior filter scope rather than intersecting
+ with the previously selected built-in tab. Clear unrelated text search.
+- Changes show Save changes and Reset for the owner. All viewers can Duplicate
+ with a prefilled “(copy)” name; copies are private unless explicitly shared.
+ Duplicating the selected view includes temporary filters, layout, grouping, and sort;
+ duplicating another sidebar view uses that view's saved definition. Other viewers cannot overwrite
+ the shared definition.
+- Only a confirmed write updates the saved baseline. Failures keep the draft and
+ its inputs. Leaving the view discards temporary settings, including when a
+ background save fails after navigation.
+- Task-detail navigation and its return breadcrumb retain the originating saved
+ view identity, but do not persist an unsaved filter draft. Scope async results
+ to the account, selected view, and revision before installing them. A confirmed
+ deletion also exits its target if the same account selected it during the request.
+
+### Mobile
+
+Tasks has navigation pills and a filter drawer, not a mobile sidebar. The shared
+`MobileDrawer` picker shows the named list and active saved-view name without a
+duplicate section heading or `+` button. Keep the active name in the picker pill
+without repeating a title/menu or action row below the tabs. Preserve built-in
+navigation and existing mobile list-only behavior.
+
+Show a filled Save view button with a leading bookmark icon in a borderless,
+edge-to-edge info banner overlaying filter content immediately above the footer
+only when filters, layout, grouping, or sort differ from the built-in tab defaults.
+Base settings and search alone do not show the banner.
+Keep the banner fixed while content scrolls behind it, with a drawer-colored
+backing and enough scroll clearance to expose the last controls. Use the unpunctuated copy “Save these filters as a view”.
+An unsaved view also has Cancel whenever its changed settings show the banner.
+For an existing saved view, show a filled Save changes button and a secondary Reset
+at the footer's right, opposite Clear all, while settings are dirty. Keep these
+actions available when all filters are cleared or only sorting changes. Preserve
+the stored desktop layout.
+
+Provide management through each saved-view row's visible overflow button in the
+picker. Use existing dialog/drawer conventions for naming, sharing, conflicts,
+and delete confirmation. Keep row menus inside the picker's portal scope for
+keyboard access. Close the picker and restore its trigger focus before opening
+a management dialog; discard queued actions when the account changes. Saving
+from the filter drawer closes it before opening the name dialog. Cancel or Escape
+reopens the current filters only if the navigation scope is unchanged; a confirmed
+creation selects the new view without reopening the drawer. No hover-only controls
+or desktop-only management actions.
+
+### URLs and unavailable views
+
+Extend the Tasks route/search codec with a stable `savedView` ID, for example
+`/app/component/tasks?savedView=<uuid>`. Links identify the stored definition;
+they do not serialize filters or bypass sharing. A private link stays private.
+Preserve the normal Task-detail route composition and split behavior.
+
+A missing, deleted, unshared, or inaccessible view shows an unavailable state
+with a return-to-Tasks action. Do not fall back to All Tasks under the saved
+view's name. A list failure retains already loaded rows with a retry action.
+Unsupported or malformed filter conditions are skipped with the danger banner;
+if none apply, show unfiltered tasks. Duplication warns before saving a copy that
+omits these conditions and leaves the original unchanged.
+Keep the banner concise: name skipped filters and view settings without a description.
+Owners can explicitly choose **Remove & save** at its right edge.
+This revision-checked update keeps supported stored conditions, layout, grouping, sort, and
+sharing unchanged; it does not save temporary edits. Failed writes retain the
+warning and stored definition, and conflicts offer a reload. Only a confirmed update clears the warning.
+
+## Delivery and review boundaries
+
+Implement in focused slices, with behavior checks alongside each slice:
+
+1. Versioned Task definition codec and generic saved-view domain/storage design;
+ additive team-sharing and revision migrations with current-membership checks.
+2. GraphQL adapter, viewer reads, service wiring, generated contracts, and mutation
+ cache policy. Preserve existing REST/CRM behavior.
+3. Reusable frontend queries/mutations, Task-owned drafts, and the main Tasks desktop/mobile integration.
+ Keep project and CRM embedded Task consumers unchanged.
+4. Update the Tasks agent guide and affected crate guidance; exercise permissions,
+ multiple viewers, revision conflicts, missing filters, and navigation in the
+ local app before rollout.
+
+Deploy the additive database changes and upgrade all backend writers before
+enabling the frontend consumer, so concurrent REST writes advance revisions.
+Do not add a REST fallback when the new schema is unavailable. Reuse existing
+tracing across writes and filter loading without logging names, configuration
+contents, or person identifiers.
+
+### Points for design review
+
+- Consumer-owned, versioned filter definitions are recommended over storing a
+ compiled Soup AST or the entire Task view state.
+- Team visibility follows current owner and viewer membership, matching existing
+ sharing patterns rather than introducing membership lifetimes.
+- Cross-client changes revalidate rather than using a new realtime subscription.
+- No existing CRM views are migrated or reinterpreted in this feature.
diff --git a/docs/development/database.md b/docs/development/database.md
index 23dc60bcf3..272d4dbeb1 100644
--- a/docs/development/database.md
+++ b/docs/development/database.md
@@ -85,6 +85,7 @@ compatible with the service code currently deployed, not just the code in its PR
obsolete schema in a later PR after deployment.
- New columns and constraints must also support currently deployed code (for
example, allow omitted values via nullability or defaults until writers migrate).
+- Consolidate unpublished branch migrations into the minimum deployment-safe final set; never rewrite migrations already deployed to a shared environment.
## Change queries or schema
diff --git a/rules/ast-grep/ts-feature-components-presentational.yml b/rules/ast-grep/ts-feature-components-presentational.yml
index a74bfc31eb..9abeab8f59 100644
--- a/rules/ast-grep/ts-feature-components-presentational.yml
+++ b/rules/ast-grep/ts-feature-components-presentational.yml
@@ -13,6 +13,7 @@ note: |-
untyped wire JSON for property-changed rows. In block-agent, `ui/` is
the presentation layer and `component/` is the composition layer.
files:
+ - apps/web/src/features/saved-views/components/**
- apps/web/src/features/calendar-notes/components/**
- apps/web/src/features/access-requests/components/**
- apps/web/src/features/agent-activity/components/**
diff --git a/rules/ast-grep/ts-feature-core-pure.yml b/rules/ast-grep/ts-feature-core-pure.yml
index 2b24d7eb4d..e4a09b1529 100644
--- a/rules/ast-grep/ts-feature-core-pure.yml
+++ b/rules/ast-grep/ts-feature-core-pure.yml
@@ -15,6 +15,7 @@ note: |-
The shared @core/util/base64 codec, cron helpers, and dateSearch/parseTime parser are pure utilities and may be reused.
Block-agent names its rendering layers `ui/` and `component/`.
files:
+ - apps/web/src/features/saved-views/core/**
- apps/web/src/features/calendar-notes/core/**
- apps/web/src/features/access-requests/core/**
- apps/web/src/features/agent-activity/core/**
diff --git a/rules/ast-grep/ts-feature-data-no-ui.yml b/rules/ast-grep/ts-feature-data-no-ui.yml
index ce1ac9754e..96aa45b4c7 100644
--- a/rules/ast-grep/ts-feature-data-no-ui.yml
+++ b/rules/ast-grep/ts-feature-data-no-ui.yml
@@ -11,6 +11,8 @@ note: |-
with fake clients and controllers with fake capabilities; neither imports
rendering code, including block-agent’s `ui/` and `component/` layers.
files:
+ - apps/web/src/features/saved-views/queries/**
+ - apps/web/src/features/saved-views/primitives/**
- apps/web/src/features/calendar-notes/queries/**
- apps/web/src/features/calendar-notes/primitives/**
- apps/web/src/features/access-requests/queries/**
diff --git a/rules/ast-grep/ts-feature-layers-use-context.yml b/rules/ast-grep/ts-feature-layers-use-context.yml
index 1b090e4153..48e4f825ee 100644
--- a/rules/ast-grep/ts-feature-layers-use-context.yml
+++ b/rules/ast-grep/ts-feature-layers-use-context.yml
@@ -15,6 +15,11 @@ note: |-
`files` in each ts-/tsx-feature-* rule. Block-agent uses `ui/` for
presentation and `component/` for composition.
files:
+ - apps/web/src/features/saved-views/context/**
+ - apps/web/src/features/saved-views/queries/**
+ - apps/web/src/features/saved-views/primitives/**
+ - apps/web/src/features/saved-views/components/**
+ - apps/web/src/features/saved-views/views/**
- apps/web/src/features/calendar-notes/queries/**
- apps/web/src/features/calendar-notes/primitives/**
- apps/web/src/features/calendar-notes/components/**
diff --git a/rules/ast-grep/tsx-feature-components-presentational.yml b/rules/ast-grep/tsx-feature-components-presentational.yml
index 614317e202..a41d3a500b 100644
--- a/rules/ast-grep/tsx-feature-components-presentational.yml
+++ b/rules/ast-grep/tsx-feature-components-presentational.yml
@@ -13,6 +13,7 @@ note: |-
untyped wire JSON for property-changed rows. In block-agent, `ui/` is
the presentation layer and `component/` is the composition layer.
files:
+ - apps/web/src/features/saved-views/components/**
- apps/web/src/features/calendar-notes/components/**
- apps/web/src/features/access-requests/components/**
- apps/web/src/features/agent-activity/components/**
diff --git a/rules/ast-grep/tsx-feature-core-pure.yml b/rules/ast-grep/tsx-feature-core-pure.yml
index d7dab46180..501b2e4fe5 100644
--- a/rules/ast-grep/tsx-feature-core-pure.yml
+++ b/rules/ast-grep/tsx-feature-core-pure.yml
@@ -15,6 +15,7 @@ note: |-
The shared @core/util/base64 codec, cron helpers, and dateSearch/parseTime parser are pure utilities and may be reused.
Block-agent names its rendering layers `ui/` and `component/`.
files:
+ - apps/web/src/features/saved-views/core/**
- apps/web/src/features/calendar-notes/core/**
- apps/web/src/features/access-requests/core/**
- apps/web/src/features/agent-activity/core/**
diff --git a/rules/ast-grep/tsx-feature-data-no-ui.yml b/rules/ast-grep/tsx-feature-data-no-ui.yml
index 30cb739c21..2045782b35 100644
--- a/rules/ast-grep/tsx-feature-data-no-ui.yml
+++ b/rules/ast-grep/tsx-feature-data-no-ui.yml
@@ -11,6 +11,8 @@ note: |-
with fake clients and controllers with fake capabilities; neither imports
rendering code, including block-agent’s `ui/` and `component/` layers.
files:
+ - apps/web/src/features/saved-views/queries/**
+ - apps/web/src/features/saved-views/primitives/**
- apps/web/src/features/calendar-notes/queries/**
- apps/web/src/features/calendar-notes/primitives/**
- apps/web/src/features/access-requests/queries/**
diff --git a/rules/ast-grep/tsx-feature-layers-use-context.yml b/rules/ast-grep/tsx-feature-layers-use-context.yml
index 8c8dc74b21..d0080dd024 100644
--- a/rules/ast-grep/tsx-feature-layers-use-context.yml
+++ b/rules/ast-grep/tsx-feature-layers-use-context.yml
@@ -15,6 +15,11 @@ note: |-
`files` in each ts-/tsx-feature-* rule. Block-agent uses `ui/` for
presentation and `component/` for composition.
files:
+ - apps/web/src/features/saved-views/context/**
+ - apps/web/src/features/saved-views/queries/**
+ - apps/web/src/features/saved-views/primitives/**
+ - apps/web/src/features/saved-views/components/**
+ - apps/web/src/features/saved-views/views/**
- apps/web/src/features/calendar-notes/queries/**
- apps/web/src/features/calendar-notes/primitives/**
- apps/web/src/features/calendar-notes/components/**
diff --git a/services/document_storage_service/AGENTS.md b/services/document_storage_service/AGENTS.md
index 0e179c85dd..6612d2707a 100644
--- a/services/document_storage_service/AGENTS.md
+++ b/services/document_storage_service/AGENTS.md
@@ -12,6 +12,7 @@ threads, pins, recents, notifications, folders, activity.
`folders_query`, `graphql_soup`, `threads`, `annotations`, `history`,
`pins`, `recents`, `notification`, `instructions`, `internal`.
- `/databases/query` mounts the `databases_sql` HTTP adapter, sharing the database/access services and the primary Soup reader; SQL authorization stays in its domain service.
+- `src/service/saved_views.rs`: composes saved-view storage with the primary-backed Teams repository, reusing `get_user_teams` and `get_all_team_members`. REST and GraphQL share its owner-only domain policy.
- `src/api/graphql_soup.rs`: the `/soup/graphql` (+ `/soup/graphql/ws`
subscriptions) GraphQL API — the frontend's main read path for Home/Recent/
search ("Soup" items); see `crates/graphql_soup` for resolvers/loaders.
diff --git a/services/document_storage_service/src/api/graphql_soup.rs b/services/document_storage_service/src/api/graphql_soup.rs
index 4f75eccc08..4802990e33 100644
--- a/services/document_storage_service/src/api/graphql_soup.rs
+++ b/services/document_storage_service/src/api/graphql_soup.rs
@@ -144,6 +144,9 @@ fn insert_graphql_context_data(
viewer_id: Option<Uuid>,
) {
data.insert(state.clone());
+ let saved_views: std::sync::Arc<dyn saved_views::domain::SavedViewApi> =
+ std::sync::Arc::new(crate::service::saved_views::service(state.db.clone()));
+ data.insert(saved_views);
let Some(macro_user_id) = macro_user_id else {
return;
diff --git a/services/document_storage_service/src/api/saved_views.rs b/services/document_storage_service/src/api/saved_views.rs
index e0dba33c1d..ef4b0f7d3d 100644
--- a/services/document_storage_service/src/api/saved_views.rs
+++ b/services/document_storage_service/src/api/saved_views.rs
@@ -1,25 +1,23 @@
use axum::Json;
-use axum::extract::{FromRef, FromRequestParts, Path, State};
+use axum::extract::{Path, State};
use axum::http::StatusCode;
-use axum::http::request::Parts;
use axum::response::{IntoResponse, Response};
use axum::routing::{delete, patch, post};
use axum::{Router, routing::get};
-use macro_authorization::{MacroAuthorizationExtractor, MacroAuthorizationState, UserOrInternal};
+use macro_authorization::{MacroAuthorizationExtractor, UserOrInternal};
use model::response::ErrorResponse;
-use model::user::UserContext;
-use saved_views::{ExcludedDefaultViewStorage, PgViewStorage, ViewStorage};
+use saved_views::domain::Error as DomainError;
+use saved_views::{ExcludedDefaultViewStorage, PgViewStorage};
pub use saved_views::{ExcludedDefaultView, View, ViewPatch};
use serde::{Deserialize, Serialize};
-use sqlx::PgPool;
use thiserror::Error;
-use tokio::try_join;
use utoipa::ToSchema;
use uuid::Uuid;
use crate::api::ApiContext;
use crate::api::context::AuthorizationService;
+use crate::service::saved_views::service;
pub fn router() -> Router<ApiContext> {
Router::new()
@@ -32,19 +30,34 @@ pub fn router() -> Router<ApiContext> {
#[derive(Debug, Error)]
pub enum SavedViewErr {
+ #[error("saved view service failed")]
+ Domain(#[from] DomainError),
#[error("An unknown error has occurred")]
DbErr(#[from] sqlx::Error),
- #[error("You are not authorized to access this")]
- Unauthorized,
- #[error("saved view not found")]
- NotFound,
- #[error("bad request {0}")]
- BadRequest(&'static str),
}
impl IntoResponse for SavedViewErr {
fn into_response(self) -> Response {
match &self {
+ SavedViewErr::Domain(error) => {
+ let status = match error {
+ DomainError::NotFound => StatusCode::NOT_FOUND,
+ DomainError::NotOwner => StatusCode::UNAUTHORIZED,
+ DomainError::Conflict => StatusCode::CONFLICT,
+ DomainError::Invalid | DomainError::NotMember => StatusCode::BAD_REQUEST,
+ DomainError::Internal(err) => {
+ tracing::error!(error=?err);
+ StatusCode::INTERNAL_SERVER_ERROR
+ }
+ };
+ (
+ status,
+ Json(ErrorResponse {
+ message: error.to_string().into(),
+ }),
+ )
+ .into_response()
+ }
SavedViewErr::DbErr(error) => {
tracing::error!(error=?error);
(
@@ -55,27 +68,6 @@ impl IntoResponse for SavedViewErr {
)
.into_response()
}
- SavedViewErr::Unauthorized => (
- StatusCode::UNAUTHORIZED,
- Json(ErrorResponse {
- message: self.to_string().into(),
- }),
- )
- .into_response(),
- SavedViewErr::NotFound => (
- StatusCode::NOT_FOUND,
- Json(ErrorResponse {
- message: self.to_string().into(),
- }),
- )
- .into_response(),
- SavedViewErr::BadRequest(message) => (
- StatusCode::BAD_REQUEST,
- Json(ErrorResponse {
- message: (*message).into(),
- }),
- )
- .into_response(),
}
}
}
@@ -99,58 +91,6 @@ pub struct ExcludeDefaultViewRequest {
default_view_id: String,
}
-async fn authorize_view_access(
- storage: &impl ViewStorage<Err = sqlx::Error>,
- view_id: Uuid,
- user_id: &str,
-) -> Result<(), SavedViewErr> {
- let view = storage.get_view(view_id).await.map_err(|e| match e {
- sqlx::Error::RowNotFound => SavedViewErr::NotFound,
- e => SavedViewErr::DbErr(e),
- })?;
-
- if view.user_id != user_id {
- return Err(SavedViewErr::Unauthorized);
- }
- Ok(())
-}
-
-#[derive(Debug)]
-struct SavedViewOwner(pub UserContext);
-
-impl<S> FromRequestParts<S> for SavedViewOwner
-where
- S: Send + Sync + 'static,
- PgPool: FromRef<S>,
- MacroAuthorizationState<AuthorizationService>: FromRef<S>,
-{
- type Rejection = SavedViewErr;
-
- #[tracing::instrument(skip(parts, state), err)]
- async fn from_request_parts(parts: &mut Parts, state: &S) -> Result<Self, Self::Rejection> {
- let db = PgPool::from_ref(state);
-
- let user =
- MacroAuthorizationExtractor::<AuthorizationService, UserOrInternal>::from_request_parts(parts, state)
- .await
- .map_err(|_| SavedViewErr::Unauthorized)?;
-
- let saved_view_id = Path::<SavedViewParams>::from_request_parts(parts, state)
- .await
- .map_err(|_| SavedViewErr::BadRequest("Missing saved view id"))?
- .saved_view_id;
-
- authorize_view_access(
- &PgViewStorage::new(db),
- saved_view_id,
- user.authorization.user.macro_user_id.as_ref(),
- )
- .await?;
-
- Ok(SavedViewOwner(user.authorization.user.user_context.clone()))
- }
-}
-
#[utoipa::path(
tag = "saved_views",
get,
@@ -161,25 +101,19 @@ where
(status = 500, body=ErrorResponse),
)
)]
-#[tracing::instrument(skip(ctx, user), fields(user_id=?user.authorization.user.macro_user_id), err)]
+#[tracing::instrument(skip_all, err)]
async fn get_views_handler(
State(ctx): State<ApiContext>,
user: MacroAuthorizationExtractor<AuthorizationService, UserOrInternal>,
) -> Result<(StatusCode, Json<ViewsResponse>), SavedViewErr> {
let pg_view_storage = PgViewStorage::new(ctx.db.clone());
- let (views, excluded_default_views) = try_join!(
- async {
- pg_view_storage
- .get_views_for_user(user.authorization.user.macro_user_id.as_ref())
- .await
- },
- async {
- pg_view_storage
- .get_excluded_default_views_for_user(user.authorization.user.macro_user_id.as_ref())
- .await
- }
- )?;
+ let views = service(ctx.db.clone())
+ .legacy_list(user.authorization.user.macro_user_id.as_ref())
+ .await?;
+ let excluded_default_views = pg_view_storage
+ .get_excluded_default_views_for_user(user.authorization.user.macro_user_id.as_ref())
+ .await?;
Ok((
StatusCode::OK,
@@ -205,15 +139,13 @@ async fn create_view_handler(
user: MacroAuthorizationExtractor<AuthorizationService, UserOrInternal>,
Json(create_view_request): Json<CreateViewRequest>,
) -> Result<(StatusCode, Json<View>), SavedViewErr> {
- let pg_view_storage = PgViewStorage::new(ctx.db.clone());
-
- let new_view = View::new(
- user.authorization.user.macro_user_id.to_string(),
- create_view_request.name,
- create_view_request.config,
- );
-
- pg_view_storage.create_view(&new_view).await?;
+ let new_view = service(ctx.db.clone())
+ .legacy_create(
+ user.authorization.user.macro_user_id.as_ref(),
+ create_view_request.name,
+ create_view_request.config,
+ )
+ .await?;
Ok((StatusCode::CREATED, Json(new_view)))
}
@@ -236,15 +168,15 @@ struct SavedViewParams {
(status = 500, body=ErrorResponse),
)
)]
-#[tracing::instrument(skip(ctx), fields(user_id=?user_context.user_id), err)]
+#[tracing::instrument(skip_all, fields(view_id = %id), err)]
async fn delete_view_handler(
State(ctx): State<ApiContext>,
- SavedViewOwner(user_context): SavedViewOwner,
+ user: MacroAuthorizationExtractor<AuthorizationService, UserOrInternal>,
Path(SavedViewParams { saved_view_id: id }): Path<SavedViewParams>,
) -> Result<StatusCode, SavedViewErr> {
- let pg_view_storage = PgViewStorage::new(ctx.db.clone());
-
- pg_view_storage.delete_view(id).await?;
+ service(ctx.db.clone())
+ .legacy_delete(user.authorization.user.macro_user_id.as_ref(), id)
+ .await?;
Ok(StatusCode::OK)
}
@@ -262,16 +194,21 @@ async fn delete_view_handler(
(status = 500, body=ErrorResponse),
)
)]
-#[tracing::instrument(skip(ctx), fields(user_id=?user_context.user_id), err)]
+#[tracing::instrument(skip_all, fields(view_id = %id), err)]
async fn patch_view_handler(
State(ctx): State<ApiContext>,
- SavedViewOwner(user_context): SavedViewOwner,
+ user: MacroAuthorizationExtractor<AuthorizationService, UserOrInternal>,
Path(SavedViewParams { saved_view_id: id }): Path<SavedViewParams>,
Json(patch): Json<ViewPatch>,
) -> Result<StatusCode, SavedViewErr> {
- let pg_view_storage = PgViewStorage::new(ctx.db.clone());
-
- pg_view_storage.patch_view(id, patch).await?;
+ service(ctx.db.clone())
+ .legacy_patch(
+ user.authorization.user.macro_user_id.as_ref(),
+ id,
+ patch.name.as_deref(),
+ patch.config.as_ref(),
+ )
+ .await?;
Ok(StatusCode::OK)
}
@@ -286,7 +223,7 @@ async fn patch_view_handler(
(status = 500, body=ErrorResponse),
)
)]
-#[tracing::instrument(skip(ctx, user), fields(user_id=?user.authorization.user.macro_user_id), err)]
+#[tracing::instrument(skip_all, err)]
pub async fn exclude_default_view_handler(
State(ctx): State<ApiContext>,
user: MacroAuthorizationExtractor<AuthorizationService, UserOrInternal>,
diff --git a/services/document_storage_service/src/service/mod.rs b/services/document_storage_service/src/service/mod.rs
index e579cd9cb5..f34b718e0e 100644
--- a/services/document_storage_service/src/service/mod.rs
+++ b/services/document_storage_service/src/service/mod.rs
@@ -7,3 +7,5 @@ pub mod document_event_publisher;
pub mod entity_mutation;
pub mod s3;
pub mod soup_favorites_reader;
+
+pub mod saved_views;
diff --git a/services/document_storage_service/src/service/saved_views.rs b/services/document_storage_service/src/service/saved_views.rs
new file mode 100644
index 0000000000..7987183d04
--- /dev/null
+++ b/services/document_storage_service/src/service/saved_views.rs
@@ -0,0 +1,48 @@
+//! Composition of saved-view storage with the Teams-owned membership reader.
+use macro_user_id::user_id::MacroUserIdStr;
+use saved_views::{
+ PgViewStorage,
+ domain::{MembershipPort, SavedViewService},
+};
+use std::collections::HashSet;
+use teams::{
+ domain::{model::TeamError, team_repo::TeamRepository},
+ outbound::team_repo::TeamRepositoryImpl,
+};
+use uuid::Uuid;
+
+/// Teams-backed membership port for saved-view policy.
+pub struct Membership(pub TeamRepositoryImpl);
+impl MembershipPort for Membership {
+ type Err = TeamError;
+
+ async fn viewer_teams(&self, viewer: &str) -> Result<Vec<Uuid>, Self::Err> {
+ let viewer = MacroUserIdStr::parse_from_str(viewer)
+ .map_err(|error| TeamError::BadRequest(error.to_string()))?;
+ Ok(self
+ .0
+ .get_user_teams(&viewer)
+ .await?
+ .into_iter()
+ .map(|team| *team.id())
+ .collect())
+ }
+
+ async fn team_members(&self, team: Uuid) -> Result<HashSet<String>, Self::Err> {
+ Ok(self
+ .0
+ .get_all_team_members(&team)
+ .await?
+ .into_iter()
+ .map(|member| member.user_id.to_string())
+ .collect())
+ }
+}
+
+/// Construct the domain service with primary-backed storage and membership evidence.
+pub fn service(pool: sqlx::PgPool) -> SavedViewService<PgViewStorage, Membership> {
+ SavedViewService::new(
+ PgViewStorage::new(pool.clone()),
+ Membership(TeamRepositoryImpl::new(pool)),
+ )
+}
diff --git a/static_assets/schema.graphql b/static_assets/schema.graphql
index 2256894a0e..04e3b4f08f 100644
--- a/static_assets/schema.graphql
+++ b/static_assets/schema.graphql
@@ -424,6 +424,18 @@ type CompleteMutationRoot {
in the requested feed.
"""
undoWorkFeedItemsDone(input: UndoWorkFeedItemsDoneInput!): UndoWorkFeedItemsDonePayload!
+ """
+ Create once; replaying the same owned ID returns its existing record.
+ """
+ createSavedView(input: CreateSavedViewInput!): GraphqlSavedView!
+ """
+ Replace supplied fields only if the caller owns the expected revision.
+ """
+ updateSavedView(input: UpdateSavedViewInput!): GraphqlSavedView!
+ """
+ Delete the expected owned revision; repeating a completed deletion returns the ID.
+ """
+ deleteSavedView(input: DeleteSavedViewInput!): ID!
}
"""
@@ -563,6 +575,28 @@ input CreateInitiativeInput {
propertyValues: [InitialPropertyValueInput!]
}
+"""
+Inputs for creating a saved view with a stable client-generated identity.
+"""
+input CreateSavedViewInput {
+ """
+ Client-generated UUID reused when retrying the same creation.
+ """
+ id: ID!
+ """
+ Nonempty display name, limited to 120 characters.
+ """
+ name: String!
+ """
+ Consumer-owned JSON object, limited to 32 KiB.
+ """
+ config: JSON!
+ """
+ Current team to share with, or null for a private definition.
+ """
+ sharedTeamId: ID
+}
+
"""
Delete an event, one occurrence, or an occurrence onward.
"""
@@ -630,6 +664,20 @@ type DeleteEmailDraftPayload {
thread: GraphqlSoupEmailThread
}
+"""
+Inputs for a revision-guarded deletion.
+"""
+input DeleteSavedViewInput {
+ """
+ Identity of the definition to delete.
+ """
+ id: ID!
+ """
+ Revision that must still match when the deletion commits.
+ """
+ expectedRevision: Int!
+}
+
"""
One entity duplication in a batch.
"""
@@ -6505,6 +6553,58 @@ type GraphqlRepliedToDocumentCommentThreadMetadata {
senderDisplayName: String
}
+"""
+A saved filter definition, not a snapshot of matching entities.
+"""
+type GraphqlSavedView {
+ """
+ Stable identity of this saved definition.
+ """
+ id: ID!
+ """
+ User who owns and can edit this definition.
+ """
+ ownerId: ID!
+ """
+ Display name chosen by the owner.
+ """
+ name: String!
+ """
+ Versioned filter configuration interpreted by the consuming feature.
+ """
+ config: JSON!
+ """
+ Team with effective access, or null when the definition is private.
+ """
+ sharedTeamId: ID
+ """
+ Current revision required for conditional updates and deletion.
+ """
+ revision: Int!
+ """
+ Creation timestamp in RFC 3339 format.
+ """
+ createdAt: String!
+ """
+ Last update timestamp in RFC 3339 format.
+ """
+ updatedAt: String!
+}
+
+"""
+A page ordered by creation time and ID after effective visibility checks.
+"""
+type GraphqlSavedViewPage {
+ """
+ Definitions the authenticated viewer can currently access.
+ """
+ nodes: [GraphqlSavedView!]!
+ """
+ Opaque continuation cursor, or null when the listing is complete.
+ """
+ nextCursor: String
+}
+
"""
An AI routine the authenticated user can access.
"""
@@ -9255,6 +9355,14 @@ type GraphqlUpdatedNotification {
The authenticated user and their user-scoped data.
"""
type GraphqlUser {
+ """
+ Visible personal and effectively shared definitions, bounded after visibility checks.
+ """
+ savedViews(kind: String, first: Int, after: String): GraphqlSavedViewPage!
+ """
+ An authorized definition or null when not found or not visible.
+ """
+ savedView(id: ID!): GraphqlSavedView
"""
Stable id of the authenticated user.
"""
@@ -10010,6 +10118,16 @@ type SaveEmailDraftPayload {
thread: GraphqlSoupEmailThread!
}
+"""
+Explicit sharing action: an omitted input leaves sharing unchanged; null team ID makes it private.
+"""
+input SavedViewSharingInput {
+ """
+ Current team to share with; null explicitly removes sharing.
+ """
+ teamId: ID
+}
+
"""
Immutable content approved by the user.
"""
@@ -10513,6 +10631,32 @@ input UpdateNotificationsInput {
operation: NotificationUpdateOperation!
}
+"""
+Inputs for a revision-guarded replacement update.
+"""
+input UpdateSavedViewInput {
+ """
+ Identity of the definition to update.
+ """
+ id: ID!
+ """
+ Revision that must still match when the update commits.
+ """
+ expectedRevision: Int!
+ """
+ Replacement display name; omission preserves the current name.
+ """
+ name: String
+ """
+ Complete replacement configuration; omission preserves current filters.
+ """
+ config: JSON
+ """
+ Explicit sharing change; omission preserves the existing share.
+ """
+ sharing: SavedViewSharingInput
+}
+
"""
One item to mark done.
"""