Commit graph

16 commits

Author SHA1 Message Date
5c607c0f65 Merge Block 1: encrypted offline inventory MVP
Inventory walking skeleton + first slice, variety detail/edit, species
catalog + autocomplete, per-lot germination tests, and photo thumbnails.
flutter_bloc over an encrypted Drift (SQLCipher) source of truth; get_it,
go_router, slang (ES/EN). 37 tests green, encryption verified.

Where we are: docs/design/block1-status.md. Pending Block-1 polish:
vernacular-name editing and per-lot edit/delete. Block 2 (social) not started.
2026-07-07 22:16:38 +02:00
d5eb2242ca docs(block1): status marker + IntelliJ run config 2026-07-07 22:14:53 +02:00
8a19a6c85a feat(block1): photo thumbnails in the inventory list
The list showed only initials even when a variety had a photo (quick-add stores
one as an encrypted BLOB). Now the avatar shows the first photo, falling back to
the initial — matching the "foto/inicial" list spec.

- VarietyListItem carries the first photo bytes; watchInventory loads them in a
  single query per emission.
- List tile renders a MemoryImage avatar when present.

Tests: repository (photo bytes surfaced, null when none) and a widget test
(avatar replaces the initial). Full suite: 37 passing, 0 skipped.
2026-07-07 22:03:36 +02:00
37427fa738 feat(block1): germination tests per lot with derived rate
Record germination tests on a lot and surface the result.

- GerminationEntry model with a derived rate (germinated / sample). VarietyLot
  carries its tests (most-recent first) and exposes latestGerminationRate.
- VarietyRepository.addGerminationTest; watchVariety now also re-emits on
  germination-test changes, so the detail refreshes live.
- Detail UI: each lot shows a germination % badge and a grass action that opens
  a sheet listing past tests and adding a new one (germinated + sample size).
  i18n strings (ES/EN).

Tests: derived-rate + reactivity at the repository, and a widget test for the
record-test → badge flow. Full suite: 35 passing, 0 skipped.
2026-07-07 21:59:34 +02:00
4e8b8293e0 feat(block1): bundled species catalog + autocomplete link
Add a small curated catalog of Iberian horticultural species and let a variety
be linked to it from the edit sheet.

- assets/catalog/species.json: 14 species with botanical family and ES/EN
  common names (wikidata_qid/gbif_key deferred to the varilla enrichment).
- SpeciesRepository: idempotent seedBundled (is_bundled rows, keyed by
  scientific name) + search by scientific/common name with a locale-best label.
  Seeded on startup from DI.
- VarietyRepository.linkSpecies: sets species_id and prefills category from the
  species' family when empty (never overwrites an existing category).
  VarietyDetail now carries the scientific name.
- Edit sheet gains a live species-search field; the detail view shows the
  scientific name (italic). i18n strings added (ES/EN).

Tests: catalog parse, idempotent seeding, search by scientific/common name,
linkSpecies prefill semantics, and a widget test for the autocomplete → link →
scientific-name-shown flow. Full suite: 32 passing, 0 skipped.
2026-07-07 21:21:59 +02:00
7ff4e38a15 feat(block1): variety detail + edit screen with reactive lots
Tapping an inventory item now opens its detail (the /variety/:id route was a
placeholder). Read + edit one variety end-to-end:

- Detail view: photo, category, "also known as" names, notes and lots, driven
  by a reactive VarietyDetailCubit.
- Edit core fields (label/category/notes, LWW) via a bottom sheet.
- Add a lot (harvest year + quantity) — the list refreshes reactively.
- Soft-delete (tombstone) with a confirm dialog.

Repository:
- watchVariety(id): merges Drift table-change streams (variety, lots, names,
  attachments) via StreamGroup and reloads the full detail on any change, so a
  lot added to a *different* table still refreshes the view.
- updateVariety (LWW), addLot, softDeleteVariety.

i18n: detail/edit/addLot strings (ES/EN); switched slang to {param} braces
interpolation (translator- and Weblate-friendly).

Tests: repository (reactive watchVariety, update, soft-delete) and widget tests
(render, edit updates title, add-lot appears, delete shows not-found). Full
suite green: 23 passing, 1 skipped (SQLCipher-only encryption guard).
2026-07-07 15:56:03 +02:00
040f15a898 feat(block1): inventory walking skeleton + first quick-add slice
Stand up the Tanemaki monorepo and the first end-to-end vertical slice of
Block 1 (offline, encrypted inventory): add a seed → see it in a categorized,
searchable list → it persists → reopen and it's still there.

Architecture (state management like G1nkgo, adapted to Tane's reality):
- flutter_bloc (Cubit-first), but the encrypted Drift DB is the single source
  of truth; cubits stream from repositories (no hydrated_bloc/Hive, which would
  write plaintext at rest).
- get_it composition root; go_router; slang i18n (ES/EN, Weblate-friendly JSON).

Workspace & core:
- pub workspace: packages/commons_core (pure Dart) + apps/app_seeds (Flutter).
- commons_core primitives: UUIDv7 IdGen, Hybrid Logical Clock, Quantity value
  type (+ plant-aware QuantityKind), IdentityService root-seed stub.

Data & security:
- Drift schemaVersion=1 with all 10 Block-1 tables + common CRDT columns
  (HLC updated_at, last_author, tombstones); Movement append-only.
- SQLCipher via an injectable executor that refuses to open a plaintext DB;
  DB key + root seed in the OS keystore (separate secrets).
- Exported drift_schema_v1.json + migration scaffold.

Tests (near-TDD; nothing merges without tests):
- commons_core units (24), Drift migration test, "no plaintext at rest"
  security guard (runs where SQLCipher is present, skips otherwise),
  repository, widget, full quick-add flow, file-reopen persistence, and a
  no-hardcoded-strings i18n guard. GitLab CI: format + analyze + test + coverage.

Follow-on Block-1 stories (item detail/edit, species catalog, germination UI)
and all of Block 2 remain out of scope.
2026-07-07 15:16:14 +02:00
57c0eeadaf Before code 2026-07-07 13:20:00 +02:00
23c12ac60c Handoff: CLAUDE.md, AGPL-3.0 LICENSE, first-sprint plan; reconcile docs (one-key identity, Nostr, AGPL, varilla/Kew SID, blockchain nuance) 2026-07-07 11:43:20 +02:00
465bef8691 Note optional Darwin Core / GBIF / ALA biodiversity-portal bridge as a deferred, opt-in intention (open-decisions C + data-notes 3-bis), with privacy guardrails; not a phase or model change 2026-07-07 11:38:51 +02:00
e4ccffe168 Fix naming (Seedks->Tanemaki) in PLAN; reconcile data-model with core/domain boundary (Plantare->Pledge, Movement->LedgerEntry notes); fix quantity_label type nit; note social layer as one indivisible block in VISION; add seedks.ttf asset 2026-07-07 11:06:38 +02:00
8286d1fec8 Add VISION and design docs (backup/recovery, G1 integration, network trust, security/privacy, open decisions); update domain boundary and data notes 2026-07-07 10:49:44 +02:00
59beadc03c Add core/domain boundary doc; clarify lots (mixed year/unit per variety) 2026-07-07 01:49:35 +02:00
86b0c4d251 Add design docs; update README/PLAN 2026-07-07 01:28:54 +02:00
ce3a3da81f Rename to Tanemaki (Tane); domain tanemaki.app; package id org.comunes.tane 2026-07-07 00:40:39 +02:00
b08d384089 Initial import: mockups, visual identity, stock photos, project plan, README 2026-07-06 23:58:31 +02:00