From 2c4b1be806f0c661b2cca2f547cd731424fd16ad Mon Sep 17 00:00:00 2001 From: hailin Date: Sun, 5 Apr 2026 03:03:32 -0700 Subject: [PATCH] fix: title auto-visible when text entered + add show/hide switch Typing title text now auto-sets visible=true so the title appears immediately. Also added a Switch to toggle title visibility. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../components/configPanel/TitleConfig.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/frontend/src/frameworks/components/configPanel/TitleConfig.tsx b/frontend/src/frameworks/components/configPanel/TitleConfig.tsx index 3cd2673..9702039 100644 --- a/frontend/src/frameworks/components/configPanel/TitleConfig.tsx +++ b/frontend/src/frameworks/components/configPanel/TitleConfig.tsx @@ -1,7 +1,7 @@ 'use client'; import React, { useCallback } from 'react'; -import { Input, InputNumber, Select, ColorPicker, Space, Typography } from 'antd'; +import { Input, InputNumber, Select, ColorPicker, Switch, Space, Typography } from 'antd'; import { useChartConfig } from '@/frameworks/hooks/useChartConfig'; import type { TitleStyle } from '@/domain/entities/StyleConfig'; @@ -23,11 +23,19 @@ export default function TitleConfig() { return ( +
+ 显示标题 + update({ visible: checked })} + /> +
标题文本 update({ text: e.target.value })} + onChange={(e) => update({ text: e.target.value, visible: true })} placeholder="请输入标题" size="small" style={{ marginTop: 4 }}