From 5aaba7260c14a05af1ff779d3f31fb36960d9336 Mon Sep 17 00:00:00 2001 From: "pouriade.com" Date: Tue, 27 Oct 2026 22:37:37 -0700 Subject: [PATCH] Say why the composer can't send from one record ModelNotice draws one paragraph, in the shared Text, with its words taken from a notices record keyed by the reason. --- .../conversation/components/Composer.tsx | 44 ++++++++++--------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/apps/web/src/features/conversation/components/Composer.tsx b/apps/web/src/features/conversation/components/Composer.tsx index bb1c134..bc0f535 100644 --- a/apps/web/src/features/conversation/components/Composer.tsx +++ b/apps/web/src/features/conversation/components/Composer.tsx @@ -14,6 +14,7 @@ import { PencilIcon } from '../../../shared/icons.tsx' import { touchOnly } from '../../../shared/touch.ts' import { ErrorAlert } from '../../../shared/ui/Alert.tsx' import { Button } from '../../../shared/ui/Button.tsx' +import { Text } from '../../../shared/ui/Text.tsx' import { EffortSelect } from '../../models/components/EffortSelect.tsx' import { ModelSelect } from '../../models/components/ModelSelect.tsx' import { rememberEffort } from '../../models/last-effort.ts' @@ -384,27 +385,28 @@ interface ModelNoticeProps { blocked: Blocked | null } +/** What the composer says for each reason it can't send. */ +const notices: Record = { + noModels: ( + <> + No models are available to you. Add a key of your own in{' '} + API keys. + + ), + needsModel: ( + <> + Choose a model, or set a default model in Preferences. + + ), + images: <>This model can't read images. Remove the image, or choose a model that can., +} + /** Why the composer can't send yet, for want of a model that can take the message. */ function ModelNotice(props: ModelNoticeProps) { - const className = 'mx-2 mt-2.5 text-muted text-small' - if (props.blocked === 'noModels') - return ( -

- No models are available to you. Add a key of your own in{' '} - API keys. -

- ) - if (props.blocked === 'needsModel') - return ( -

- Choose a model, or set a default model in Preferences. -

- ) - if (props.blocked === 'images') - return ( -

- This model can't read images. Remove the image, or choose a model that can. -

- ) - return null + if (!props.blocked) return null + return ( + + {notices[props.blocked]} + + ) } -- knotmirror 0.0.1