mirror of
https://github.com/simstudioai/sim.git
synced 2026-02-15 08:55:05 -05:00
Compare commits
1 Commits
cursor/cop
...
fix/model
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
43d02953a2 |
@@ -131,8 +131,10 @@ export const Copilot = forwardRef<CopilotRef, CopilotProps>(({ panelWidth }, ref
|
|||||||
resumeActiveStream,
|
resumeActiveStream,
|
||||||
})
|
})
|
||||||
|
|
||||||
// Handle scroll management
|
// Handle scroll management (80px stickiness for copilot)
|
||||||
const { scrollAreaRef, scrollToBottom } = useScrollManagement(messages, isSendingMessage)
|
const { scrollAreaRef, scrollToBottom } = useScrollManagement(messages, isSendingMessage, {
|
||||||
|
stickinessThreshold: 40,
|
||||||
|
})
|
||||||
|
|
||||||
// Handle chat history grouping
|
// Handle chat history grouping
|
||||||
const { groupedChats, handleHistoryDropdownOpen: handleHistoryDropdownOpenHook } = useChatHistory(
|
const { groupedChats, handleHistoryDropdownOpen: handleHistoryDropdownOpenHook } = useChatHistory(
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ interface UseScrollManagementOptions {
|
|||||||
/**
|
/**
|
||||||
* Distance from bottom (in pixels) within which auto-scroll stays active
|
* Distance from bottom (in pixels) within which auto-scroll stays active
|
||||||
* @remarks Lower values = less sticky (user can scroll away easier)
|
* @remarks Lower values = less sticky (user can scroll away easier)
|
||||||
* @defaultValue 30
|
* @defaultValue 100
|
||||||
*/
|
*/
|
||||||
stickinessThreshold?: number
|
stickinessThreshold?: number
|
||||||
}
|
}
|
||||||
@@ -41,7 +41,7 @@ export function useScrollManagement(
|
|||||||
const lastScrollTopRef = useRef(0)
|
const lastScrollTopRef = useRef(0)
|
||||||
|
|
||||||
const scrollBehavior = options?.behavior ?? 'smooth'
|
const scrollBehavior = options?.behavior ?? 'smooth'
|
||||||
const stickinessThreshold = options?.stickinessThreshold ?? 30
|
const stickinessThreshold = options?.stickinessThreshold ?? 100
|
||||||
|
|
||||||
/** Scrolls the container to the bottom */
|
/** Scrolls the container to the bottom */
|
||||||
const scrollToBottom = useCallback(() => {
|
const scrollToBottom = useCallback(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user