diff --git a/src/web-ui/src/component-library/components/NumberInput/NumberInput.tsx b/src/web-ui/src/component-library/components/NumberInput/NumberInput.tsx index 002b3ae9..37a8eb84 100644 --- a/src/web-ui/src/component-library/components/NumberInput/NumberInput.tsx +++ b/src/web-ui/src/component-library/components/NumberInput/NumberInput.tsx @@ -23,6 +23,7 @@ export interface NumberInputProps { className?: string; label?: string; draggable?: boolean; + disableWheel?: boolean; } export const NumberInput = forwardRef( @@ -42,6 +43,7 @@ export const NumberInput = forwardRef( className = '', label, draggable = false, + disableWheel = false, }, ref ) => { @@ -162,7 +164,7 @@ export const NumberInput = forwardRef( const handleWheel = useCallback( (e: React.WheelEvent) => { - if (disabled || !isHovered) return; + if (disabled || disableWheel || !isHovered) return; e.preventDefault(); if (e.deltaY < 0) { increment(); @@ -170,7 +172,7 @@ export const NumberInput = forwardRef( decrement(); } }, - [disabled, isHovered, increment, decrement] + [disabled, disableWheel, isHovered, increment, decrement] ); const containerClassName = [ diff --git a/src/web-ui/src/flow_chat/components/ModelSelector.tsx b/src/web-ui/src/flow_chat/components/ModelSelector.tsx index 55bad67a..b0c6beb6 100644 --- a/src/web-ui/src/flow_chat/components/ModelSelector.tsx +++ b/src/web-ui/src/flow_chat/components/ModelSelector.tsx @@ -52,7 +52,7 @@ const formatContextWindow = (contextWindow?: number): string | null => { return `${Math.round(contextWindow / 1000)}k`; }; -const buildModelMetaText = (model: Pick): string => { +const buildModelMetaText = (model: Pick): string => { const parts = [model.providerName]; const contextWindow = formatContextWindow(model.contextWindow); @@ -60,11 +60,42 @@ const buildModelMetaText = (model: Pick | null | undefined, + fallback: string +): string => { + if (!model) return fallback; + + const parts = []; + if (modelName) { + parts.push(modelName); } - return parts.join(' · '); + const metaText = buildModelMetaText(model); + if (metaText) { + parts.push(metaText); + } + + return parts.join(' · ') || fallback; +}; + +const getModelDisplayLabel = (model: ModelInfo | null, fallback: string): string => { + if (!model) return fallback; + if (isSpecialModel(model.id)) return model.configName; + return model.modelName || model.configName || fallback; +}; + +const getModelTooltipText = (model: ModelInfo | null, fallback: string): string => { + if (!model) return fallback; + if (model.id === 'auto') return model.providerName; + if (isSpecialModel(model.id)) { + return buildResolvedModelTooltipText(model.modelName, model, fallback); + } + return buildModelMetaText(model); }; export const ModelSelector: React.FC = ({ @@ -248,7 +279,7 @@ export const ModelSelector: React.FC = ({ ref={dropdownRef} className={`bitfun-model-selector ${className}`} > - +