Skip to content

fix: resolve a large collection of issues and bugs (PR #313 mirror)#9

Merged
erikpt merged 43 commits intomainfrom
erikpt/fix-issue-263-keyboard-dismissal
Mar 14, 2026
Merged

fix: resolve a large collection of issues and bugs (PR #313 mirror)#9
erikpt merged 43 commits intomainfrom
erikpt/fix-issue-263-keyboard-dismissal

Conversation

@erikpt
Copy link
Copy Markdown
Owner

@erikpt erikpt commented Mar 14, 2026

Mirror of upstream PR simonoppowa/OpenNutriTracker#313 — kept in sync on this fork for visibility and testing.

Summary

Bug Fixes

Enhancements

Technical Debt

  • Replaced assert(x != null) + force-unwraps in home_bloc.dart with proper null guards
  • DayRating enum introduced for calorie goal rating colours

Test plan

  • Open Add Meal screen, type in search bar, then tap outside or scroll → keyboard dismisses
  • Search OFF for a product with missing nutriments → results load without crash
  • Onboarding and profile: date picker blocks future dates
  • Set height in imperial mode — cannot scroll above 15 ft
  • Settings (German locale) → "System", "Metrisch (kg, cm, ml)", "Imperial (lbs, ft, oz)"
  • Activities list → Yoga, Circuit Training/HIIT, and vigorous Calisthenics appear
  • Exceed daily kcal goal → dashboard shows "X kcal exceeded" in red
  • Search FDC → kcal resolves from Atwater Specific factors where available
  • Try logging quantity of 0 or > 10,000 → blocked with error
  • Try saving a custom meal with no name → blocked

🤖 Generated with Claude Code

Copilot AI and others added 30 commits December 2, 2025 19:09
…gative macro values

Co-authored-by: erikpt <4423348+erikpt@users.noreply.github.com>
Co-authored-by: erikpt <4423348+erikpt@users.noreply.github.com>
…ation

Co-authored-by: erikpt <4423348+erikpt@users.noreply.github.com>
…ility

Co-authored-by: erikpt <4423348+erikpt@users.noreply.github.com>
… functionality

Co-authored-by: erikpt <4423348+erikpt@users.noreply.github.com>
Co-authored-by: erikpt <4423348+erikpt@users.noreply.github.com>
… Add height/weight validation and prevent negative values

Co-authored-by: erikpt <4423348+erikpt@users.noreply.github.com>
…ity and name validation

Co-authored-by: erikpt <4423348+erikpt@users.noreply.github.com>
Co-authored-by: erikpt <4423348+erikpt@users.noreply.github.com>
Co-authored-by: erikpt <4423348+erikpt@users.noreply.github.com>
… for FDC imports

Co-authored-by: erikpt <4423348+erikpt@users.noreply.github.com>
Co-authored-by: erikpt <4423348+erikpt@users.noreply.github.com>
… UX improvements - next key, error message, and recent list extension

Co-authored-by: erikpt <4423348+erikpt@users.noreply.github.com>
Co-authored-by: erikpt <4423348+erikpt@users.noreply.github.com>
…ve indicator

Co-authored-by: erikpt <4423348+erikpt@users.noreply.github.com>
Co-authored-by: erikpt <4423348+erikpt@users.noreply.github.com>
Co-authored-by: erikpt <4423348+erikpt@users.noreply.github.com>
Fix critical bugs, input validation, and data quality: 23 issues including data loss, negative values, keyboard focus, custom meal search, FDC import validation, duplicate warnings, and UX improvements
Co-authored-by: erikpt <4423348+erikpt@users.noreply.github.com>
Comprehensive analysis and categorization of 136 open issues into prioritized task list with code verification
Fix diary showing zero intake for days at date range boundaries
Fix FDC import: prefer Atwater Specific Factors and validate nutritional data
Revert "Fix FDC import: prefer Atwater Specific Factors and validate nutritional data"
- Add INDEX.md for navigation hub with role-based reading paths
- Add README.md with documentation overview and recommendations
- Add QUICK-REFERENCE.md for quick status checks and decisions
- Add UPDATES.md summarizing all documentation changes
- Add 07-BRANCH-REORGANIZATION-2025-12-03.md detailing branch cleanup
- Update 00-OVERALL-PLAN.md to reflect accurate branch status
  * Clarify 17 issues on main, 3 pending on bugfixes branch
  * Add repository status section
  * Update completion counts

This ensures documentation reflects the current state after moving
PRs #3, #4, #5 from main to erikpt/bugfixes branch.
- Update QUICK-REFERENCE.md to show bugfixes as main working branch
- Update README.md to clarify development workflow
- Update 00-OVERALL-PLAN.md with working branch context
- Update INDEX.md with working branch notice
- Update UPDATES.md with revision history

This clarifies that erikpt/bugfixes is the primary development branch
with 20 completed issues, while main (17 issues) is the stable upstream.
…owa#154)

- Add optional dayToRefresh parameter to RefreshCalendarDayEvent
- Update CalendarDayBloc to use provided date instead of _currentDay
- Pass selected date when refreshing calendar after meal addition

When adding a meal for a future date, the diary now stays on that date
instead of navigating back to today. Previously, the calendar always
refreshed to DateTime.now() causing the view to jump to the current date.

This fix allows the meal_detail_bottom_sheet to pass the selected date
when refreshing the calendar, preserving the user's position in the UI.

Fixes simonoppowa#154
fix: preserve diary date selection when adding meal entries (simonoppowa#154)
erikpt and others added 13 commits December 4, 2025 17:11
- Fix LoadCalendarDayEvent props to include day parameter
  - Previously: List<Object?> get props => [];
  - Now: List<Object?> get props => [day];

This fixes a critical bug where Equatable comparison fails because the
day field is not included in the props list. Events with different dates
would be incorrectly considered equal, leading to duplicate event
processing bugs.

- Add technical debt documentation (09-TECHNICAL-DEBT-FIXES.md)
  - Identifies dummy user data handling
  - Documents rating enum refactoring opportunity
  - Tracks all identified technical debt

Impact: HIGH - Fixes Equatable equality comparison
Severity: CRITICAL - Affects event deduplication logic
- Create new DayRating enum with good/poor values
- Add color methods to enum (getCalendarColor, getTextColor, getTextBackgroundColor)
- Refactor TrackedDayEntity to use rating getter
- Rename private method to _isWithinAcceptableCalorieDifference for clarity
- Remove TODO comment as it's now implemented
- Update technical debt documentation
- Pin Flutter SDK to 3.27.0 via FVM for consistent builds
- Add missing l10n strings: warningLabel, duplicateMealDialogContent
- Update meal_detail_bottom_sheet to use proper l10n keys
- Remove unused intl import from tracked_day_data_source.dart
- Remove unused variable in tracked_day_data_source_test.dart
- Regenerate localization files with intl_translation
- Add intl_translation as dev dependency for l10n generation

All errors resolved - only info-level lints remain (pre-existing)
- Mark simonoppowa#229 (API rate limiting) as COMPLETE
- Mark simonoppowa#125 (Search quality) as COMPLETE
- Mark simonoppowa#212 (Duplicate meal detection) as COMPLETE
- Mark DayRating enum as COMPLETE
- Add 10-STATUS-UPDATE-2025-12-04.md with session summary
- Update INDEX.md with new documents
- Update QUICK-REFERENCE.md with current status
- Update 02-REMAINING-TASKS.md with completed items
fix: resolve technical debt - props bug, DayRating enum, analyzer errors
- Correct 02-INPUT-VALIDATION.md: all items verified complete except simonoppowa#222 (reverted)
- Flag 5 use_build_context_synchronously violations in meal_detail_bottom_sheet.dart
- Correct simonoppowa#229/simonoppowa#125 status: code not found, likely reverted in PR #5
- Document hardcoded validation strings (not localized) as tech debt
- Update QUICK-REFERENCE.md: current branch, active bug, corrected priorities
- UPDATES.md: add March 2026 review session entry
- simonoppowa#213: validate macro values in edit_meal_screen before saving
  - each macro must not exceed base quantity
  - total macros must not exceed base quantity (5% tolerance)
  - kcal must not exceed 9 kcal/g * base quantity
- docs: consolidate .copilot/workitems — remove 10 stale session/PR docs,
  update remaining 5 files to reflect current branch state (2026-03-11)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…simonoppowa#277)

- simonoppowa#235: Show macros (carbs/fat/protein) per meal section header and
  per intake item card on home screen
- simonoppowa#277: Add 'Show Activity Tracking' toggle in Settings; persisted via
  ConfigDBO.showActivityTracking (HiveField 9); ActivityVerticalList
  conditionally rendered on home page based on setting

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add a 'Per Xg/ml' / 'Total' toggle above the nutritional fields in the
edit meal screen. In Total mode, users enter absolute values for the
specified meal quantity; values are converted to per-base-qty before
validation and saving. Meal quantity must be set to use Total mode.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
, simonoppowa#174)

Custom meals are now saved to a dedicated CustomMealBox (Box<MealDBO>)
when the user finishes the edit-meal flow. RecentMealBloc merges these
templates with recent intakes so custom meals appear in the 'Recently
Added' tab even before they are logged for the first time.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…a#182)

- DayInfoWidget now computes calories/macros from actual intake lists
  instead of the stale TrackedDayDBO cache, so 0 kcal never shows
  when food was logged
- CalendarDayBloc reconciles the cache on each day load: if actual kcal
  differs from cached by >0.5, it overwrites the stored values, fixing
  calendar dot colors over time as the user browses past days

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…oppowa#267/simonoppowa#174 complete

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@erikpt erikpt merged commit 3852787 into main Mar 14, 2026
erikpt added a commit that referenced this pull request Mar 15, 2026
…licts

Merges all changes from main (PRs #9, #10):
- Keeps showActivityTracking (field 9), notificationsEnabled (10),
  notificationHour (11), notificationMinute (12) from main
- Adds showMicronutrients at HiveField 13 (renumbered from 9 to avoid collision)
- Merges all l10n keys from both branches in messages_en/de/tr.dart
- Flutter upgraded to stable (3.41.4), mobile_scanner 6→7

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants