Skip to content

Erikpt/fix a large collection of issues and bugs#313

Open
erikpt wants to merge 44 commits intosimonoppowa:developfrom
erikpt:erikpt/fix-issue-263-keyboard-dismissal
Open

Erikpt/fix a large collection of issues and bugs#313
erikpt wants to merge 44 commits intosimonoppowa:developfrom
erikpt:erikpt/fix-issue-263-keyboard-dismissal

Conversation

@erikpt
Copy link
Copy Markdown

@erikpt erikpt commented Mar 12, 2026

Summary

Bug Fixes

Enhancements

Localisation

New Activities

Technical Debt

  • Replaced assert(x != null) + force-unwraps in home_bloc.dart with proper null guards

Test plan

  • Open Add Meal screen, type in search bar, then tap outside or scroll results → keyboard should dismiss
  • Search for "schnitzel" or "gemischter salat" in OFF tab → results should load (no crash), items with missing nutriments shown as "missing required info"
  • Add a meal; verify no crash when adding a duplicate item
  • Onboarding: date picker should not allow future dates
  • Profile: birthday date picker should not allow future dates
  • Set height in imperial mode, try to scroll above 15 ft → blocked
  • Settings → Units (German locale): should show "System", "Metrisch (kg, cm, ml)", "Imperial (lbs, ft, oz)"
  • Activities list → Yoga, Circuit Training/HIIT, and Calisthenics (vigorous) appear
  • Eat more than your daily kcal goal → dashboard shows "X kcal exceeded" in red instead of "0 kcal left"
  • Search FDC for "Bread, whole-wheat, commercial" → kcal should now resolve from Atwater Specific factors

🤖 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 5 commits December 4, 2025 18:19
- 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
erikpt and others added 6 commits March 13, 2026 23:29
- 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 changed the title Erikpt/fix issue 263 keyboard dismissal Erikpt/fix a large collection of issues and bugs Mar 14, 2026
erikpt added a commit to erikpt/OpenNutriTracker that referenced this pull request Mar 14, 2026
…ssal

fix: resolve a large collection of issues and bugs (PR simonoppowa#313 mirror)
@Elxas866
Copy link
Copy Markdown

Hi @erikpt ,

Thanks for the contribution. I’ve just finished testing this PR locally and noticed a few critical issues that we should address before moving forward:

  • Wrong Target Branch: This PR is currently targeting main. The project’s workflow is set up so that all development and automated CI testing happens on the develop branch. Targeting main bypasses these essential checks and breaks the release flow. Granted, the contribution guide is currently not working, but I do think this would be the correct flow.
  • Redundancy & Conflict: This PR overlaps significantly with my existing PRs (Fix single NULL value leading to empty results #307 and Show "x kcal too much" when exceeding calorie goal by x kcal. #310 ), which have been open for two weeks specifically to fix those bugs.
  • Functional Issues: During my local test of this branch, the bugs I addressed in my earlier PRs are actually still present/unresolved here.
  • Reviewability: This is a very large "monolithic" PR. To keep the codebase stable, it's usually better to merge small, atomic fixes first.

@simonoppowa , I’d suggest merging the dedicated bug fixes (#307 and #310 ) into develop first. This ensures the bugs are actually gone and keeps the CI workflow intact. We can then look at the additional features in this PR separately.

@erikpt erikpt changed the base branch from main to develop March 15, 2026 05:48
@erikpt erikpt marked this pull request as draft March 15, 2026 05:49
Resolved conflicts by:
- Taking upstream develop version for all files modified only by fork-specific
  features (notifications, activity tracking toggle, weekly weight goals, etc.)
- Hand-merging files that contained intentional PR simonoppowa#313 bug fixes:
  height cap, weight minimums/decimals, meal name validation, nutritional
  consistency validation, null-guard in home_bloc, German l10n keys

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@erikpt
Copy link
Copy Markdown
Author

erikpt commented Mar 15, 2026

Thanks for the tip. I cleared the merge conflicts and re-targeted against develop branch and fixed the merge conflicts. I'll try and keep future PRs more atomic.

@erikpt erikpt marked this pull request as ready for review March 15, 2026 07:10
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.

3 participants