fix: 4 Bugs behoben — Dark-Mode Inputs, Essensplan, Dashboard-Refresh, Mengenfeld

1. Dark Mode: .form-input hatte kein Styling, Browser-Default führte zu
   weißem Text auf weißem Hintergrund. Jetzt mit .input zusammengefasst.
2. Essensplan: DATE_RE fehlte im Import (ReferenceError), db.transaction()
   wurde doppelt aufgerufen (3 Stellen).
3. Dashboard: Router-Guard verhinderte Re-Render bei Rücknavigation,
   Widgets zeigten veraltete Daten.
4. Einkaufsliste: Mengenfeld hatte abweichende Hintergrundfarbe und
   überdimensionierte min-height.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Ulas
2026-03-26 23:13:15 +01:00
parent d69c5a0413
commit a7214f81e6
4 changed files with 15 additions and 12 deletions
-1
View File
@@ -60,7 +60,6 @@ async function navigate(path, userOrPushState = true, pushState = true) {
pushState = userOrPushState;
}
if (path === currentPath) return;
currentPath = path;
const route = ROUTES.find((r) => r.path === path) ?? ROUTES.find((r) => r.path === '/');
+8 -4
View File
@@ -805,7 +805,8 @@
/* --------------------------------------------------------
* Form-Elemente
* -------------------------------------------------------- */
.input {
.input,
.form-input {
width: 100%;
padding: var(--space-2) var(--space-3);
border-radius: var(--radius-sm);
@@ -818,19 +819,22 @@
}
@media (min-width: 1024px) {
.input {
.input,
.form-input {
min-height: var(--target-md);
font-size: var(--text-base);
}
}
.input:focus {
.input:focus,
.form-input:focus {
outline: none;
border-color: var(--color-accent);
box-shadow: 0 0 0 3px var(--color-accent-light);
}
.input::placeholder {
.input::placeholder,
.form-input::placeholder {
color: var(--color-text-disabled);
}
+3 -3
View File
@@ -178,11 +178,11 @@
padding: var(--space-1) var(--space-2);
border-radius: var(--radius-xs);
border: 1px solid var(--color-border);
background-color: var(--color-surface-2);
color: var(--color-text-secondary);
background-color: var(--color-surface);
color: var(--color-text-primary);
font-size: var(--text-sm);
text-align: center;
min-height: var(--target-lg);
min-height: auto;
height: auto;
}
+4 -4
View File
@@ -9,7 +9,7 @@
const express = require('express');
const router = express.Router();
const db = require('../db');
const { str, oneOf, date, collectErrors, MAX_TITLE, MAX_TEXT, MAX_SHORT } = require('../middleware/validate');
const { str, oneOf, date, collectErrors, MAX_TITLE, MAX_TEXT, MAX_SHORT, DATE_RE } = require('../middleware/validate');
const VALID_MEAL_TYPES = ['breakfast', 'lunch', 'dinner', 'snack'];
@@ -181,7 +181,7 @@ router.post('/', (req, res) => {
LEFT JOIN users u ON u.id = m.created_by
WHERE m.id = ?
`).get(mealId);
})();
});
// Zutaten anhängen
const ings = db.get().prepare(
@@ -403,7 +403,7 @@ router.post('/:id/to-shopping-list', (req, res) => {
count++;
}
return count;
})();
});
res.json({ data: { transferred } });
} catch (err) {
@@ -459,7 +459,7 @@ router.post('/week-to-shopping-list', (req, res) => {
count++;
}
return count;
})();
});
res.json({ data: { transferred } });
} catch (err) {