fixed upload page and navbar - #1778
Conversation
|
@YashviHirani is attempting to deploy a commit to the souma9830's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Hey Soumadeep ! Please assign me this issue and I have already completed my part of work for this issue ,please review it in #1778 |
There was a problem hiding this comment.
Pull request overview
This PR updates the frontend upload flow and navigation UI to better support static/offline deployments (retain photo preview when backend upload fails), removes redundant Upload page UI, and fixes missing imports/components that were causing runtime/build issues.
Changes:
- Add backend-upload fallback behavior to keep a local photo URL available when uploads fail (e.g., 405 / unreachable backend).
- Remove redundant Upload page privacy container and adjust navbar sizing/styles to prevent CTA overflow.
- Add missing components/imports and minor cleanup (routes, hooks exports, unused import removal).
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/routes/AppRoutes.jsx | Adds lazy imports/routes for Queue and Shared Photo pages. |
| frontend/src/pages/UploadPage.jsx | Keeps preview on errors and removes redundant privacy element. |
| frontend/src/pages/PrintPreviewPage.jsx | Removes stale PrintButton import. |
| frontend/src/pages/EditorPage.jsx | Prioritizes local/blob URLs when resolving base image URL. |
| frontend/src/hooks/usePhotoUpload.jsx | Adds local fallback when backend upload fails. |
| frontend/src/hooks/useHistory.js | Adds default export for useHistory. |
| frontend/src/components/ThemeColorSelector.jsx | Adds missing theme accent selector component. |
| frontend/src/components/SkipToContent.jsx | Adds missing skip link component for accessibility. |
| frontend/src/components/layout/Navbar.jsx | Adds ThemeColorSelector and alignment detector to navbar. |
| frontend/src/App.css | Adjusts navbar sizing and styling to contain CTA. |
| frontend/dist/index.html | Updates built asset hashes in dist output. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| } catch (uploadErr) { | ||
| console.warn('[usePhotoUpload] Backend upload unavailable or returned error, using local fallback:', uploadErr); | ||
| nextUploaded = { | ||
| fileId: `local-${Date.now()}`, | ||
| filename: file.name || 'uploaded_photo.jpg', | ||
| fileUrl: localUrl, | ||
| localUrl, | ||
| isLocalFallback: true, | ||
| }; | ||
| } |
| await uploadFile(compressed); | ||
| } catch (err) { | ||
| if (previewUrl) URL.revokeObjectURL(previewUrl); | ||
| setLocalPreview(null); | ||
| console.warn('[UploadPage] Error during photo handling:', err); | ||
| } |
Summary
Issue / Ticket
Fixes photo upload status 405 error, removes redundant Upload page container, adjusts Navbar dimensions to fit the Start button, and resolves missing runtime module imports.
What does this PR do?
.navbarcontainer width from72%to90%(max-width: 1380px) with proper box sizing, ensuring the yellow "Start" CTA button stays neatly aligned inside the navbar pill background.SkipToContent.jsxandThemeColorSelector.jsxcomponents, adds missing imports (NavbarAlignmentDetector,QueuePage,SharedPhotoPage), fixesuseHistoryexport, and removes stalePrintButtonimport.Changes
frontend/src/hooks/usePhotoUpload.jsx&UploadPage.jsx: Added local fallback payload handling on backend upload error to preserve image preview.frontend/src/pages/UploadPage.jsx: Removed extraupload-page__privacymotion.div element.frontend/src/App.css: Adjusted.navbarwidth to 90% and addedbox-sizing: border-boxto fix CTA button overflow.frontend/src/pages/EditorPage.jsx: UpdatedbaseImageUrlto prioritize local blob URLs for fallback uploads.frontend/src/components/SkipToContent.jsx&src/components/ThemeColorSelector.jsx: Created missing components required by shell and navigation.frontend/src/components/layout/Navbar.jsx&src/routes/AppRoutes.jsx: Added missing imports forNavbarAlignmentDetector,QueuePage,SharedPhotoPage, andThemeColorSelector.frontend/src/hooks/useHistory.js&src/pages/PrintPreviewPage.jsx: Fixed default export and cleaned up unused imports.Testing & Verification
How to test
/uploadpage; image remains previewed and navigating to/editorworks seamlessly.npx vite buildinfrontenddirectory (✓ built in 3.74swith 0 errors).SkipToContentlink.Results
Screenshots / Screencast (if applicable)
Release Notes