Skip to content

improvement: make macro calculations truly reactive and instant #973

Open

Description

@marcuscastelo

Summary

Enhance macro calculations to be truly reactive and update instantly without requiring manual triggers.

Current Behavior

  • Macro calculations update only after Tab/blur events
  • Users must manually trigger updates by pressing Tab
  • No immediate visual feedback during value entry
  • Calculations feel sluggish and non-responsive

Proposed Improvement

Make macro calculations update instantly:

  • Real-time calculation updates as user types
  • Immediate calorie and percentage updates
  • Smooth animations for value changes
  • Debounced updates to avoid excessive calculations
  • Visual indicators during calculation updates

Technical Implementation

  • Implement reactive calculations using SolidJS signals
  • Add debounced input handlers (100-200ms delay)
  • Use createComputed for automatic dependency tracking
  • Add loading states during calculations
  • Optimize calculation performance for real-time updates

Benefits

  • Modern, responsive user experience
  • Immediate feedback improves usability
  • Matches user expectations for modern web apps
  • Better engagement with macro planning
  • Reduced cognitive load for users

Affected Components

  • Macro calculation logic
  • MacroTargets component
  • Macro profile forms and displays

Acceptance Criteria

  • Instant calculation updates during typing
  • Smooth visual transitions for value changes
  • Debounced calculations to avoid performance issues
  • Loading indicators for calculation states
  • Maintains calculation accuracy
  • No performance degradation

Activity

  1. added this to the v0.17.0 milestone on Jul 9, 2025
  2. added
    improvementTechnical debt or general improvement
    uiUI/UX related issue or improvement
    on Jul 9, 2025
  3. modified the milestones: v0.17.0, v0.18.0 on Jul 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    complexity-mediumMedium implementation complexityimprovementTechnical debt or general improvementuiUI/UX related issue or improvement

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions