wrolpi/wrolpi
Roland 3d6aead072
Some checks failed
CodeQL / Analyze (push) Has been cancelled
Controller Tests / controller-tests (push) Has been cancelled
Jest Tests / jest-tests (push) Has been cancelled
Rebuild Inventory as a config-only system with food catalog and calculators
Replace the DB-backed inventory module with a config-only design and build out
food-storage tooling around it.

Inventory (config-only, no database)
- Each inventory is a YAML file at config/inventory/<slug>.yaml, loaded once
  into memory and the single source of truth. New reusable MultiFileConfig
  (wrolpi/common.py) manages a directory of per-entity files.
- Inventory types (food/fuel/tool) seed a customizable field schema
  (text/number/quantity/date/select/location/calories). Unit math/aggregation
  moved to the frontend (mathjs); Pint dropped from the backend.
- Minimal API: GET / (all inventories full), POST /, PUT /<slug> (whole-
  inventory save with version-based optimistic concurrency; 404 for missing),
  DELETE. Legacy inventories.yaml / old tables migrate to per-inventory files
  (pound->lb), and an alembic migration drops the tables.

Frontend
- New app/src/components/inventory/ package: spreadsheet-style table with
  Tab/Enter keyboard entry, sortable columns, expired-row highlighting,
  customizable field editor, and pooled cross-inventory location autocomplete.
- A single useInventories store loads everything once and persists whole
  inventories optimistically; list/items/summary/locations derive client-side.
- Summary groups items (default by Category), totals size x count, shows a
  calories column, and embeds a ration estimate (how long the stock lasts).

Food catalog
- Shared, editable catalog (config/inventory/catalog.yaml) seeded from
  catalog_defaults.yaml (~60 generic items, total calories per package) with
  merge-keep-edits + tombstones. GET/PUT /api/inventory/catalog, a management
  modal, and entry-row pre-fill of category/size/calories from a name match.

Calculators
- Generic Food Storage planner (like the Water calculator): household +
  editable per-person/year amounts -> total to store over a chosen duration,
  with women/children weighted by DGA calorie shares and an imperial/metric
  toggle.

Also fixes ConfigFile.save() to accept nested file_names. Backend pytest and
frontend jest suites updated/added throughout; alembic check clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-14 17:14:54 -06:00
..
collections Playlists can be tagged on creation. Playlist destination is no longer empty by default. 2026-06-11 19:46:35 -06:00
files HTML indexer is binary-safe; it indexes the page inside a compressed singlefile. 2026-06-12 17:24:02 -06:00
scripts Map search added to global search. Preview cards are displayed for all results in new Map tab. 2026-04-13 12:17:08 -06:00
static/extensions Bump extension to v0.2.4 2026-06-01 19:23:39 -06:00
test Rebuild Inventory as a config-only system with food catalog and calculators 2026-06-14 17:14:54 -06:00
__init__.py Removing WROLPi admin functionality that is now in Controller. 2025-12-19 18:41:27 -07:00
api_utils.py Reworking how Sanic is run for upgraded Sanic version 2026-01-23 15:29:17 -07:00
captions.py Adding links next to video captions to allow scrubbing of video by the captions, adding filter to make finding quick. 2026-03-21 16:50:27 -06:00
cmd.py Single file deno (#478) 2026-06-12 17:07:28 -06:00
common.py Rebuild Inventory as a config-only system with food catalog and calculators 2026-06-14 17:14:54 -06:00
config_api.py Fixing bug where configs could be overwritten with empty configs on first refresh. Fixing bug where configs were displayed as JSON in admin settings. 2026-03-22 12:56:37 -06:00
config_schema.py Backup configs can be restored in the UI. User can choose between Merge or Overwrite, the UI displays a comparison. Configs are compared when user opens the restore modal, configs which won't cause changes are marked. 2026-03-10 20:30:46 -06:00
conftest.py Fix Downloads stuck "pending": persist finalize_download mutations (#473) 2026-06-11 19:46:33 -06:00
contexts.py Rebuild Inventory as a config-only system with food catalog and calculators 2026-06-14 17:14:54 -06:00
dates.py Testing that downloads have absolute destinations. Handling 'undefined', 'null', etc, dates. 2025-03-21 17:14:53 -06:00
db.py Creating AutoAwaitTestClient for tests which automatically runs background tasks and expires db objects. 2026-01-05 18:26:49 -07:00
downloader.py Single file deno (#478) 2026-06-12 17:07:28 -06:00
errors.py Showing preview of zip file contents, allowing user to download individual files without full extraction. 2026-03-15 12:58:40 -06:00
events.py Map search added to global search. Preview cards are displayed for all results in new Map tab. 2026-04-13 12:17:08 -06:00
flags.py Displaying warning when no drive is mounted. 2026-05-14 16:16:18 -06:00
lang.py Including Country/Region codes in caption file names. 2024-10-16 18:56:31 -06:00
log_levels.py Reworking and unifying log levels. 2025-12-16 19:20:04 -07:00
logging_extra.py Hiding empty log line messages because Sanic's access log logs empty lines. 2025-03-28 10:25:32 -06:00
media_path.py FileGroups in Collections can be reorganized in the Collection's directory. 2026-01-31 18:08:41 -07:00
roland@learningselfreliance.com.gpg Updating git signing gpg key. 2024-10-16 18:57:06 -06:00
root_api.py Move One-Time Pad encryption to the browser (#479) 2026-06-13 13:52:34 -06:00
schema.py Archives can be compressed (SingleFileZ self-extracting HTML) (#477) 2026-06-11 19:46:35 -06:00
scrape_downloader.py Migrating FileDownloader. 2026-05-07 15:54:53 -06:00
switches.py Add Docs module for searching and organizing PDFs and EPUBs 2026-03-20 14:17:06 -06:00
tags.py Add ordered collections (playlists): polymorphic items + item API (#475) 2026-06-11 19:46:34 -06:00
test_media_path.py Add Docs module for searching and organizing PDFs and EPUBs 2026-03-20 14:17:06 -06:00
upgrade.py Not checking for updates when WROL Mode is enabled. 2025-12-06 15:11:37 -07:00
vars.py Reworking and unifying log levels. 2025-12-16 19:20:04 -07:00
version.py Bumping version. Moving version to text file for easy reference in scripts. 2023-05-03 13:39:58 -06:00
version.txt Bump version to 0.24.2-beta 2026-06-13 14:08:56 -06:00