From d4377b1609f1668e2c03c091db83f160cd728654 Mon Sep 17 00:00:00 2001 From: Om Shah <109162009+Omm2005@users.noreply.github.com> Date: Thu, 30 Jul 2026 16:42:15 -0700 Subject: [PATCH] Add consent flow for Slack workspace reassignment (#1369) Co-authored-by: Vorflux AI <249966464+vorflux[bot]@users.noreply.github.com> Co-authored-by: Mahesh Sanikommu --- .../settings/company-brain-models.tsx | 58 ++++++++++++++----- apps/web/hooks/use-brain-models.ts | 2 +- 2 files changed, 45 insertions(+), 15 deletions(-) diff --git a/apps/web/components/settings/company-brain-models.tsx b/apps/web/components/settings/company-brain-models.tsx index 37815ef2..89615532 100644 --- a/apps/web/components/settings/company-brain-models.tsx +++ b/apps/web/components/settings/company-brain-models.tsx @@ -51,11 +51,22 @@ const MODEL_TAGS: Record = { } const EFFORT_LABELS: Record = { + auto: "Auto", low: "Low", medium: "Medium", high: "High", xhigh: "Extra high", } +const EFFORT_ORDER: BrainReasoningEffort[] = [ + "auto", + "low", + "medium", + "high", + "xhigh", +] + +const AUTO_EFFORT_HELP = + "Automatically adjusts thinking depth for each request." const ROWS: { role: BrainModelRole @@ -167,6 +178,11 @@ const CONFIG_KEYS = [ const extraHighIsBounded = (model: string): boolean => model.startsWith("grok-") || model.startsWith("gpt-") +const orderedEfforts = ( + options: BrainReasoningEffort[], +): BrainReasoningEffort[] => + [...options].sort((a, b) => EFFORT_ORDER.indexOf(a) - EFFORT_ORDER.indexOf(b)) + const controlClass = cn( dmSans125ClassName(), "h-9 w-full rounded-full border border-[#1E293B] bg-[#0D121A] px-3.5 text-[13px] text-[#FAFAFA] outline-none disabled:opacity-50", @@ -209,6 +225,13 @@ export default function CompanyBrainModels({ const [draft, setDraft] = useState>({}) const [advancedOpen, setAdvancedOpen] = useState(false) + const updateDraft = (patch: Partial) => { + // A saved custom config opens Advanced automatically. Keep it open if an + // edit happens to match a preset again, instead of collapsing mid-click. + setAdvancedOpen(true) + setDraft((currentDraft) => ({ ...currentDraft, ...patch })) + } + const resolved = modelsQuery.data?.resolved const defaults = modelsQuery.data?.defaults const choices = modelsQuery.data?.choices @@ -344,11 +367,21 @@ export default function CompanyBrainModels({ {advancedOpen || activePresetId === null ? ( -
+
{ROWS.map(({ role, effortKey, title, help, effortHelp }) => { const options = choices?.[role] ?? [] const current = valueFor(role) - const effortOptions = choices?.[effortKey] ?? [] + const availableEfforts = choices?.[effortKey] ?? [] + const effortOptions = orderedEfforts( + role === "main" + ? [ + ...new Set([ + "auto", + ...availableEfforts, + ]), + ] + : availableEfforts.filter((effort) => effort !== "auto"), + ) const currentEffort = effortFor(effortKey) const isDefault = defaults?.[role] === current && @@ -395,9 +428,7 @@ export default function CompanyBrainModels({