feat: add FAB to meals page for quick meal creation (#62)

This commit is contained in:
Ulas Kalayci
2026-04-20 10:15:04 +02:00
parent 30d3d6cd13
commit e92487f464
4 changed files with 16 additions and 3 deletions
+5
View File
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## [0.20.26] - 2026-04-20
### Added
- Meals: floating action button (FAB) now appears fixed at the bottom-right corner, opening a quick-add modal for today with the first visible meal type pre-selected
## [0.20.25] - 2026-04-20
### Fixed
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "oikos",
"version": "0.20.25",
"version": "0.20.26",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "oikos",
"version": "0.20.25",
"version": "0.20.26",
"license": "MIT",
"dependencies": {
"bcrypt": "^6.0.0",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "oikos",
"version": "0.20.25",
"version": "0.20.26",
"description": "Self-hosted family planner - calendar, tasks, shopping, meal planning, budget and more. Private, open-source, no subscription.",
"main": "server/index.js",
"type": "module",
+8
View File
@@ -146,6 +146,9 @@ export async function render(container, { user }) {
<div class="week-grid" id="week-grid">
<div style="margin:auto;padding:2rem;text-align:center;color:var(--color-text-disabled)">${t('meals.loadingIndicator')}</div>
</div>
<button class="page-fab" id="fab-new-meal" aria-label="${t('meals.addMealTitle')}">
<i data-lucide="plus" style="width:24px;height:24px" aria-hidden="true"></i>
</button>
</div>
`;
@@ -157,6 +160,11 @@ export async function render(container, { user }) {
await Promise.all([loadWeek(monday), loadLists(), loadPreferences(), loadCategories()]);
renderWeekGrid();
wireNav();
container.querySelector('#fab-new-meal').addEventListener('click', () => {
const firstType = state.visibleMealTypes[0] ?? 'lunch';
openMealModal({ mode: 'create', date: today, mealType: firstType });
});
}
// --------------------------------------------------------