Compare commits
1 Commits
fix/inputb
...
dependabot
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
94a28f1055 |
2
.github/workflows/github-issue-tracker.yml
vendored
2
.github/workflows/github-issue-tracker.yml
vendored
@@ -42,7 +42,7 @@ jobs:
|
||||
|
||||
- name: Add pending label if in quiet hours
|
||||
if: steps.check_time.outputs.should_delay == 'true'
|
||||
uses: actions/github-script@v7
|
||||
uses: actions/github-script@v8
|
||||
with:
|
||||
script: |
|
||||
github.rest.issues.addLabels({
|
||||
|
||||
@@ -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 | undefined>(undefined)
|
||||
const [customHeight, setCustomHeight] = useState<number>()
|
||||
const [isExpanded, setIsExpanded] = useState(false)
|
||||
|
||||
const resize = useCallback(
|
||||
|
||||
@@ -177,10 +177,8 @@ const AgentSessionInputbarInner: FC<InnerProps> = ({ assistant, agentId, session
|
||||
resize: resizeTextArea,
|
||||
focus: focusTextarea,
|
||||
setExpanded,
|
||||
isExpanded: textareaIsExpanded,
|
||||
customHeight,
|
||||
setCustomHeight
|
||||
} = useTextareaResize({ maxHeight: 500, minHeight: 30 })
|
||||
isExpanded: textareaIsExpanded
|
||||
} = useTextareaResize({ maxHeight: 400, minHeight: 30 })
|
||||
const { sendMessageShortcut, apiServer } = useSettings()
|
||||
|
||||
const { t } = useTranslation()
|
||||
@@ -476,8 +474,6 @@ const AgentSessionInputbarInner: FC<InnerProps> = ({ assistant, agentId, session
|
||||
text={text}
|
||||
onTextChange={setText}
|
||||
textareaRef={textareaRef}
|
||||
height={customHeight}
|
||||
onHeightChange={setCustomHeight}
|
||||
resizeTextArea={resizeTextArea}
|
||||
focusTextarea={focusTextarea}
|
||||
placeholder={placeholderText}
|
||||
|
||||
@@ -143,11 +143,9 @@ const InputbarInner: FC<InputbarInnerProps> = ({ assistant: initialAssistant, se
|
||||
resize: resizeTextArea,
|
||||
focus: focusTextarea,
|
||||
setExpanded,
|
||||
isExpanded: textareaIsExpanded,
|
||||
customHeight,
|
||||
setCustomHeight
|
||||
isExpanded: textareaIsExpanded
|
||||
} = useTextareaResize({
|
||||
maxHeight: 500,
|
||||
maxHeight: 400,
|
||||
minHeight: 30
|
||||
})
|
||||
|
||||
@@ -259,7 +257,7 @@ const InputbarInner: FC<InputbarInnerProps> = ({ assistant: initialAssistant, se
|
||||
setText('')
|
||||
setFiles([])
|
||||
setTimeoutTimer('sendMessage_1', () => setText(''), 500)
|
||||
setTimeoutTimer('sendMessage_2', () => resizeTextArea(), 0)
|
||||
setTimeoutTimer('sendMessage_2', () => resizeTextArea(true), 0)
|
||||
} catch (error) {
|
||||
logger.warn('Failed to send message:', error as Error)
|
||||
parent?.recordException(error as Error)
|
||||
@@ -480,8 +478,6 @@ const InputbarInner: FC<InputbarInnerProps> = ({ assistant: initialAssistant, se
|
||||
text={text}
|
||||
onTextChange={setText}
|
||||
textareaRef={textareaRef}
|
||||
height={customHeight}
|
||||
onHeightChange={setCustomHeight}
|
||||
resizeTextArea={resizeTextArea}
|
||||
focusTextarea={focusTextarea}
|
||||
isLoading={loading}
|
||||
|
||||
@@ -50,9 +50,6 @@ export interface InputbarCoreProps {
|
||||
resizeTextArea: (force?: boolean) => void
|
||||
focusTextarea: () => void
|
||||
|
||||
height: number | undefined
|
||||
onHeightChange: (height: number) => void
|
||||
|
||||
supportedExts: string[]
|
||||
isLoading: boolean
|
||||
|
||||
@@ -107,8 +104,6 @@ export const InputbarCore: FC<InputbarCoreProps> = ({
|
||||
textareaRef,
|
||||
resizeTextArea,
|
||||
focusTextarea,
|
||||
height,
|
||||
onHeightChange,
|
||||
supportedExts,
|
||||
isLoading,
|
||||
onPause,
|
||||
@@ -136,6 +131,8 @@ 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()
|
||||
@@ -542,7 +539,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))
|
||||
onHeightChange(newHeight)
|
||||
setTextareaHeight(newHeight)
|
||||
}
|
||||
|
||||
const handleMouseUp = () => {
|
||||
@@ -553,7 +550,7 @@ export const InputbarCore: FC<InputbarCoreProps> = ({
|
||||
document.addEventListener('mousemove', handleMouseMove)
|
||||
document.addEventListener('mouseup', handleMouseUp)
|
||||
},
|
||||
[config.enableDragDrop, onHeightChange, textareaRef]
|
||||
[config.enableDragDrop, setTextareaHeight, textareaRef]
|
||||
)
|
||||
|
||||
const onQuote = useCallback(
|
||||
@@ -670,11 +667,11 @@ export const InputbarCore: FC<InputbarCoreProps> = ({
|
||||
variant="borderless"
|
||||
spellCheck={enableSpellCheck}
|
||||
rows={2}
|
||||
autoSize={height ? false : { minRows: 2, maxRows: 20 }}
|
||||
autoSize={textareaHeight ? false : { minRows: 2, maxRows: 20 }}
|
||||
styles={{ textarea: TextareaStyle }}
|
||||
style={{
|
||||
fontSize,
|
||||
height: height,
|
||||
height: textareaHeight,
|
||||
minHeight: '30px'
|
||||
}}
|
||||
disabled={isTranslating || searching}
|
||||
|
||||
Reference in New Issue
Block a user