Commit Graph
53 Commits
Author SHA1 Message Date
agentbox b41c1ade44 feat: dark mode toggle for the web UI
CI / test-and-package (push) Successful in 1m13s
CI / build-android (push) Successful in 1m41s
- CSS variables for dark theme: surface, text, borders, accents
- Dark mode overrides for all hardcoded colors (buttons, tags,
  flashes, inputs, table headers, code blocks)
- Toggle button (☀️/🌙) in navbar, saved to localStorage
- Inline script applies saved theme before page render (no flash)
- Applied to both base.html and public.html
- System color-scheme meta tag for native browser chrome
2026-08-01 13:19:19 +00:00
agentbox 11d111fe83 test: 42 web UI tests covering all pages and settings
CI / test-and-package (push) Successful in 1m3s
CI / build-android (push) Successful in 1m29s
tests/test_ui.py — 7 test classes, 42 tests:

TestLoginUI (4): form fields, empty submit, wrong password, success redirect
TestRegisterUI (6): join/create options, admin on create, not admin on join,
  duplicate name, missing selection, password mismatch
TestDashboardUI (6): correct columns, own response buttons, other-user badges,
  date nav, changed-mind badge, history mode
TestAccountSettingsUI (7): section visible, password form, wrong current,
  success, mismatch, too short, delete requires password
TestHouseholdSettingsUI (8): hidden from non-admin, admin sees all sections,
  generate/disable/enable public link
TestPublicPageUI (5): household name, no response buttons, date nav,
  invalid token 404, disabled token 404
TestLanguageUI (6): default en, fr switch, de switch, session persist,
  public page lang, footer links
2026-08-01 12:54:30 +00:00
agentbox bda54eda3a feat: password change + split account/household settings UI
CI / test-and-package (push) Successful in 43s
CI / build-android (push) Successful in 1m10s
- New /change-password route: validates current password,
  enforces min 4 chars, requires confirmation match
- update_password() helper in models.py
- Dashboard UI split into two collapsible sections:
  👤 Account Settings (password, ntfy, delete account)
  🏠 Household Settings (admin only: public link, timezone,
     delete household)
- 14 new i18n keys with fr/de translations
- Restored accidentally dropped 'Delete My Account' key
2026-08-01 12:23:30 +00:00
agentbox 4abbbecce6 feat: i18n — translate Android app UI + pass device lang to server
CI / test-and-package (push) Successful in 40s
CI / build-android (push) Successful in 1m25s
- French (values-fr) and German (values-de) string resources for
  all app UI: settings dialog, errors, labels, buttons
- getDeviceLang() detects Locale.getDefault().getLanguage()
  and maps to en/fr/de
- loadUrl() now appends ?lang=XX to the base URL so the web
  app renders in the user's device language automatically
- English remains the fallback for unsupported languages
2026-08-01 12:11:57 +00:00
agentbox 69def70fe6 fix: swipe-to-refresh hijacks upward scroll in WebView
CI / test-and-package (push) Successful in 37s
CI / build-android (push) Successful in 1m7s
Added setOnChildScrollUpCallback — only allows pull-to-refresh
when WebView scrollY is 0 (at the very top). When scrolled down,
the gesture passes through to the WebView for normal scrolling.

Also fixed: url_label/hint now say 'base URL' instead of
misleading 'server URL'/'public URL'.
2026-08-01 12:04:49 +00:00
agentbox 8d2585bb6e fix: blank page at start — SSL, HTTP errors, old-key migration
CI / test-and-package (push) Successful in 1m6s
CI / build-android (push) Successful in 1m39s
- WebView background set to #F5F5F5 to avoid white flash
- SSL certificate errors now show a dialog (user can accept self-signed)
- HTTP errors (4xx/5xx) shown with status code
- Migrates old 'public_url' key to 'server_url' automatically
- Better error messages with troubleshooting tips
- Progress bar shows real page load progress
- No-server-configured state shows clear instructions
2026-08-01 12:00:07 +00:00
agentbox d7f1005316 trivial: trigger cached build for perf test
CI / test-and-package (push) Successful in 50s
CI / build-android (push) Successful in 1m32s
2026-08-01 11:49:53 +00:00
agentbox c6c30d92f0 perf: cache Android SDK, Gradle, and pip in CI
CI / test-and-package (push) Successful in 3m46s
CI / build-android (push) Successful in 9m22s
Added actions/cache@v3 for:
- ~/android-sdk (keyed on OS + API 34) — skips 150MB download
- ~/.gradle + android/.gradle-home (keyed on OS + gradle 8.7
  + gradle files hash) — skips 130MB gradle download + all
  dependency resolution and jar caching
