feat: Improve mobile text truncation and sidebar visibility

This commit is contained in:
CalciumIon
2025-02-19 23:25:42 +08:00
parent 971aea09ee
commit 4ce12ea6e3
3 changed files with 78 additions and 10 deletions

View File

@@ -7,7 +7,7 @@ import { SSE } from 'sse';
import { IconSetting } from '@douyinfe/semi-icons';
import { StyleContext } from '../../context/Style/index.js';
import { useTranslation } from 'react-i18next';
import { renderGroupOption } from '../../helpers/render.js';
import { renderGroupOption, truncateText } from '../../helpers/render.js';
const roleInfo = {
user: {
@@ -99,9 +99,10 @@ const Playground = () => {
const { success, message, data } = res.data;
if (success) {
let localGroupOptions = Object.entries(data).map(([group, info]) => ({
label: info.desc,
label: truncateText(info.desc, "50%"),
value: group,
ratio: info.ratio
ratio: info.ratio,
fullLabel: info.desc // 保存完整文本用于tooltip
}));
if (localGroupOptions.length === 0) {