@@ -24,22 +24,14 @@ import {
2424import { useViewer } from "@app/contexts/ViewerContext" ;
2525import AppsIcon from "@mui/icons-material/AppsRounded" ;
2626
27- import ToolPanel from "@app/components/tools/ToolPanel" ;
28- import Workbench from "@app/components/layout/Workbench" ;
2927import QuickAccessBar from "@app/components/shared/QuickAccessBar" ;
3028import RightRail from "@app/components/shared/RightRail" ;
31- import FileManager from "@app/components/FileManager" ;
3229import LocalIcon from "@app/components/shared/LocalIcon" ;
3330import { useFilesModalContext } from "@app/contexts/FilesModalContext" ;
34- import AppConfigModal from "@app/components/shared/AppConfigModalLazy" ;
3531import { getStartupNavigationAction } from "@app/utils/homePageNavigation" ;
3632import { HomePageExtensions } from "@app/components/home/HomePageExtensions" ;
37- import LocalIcon from "@app/components/shared/LocalIcon" ;
38- import { useFilesModalContext } from "@app/contexts/FilesModalContext" ;
39-
40- import QuickAccessBar from "@app/components/shared/QuickAccessBar" ;
41- import RightRail from "@app/components/shared/RightRail" ;
4233import { LoadingFallback } from "@app/components/shared/LoadingFallback" ;
34+ import ToolPanelSkeleton from "@app/components/tools/ToolPanelSkeleton" ;
4335
4436import "@app/pages/HomePage.css" ;
4537
@@ -150,8 +142,14 @@ export default function HomePage() {
150142 if ( isMobile ) {
151143 const container = sliderRef . current ;
152144 if ( container ) {
153- isProgrammaticScroll . current = true ;
154145 const offset = activeMobileView === "tools" ? 0 : container . offsetWidth ;
146+
147+ // Skip if already at the target position to avoid fighting with user swipes
148+ if ( Math . abs ( container . scrollLeft - offset ) < 10 ) {
149+ return ;
150+ }
151+
152+ isProgrammaticScroll . current = true ;
155153 container . scrollTo ( { left : offset , behavior : "smooth" } ) ;
156154
157155 // Re-enable scroll listener after animation completes
@@ -165,7 +163,9 @@ export default function HomePage() {
165163 setActiveMobileView ( "tools" ) ;
166164 const container = sliderRef . current ;
167165 if ( container ) {
168- container . scrollTo ( { left : 0 , behavior : "auto" } ) ;
166+ if ( container . scrollLeft !== 0 ) {
167+ container . scrollTo ( { left : 0 , behavior : "auto" } ) ;
168+ }
169169 }
170170 } , [ activeMobileView , isMobile ] ) ;
171171
@@ -311,7 +311,7 @@ export default function HomePage() {
311311 aria-label = { t ( "home.mobile.toolsSlide" , "Tool selection panel" ) }
312312 >
313313 < div className = "mobile-slide-content" >
314- < Suspense fallback = { < LoadingFallback /> } >
314+ < Suspense fallback = { < ToolPanelSkeleton /> } >
315315 < ToolPanel />
316316 </ Suspense >
317317 </ div >
@@ -406,7 +406,7 @@ export default function HomePage() {
406406 < Group align = "flex-start" gap = { 0 } h = "100%" className = "flex-nowrap flex" >
407407 < QuickAccessBar ref = { quickAccessRef } />
408408 { ! hideToolPanel && (
409- < Suspense fallback = { < LoadingFallback /> } >
409+ < Suspense fallback = { < ToolPanelSkeleton /> } >
410410 < ToolPanel />
411411 </ Suspense >
412412 ) }
0 commit comments