Skip to content

Commit a4b95fa

Browse files
committed
Prevent flex overflow in prompt field footer by adding text truncation and min-width constraints
- current 'edit format' should get truncated if there is not enough space
1 parent af0fef9 commit a4b95fa

2 files changed

Lines changed: 11 additions & 5 deletions

File tree

‎packages/ui/src/components/editor/panel/prompts/PromptField/PromptField.module.scss‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,13 +160,11 @@
160160
gap: 5px;
161161
justify-content: space-between;
162162
position: relative;
163-
164-
> div {
165-
flex-shrink: 0;
166-
}
163+
min-width: 0;
167164

168165
&__left {
169166
display: flex;
167+
flex-shrink: 0;
170168

171169
&__button {
172170
--size: 20px;
@@ -197,12 +195,14 @@
197195
justify-content: flex-end;
198196
gap: 5px;
199197
pointer-events: none;
198+
min-width: 0;
200199

201200
&__edit-format {
202201
flex: 1;
203202
display: flex;
204203
align-items: center;
205204
justify-content: flex-end;
205+
min-width: 0;
206206

207207
&__button {
208208
font-size: 11px;
@@ -212,6 +212,8 @@
212212
opacity: var(--dimmed-opacity);
213213
white-space: nowrap;
214214
text-decoration: dotted;
215+
overflow: hidden;
216+
text-overflow: ellipsis;
215217

216218
&:hover {
217219
opacity: 1;
@@ -224,6 +226,7 @@
224226
pointer-events: all;
225227
display: flex;
226228
align-items: center;
229+
flex-shrink: 0;
227230

228231
&__button {
229232
font-size: 11px !important;
@@ -238,6 +241,7 @@
238241
pointer-events: all;
239242
position: relative;
240243
border-radius: 5px;
244+
flex-shrink: 0;
241245

242246
&:hover {
243247
background-color: var(--vscode-toolbar-hoverBackground);

‎packages/ui/src/components/editor/panel/prompts/PromptField/PromptField.tsx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,9 @@ export const PromptField: React.FC<PromptFieldProps> = (props) => {
602602
}}
603603
>
604604
{props.edit_format && (
605-
<div style={{ position: 'relative', display: 'flex' }}>
605+
<div
606+
style={{ position: 'relative', display: 'flex', minWidth: 0 }}
607+
>
606608
{is_edit_format_hovered && (
607609
<Tooltip
608610
message={props.translations.edit_format}

0 commit comments

Comments
 (0)