Просмотр исходного кода

feat: Enhance group label display in Playground component

- Updated the group selection input to truncate long labels on mobile devices, ensuring better readability and a cleaner interface.
- Implemented a conditional label adjustment that shortens group names exceeding 18 characters, appending '...' for clarity.
CalciumIon 1 год назад
Родитель
Сommit
44512d3c28
1 измененных файлов с 6 добавлено и 1 удалено
  1. 6 1
      web/src/pages/Playground/Playground.js

+ 6 - 1
web/src/pages/Playground/Playground.js

@@ -326,7 +326,12 @@ const Playground = () => {
               }}
               value={inputs.group}
               autoComplete='new-password'
-              optionList={groups}
+              optionList={groups.map((group) => ({
+                ...group,
+                label: styleState.isMobile && group.label.length > 18
+                  ? group.label.substring(0, 18) + '...'
+                  : group.label,
+              }))}
             />
             <div style={{ marginTop: 10 }}>
               <Typography.Text strong>模型:</Typography.Text>