feat(mobile): modernize dashboard & nav mobile UX - #161
Conversation
Flutter app (apps/mobile-flutter) mobile-UX polish: - Nav drawer: add left-edge swipe-to-open (1:1 finger tracking + fling/ threshold settle), not just the hamburger tap. Light haptic on open. - Haptics audit: tactile cues on the shared NhamButton, the header back button, the drawer open, and the meal FAB (open/close/submit/pick-up/ snap). Weight save now also warns (heavy impact) on rejected input. - Weight input: stack the submit button beneath the field (full-width, thumb-friendly) instead of side-by-side; always label it "Today's weight"; drop the scale icon. - Tap anywhere on empty surface dismisses the keyboard, app-wide (added to the shared Screen primitive, so every screen inherits it). - Dashboard: trim the dead space at the end (no trailing margin on the last section + tighter bottom padding sized to the FAB footprint). - Log-meal FAB is now draggable — pick it up, drop it anywhere; it snaps to the nearest edge and remembers the spot for the session. Lifts/ shadows while held; the meal-input bar re-anchors above/below it. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WrWVKndNCM8jguxsJMvEPP
|
Warning Review limit reached
Next review available in: 49 minutes Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable usage-based reviews in Billing to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please see our Fair Usage Limits Policy for further information, and refer to the rate limits docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds a draggable, session-persistent meal FAB with snap-to-edge behavior and dynamic input bar anchoring. Introduces haptic feedback to buttons, back navigation, and drawer open/swipe gestures. Refactors compact weight log to a vertical layout. Adds tap-to-dismiss keyboard on Screen. Adjusts dashboard scroll padding and section bottom margin handling. ChangesDashboard UX improvements
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
apps/mobile-flutter/lib/features/dashboard/widgets/compact_weight_log.dart (1)
177-180: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winAvoid uppercasing translated copy in code.
toUpperCase()here can produce incorrect text in some locales. Keep the intended casing in the translation itself, or route this through a locale-aware casing helper instead.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/mobile-flutter/lib/features/dashboard/widgets/compact_weight_log.dart` around lines 177 - 180, The translated label in compact_weight_log.dart is being force-uppercased in code, which can break locale-specific text handling. Update the Text usage in the dashboard weight card so it renders the translation from tr('dashboard.weightCard.todaysWeight') without calling toUpperCase(), and if uppercase styling is still required, move that casing into the translation or use a locale-aware helper instead.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/mobile-flutter/lib/shell/tab_scaffold.dart`:
- Around line 100-106: The edge-swipe handling in GestureDetector inside
tab_scaffold.dart is missing cancel handling, which can leave _controller.value
stuck mid-drag. Add onHorizontalDragCancel alongside onHorizontalDragUpdate and
onHorizontalDragEnd, and have it snap the drawer to the nearest open/closed
state using the same _onEdgeDragEnd or equivalent logic so interrupted swipes
always settle cleanly.
---
Nitpick comments:
In `@apps/mobile-flutter/lib/features/dashboard/widgets/compact_weight_log.dart`:
- Around line 177-180: The translated label in compact_weight_log.dart is being
force-uppercased in code, which can break locale-specific text handling. Update
the Text usage in the dashboard weight card so it renders the translation from
tr('dashboard.weightCard.todaysWeight') without calling toUpperCase(), and if
uppercase styling is still required, move that casing into the translation or
use a locale-aware helper instead.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 8f0c8424-6502-452b-b09e-e6ebea1025cf
📒 Files selected for processing (6)
apps/mobile-flutter/lib/features/dashboard/screens/dashboard_screen.dartapps/mobile-flutter/lib/features/dashboard/widgets/compact_weight_log.dartapps/mobile-flutter/lib/features/dashboard/widgets/floating_meal_trigger.dartapps/mobile-flutter/lib/shared/widgets/nham_primitives.dartapps/mobile-flutter/lib/shell/app_header.dartapps/mobile-flutter/lib/shell/tab_scaffold.dart
An interrupted left-edge swipe cancels the horizontal-drag recognizer without firing onHorizontalDragEnd, which could leave the drawer's animation controller stuck mid-position (half-open). Add onHorizontalDragCancel to settle it to the nearest open/closed state. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WrWVKndNCM8jguxsJMvEPP
Summary
A pass of mobile-UX polish on the Flutter app (
apps/mobile-flutter) to make it feel more modern and interactive: swipe-to-open navigation, broader haptic feedback, a cleaner weight input, app-wide tap-to-dismiss keyboard, trimmed dashboard dead space, and a draggable log-meal FAB.Changes
shell/tab_scaffold.dart)NhamButton, the header back button, the drawer open, and the meal FAB (open / close / submit / pick-up / edge-snap). Weight save now also gives a heavy warn-buzz on rejected input. (shared/widgets/nham_primitives.dart,shell/app_header.dart, dashboard widgets)dashboard/widgets/compact_weight_log.dart)Screenprimitive so every screen inherits it. (shared/widgets/nham_primitives.dart)dashboard/screens/dashboard_screen.dart)dashboard/widgets/floating_meal_trigger.dart)Testing
Manual review only — no Flutter SDK is available in this environment, so changes were verified by hand (structure, balanced braces, no unused imports; the repo's lints are non-fatal and no CI runs
flutter analyze). Recommend a localflutter runto confirm the new gestures feel right.Notes
shared_preferencesdependency exists in the project andflutter_secure_storageis meant for secrets, so cross-launch persistence was intentionally skipped. Happy to add it if wanted.🤖 Generated with Claude Code
Generated by Claude Code
Summary by CodeRabbit
New Features
Bug Fixes