Skip to content

Commit c7f6cbe

Browse files
romanlutzCopilot
andauthored
FEAT: Block GUI sends when target doesn't support the modality (microsoft#1692)
Co-authored-by: Roman Lutz <romanlutz@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 38359ce commit c7f6cbe

18 files changed

Lines changed: 639 additions & 141 deletions

frontend/e2e/converters.spec.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,16 @@ async function mockBackendAPIs(page: Page) {
137137
target_type: "OpenAIChatTarget",
138138
endpoint: "https://mock.openai.com",
139139
model_name: "gpt-4o-mock",
140-
supports_multi_turn: true,
140+
capabilities: {
141+
supports_multi_turn: true,
142+
supports_multi_message_pieces: false,
143+
supports_json_schema: false,
144+
supports_json_output: false,
145+
supports_editable_history: false,
146+
supports_system_prompt: false,
147+
supported_input_data_types: ["text"],
148+
supported_output_data_types: ["text"],
149+
},
141150
},
142151
],
143152
pagination: { limit: 50, has_more: false },

frontend/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/src/components/Chat/ChatInputArea.styles.ts

Lines changed: 43 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export const useChatInputAreaStyles = makeStyles({
6767
columnLeft: {
6868
display: 'flex',
6969
flexDirection: 'column',
70-
gap: tokens.spacingVerticalXXS,
70+
gap: tokens.spacingVerticalS,
7171
alignItems: 'center',
7272
marginRight: tokens.spacingHorizontalS,
7373
alignSelf: 'center',
@@ -77,24 +77,24 @@ export const useChatInputAreaStyles = makeStyles({
7777
flexDirection: 'column',
7878
flex: 1,
7979
minWidth: 0,
80-
gap: tokens.spacingVerticalXXS,
80+
gap: tokens.spacingVerticalXS,
8181
},
8282
columnRight: {
8383
display: 'flex',
8484
flexDirection: 'column',
85-
gap: tokens.spacingVerticalXXS,
85+
gap: tokens.spacingVerticalS,
8686
alignItems: 'center',
8787
marginLeft: tokens.spacingHorizontalS,
8888
alignSelf: 'center',
8989
},
9090
textRow: {
9191
display: 'flex',
92-
alignItems: 'center',
92+
alignItems: 'flex-start',
9393
gap: tokens.spacingHorizontalXXS,
9494
},
9595
convertedRow: {
9696
display: 'flex',
97-
alignItems: 'center',
97+
alignItems: 'flex-start',
9898
gap: tokens.spacingHorizontalXXS,
9999
},
100100
textInput: {
@@ -107,7 +107,7 @@ export const useChatInputAreaStyles = makeStyles({
107107
color: tokens.colorNeutralForeground1,
108108
resize: 'none',
109109
minHeight: '24px',
110-
maxHeight: '96px',
110+
maxHeight: '60vh',
111111
overflowY: 'auto',
112112
'::placeholder': {
113113
color: tokens.colorNeutralForeground4,
@@ -123,12 +123,16 @@ export const useChatInputAreaStyles = makeStyles({
123123
borderRadius: '4px',
124124
},
125125
},
126+
textInputShared: {
127+
maxHeight: '30vh',
128+
},
126129
iconButton: {
127130
minWidth: '32px',
128131
width: '32px',
129132
height: '32px',
130133
padding: 0,
131134
borderRadius: '50%',
135+
border: `1px solid ${tokens.colorNeutralStroke1}`,
132136
},
133137
dismissBtn: {
134138
minWidth: '24px',
@@ -143,6 +147,20 @@ export const useChatInputAreaStyles = makeStyles({
143147
padding: 0,
144148
borderRadius: '50%',
145149
},
150+
clearConversionButton: {
151+
minWidth: '32px',
152+
width: '32px',
153+
height: '32px',
154+
padding: 0,
155+
borderRadius: '50%',
156+
border: `1px solid ${tokens.colorNeutralStroke1}`,
157+
backgroundColor: tokens.colorNeutralBackground1,
158+
color: tokens.colorNeutralForeground2,
159+
':hover': {
160+
backgroundColor: tokens.colorNeutralBackground1Hover,
161+
color: tokens.colorNeutralForeground1,
162+
},
163+
},
146164
singleTurnWarning: {
147165
display: 'flex',
148166
alignItems: 'center',
@@ -204,11 +222,21 @@ export const useChatInputAreaStyles = makeStyles({
204222
color: tokens.colorNeutralForeground1,
205223
resize: 'none',
206224
minHeight: '20px',
207-
maxHeight: '80px',
225+
maxHeight: '30vh',
208226
overflowY: 'auto',
209227
whiteSpace: 'pre-wrap',
210228
wordBreak: 'break-word',
211229
padding: 0,
230+
'::-webkit-scrollbar': {
231+
width: '8px',
232+
},
233+
'::-webkit-scrollbar-track': {
234+
backgroundColor: 'transparent',
235+
},
236+
'::-webkit-scrollbar-thumb': {
237+
backgroundColor: tokens.colorNeutralStroke1,
238+
borderRadius: '4px',
239+
},
212240
},
213241
convertedMediaPreview: {
214242
maxHeight: '60px',
@@ -228,6 +256,13 @@ export const useChatInputAreaStyles = makeStyles({
228256
fontSize: tokens.fontSizeBase200,
229257
color: tokens.colorNeutralForeground2,
230258
},
259+
unsupportedWarning: {
260+
display: 'flex',
261+
alignItems: 'center',
262+
gap: tokens.spacingHorizontalXXS,
263+
color: tokens.colorPaletteYellowForeground2,
264+
fontSize: tokens.fontSizeBase200,
265+
},
231266
originalBadge: {
232267
display: 'inline-block',
233268
padding: `0 ${tokens.spacingHorizontalXS}`,
@@ -242,6 +277,7 @@ export const useChatInputAreaStyles = makeStyles({
242277
convertedBadge: {
243278
display: 'inline-block',
244279
padding: `0 ${tokens.spacingHorizontalXS}`,
280+
marginRight: tokens.spacingHorizontalXS,
245281
borderRadius: tokens.borderRadiusSmall,
246282
backgroundColor: tokens.colorPaletteGreenBackground2,
247283
color: tokens.colorPaletteGreenForeground2,

0 commit comments

Comments
 (0)