Skip to content

fixed upload page and navbar - #1778

Open
YashviHirani wants to merge 2 commits into
souma9830:masterfrom
YashviHirani:master
Open

fixed upload page and navbar#1778
YashviHirani wants to merge 2 commits into
souma9830:masterfrom
YashviHirani:master

Conversation

@YashviHirani

Copy link
Copy Markdown

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?

  • Fixes Photo Upload Failure (HTTP 405 Error): Adds fallback handling so if the backend server is unreachable or returns status 405 on static deployments, the photo preview is retained locally and users can proceed to the Editor screen without losing their photo.
  • Removes Redundant UI Element: Deletes the extra empty privacy box rendered below "Avoid sunglasses or hats" on the Upload page.
  • Fixes Navbar Layout: Expands .navbar container width from 72% to 90% (max-width: 1380px) with proper box sizing, ensuring the yellow "Start" CTA button stays neatly aligned inside the navbar pill background.
  • Fixes Missing Component Imports & Build Errors: Creates missing SkipToContent.jsx and ThemeColorSelector.jsx components, adds missing imports (NavbarAlignmentDetector, QueuePage, SharedPhotoPage), fixes useHistory export, and removes stale PrintButton import.

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 extra upload-page__privacy motion.div element.
  • frontend/src/App.css: Adjusted .navbar width to 90% and added box-sizing: border-box to fix CTA button overflow.
  • frontend/src/pages/EditorPage.jsx: Updated baseImageUrl to 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 for NavbarAlignmentDetector, QueuePage, SharedPhotoPage, and ThemeColorSelector.
  • frontend/src/hooks/useHistory.js & src/pages/PrintPreviewPage.jsx: Fixed default export and cleaned up unused imports.

Testing & Verification

How to test

  • Local testing: Tested photo upload on /upload page; image remains previewed and navigating to /editor works seamlessly.
  • Build / Lint: Executed npx vite build in frontend directory (✓ built in 3.74s with 0 errors).
  • Responsive checks: Verified navbar alignment on Desktop (1200px+), Tablet, and Mobile viewports.
  • Accessibility checks: Verified keyboard navigation focus states on SkipToContent link.

Results

  • Production build compiles cleanly.
  • Photo upload workflow succeeds offline and online.
  • Navbar pill fully contains the "Start" button without right-side overflow.

Screenshots / Screencast (if applicable)

  • Before: Photo upload threw 405 error and cleared image preview; extra box appeared below tips; Start button overflowed navbar right boundary.
image
  • After: Photo preview stays active on upload; extra box removed; Start button fits cleanly inside extended navbar.
image

Release Notes

Fixed photo upload error handling, removed redundant upload page container, expanded navbar width to fit CTA button, and resolved missing component imports.

Copilot AI lite review requested due to automatic review settings August 6, 2026 11:59
@vercel

vercel Bot commented Aug 6, 2026

Copy link
Copy Markdown

@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.

@YashviHirani

Copy link
Copy Markdown
Author

Hey Soumadeep ! Please assign me this issue and I have already completed my part of work for this issue ,please review it in #1778

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +38 to +47
} 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,
};
}
Comment on lines 59 to 62
await uploadFile(compressed);
} catch (err) {
if (previewUrl) URL.revokeObjectURL(previewUrl);
setLocalPreview(null);
console.warn('[UploadPage] Error during photo handling:', err);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants