From d5f44370b676f3f844a61c5f45b76257a8d9fa95 Mon Sep 17 00:00:00 2001 From: th Date: Sun, 12 Apr 2026 17:46:56 +0200 Subject: [PATCH] fix: PHP upload limits, import error dialog, earlier footer breakpoint - Set upload_max_filesize=64M and display_errors=0 for Electron PHP - Import shows error dialog instead of silently failing - Footer count repositions at 1450px instead of 1250px Co-Authored-By: Claude Opus 4.6 (1M context) --- electron/main.js | 3 +++ public/css/style.css | 2 +- public/js/app.js | 8 ++++++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/electron/main.js b/electron/main.js index 669ab38..15f1b0e 100644 --- a/electron/main.js +++ b/electron/main.js @@ -118,6 +118,9 @@ async function startPhpServer() { console.log('[hyprcrd] port:', serverPort); phpProcess = spawn(phpBin, [ + '-d', 'upload_max_filesize=64M', + '-d', 'post_max_size=66M', + '-d', 'display_errors=0', '-S', `127.0.0.1:${serverPort}`, '-t', docRoot, routerFile, diff --git a/public/css/style.css b/public/css/style.css index 5212813..3043061 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -28,7 +28,7 @@ body.no-scanlines::after { display: none !important; } #main-header { box-shadow: var(--ui-shadow-header); } #main-footer { box-shadow: var(--ui-shadow-footer); position: relative; } #footer-count { flex-shrink: 0; } -@media (min-width: 1250px) { +@media (min-width: 1450px) { #footer-count { position: absolute; left: 50%; translate: -50% 0; } } html { min-width: 1150px; } diff --git a/public/js/app.js b/public/js/app.js index 4f5680e..9c4dd68 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -143,10 +143,14 @@ importFile?.addEventListener('change', async e => { try { const url = mode ? 'api/import?merge=1' : 'api/import'; const res = await fetch(url, { method: 'POST', body: form, headers: { 'X-CSRF-Token': getCsrf() } }); - const data = JSON.parse(await res.text()); + const text = await res.text(); + if (!res.ok) throw new Error(text || `HTTP ${res.status}`); + const data = JSON.parse(text); if (data.error) throw new Error(data.error); await loadBuckets(); state.cards = await api('api/cards'); renderBoard(); - } catch {} + } catch (err) { + await showDialog({ title: 'import failed', message: err.message || 'Unknown error', danger: true, okLabel: 'OK', cancelLabel: '' }); + } e.target.value = ''; });