## Summary - Closes [#106](#106). - Removes the FAST / THINKING `<select>` from the chat input bar. - Continues to send a fixed `modelName` of `FAST` on WebSocket sends so the backend contract is unchanged. ## Test plan - [ ] Open chat dashboard — composer shows attach + text field + send only (no FAST/THINKING dropdown). - [ ] Send a message — stream still works. - [ ] Send with attachment — still works.Reviewed-on: #107
This commit was merged in pull request #107.
This commit is contained in:
@@ -252,32 +252,6 @@ const IconButton = styled.button`
|
|||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const StyledSelect = styled.select`
|
|
||||||
background: transparent;
|
|
||||||
border: none;
|
|
||||||
flex-shrink: 0;
|
|
||||||
max-width: 7rem;
|
|
||||||
color: ${({ theme }) => theme.colors.text};
|
|
||||||
font-size: 0.9rem;
|
|
||||||
padding: 0.5rem;
|
|
||||||
outline: none;
|
|
||||||
cursor: pointer;
|
|
||||||
margin-right: 0.5rem;
|
|
||||||
border-right: 1px solid ${({ theme }) => theme.colors.cardBorder};
|
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
|
||||||
max-width: 5.5rem;
|
|
||||||
font-size: 0.8rem;
|
|
||||||
padding: 0.4rem 0.2rem;
|
|
||||||
margin-right: 0.25rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
option {
|
|
||||||
background: ${({ theme }) => theme.colors.background || '#1a1a1a'};
|
|
||||||
color: ${({ theme }) => theme.colors.text};
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
|
|
||||||
const ConversationItem = styled.div<{ $active: boolean }>`
|
const ConversationItem = styled.div<{ $active: boolean }>`
|
||||||
padding: 0.8rem 1rem;
|
padding: 0.8rem 1rem;
|
||||||
margin-bottom: 0.5rem;
|
margin-bottom: 0.5rem;
|
||||||
@@ -343,11 +317,13 @@ const validationSchema = Yup.object().shape({
|
|||||||
.required("This is required"),
|
.required("This is required"),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/** Fixed until product re-exposes a model picker (#106). */
|
||||||
|
const DEFAULT_MODEL_NAME = "FAST";
|
||||||
|
|
||||||
type PromptValues = {
|
type PromptValues = {
|
||||||
prompt: string;
|
prompt: string;
|
||||||
file: Blob | null;
|
file: Blob | null;
|
||||||
fileType: string | null;
|
fileType: string | null;
|
||||||
modelName: string;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const AlwaysScrollToBottom = ({ trigger }: { trigger: string | number }): JSX.Element => {
|
const AlwaysScrollToBottom = ({ trigger }: { trigger: string | number }): JSX.Element => {
|
||||||
@@ -447,7 +423,7 @@ const AsyncDashboardInner = (): JSX.Element => {
|
|||||||
})();
|
})();
|
||||||
|
|
||||||
const handlePromptSubmit = async (
|
const handlePromptSubmit = async (
|
||||||
{ prompt, file, fileType, modelName }: PromptValues,
|
{ prompt, file, fileType }: PromptValues,
|
||||||
{ resetForm }: any,
|
{ resetForm }: any,
|
||||||
): Promise<void> => {
|
): Promise<void> => {
|
||||||
const trimmedPrompt = (prompt ?? "").trim();
|
const trimmedPrompt = (prompt ?? "").trim();
|
||||||
@@ -464,7 +440,7 @@ const AsyncDashboardInner = (): JSX.Element => {
|
|||||||
|
|
||||||
conversationRef.current = tempConversations;
|
conversationRef.current = tempConversations;
|
||||||
setConversationDetails(tempConversations);
|
setConversationDetails(tempConversations);
|
||||||
sendMessage(trimmedPrompt, selectedConversation, file, fileType, modelName);
|
sendMessage(trimmedPrompt, selectedConversation, file, fileType, DEFAULT_MODEL_NAME);
|
||||||
trackEvent(AnalyticsEvents.MESSAGE_SENT, {
|
trackEvent(AnalyticsEvents.MESSAGE_SENT, {
|
||||||
hasConversation: Boolean(selectedConversation),
|
hasConversation: Boolean(selectedConversation),
|
||||||
hasAttachment: Boolean(file),
|
hasAttachment: Boolean(file),
|
||||||
@@ -474,7 +450,6 @@ const AsyncDashboardInner = (): JSX.Element => {
|
|||||||
prompt: "",
|
prompt: "",
|
||||||
file: null,
|
file: null,
|
||||||
fileType: null,
|
fileType: null,
|
||||||
modelName: modelName, // Keep the selected model
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -640,7 +615,6 @@ const AsyncDashboardInner = (): JSX.Element => {
|
|||||||
prompt: "",
|
prompt: "",
|
||||||
file: null,
|
file: null,
|
||||||
fileType: null,
|
fileType: null,
|
||||||
modelName: "FAST",
|
|
||||||
}}
|
}}
|
||||||
validationSchema={validationSchema}
|
validationSchema={validationSchema}
|
||||||
onSubmit={handlePromptSubmit}
|
onSubmit={handlePromptSubmit}
|
||||||
@@ -691,14 +665,6 @@ const AsyncDashboardInner = (): JSX.Element => {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Field
|
|
||||||
as={StyledSelect}
|
|
||||||
name="modelName"
|
|
||||||
>
|
|
||||||
<option value="FAST">FAST</option>
|
|
||||||
<option value="THINKING">THINKING</option>
|
|
||||||
</Field>
|
|
||||||
|
|
||||||
<Field name="prompt">
|
<Field name="prompt">
|
||||||
{({ field }: any) => (
|
{({ field }: any) => (
|
||||||
<StyledInput
|
<StyledInput
|
||||||
|
|||||||
Reference in New Issue
Block a user