Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions web-app/src/containers/LeftPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@
// Use click outside hook for panel with debugging
useClickOutside(
() => {
if (isSmallScreen && open) {
setLeftPanel(false)
}
},

Check warning on line 104 in web-app/src/containers/LeftPanel.tsx

View workflow job for this annotation

GitHub Actions / coverage-check

101-104 lines are not covered with tests
null,
[
panelRef.current,
Expand All @@ -113,28 +113,28 @@
// Auto-collapse panel only when window is resized
useEffect(() => {
const handleResize = () => {
const currentIsSmallScreen = window.innerWidth <= 768

Check warning on line 116 in web-app/src/containers/LeftPanel.tsx

View workflow job for this annotation

GitHub Actions / coverage-check

116 line is not covered with tests

// Skip on initial mount
if (isInitialMountRef.current) {
isInitialMountRef.current = false
prevScreenSizeRef.current = currentIsSmallScreen
return
}

Check warning on line 123 in web-app/src/containers/LeftPanel.tsx

View workflow job for this annotation

GitHub Actions / coverage-check

119-123 lines are not covered with tests

// Only trigger if the screen size actually changed
if (
prevScreenSizeRef.current !== null &&
prevScreenSizeRef.current !== currentIsSmallScreen
) {
if (currentIsSmallScreen && open) {
setLeftPanel(false)
} else if (!open) {
setLeftPanel(true)
}
prevScreenSizeRef.current = currentIsSmallScreen
}
}

Check warning on line 137 in web-app/src/containers/LeftPanel.tsx

View workflow job for this annotation

GitHub Actions / coverage-check

126-137 lines are not covered with tests

// Add resize listener
window.addEventListener('resize', handleResize)
Expand Down Expand Up @@ -180,9 +180,9 @@

const filteredProjects = useMemo(() => {
if (!searchTerm) return folders
return folders.filter((folder) =>
folder.name.toLowerCase().includes(searchTerm.toLowerCase())
)

Check warning on line 185 in web-app/src/containers/LeftPanel.tsx

View workflow job for this annotation

GitHub Actions / coverage-check

183-185 lines are not covered with tests
}, [folders, searchTerm])

// Memoize categorized threads based on filteredThreads
Expand All @@ -196,32 +196,32 @@

// Project handlers
const handleProjectDelete = (id: string) => {
setDeletingProjectId(id)
setDeleteProjectConfirmOpen(true)
}

Check warning on line 201 in web-app/src/containers/LeftPanel.tsx

View workflow job for this annotation

GitHub Actions / coverage-check

199-201 lines are not covered with tests

const confirmProjectDelete = () => {
if (deletingProjectId) {
deleteFolder(deletingProjectId)
setDeleteProjectConfirmOpen(false)
setDeletingProjectId(null)
}
}

Check warning on line 209 in web-app/src/containers/LeftPanel.tsx

View workflow job for this annotation

GitHub Actions / coverage-check

204-209 lines are not covered with tests

const handleProjectSave = (name: string) => {
if (editingProjectKey) {
updateFolder(editingProjectKey, name)
} else {
addFolder(name)
}
setProjectDialogOpen(false)
setEditingProjectKey(null)
}

Check warning on line 219 in web-app/src/containers/LeftPanel.tsx

View workflow job for this annotation

GitHub Actions / coverage-check

212-219 lines are not covered with tests

// Disable body scroll when panel is open on small screens
useEffect(() => {
if (isSmallScreen && open) {
document.body.style.overflow = 'hidden'

Check warning on line 224 in web-app/src/containers/LeftPanel.tsx

View workflow job for this annotation

GitHub Actions / coverage-check

224 line is not covered with tests
} else {
document.body.style.overflow = ''
}
Expand All @@ -235,9 +235,9 @@
<>
{/* Backdrop overlay for small screens */}
{isSmallScreen && open && (
<div
className="fixed inset-0 bg-black/50 backdrop-blur z-30"
onClick={(e) => {

Check warning on line 240 in web-app/src/containers/LeftPanel.tsx

View workflow job for this annotation

GitHub Actions / coverage-check

238-240 lines are not covered with tests
// Don't close if clicking on search container or if currently searching
if (
searchContainerRef.current?.contains(e.target as Node) ||
Expand Down Expand Up @@ -431,9 +431,9 @@
>
<IconFolder
size={16}
className="text-left-panel-fg/70"
className="text-left-panel-fg/70 shrink-0"
/>
<span className="text-sm text-left-panel-fg/90">
<span className="text-sm text-left-panel-fg/90 truncate">
{folder.name}
</span>
</Link>
Expand Down
Loading