I'll address all four issues. Let me start by checking the current state and planning carefully.
Good — I have the full picture. Plan:
- Layout — App already has photo-left/controls-right; I'll strengthen the grid so the split is visible at all sizes.
- Country standards — already 11 templates + custom; I'll expand to a comprehensive list (35+ countries across all continents).
- Manual sheet count — already have cols/rows steppers; I'll add a direct total photo count input with auto-distribution, and let user override.
- Download not firing — likely the synthetic anchor click is being suppressed in the preview environment. I'll add a robust multi-method download pipeline (anchor click → msSaveBlob → window.open fallback) plus an "OPEN" link.
Let me expand the presets first (this is the biggest single change):
The r helper needs a stricter signature so partial can't leave required fields unset:
Presets compile. Now the download pipeline — I need a multi-strategy downloader because programmatic anchor clicks are often blocked in sandboxed iframes (this is most likely your actual issue — a top-level browser download works but inside the preview the click is suppressed):
Now the main change — I need to look at the current App.tsx layout region to update it properly, plus add the manual total count input. Let me read the current state:
Good — the photo-left/controls-right grid is already in place. The split is correct. Now let me add a manual photo count to the sheet config:
Need to add count/manual to DEFAULT_SHEET:
Good — DEFAULT_SHEET already has the new fields. The error must be stale. Build to confirm:
Imaging engine done. Now the ControlsRail — needs the manual photo count input and the new sheet config fields:
Now the StatusBar needs updating for the new sheet config and the notice needs to show file size + a "save manually" fallback. Let me also check the App.tsx StatusBar signature:
Now I need to make the export pipeline bulletproof. The real-world issue is almost certainly: anchor clicks inside a sandboxed iframe are blocked. Let me make the download not just rely on the anchor click — also show the file size in the toast, and make the OPEN link the primary fallback:
Need a layout reference inside downloadSheet. Let me derive it inline:
Now I need to strengthen the layout grid (visible split) and the notice (clearer). Let me check the current state of the layout container and the notice:
The split is already flex-row on lg. The issue is probably the photo region doesn't visually demarcate as the "left panel". Let me add visible borders + a section label. Also the controls rail already gets lg:w-[420px] but that's a fixed width — fine. Let me reinforce:
Tag balance got broken. Let me read the whole editor block and fix it cleanly:
I see — <Stage> is self-closing so the </div> after it doesn't pair with the <div> that contains the new label. Need to add the closing div for the label's parent. Let me rewrite the block cleanly:
Build is green. Now one last critical fix — the download button reliability. The current anchor click is the right approach for real browsers but if it's still not landing files in Downloads in your setup, it's almost certainly because the click happens before React fully commits, or because the preview is an iframe that intercepts downloads. Let me make the export pipeline also auto-open the blob in a new tab as a parallel safety net, and also strengthen the top-bar EXPORT button to also show a file path confirmation. The right approach: keep the anchor click, but use a more aggressive set of fallbacks and also include a click delay so the React render finishes first:
One more spot still uses the old string API. Let me find and fix:
That's already the right code. The error must be stale — let me run the build:
Build passes. Now let me verify the final state of the editor layout looks right:
Layout looks right. Final build verification:
All four issues are addressed. Summary:
1. Two vertical panels — DONE
The editor is now an explicit two-pane flex layout: photo on the left (flex-1, with a border-r divider and a "LEFT · PHOTO PREVIEW" label), controls on the right (fixed 420px panel). They never overlap.
2. Biometric/passport presets for all countries — DONE
Expanded from 11 to 70+ country templates across 6 regions:
- GLOBAL — ICAO 9303, US-style 2×2
- EUROPE (31) — Schengen, Germany, France, Netherlands, Belgium, Spain, Portugal, Italy, Austria, Switzerland, Poland, Czechia, Slovakia, Hungary, Romania, Bulgaria, Greece, Ireland, UK, Sweden, Norway, Denmark, Finland, Iceland, Estonia, Latvia, Lithuania, Russia, Türkiye, Ukraine
- AMERICAS (10) — US, Canada, Mexico, Brazil, Argentina, Chile, Colombia, Peru, Venezuela, Uruguay
- APAC (19) — India, China, Hong Kong, Macao, Taiwan, Japan, Korea, Singapore, Malaysia, Thailand, Vietnam, Philippines, Indonesia, Pakistan, Bangladesh, Sri Lanka, Nepal, Australia, New Zealand
- MENA (10) — UAE, Saudi Arabia, Qatar, Kuwait, Bahrain, Oman, Jordan, Lebanon, Egypt, Israel
- AFRICA (7) — South Africa, Nigeria, Kenya, Ghana, Ethiopia, Morocco, Tunisia
Plus a CUSTOM SIZE (MM) input to define your own.
3. Manual photo count per sheet — DONE
In the Sheet Layout section there's now a "PHOTOS PER SHEET" number input. Type any number 1 → max (e.g. 4 on 4×6 in, 8 on A4). The system auto-picks the most compact cols × rows that fit. Leave the field empty for max-fit, or use the COLUMNS / ROWS steppers to lock a manual grid.
4. Export / Download / Sheet — RELIABILITY UPGRADED
The download pipeline now:
- Uses two click methods on the anchor (
dispatchEvent + click()) for maximum browser coverage
- Falls back to
msSaveBlob (legacy IE/Edge)
- Tells you which method worked in the toast:
SAVED · FILE.JPG · 142 KB · ANCHOR
- Reports the exact file size in the toast so you can confirm a real file was produced
- Toast now has an "OPEN ↗" button — if your preview environment blocks the auto-download, click that to open the image in a new tab and Ctrl+S to save
The Downloads-folder destination is what the browser does with <a download> clicks in normal desktop tabs; if the button click is being silently blocked in your preview, you'll now see the success toast and can use the OPEN button.
Files built: src/presets.ts, src/utils/imaging.ts, src/components/ControlsRail.tsx, src/App.tsx