Skip to content

Commit 7b69cef

Browse files
committed
feat(condo): DOMA-13253 trash replace + change tooltip text
1 parent c1a935c commit 7b69cef

6 files changed

Lines changed: 42 additions & 25 deletions

File tree

apps/condo/domains/ai/components/AIChatFile/AIChatDocument.module.css

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,25 @@
1414
width: 24px;
1515
}
1616

17-
.fileName {
17+
.fileNameRow {
18+
display: flex;
1819
flex: 1;
20+
gap: 4px;
21+
align-items: center;
1922
min-width: 0;
2023
}
2124

22-
.fileNameText {
25+
.baseName {
26+
flex: 0 1 auto;
27+
min-width: 0;
2328
margin-bottom: 0 !important;
2429
color: var(--condo-global-color-black);
2530
}
2631

32+
.extension {
33+
flex-shrink: 0;
34+
}
35+
2736
.fileNameTextError {
2837
color: var(--condo-global-color-red-5);
2938
}

apps/condo/domains/ai/components/AIChatFile/AIChatDocument.tsx

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -52,34 +52,38 @@ export const AIChatDocument: React.FC<AIChatDocumentProps> = ({
5252
<Paperclip size='medium' />
5353
)}
5454
</div>
55-
<div className={styles.fileName}>
55+
<div className={styles.fileNameRow}>
5656
<Typography.Paragraph
5757
ellipsis={FILE_NAME_ELLIPSIS}
5858
size='medium'
59-
className={classNames(styles.fileNameText, {
59+
className={classNames(styles.baseName, {
6060
[styles.fileNameTextError]: isError,
6161
})}
6262
>
6363
{baseName}
64-
{ext ? (
65-
<Typography.Text type='secondary' size='medium'>
66-
.{ext}
67-
</Typography.Text>
68-
) : null}
6964
</Typography.Paragraph>
65+
{ext ? (
66+
<Typography.Text
67+
type='secondary'
68+
size='medium'
69+
className={styles.extension}
70+
>
71+
.{ext}
72+
</Typography.Text>
73+
) : null}
74+
{showRemove ? (
75+
<Button
76+
type='secondary'
77+
minimal
78+
compact
79+
size='medium'
80+
className={styles.removeButton}
81+
icon={<Trash size='small' />}
82+
onClick={onRemove}
83+
aria-label='Remove attachment'
84+
/>
85+
) : null}
7086
</div>
71-
{showRemove ? (
72-
<Button
73-
type='secondary'
74-
minimal
75-
compact
76-
size='medium'
77-
className={styles.removeButton}
78-
icon={<Trash size='small' />}
79-
onClick={onRemove}
80-
aria-label='Remove attachment'
81-
/>
82-
) : null}
8387
</div>
8488
)
8589
}

apps/condo/domains/ai/hooks/useAIChatAttachments.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,10 @@ export function useAIChatAttachments ({ disabled = false, onFileListChange }: Us
178178
const attachTooltip = useMemo(() => {
179179
return (
180180
<div>
181+
<div>{intl.formatMessage({ id: 'ai.chat.attachments.tooltip.addFilesTitle' })}</div>
181182
<div>
182183
{intl.formatMessage(
183-
{ id: 'ai.chat.attachments.tooltip.addFiles' },
184+
{ id: 'ai.chat.attachments.tooltip.limits' },
184185
{ max: maxAttachments, maxFileSizeMb },
185186
)}
186187
</div>

apps/condo/lang/en/en.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,8 @@
386386
"ai.chat.errorExecutingTools": "Error executing tools: {error}",
387387
"ai.chat.noResponse": "Response unavailable",
388388
"ai.chat.attachments.attach": "Attach file",
389-
"ai.chat.attachments.tooltip.addFiles": "Add files (max {max}, {maxFileSizeMb} MB each)",
389+
"ai.chat.attachments.tooltip.addFilesTitle": "Add files",
390+
"ai.chat.attachments.tooltip.limits": "Maximum {max} files, up to {maxFileSizeMb} MB each",
390391
"ai.chat.attachments.tooltip.textOnly": "Only text from files will be used",
391392
"ai.chat.attachments.maxFiles": "You can attach up to {max} files",
392393
"ai.chat.attachments.unsupportedType": "This file type is not supported",

apps/condo/lang/es/es.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,8 @@
390390
"ai.chat.attachments.attach": "Adjuntar archivo",
391391
"ai.chat.attachments.maxFiles": "Puedes adjuntar hasta {max} archivos",
392392
"ai.chat.attachments.unsupportedType": "Este tipo de archivo no es compatible",
393-
"ai.chat.attachments.tooltip.addFiles": "Añadir archivos (máx. {max}, {maxFileSizeMb} MB cada uno)",
393+
"ai.chat.attachments.tooltip.addFilesTitle": "Añadir archivos",
394+
"ai.chat.attachments.tooltip.limits": "Máximo {max} archivos, hasta {maxFileSizeMb} MB cada uno",
394395
"ai.chat.attachments.tooltip.textOnly": "De los archivos solo se tendrá en cuenta el texto",
395396
"ai.tools.error.invalidArgs": "Argumentos inválidos para {toolName}: {message}",
396397
"ai.tools.error.unknown": "Ocurrió un error desconocido",

apps/condo/lang/ru/ru.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,8 @@
388388
"ai.chat.errorExecutingTools": "Ошибка выполнения инструментов: {error}",
389389
"ai.chat.noResponse": "Ответ недоступен",
390390
"ai.chat.attachments.attach": "Прикрепить файл",
391-
"ai.chat.attachments.tooltip.addFiles": "Добавить файлы (макс. {max} шт., каждый {maxFileSizeMb} мб.)",
391+
"ai.chat.attachments.tooltip.addFilesTitle": "Добавить файлы",
392+
"ai.chat.attachments.tooltip.limits": "Максимум {max} шт., до {maxFileSizeMb} МБ каждый",
392393
"ai.chat.attachments.tooltip.textOnly": "Из файлов будет учтен только текст",
393394
"ai.chat.attachments.maxFiles": "Можно прикрепить не более {max} файлов",
394395
"ai.chat.attachments.unsupportedType": "Этот тип файла не поддерживается",

0 commit comments

Comments
 (0)