Revert "fix(ChatNavigation): improve navigation button collapse functionality"

This reverts commit fb5ddaf9d538bf698fd419282b70c1c6d8057d84.
This commit is contained in:
kangfenmao 2025-04-12 16:12:34 +08:00
parent 0bd24f652d
commit 315271ac35

View File

@ -255,15 +255,19 @@ const ChatNavigation: FC<ChatNavigationProps> = ({ containerId }) => {
if (now - lastMoveTime.current < 50) return
lastMoveTime.current = now
const triggerWidth = 10
let rightOffset = 5
// Calculate if the mouse is in the trigger area
const triggerWidth = 80 // Same as the width in styled component
// Safe way to calculate position when using calc expressions
let rightOffset = 16 // Default right offset
if (showRightTopics) {
rightOffset = 5 + 300
// When topics are shown on right, we need to account for topic list width
rightOffset = 16 + 300 // Assuming topic list width is 300px, adjust if different
}
const rightPosition = window.innerWidth - rightOffset - triggerWidth
const topPosition = window.innerHeight * 0.35
const height = window.innerHeight * 0.3
const topPosition = window.innerHeight * 0.3 // 30% from top
const height = window.innerHeight * 0.4 // 40% of window height
const isInTriggerArea =
e.clientX > rightPosition &&
@ -403,32 +407,31 @@ const ButtonGroup = styled.div`
display: flex;
flex-direction: column;
background: var(--bg-color);
border-radius: 12px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
border-radius: 8px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
overflow: hidden;
backdrop-filter: blur(12px);
backdrop-filter: blur(8px);
border: 1px solid var(--color-border);
`
const NavigationButton = styled(Button)`
width: 32px;
height: 32px;
width: 28px;
height: 28px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 0;
border: none;
color: var(--color-text);
transition: all 0.25s ease-in-out;
transition: all 0.2s ease-in-out;
&:hover {
background-color: var(--color-hover);
color: var(--color-primary);
transform: scale(1.05);
}
.anticon {
font-size: 16px;
font-size: 14px;
}
`