- ~/.cache/pip (keyed on requirements.txt hash) — skips
  flask/click/werkzeug installs

Build step now checks if cached paths exist before downloading.
Expected speedup: 5-6 min → ~1-2 min on cache hits.
2026-08-01 11:37:15 +00:00
agentbox f93e75e6f0 feat: full-featured Android app — not just public view
CI / test-and-package (push) Successful in 40s
CI / build-android (push) Successful in 3m10s
Rewrote the Android WebView app to load the entire meal-tracker
web application, not just the public sharing page:

- User configures their server base URL (e.g. https://meals.example.com)
- Full login/register, dashboard, meal responses, history, settings
- Cookie/session support — login persists across app restarts
- Dynamic toolbar title from page
- 'Clear Data' button in settings to wipe cookies/cache/sessions
- Server URL auto-normalized (trailing slash stripped, https:// added)
- Back button navigates within WebView history
- Swipe-to-refresh, loading bar, network error handling
2026-08-01 11:35:05 +00:00
agentbox d37efa1dcc ci: rename APK to meal-tracker.apk before artifact upload
CI / test-and-package (push) Successful in 47s
CI / build-android (push) Successful in 3m47s
build-apk.sh now also copies the APK to ./meal-tracker.apk
2026-08-01 11:29:08 +00:00
agentbox 1233f7e024 revert: back to CI artifacts, remove all release/tag experiments
CI / test-and-package (push) Successful in 42s
CI / build-android (push) Successful in 3m24s
2026-08-01 11:26:31 +00:00
agentbox 32c52565ad ci: simplify — remove auto-release, manual releases work better
CI / test (push) Successful in 56s
CI / build-android (push) Successful in 3m9s
Removed tag-triggered release publishing since secrets.GITEA_TOKEN
is not available on this Gitea instance. CI now tests and verifies
the APK compiles. Releases created manually via API as shown with v1.0.0.

Release: https://gitea.ct.cozytren.ch/romane/agentbox-test/releases/tag/v1.0.0
2026-08-01 11:19:53 +00:00
agentbox 047734b613 fix: avoid pipefail in find|zip, write file list to temp file first
CI / build-android (push) Successful in 3m50s
CI / test (push) Successful in 44s
2026-08-01 11:10:59 +00:00
agentbox 3a94a8a8ba fix: use find+zip to properly exclude files from release zip
CI / build-android (push) Successful in 3m6s
CI / test (push) Successful in 36s
Switched from 'zip -x' patterns (which don't handle .git/ correctly)
to 'find | zip -@' with explicit path exclusions. Release zip now
~130 KB instead of ~4.5 MB.
2026-08-01 11:01:55 +00:00
agentbox 587c847b44 fix: exclude git dir and gradle jar from release zip
CI / build-android (push) Successful in 3m23s
CI / test (push) Successful in 38s
Added more aggressive exclusions to keep the release zip small
(~134 KB instead of ~4.5 MB).
2026-08-01 10:53:07 +00:00
agentbox bbb6bc206a feat: publish releases with APK + ZIP on tag push
CI / build-android (push) Successful in 3m8s
CI / test (push) Successful in 43s
CI now triggers on tags matching 'v*':
- Builds APK (always, after tests pass)
- On tag push: creates a Gitea Release and attaches
  meal-tracker.apk + meal-tracker.zip as release assets
- Removed CI artifact steps (replaced by release publishing)

The v1.0.0 release is live with APK (5.3 MB) and ZIP (134 KB).
2026-08-01 10:44:32 +00:00
agentbox 456250c142 fix: handle SIGPIPE from yes|sdkmanager under pipefail
CI / test-and-package (push) Successful in 37s
CI / build-android (push) Successful in 3m15s
CI runs with -o pipefail, so 'yes | sdkmanager --licenses' fails
with exit code 141 when sdkmanager closes stdin. Wrapped with
{ yes || true; } | ... || true to handle this gracefully.
2026-08-01 10:32:42 +00:00
agentbox 92c69ddf4b feat: android webview app + APK build script + CI artifact
CI / test-and-package (push) Successful in 43s
CI / build-android (push) Failing after 39s
Android app (WebView wrapper):
- Wraps the public household sharing URL in a native Android app
- Swipe-to-refresh, error handling, back navigation, settings dialog
- User enters their household's public URL on first launch
- Material Design with toolbar, progress indicator

Build tooling:
- build-apk.sh: one-command APK build (auto-installs Java, SDK, Gradle)
- .gitignore updated for Android build artifacts

CI (.gitea/workflows/ci.yml):
- New 'build-android' job (needs test-and-package)
- Installs Android SDK + Java 17, builds debug APK
- Uploads APK as 'meal-tracker-apk' artifact
2026-08-01 10:28:54 +00:00
agentbox ae95841b5b feat: public sharing links for households
CI / test-and-package (push) Successful in 40s
Add hard-to-guess public URLs (/public/<token>) that show a read-only
meal status dashboard for each household. Only people with the link can
see the data — no login required.

- models.py: public_token + public_enabled columns on households,
  get_household_by_public_token(), generate_public_token(),
  set_public_enabled()
- meals.py: /public/<token> route, /admin/public-link for
  generate/disable/enable/regenerate
- templates/public.html: clean read-only public dashboard
- templates/public-not-found.html: 404 for invalid/disabled links
- templates/dashboard.html: admin UI with copy/regenerate/disable
- static/style.css: public page and URL box styles
- i18n.py: 18 new translation keys (en/fr/de)
2026-08-01 10:12:21 +00:00
agentbox 2a3101071b docs: remove stale cronjob scheduling section, update to meal-cron container
CI / test-and-package (push) Successful in 37s
2026-08-01 07:27:31 +00:00
agentbox 28cf1a2f6a fix: lunch before dinner in columns, responsive mobile layout
CI / test-and-package (push) Successful in 33s
- models.py: ORDER BY CASE so lunch always appears before dinner in the
  dashboard table (was alphabetical, putting dinner first).
- style.css: add @media (max-width: 600px) with mobile-friendly layout:
  stacked navbar, full-width dashboard header, reduced padding/margins,
  larger touch targets for chips/buttons, stacked manage forms, and
  compact table cells.
2026-08-01 06:55:04 +00:00
agentbox 0170786fd3 fix: include is_admin and household_name in get_user_by_callback_token query
CI / test-and-package (push) Successful in 33s
The auto-login route needs these fields to populate the session, but the
query only selected id, username, household_id. Added JOIN with
households table and selected is_admin + household_name.
2026-08-01 06:52:27 +00:00
agentbox 09eda19fc4 fix: send ntfy metadata as HTTP headers, add auto-login from notification click
CI / test-and-package (push) Successful in 42s
- ntfy.py: switch from JSON body to HTTP headers (Title, Priority, Tags,
  Actions, Click) with plain message body. ntfy servers treat the POST
  body as the message, so JSON body fields were ignored and displayed as
  raw JSON.
- ntfy.py: replace em dashes in headers with hyphens (HTTP headers must
  be latin-1 encodable).
- meals.py: add /auto-login/<token> route that logs users in via their
  ntfy callback token so clicking a notification opens the dashboard
  without re-entering credentials.
- ntfy.py: update Click URL to /auto-login/<token>?date=...
2026-08-01 06:50:23 +00:00
agentbox 8466a6e029 fix: unify ntfy URL input styling with rest of manage-form inputs
CI / test-and-package (push) Successful in 38s
Add .manage-form label styling and .manage-form input[type="text"] rule
to match the existing password input styling, so the ntfy topic URL field
looks consistent with the rest of the UI.
2026-08-01 06:37:20 +00:00
agentbox 710cd1fbf9 Refactor cron to call API via HTTP, capture base_url from browser
CI / test-and-package (push) Successful in 33s
- meal-cron now runs send_reminders_cron.sh (simple wget loop, no DB mount)
- New /api/cron-tick endpoint handles all timezone logic server-side
- base_url captured from request.host_url when user saves ntfy settings,
  stored per-user — no APP_BASE_URL env var needed
- Cron endpoint protected by CRON_SECRET shared env var
- Removed send_reminders_cron.py, DB volume from cron container
- tests: 3 new cron-tick + base_url capture tests (69 total)
2026-08-01 06:32:09 +00:00
agentbox 2cd435daf2 Add cron container and per-household timezone for auto-reminders
CI / test-and-package (push) Successful in 36s
- docker-compose.yml: meal-cron service loops send_reminders_cron.py every 60s
- send_reminders_cron.py: checks each household's local time, sends ntfy
  reminders at 10:00 (lunch) and 16:00 (dinner), guarded against duplicates
- models.py: timezone, last_lunch_reminder, last_dinner_reminder on households
- meals.py: /admin/timezone route for admins to set household timezone
- dashboard: timezone selector (20 common zones) in Account Settings
- i18n: 5 new translation keys for timezone strings
- Dockerfile: copy send_reminders_cron.py
- tests: 4 new timezone tests (admin set, non-admin denied, default UTC, auth)
- docs: updated AGENTS.md
2026-08-01 06:23:33 +00:00
agentbox 3681f9dfce Add ntfy push notifications with action buttons for meal reminders
CI / test-and-package (push) Successful in 37s
- ntfy.py: send_meal_reminder() with Home/Out HTTP action buttons, test helper
- models.py: new columns ntfy_url, ntfy_token, callback_token on users table
- meals.py: /api/ntfy-callback (public, token-authenticated), /ntfy-settings, /ntfy-test
- app.py: flask send-reminders CLI command (cron-schedulable)
- Dashboard: ntfy config form in Account Settings
- i18n: translations for all ntfy strings (en/fr/de)
- Dockerfile: include ntfy.py in COPY
- tests: 15 new tests covering callback, settings, and auth
- docs: updated AGENTS.md and doc/index.md
2026-08-01 06:17:26 +00:00
agentbox 7bf00ee2e3 Add AGENTS.md for AI agent context
CI / test-and-package (push) Successful in 29s
2026-08-01 06:05:44 +00:00
agentbox 27a6829242 Fix Dockerfile: add missing i18n.py to COPY
CI / test-and-package (push) Successful in 28s
2026-08-01 06:04:44 +00:00
agentbox b46691fee3 Add i18n support for French and German with browser language detection
CI / test-and-package (push) Successful in 35s
2026-08-01 06:00:29 +00:00
agentbox 218e2b6fb0 Add README.md symlink to doc/index.md
CI / test-and-package (push) Successful in 22s
2026-08-01 05:54:55 +00:00
agentbox be75738aa7 Add documentation in doc/index.md
CI / test-and-package (push) Successful in 29s
2026-08-01 05:54:31 +00:00
agentbox 219003dffb Replace Dockerfile and docker-compose.yml with .meal versions, update references
CI / test-and-package (push) Successful in 1m53s
2026-08-01 05:52:12 +00:00
agentbox 66ee072046 fix: replace container_name with hostname for caddy network resolution
CI / test-and-package (push) Successful in 53s
2026-07-31 22:53:52 +00:00
agentbox 365b4c4e0e fix: networks entry must be a string, not a mapping
CI / test-and-package (push) Successful in 24s
2026-07-31 22:46:48 +00:00
agentbox 26a830c39f fix: launch docker compose on first run too
CI / test-and-package (push) Successful in 31s
2026-07-31 22:45:56 +00:00
agentbox 0a7fdd6a49 fix: use docker-compose.meal.yml compose file
CI / test-and-package (push) Successful in 26s
2026-07-31 22:40:52 +00:00
agentbox e45c5c849c fix: point watch script to agentbox-test repo
CI / test-and-package (push) Successful in 22s
2026-07-31 22:39:20 +00:00
agentbox 465eb69824 add watch-for-updates.sh: auto-pull and docker compose rebuild every 20s
CI / test-and-package (push) Successful in 23s
2026-07-31 22:38:18 +00:00
Romane 627987f6e1 Merge remote-tracking branch 'refs/remotes/origin/main'
CI / test-and-package (push) Successful in 34s
2026-08-01 00:29:56 +02:00
Romane 90a7cab428 add caddy networking 2026-08-01 00:29:19 +02:00
agentbox bbd0f6a4c1 Fix CI: downgrade actions to v3-compatible versions for Gitea
CI / test-and-package (push) Successful in 47s
2026-07-31 22:16:56 +00:00
agentbox fd934c006d Add Gitea Actions CI: run tests, package artifact zip on push
CI / test-and-package (push) Failing after 1m21s
2026-07-31 22:14:55 +00:00
agentbox 188aaf66a0 Add account deletion, admin user removal, household deletion, grayed-out other-user chips (47 tests) 2026-07-31 22:12:13 +00:00
agentbox 53a1ceab75 Fix: household name input visible on page load when creating new household 2026-07-31 22:04:59 +00:00
agentbox 1e57a886f4 Fix: handle stale sessions and migrated users without household_id 2026-07-31 22:02:06 +00:00
agentbox a318b577cb Fix init_db: move household_id index after migration ALTER TABLE 2026-07-31 21:51:05 +00:00
agentbox c48cd265ca Add household support: multi-household isolation, each with own admin and users, 38 tests 2026-07-31 21:44:29 +00:00
agentbox d58828e0ef Add meal tracker app: Flask + SQLite with auth, dashboard, 31 passing tests, Docker Compose 2026-07-31 21:25:59 +00:00
Romane aabc83281b typo in dockerfile 2026-07-31 22:57:13 +02:00