Parcourir la source

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 il y a 1 an
Parent
commit
44512d3c28
1 fichiers modifiés avec 6 ajouts et 1 suppressions
  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>