refactor(app): remove debug logging from voice and UI components
This commit is contained in:
@@ -32,14 +32,6 @@ import {
|
||||
import { useKeyboardShortcutsStore } from '@/stores/keyboard-shortcuts-store'
|
||||
|
||||
const DESKTOP_SIDEBAR_WIDTH = 320
|
||||
const IS_DEV = Boolean((globalThis as { __DEV__?: boolean }).__DEV__)
|
||||
|
||||
function logLeftSidebarCloseGesture(event: string, details: Record<string, unknown>): void {
|
||||
if (!IS_DEV) {
|
||||
return
|
||||
}
|
||||
console.log(`[LeftSidebarCloseGesture] ${event}`, details)
|
||||
}
|
||||
|
||||
interface LeftSidebarProps {
|
||||
selectedAgentId?: string
|
||||
@@ -144,70 +136,6 @@ export function LeftSidebar({ selectedAgentId: _selectedAgentId }: LeftSidebarPr
|
||||
// Track user-initiated refresh to avoid showing spinner on background revalidation
|
||||
const [isManualRefresh, setIsManualRefresh] = useState(false)
|
||||
|
||||
useEffect(() => {
|
||||
console.log('[LeftSidebar] isOpen_changed', {
|
||||
isOpen,
|
||||
isMobile,
|
||||
mobileView,
|
||||
desktopAgentListOpen,
|
||||
})
|
||||
}, [desktopAgentListOpen, isMobile, isOpen, mobileView])
|
||||
|
||||
useEffect(() => {
|
||||
console.log('[LeftSidebar] pathname_changed', {
|
||||
pathname,
|
||||
activeServerIdFromPath,
|
||||
activeServerId,
|
||||
})
|
||||
}, [activeServerId, activeServerIdFromPath, pathname])
|
||||
|
||||
useEffect(() => {
|
||||
console.log('[LeftSidebar] hosts_changed', {
|
||||
hostCount: daemons.length,
|
||||
serverIds: daemons.map((daemon) => daemon.serverId),
|
||||
runtimeConnectionStatusSignature,
|
||||
})
|
||||
}, [daemons, runtimeConnectionStatusSignature])
|
||||
|
||||
useEffect(() => {
|
||||
console.log('[LeftSidebar] active_host_changed', {
|
||||
activeServerId,
|
||||
activeHostLabel,
|
||||
activeHostStatus,
|
||||
})
|
||||
}, [activeHostLabel, activeHostStatus, activeServerId])
|
||||
|
||||
useEffect(() => {
|
||||
console.log('[LeftSidebar] projects_changed', {
|
||||
activeServerId,
|
||||
projectCount: projects.length,
|
||||
projectKeys: projects.map((project) => project.projectKey),
|
||||
workspaceCounts: projects.map((project) => ({
|
||||
projectKey: project.projectKey,
|
||||
workspaceCount: project.workspaces.length,
|
||||
})),
|
||||
isInitialLoad,
|
||||
isRevalidating,
|
||||
})
|
||||
}, [activeServerId, isInitialLoad, isRevalidating, projects])
|
||||
|
||||
useEffect(() => {
|
||||
console.log('[LeftSidebar] collapsed_or_shortcuts_changed', {
|
||||
collapsedProjectKeys: Array.from(collapsedProjectKeys),
|
||||
shortcutCount: shortcutIndexByWorkspaceKey.size,
|
||||
})
|
||||
}, [collapsedProjectKeys, shortcutIndexByWorkspaceKey])
|
||||
|
||||
useEffect(() => {
|
||||
console.log('[LeftSidebar] animation_context_changed', {
|
||||
windowWidth,
|
||||
translateXValue: translateX.value,
|
||||
backdropOpacityValue: backdropOpacity.value,
|
||||
isGesturing: isGesturing.value,
|
||||
hasCloseGestureRef: Boolean(closeGestureRef.current),
|
||||
})
|
||||
}, [backdropOpacity, closeGestureRef, isGesturing, translateX, windowWidth])
|
||||
|
||||
const handleRefresh = useCallback(() => {
|
||||
setIsManualRefresh(true)
|
||||
refreshAll()
|
||||
@@ -320,7 +248,6 @@ export function LeftSidebar({ selectedAgentId: _selectedAgentId }: LeftSidebarPr
|
||||
})
|
||||
.onStart(() => {
|
||||
isGesturing.value = true
|
||||
runOnJS(logLeftSidebarCloseGesture)('start', { isOpen, isMobile })
|
||||
})
|
||||
.onUpdate((event) => {
|
||||
if (!isMobile) return
|
||||
@@ -338,11 +265,6 @@ export function LeftSidebar({ selectedAgentId: _selectedAgentId }: LeftSidebarPr
|
||||
isGesturing.value = false
|
||||
if (!isMobile) return
|
||||
const shouldClose = event.translationX < -windowWidth / 3 || event.velocityX < -500
|
||||
runOnJS(logLeftSidebarCloseGesture)('end', {
|
||||
translationX: event.translationX,
|
||||
velocityX: event.velocityX,
|
||||
shouldClose,
|
||||
})
|
||||
if (shouldClose) {
|
||||
animateToClose()
|
||||
runOnJS(handleClose)()
|
||||
|
||||
Reference in New Issue
Block a user