diff --git a/frontend/src-tauri/tauri.conf.json b/frontend/src-tauri/tauri.conf.json index 0da39ba5a6..1dee578dd1 100644 --- a/frontend/src-tauri/tauri.conf.json +++ b/frontend/src-tauri/tauri.conf.json @@ -13,8 +13,10 @@ "windows": [ { "title": "Stirling-PDF", - "width": 1280, - "height": 800, + "width": 1600, + "height": 1000, + "minWidth": 1100, + "minHeight": 700, "resizable": true, "fullscreen": false, "additionalBrowserArgs": "--enable-features=CertVerifierBuiltinFeature" diff --git a/frontend/src/core/pages/HomePage.tsx b/frontend/src/core/pages/HomePage.tsx index f99cbfc8b0..721f109502 100644 --- a/frontend/src/core/pages/HomePage.tsx +++ b/frontend/src/core/pages/HomePage.tsx @@ -10,7 +10,7 @@ import { useAppConfig } from "@app/contexts/AppConfigContext"; import { useLogoPath } from "@app/hooks/useLogoPath"; import { useLogoAssets } from '@app/hooks/useLogoAssets'; import { useFileContext } from "@app/contexts/file/fileHooks"; -import { useNavigationState, useNavigationActions } from "@app/contexts/NavigationContext"; +import { useNavigationActions } from "@app/contexts/NavigationContext"; import { useViewer } from "@app/contexts/ViewerContext"; import AppsIcon from '@mui/icons-material/AppsRounded'; @@ -55,27 +55,22 @@ export default function HomePage() { const [configModalOpen, setConfigModalOpen] = useState(false); const { activeFiles } = useFileContext(); - const navigationState = useNavigationState(); const { actions } = useNavigationActions(); const { setActiveFileIndex } = useViewer(); - const prevFileCountRef = useRef(activeFiles.length); + const prevFileCountRef = useRef(0); - // Auto-switch to viewer when going from 0 to 1 file - // Skip this if PDF Text Editor is active - it handles its own empty state + // Startup/open transition behavior: + // - opening exactly 1 file from empty -> viewer + // - opening 2+ files from empty -> fileEditor useEffect(() => { const prevCount = prevFileCountRef.current; const currentCount = activeFiles.length; - if ( - navigationState.workbench !== 'fileEditor' && - prevCount === 0 && - currentCount === 1 - ) { - // PDF Text Editor handles its own empty state with a dropzone - if (selectedToolKey !== 'pdfTextEditor') { - actions.setWorkbench('viewer'); - setActiveFileIndex(0); - } + if (prevCount === 0 && currentCount === 1) { + actions.setWorkbench('viewer'); + setActiveFileIndex(0); + } else if (prevCount === 0 && currentCount > 1) { + actions.setWorkbench('fileEditor'); } prevFileCountRef.current = currentCount; @@ -83,8 +78,6 @@ export default function HomePage() { activeFiles.length, actions, setActiveFileIndex, - selectedToolKey, - navigationState.workbench, ]); const brandAltText = t("home.mobile.brandAlt", "Stirling PDF logo");