Compare commits

...

2 Commits

Author SHA1 Message Date
suyao
776fb27a58 fix: update Inputbar components to support dynamic textarea height adjustment 2025-12-01 01:27:46 +08:00
kangfenmao
b3a58ec321 chore: update release notes for v1.7.1 2025-11-30 19:57:44 +08:00
6 changed files with 28 additions and 17 deletions

View File

@@ -134,9 +134,9 @@ artifactBuildCompleted: scripts/artifact-build-completed.js
releaseInfo:
releaseNotes: |
<!--LANG:en-->
A New Era of Intelligence with Cherry Studio 1.7.0
A New Era of Intelligence with Cherry Studio 1.7.1
Today we're releasing Cherry Studio 1.7.0 — our most ambitious update yet, introducing Agent: autonomous AI that thinks, plans, and acts.
Today we're releasing Cherry Studio 1.7.1 — our most ambitious update yet, introducing Agent: autonomous AI that thinks, plans, and acts.
For years, AI assistants have been reactive — waiting for your commands, responding to your questions. With Agent, we're changing that. Now, AI can truly work alongside you: understanding complex goals, breaking them into steps, and executing them independently.
@@ -187,9 +187,9 @@ releaseInfo:
The Agent Era is here. We can't wait to see what you'll create.
<!--LANG:zh-CN-->
Cherry Studio 1.7.0:开启智能新纪元
Cherry Studio 1.7.1:开启智能新纪元
今天,我们正式发布 Cherry Studio 1.7.0 —— 迄今最具雄心的版本,带来全新的 Agent能够自主思考、规划和行动的 AI。
今天,我们正式发布 Cherry Studio 1.7.1 —— 迄今最具雄心的版本,带来全新的 Agent能够自主思考、规划和行动的 AI。
多年来AI 助手一直是被动的——等待你的指令回应你的问题。Agent 改变了这一切。现在AI 能够真正与你并肩工作:理解复杂目标,将其拆解为步骤,并独立执行。

View File

@@ -1,6 +1,6 @@
{
"name": "CherryStudio",
"version": "1.7.0",
"version": "1.7.1",
"private": true,
"description": "A powerful AI assistant for producer.",
"main": "./out/main/index.js",

View File

@@ -51,7 +51,7 @@ export function useTextareaResize(options: UseTextareaResizeOptions = {}): UseTe
const { maxHeight = 400, minHeight = 30, autoResize = true } = options
const textareaRef = useRef<TextAreaRef>(null)
const [customHeight, setCustomHeight] = useState<number>()
const [customHeight, setCustomHeight] = useState<number | undefined>(undefined)
const [isExpanded, setIsExpanded] = useState(false)
const resize = useCallback(

View File

@@ -177,8 +177,10 @@ const AgentSessionInputbarInner: FC<InnerProps> = ({ assistant, agentId, session
resize: resizeTextArea,
focus: focusTextarea,
setExpanded,
isExpanded: textareaIsExpanded
} = useTextareaResize({ maxHeight: 400, minHeight: 30 })
isExpanded: textareaIsExpanded,
customHeight,
setCustomHeight
} = useTextareaResize({ maxHeight: 500, minHeight: 30 })
const { sendMessageShortcut, apiServer } = useSettings()
const { t } = useTranslation()
@@ -474,6 +476,8 @@ const AgentSessionInputbarInner: FC<InnerProps> = ({ assistant, agentId, session
text={text}
onTextChange={setText}
textareaRef={textareaRef}
height={customHeight}
onHeightChange={setCustomHeight}
resizeTextArea={resizeTextArea}
focusTextarea={focusTextarea}
placeholder={placeholderText}

View File

@@ -143,9 +143,11 @@ const InputbarInner: FC<InputbarInnerProps> = ({ assistant: initialAssistant, se
resize: resizeTextArea,
focus: focusTextarea,
setExpanded,
isExpanded: textareaIsExpanded
isExpanded: textareaIsExpanded,
customHeight,
setCustomHeight
} = useTextareaResize({
maxHeight: 400,
maxHeight: 500,
minHeight: 30
})
@@ -257,7 +259,7 @@ const InputbarInner: FC<InputbarInnerProps> = ({ assistant: initialAssistant, se
setText('')
setFiles([])
setTimeoutTimer('sendMessage_1', () => setText(''), 500)
setTimeoutTimer('sendMessage_2', () => resizeTextArea(true), 0)
setTimeoutTimer('sendMessage_2', () => resizeTextArea(), 0)
} catch (error) {
logger.warn('Failed to send message:', error as Error)
parent?.recordException(error as Error)
@@ -478,6 +480,8 @@ const InputbarInner: FC<InputbarInnerProps> = ({ assistant: initialAssistant, se
text={text}
onTextChange={setText}
textareaRef={textareaRef}
height={customHeight}
onHeightChange={setCustomHeight}
resizeTextArea={resizeTextArea}
focusTextarea={focusTextarea}
isLoading={loading}

View File

@@ -50,6 +50,9 @@ export interface InputbarCoreProps {
resizeTextArea: (force?: boolean) => void
focusTextarea: () => void
height: number | undefined
onHeightChange: (height: number) => void
supportedExts: string[]
isLoading: boolean
@@ -104,6 +107,8 @@ export const InputbarCore: FC<InputbarCoreProps> = ({
textareaRef,
resizeTextArea,
focusTextarea,
height,
onHeightChange,
supportedExts,
isLoading,
onPause,
@@ -131,8 +136,6 @@ export const InputbarCore: FC<InputbarCoreProps> = ({
} = useSettings()
const quickPanelTriggersEnabled = forceEnableQuickPanelTriggers ?? enableQuickPanelTriggers
const [textareaHeight, setTextareaHeight] = useState<number>()
const { t } = useTranslation()
const [isTranslating, setIsTranslating] = useState(false)
const { getLanguageByLangcode } = useTranslate()
@@ -539,7 +542,7 @@ export const InputbarCore: FC<InputbarCoreProps> = ({
const handleMouseMove = (e: MouseEvent) => {
const deltaY = startDragY.current - e.clientY
const newHeight = Math.max(40, Math.min(400, startHeight.current + deltaY))
setTextareaHeight(newHeight)
onHeightChange(newHeight)
}
const handleMouseUp = () => {
@@ -550,7 +553,7 @@ export const InputbarCore: FC<InputbarCoreProps> = ({
document.addEventListener('mousemove', handleMouseMove)
document.addEventListener('mouseup', handleMouseUp)
},
[config.enableDragDrop, setTextareaHeight, textareaRef]
[config.enableDragDrop, onHeightChange, textareaRef]
)
const onQuote = useCallback(
@@ -667,11 +670,11 @@ export const InputbarCore: FC<InputbarCoreProps> = ({
variant="borderless"
spellCheck={enableSpellCheck}
rows={2}
autoSize={textareaHeight ? false : { minRows: 2, maxRows: 20 }}
autoSize={height ? false : { minRows: 2, maxRows: 20 }}
styles={{ textarea: TextareaStyle }}
style={{
fontSize,
height: textareaHeight,
height: height,
minHeight: '30px'
}}
disabled={isTranslating || searching}