From 18780f1d09db6bd6c8141020783de5f1cacd0021 Mon Sep 17 00:00:00 2001 From: Vorflux AI <249966464+vorflux[bot]@users.noreply.github.com> Date: Tue, 21 Jul 2026 14:29:15 +0000 Subject: [PATCH] fix(web): address workspace settings review --- apps/web/components/settings/account.tsx | 14 +++++++++++--- apps/web/hooks/use-org-settings.ts | 9 +++++---- packages/lib/api.ts | 2 +- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/apps/web/components/settings/account.tsx b/apps/web/components/settings/account.tsx index 57d356fc..6db42156 100644 --- a/apps/web/components/settings/account.tsx +++ b/apps/web/components/settings/account.tsx @@ -617,9 +617,17 @@ export default function Account() { - {canManageTeam && } - - {canManageTeam && isCompanyBrain && } + {canManageTeam && ( +
+ + {isCompanyBrain && ( + <> + + )} diff --git a/apps/web/hooks/use-org-settings.ts b/apps/web/hooks/use-org-settings.ts index 374090fe..4ee1e4b6 100644 --- a/apps/web/hooks/use-org-settings.ts +++ b/apps/web/hooks/use-org-settings.ts @@ -54,14 +54,15 @@ export function useUpdateOrgSettings() { body: settings, }) if (response.error) { - throw new Error("Failed to save settings", { - cause: response.error.message, + throw new Error(response.error.message || "Failed to save settings", { + cause: response.error, }) } return response.data }, - onSuccess: async (data) => { - const queryKey = ["settings", "org", orgId] as const + onMutate: () => ({ orgId }), + onSuccess: async (data, _settings, mutationContext) => { + const queryKey = ["settings", "org", mutationContext.orgId] as const const canonicalSettings = data?.settings if (canonicalSettings) { queryClient.setQueryData(queryKey, (current) => diff --git a/packages/lib/api.ts b/packages/lib/api.ts index 4dc73327..63d727f0 100644 --- a/packages/lib/api.ts +++ b/packages/lib/api.ts @@ -34,7 +34,7 @@ const SettingsResponseSchema = z.object({ message: z.string(), settings: z.object({ excludeItems: z.array(z.string().min(1).max(20)).nullable().optional(), - filterPrompt: z.string().min(1).max(750).nullable().optional(), + filterPrompt: z.string().max(750).nullable().optional(), includeItems: z.array(z.string().min(1).max(20)).nullable().optional(), shouldLLMFilter: z.boolean().optional(), workspacePersona: z.string().max(1500).nullable().optional(),