fix: adjust visibility timer and trigger area dimensions in ChatNavigation

* Reduced the button visibility timer from 1500ms to 500ms for quicker feedback.
* Decreased the trigger width from 80 to 60 for improved interaction.
* Updated the height calculation from 40% to 30% of the window height for better layout consistency.
This commit is contained in:
kangfenmao 2025-05-16 14:46:22 +08:00
parent d0a368d9ef
commit 727a84e5ca

View File

@ -73,7 +73,7 @@ const ChatNavigation: FC<ChatNavigationProps> = ({ containerId }) => {
// Set a timer to hide the buttons // Set a timer to hide the buttons
const timer = setTimeout(() => { const timer = setTimeout(() => {
setIsVisible(false) setIsVisible(false)
}, 1500) }, 500)
setHideTimer(timer) setHideTimer(timer)
}, []) }, [])
@ -256,7 +256,7 @@ const ChatNavigation: FC<ChatNavigationProps> = ({ containerId }) => {
lastMoveTime.current = now lastMoveTime.current = now
// Calculate if the mouse is in the trigger area // Calculate if the mouse is in the trigger area
const triggerWidth = 80 // Same as the width in styled component const triggerWidth = 60 // Same as the width in styled component
// Safe way to calculate position when using calc expressions // Safe way to calculate position when using calc expressions
let rightOffset = 16 // Default right offset let rightOffset = 16 // Default right offset
@ -267,7 +267,7 @@ const ChatNavigation: FC<ChatNavigationProps> = ({ containerId }) => {
const rightPosition = window.innerWidth - rightOffset - triggerWidth const rightPosition = window.innerWidth - rightOffset - triggerWidth
const topPosition = window.innerHeight * 0.3 // 30% from top const topPosition = window.innerHeight * 0.3 // 30% from top
const height = window.innerHeight * 0.4 // 40% of window height const height = window.innerHeight * 0.3 // 30% of window height
const isInTriggerArea = const isInTriggerArea =
e.clientX > rightPosition && e.clientX > rightPosition &&