feat(calendar): "what's due this month" — dedicated screen + inventory filter

Reuses the existing per-variety crop-calendar masks (sow/transplant/
flowering/fruiting/seed-harvest) — no schema change, no migration — to
answer "qué toca este mes" across the whole inventory. Since the months
are the grower's own record, there's no hemisphere assumption.

- Repo: CalendarEntry + watchCalendar() (varieties with any recorded
  phase); VarietyListItem now carries sowMonths.
- Dedicated CalendarScreen (/calendar): a month strip (defaults to the
  current month, intl month names) and varieties grouped by phase —
  actions (sow/transplant/harvest seed) above informational (flowering/
  fruiting), each tinted, tap → variety detail; empty-month state.
- Inventory filter: a 'this month' chip (shown only when some variety
  has a calendar) keeps what sows in the current month; folded into the
  attributes group + clear-filters.
- Entry points: a live Home card + a drawer item.
- i18n calendar block + menu.calendar (en/es/pt/ast).
- Tests: calendar_test (watchCalendar, list carries sow-months, pure
  filter), calendar_screen_test (phase grouping, month switch, empty),
  plus the screen added to the small-screen overflow guard.
This commit is contained in:
vjrj 2026-07-11 06:27:57 +02:00
parent 28e8318026
commit 171daabce3
19 changed files with 681 additions and 5 deletions

View file

@ -39,6 +39,7 @@ class TranslationsAst extends Translations with BaseTranslations<AppLocale, Tran
TranslationsAst $copyWith({TranslationMetadata<AppLocale, Translations>? meta}) => TranslationsAst(meta: meta ?? this.$meta);
// Translations
@override late final _Translations$calendar$ast calendar = _Translations$calendar$ast._(_root);
@override late final _Translations$app$ast app = _Translations$app$ast._(_root);
@override late final _Translations$bootstrap$ast bootstrap = _Translations$bootstrap$ast._(_root);
@override late final _Translations$common$ast common = _Translations$common$ast._(_root);
@ -81,6 +82,19 @@ class TranslationsAst extends Translations with BaseTranslations<AppLocale, Tran
@override late final _Translations$sale$ast sale = _Translations$sale$ast._(_root);
}
// Path: calendar
class _Translations$calendar$ast extends Translations$calendar$en {
_Translations$calendar$ast._(TranslationsAst root) : this._root = root, super.internal(root);
final TranslationsAst _root; // ignore: unused_field
// Translations
@override String get title => 'Esti mes';
@override String get homeSubtitle => 'Qué semar y facer agora';
@override String get filterChip => 'Esti mes';
@override String nothing({required Object month}) => 'Nada anotao pa ${month}.';
}
// Path: app
class _Translations$app$ast extends Translations$app$en {
_Translations$app$ast._(TranslationsAst root) : this._root = root, super.internal(root);
@ -161,6 +175,7 @@ class _Translations$menu$ast extends Translations$menu$en {
@override String get following => 'Siguiendo';
@override String get plantares => 'Plantares';
@override String get sales => 'Ventes';
@override String get calendar => 'Calendariu';
@override String get settings => 'Axustes';
}
@ -1208,6 +1223,10 @@ class _Translations$intro$slides$plantare$ast extends Translations$intro$slides$
extension on TranslationsAst {
dynamic _flatMapFunction(String path) {
return switch (path) {
'calendar.title' => 'Esti mes',
'calendar.homeSubtitle' => 'Qué semar y facer agora',
'calendar.filterChip' => 'Esti mes',
'calendar.nothing' => ({required Object month}) => 'Nada anotao pa ${month}.',
'app.title' => 'Tanemaki',
'bootstrap.failed' => 'Tanemaki nun pudo aniciar',
'bootstrap.retry' => 'Reintentar',
@ -1236,6 +1255,7 @@ extension on TranslationsAst {
'menu.following' => 'Siguiendo',
'menu.plantares' => 'Plantares',
'menu.sales' => 'Ventes',
'menu.calendar' => 'Calendariu',
'menu.settings' => 'Axustes',
'settings.language' => 'Llingua',
'settings.systemLanguage' => 'Llingua del sistema',