From eda759798e68a38995e59fc467952eebd18e6c03 Mon Sep 17 00:00:00 2001 From: Nate Kelley Date: Mon, 29 Sep 2025 14:33:53 -0600 Subject: [PATCH] Update AppSegmented.tsx --- .../BusterChatInputButtons.tsx | 100 ++++++++++++++++-- .../components/ui/segmented/AppSegmented.tsx | 24 ++++- 2 files changed, 115 insertions(+), 9 deletions(-) diff --git a/apps/web/src/components/features/input/BusterChatInput/BusterChatInputButtons.tsx b/apps/web/src/components/features/input/BusterChatInput/BusterChatInputButtons.tsx index 1ff7a7dfd..ec7275134 100644 --- a/apps/web/src/components/features/input/BusterChatInput/BusterChatInputButtons.tsx +++ b/apps/web/src/components/features/input/BusterChatInput/BusterChatInputButtons.tsx @@ -1,7 +1,10 @@ import React from 'react'; import { Magnifier, Sparkle2 } from '@/components/ui/icons'; import Atom from '@/components/ui/icons/NucleoIconOutlined/atom'; +import { Popover } from '@/components/ui/popover'; import { AppSegmented, type AppSegmentedProps } from '@/components/ui/segmented'; +import { Text } from '@/components/ui/typography'; +import { cn } from '@/lib/utils'; export type BusterChatInputMode = 'auto' | 'research' | 'deep-research'; @@ -14,12 +17,6 @@ type BusterChatInputButtons = { onModeChange: (mode: BusterChatInputMode) => void; }; -const modesOptions: AppSegmentedProps['options'] = [ - { icon: , value: 'auto' }, - { icon: , value: 'research' }, - { icon: , value: 'deep-research' }, -]; - export const BusterChatInputButtons = ({ onSubmit, onStop, @@ -34,3 +31,94 @@ export const BusterChatInputButtons = ({ ); }; + +const ModePopoverContent = ({ + title, + description, + icon, + iconText, + content, + children, +}: { + title: string; + description: string; + icon: React.ReactNode; + iconText: string; + content: string; + children: React.ReactNode; +}) => { + const classes = 'px-3'; + return ( + +
+ {title} + {description} +
+
+
+
+ {icon} + + {iconText} + +
+ {content} +
+
+ } + > + {children} +
+ ); +}; + +const modesOptions: AppSegmentedProps['options'] = [ + { + icon: ( + } + iconText="Auto Mode" + content={`Dynamically pick between “Research” and “Deep Research”`} + > + + + ), + value: 'auto' as const, + }, + { + icon: ( + } + iconText="Research Mode" + content={`In-depth exploration for ad-hoc charts, dashboards, or reports`} + > + + + ), + value: 'research' as const, + }, + { + icon: ( + } + iconText="Deep Research Mode" + content={`Generate robust reports with extremely thorough analysis`} + > + + + ), + value: 'deep-research' as const, + }, +]; diff --git a/apps/web/src/components/ui/segmented/AppSegmented.tsx b/apps/web/src/components/ui/segmented/AppSegmented.tsx index 682c6aa3c..16f184122 100644 --- a/apps/web/src/components/ui/segmented/AppSegmented.tsx +++ b/apps/web/src/components/ui/segmented/AppSegmented.tsx @@ -11,7 +11,6 @@ import * as React from 'react'; import { useEffect, useLayoutEffect, useState, useTransition } from 'react'; import { useIsBlockerEnabled } from '@/context/Routes/blocker-store'; import { useDebounce } from '@/hooks/useDebounce'; -import { useMount } from '@/hooks/useMount'; import { useSize } from '@/hooks/useSize'; import { cn } from '@/lib/classMerge'; import type { ILinkProps } from '@/types/routes'; @@ -77,7 +76,7 @@ const triggerVariants = cva( { variants: { size: { - default: 'px-2 flex-row', + default: 'flex-row min-w-6', medium: 'px-3 flex-row', large: 'px-3 flex-col', }, @@ -302,6 +301,24 @@ function SegmentedTriggerComponent<
{linkContent}
); + // Determine padding based on size, icon, and label presence + const getPaddingClass = () => { + if (size === 'default') { + // If there's an icon but no label, use p-0 + if (icon && !label) { + return 'p-0'; + } + // If there's a label, use p-2 + if (label) { + return 'p-2'; + } + // Default fallback for edge cases + return 'p-2'; + } + // For other sizes, no additional padding (they have their own px-3) + return ''; + }; + return ( {linkDiv}