{
  "page_ir": {
    "page_id": "history",
    "page_goal": "Display paginated calculation history with sortable/filterable table, BMI/weight trend chart with category zone bands, inline note editing, soft-delete, and CSV/PDF export",
    "style": {
      "tone": "informational",
      "theme": "light",
      "density": "comfortable",
      "color_intent": "Use category color codes for badges; primary blue for actions"
    },
    "accessibility": {
      "required_labels": [
        "Date range filter",
        "Search calculations",
        "BMI history table",
        "BMI trend chart",
        "Export options",
        "Edit notes",
        "Delete calculation"
      ],
      "skip_navigation": true,
      "focus_management": true,
      "announce_changes": []
    },
    "responsive": {
      "breakpoints": {
        "xs": 480,
        "sm": 576,
        "md": 768,
        "lg": 992,
        "xl": 1200
      },
      "collapse_rules": [
        "Chart stacks above table on screens < md",
        "Filter controls stack vertically on screens < sm",
        "Table scrolls horizontally on screens < md"
      ],
      "hidden_on_small": [
        "export_dropdown"
      ],
      "stack_on_small": []
    },
    "constraints": [
      "User must be authenticated to view this page",
      "Only show calculations belonging to appContext.currentUser",
      "Soft-deleted records are excluded from the list"
    ],
    "seo_title": null,
    "seo_description": null
  },
  "data_ir": {
    "types": {},
    "state": {
      "calculations": {
        "type": "array",
        "initial": [],
        "required": true,
        "constraints": {},
        "item_type": null
      },
      "calculationsTotal": {
        "type": "number",
        "initial": 0,
        "required": false,
        "constraints": {},
        "item_type": null
      },
      "loading": {
        "type": "boolean",
        "initial": false,
        "required": false,
        "constraints": {},
        "item_type": null
      },
      "currentPage": {
        "type": "number",
        "initial": 1,
        "required": false,
        "constraints": {
          "min": 1
        },
        "item_type": null
      },
      "pageSize": {
        "type": "number",
        "initial": 10,
        "required": false,
        "constraints": {
          "min": 10,
          "max": 20
        },
        "item_type": null
      },
      "sortField": {
        "type": "string",
        "initial": "calculated_at",
        "required": false,
        "constraints": {},
        "item_type": null
      },
      "sortOrder": {
        "type": "string",
        "initial": "descend",
        "required": false,
        "constraints": {},
        "item_type": null
      },
      "searchText": {
        "type": "string",
        "initial": "",
        "required": false,
        "constraints": {},
        "item_type": null
      },
      "dateRange": {
        "type": "array",
        "initial": null,
        "required": false,
        "constraints": {},
        "item_type": null
      },
      "chartMode": {
        "type": "enum",
        "initial": "bmi",
        "required": false,
        "constraints": {
          "values": [
            "bmi",
            "weight"
          ]
        },
        "item_type": null
      },
      "editModalVisible": {
        "type": "boolean",
        "initial": false,
        "required": false,
        "constraints": {},
        "item_type": null
      },
      "deleteModalVisible": {
        "type": "boolean",
        "initial": false,
        "required": false,
        "constraints": {},
        "item_type": null
      },
      "selectedCalculation": {
        "type": "object",
        "initial": null,
        "required": false,
        "constraints": {},
        "item_type": null
      }
    },
    "derived": {
      "paginationOffset": {
        "type": "number",
        "expr": "(state.currentPage - 1) * state.pageSize",
        "deps": []
      },
      "chartData": {
        "type": "array",
        "expr": "state.calculations.map(c => ({ date: c.calculated_at, bmi: c.bmi_value, weight: c.weight_kg, category: c.bmi_category }))",
        "deps": []
      }
    }
  },
  "data_fetch_ir": {
    "endpoints": {
      "96ef8e53e8d0454ca6c98b2cbcc4274f": {
        "endpoint_id": "96ef8e53e8d0454ca6c98b2cbcc4274f",
        "module": "BMI Calculation",
        "endpoint": "/bmi/calculations",
        "method": "GET",
        "path_params": {},
        "query_params": {
          "limit": "$state.pageSize",
          "offset": "$derived.paginationOffset",
          "user_id": "$appContext.currentUser.userId",
          "is_deleted": false
        },
        "body": null,
        "fields": [
          "id",
          "calculation_id",
          "user_id",
          "height_cm",
          "weight_kg",
          "bmi_value",
          "bmi_category",
          "category_id",
          "unit",
          "calculated_at",
          "notes",
          "is_deleted",
          "created_at",
          "updated_at"
        ],
        "response_target": "calculations",
        "response_transform": null,
        "trigger": "on_mount",
        "depends_on": [],
        "debounce_ms": null,
        "loading_field": null,
        "error_field": null
      },
      "5277950c14e44371bc48dab3cfde7460": {
        "endpoint_id": "5277950c14e44371bc48dab3cfde7460",
        "module": "BMI Calculation",
        "endpoint": "/bmi/categories",
        "method": "GET",
        "path_params": {},
        "query_params": {
          "limit": 50,
          "offset": 0
        },
        "body": null,
        "fields": [
          "id",
          "category_id",
          "category_name",
          "min_bmi",
          "max_bmi",
          "color_code"
        ],
        "response_target": "categories",
        "response_transform": null,
        "trigger": "on_mount",
        "depends_on": [],
        "debounce_ms": null,
        "loading_field": null,
        "error_field": null
      },
      "1fc4b29b9d234254947659082484c92e": {
        "endpoint_id": "1fc4b29b9d234254947659082484c92e",
        "module": "BMI Calculation",
        "endpoint": "/bmi/calculations/{calculation_id}",
        "method": "PUT",
        "path_params": {
          "calculation_id": "$state.selectedCalculation.calculation_id"
        },
        "query_params": {},
        "body": null,
        "fields": [
          "id",
          "calculation_id",
          "notes",
          "updated_at"
        ],
        "response_target": "updateCalculationNotes_data",
        "response_transform": null,
        "trigger": "manual",
        "depends_on": [],
        "debounce_ms": null,
        "loading_field": null,
        "error_field": null
      },
      "87da7eb50269421c8ffaf313131b0189": {
        "endpoint_id": "87da7eb50269421c8ffaf313131b0189",
        "module": "BMI Calculation",
        "endpoint": "/bmi/calculations/{calculation_id}",
        "method": "DELETE",
        "path_params": {
          "calculation_id": "$state.selectedCalculation.calculation_id"
        },
        "query_params": {},
        "body": null,
        "fields": [],
        "response_target": "softDeleteCalculation_data",
        "response_transform": null,
        "trigger": "manual",
        "depends_on": [],
        "debounce_ms": null,
        "loading_field": null,
        "error_field": null
      }
    }
  },
  "data_model_ir": {
    "entities": {
      "bmi_calculation": {
        "name": "BMI Calculation",
        "backend_module": "BMI Calculation",
        "fields": [
          "id",
          "calculation_id",
          "user_id",
          "height_cm",
          "weight_kg",
          "bmi_value",
          "bmi_category",
          "category_id",
          "unit",
          "calculated_at",
          "notes",
          "is_deleted",
          "created_at",
          "updated_at"
        ],
        "computed": [],
        "display_fields": [
          "calculated_at",
          "height_cm",
          "weight_kg",
          "bmi_value",
          "bmi_category",
          "notes"
        ],
        "search_fields": [
          "notes"
        ],
        "filters": [
          "user_id",
          "is_deleted"
        ],
        "default_sort": null,
        "default_sort_dir": "asc"
      },
      "bmi_category": {
        "name": "BMI Category",
        "backend_module": "BMI Calculation",
        "fields": [
          "id",
          "category_id",
          "category_name",
          "min_bmi",
          "max_bmi",
          "description",
          "color_code",
          "health_risk",
          "recommendations",
          "created_at",
          "updated_at"
        ],
        "computed": [],
        "display_fields": [
          "category_name",
          "color_code",
          "min_bmi",
          "max_bmi"
        ],
        "search_fields": [],
        "filters": [],
        "default_sort": null,
        "default_sort_dir": "asc"
      }
    },
    "relationships": []
  },
  "behaviour_ir": {
    "events": {
      "onPageChange": {
        "type": "mutation",
        "updates": [
          {
            "target": "state.currentPage",
            "expr": "event.page"
          },
          {
            "target": "state.pageSize",
            "expr": "event.pageSize"
          }
        ],
        "description": ""
      },
      "onSortChange": {
        "type": "mutation",
        "updates": [
          {
            "target": "state.sortField",
            "expr": "event.field"
          },
          {
            "target": "state.sortOrder",
            "expr": "event.order"
          }
        ],
        "description": ""
      },
      "onSearchChange": {
        "type": "mutation",
        "updates": [
          {
            "target": "state.searchText",
            "expr": "event.value"
          },
          {
            "target": "state.currentPage",
            "expr": "1"
          }
        ],
        "description": ""
      },
      "onDateRangeChange": {
        "type": "mutation",
        "updates": [
          {
            "target": "state.dateRange",
            "expr": "event.dates"
          },
          {
            "target": "state.currentPage",
            "expr": "1"
          }
        ],
        "description": ""
      },
      "onChartModeToggle": {
        "type": "mutation",
        "updates": [
          {
            "target": "state.chartMode",
            "expr": "state.chartMode === 'bmi' ? 'weight' : 'bmi'"
          }
        ],
        "description": ""
      },
      "onEditModalOpen": {
        "type": "mutation",
        "updates": [
          {
            "target": "state.selectedCalculation",
            "expr": "event.record"
          },
          {
            "target": "state.editModalVisible",
            "expr": "true"
          }
        ],
        "description": ""
      },
      "onEditModalClose": {
        "type": "mutation",
        "updates": [
          {
            "target": "state.editModalVisible",
            "expr": "false"
          },
          {
            "target": "state.selectedCalculation",
            "expr": "null"
          }
        ],
        "description": ""
      },
      "onDeleteModalOpen": {
        "type": "mutation",
        "updates": [
          {
            "target": "state.selectedCalculation",
            "expr": "event.record"
          },
          {
            "target": "state.deleteModalVisible",
            "expr": "true"
          }
        ],
        "description": ""
      },
      "onDeleteModalClose": {
        "type": "mutation",
        "updates": [
          {
            "target": "state.deleteModalVisible",
            "expr": "false"
          },
          {
            "target": "state.selectedCalculation",
            "expr": "null"
          }
        ],
        "description": ""
      }
    },
    "actions": {
      "13c482e4120140fa97139b68e8786f50": {
        "action_id": "13c482e4120140fa97139b68e8786f50",
        "trigger": "button_click",
        "target_component_id": "history_table",
        "operation": "read",
        "description": "",
        "payload": {},
        "guard": null,
        "requires_confirmation": false,
        "confirmation_message": null,
        "validation_rules": [],
        "validation_messages": {},
        "updates": [
          {
            "target": "state.loading",
            "expr": "true"
          }
        ],
        "api_endpoint": "96ef8e53e8d0454ca6c98b2cbcc4274f",
        "api_body": null,
        "side_effects": [],
        "then": null,
        "catch": null,
        "data_action": null
      },
      "7ca9df4baa0a48488efec911262585d8": {
        "action_id": "7ca9df4baa0a48488efec911262585d8",
        "trigger": "form_submit",
        "target_component_id": "edit_notes_modal",
        "operation": "update",
        "description": "",
        "payload": {},
        "guard": null,
        "requires_confirmation": false,
        "confirmation_message": null,
        "validation_rules": [
          {
            "rule_id": "val_0",
            "field": null,
            "type": "custom",
            "value": null,
            "expression": "{\"field\": \"notes\", \"message\": \"Notes must be 500 characters or less\", \"rule_id\": \"val_notes_length\", \"type\": \"max_length\", \"value\": 500}",
            "message": "{\"field\": \"notes\", \"message\": \"Notes must be 500 characters or less\", \"rule_id\": \"val_notes_length\", \"type\": \"max_length\", \"value\": 500}"
          }
        ],
        "validation_messages": {},
        "updates": [
          {
            "target": "state.editModalVisible",
            "expr": "false"
          }
        ],
        "api_endpoint": "1fc4b29b9d234254947659082484c92e",
        "api_body": "{ notes: formValues.notes }",
        "side_effects": [
          {
            "type": "toast",
            "config": {
              "message": "Notes updated successfully",
              "type": "success"
            }
          },
          {
            "type": "refresh",
            "config": {
              "target": "fetchCalculations"
            }
          }
        ],
        "then": null,
        "catch": null,
        "data_action": null
      },
      "92f17a7c2fb94743aba75b129b5c56b3": {
        "action_id": "92f17a7c2fb94743aba75b129b5c56b3",
        "trigger": "button_click",
        "target_component_id": "delete_confirm_modal",
        "operation": "delete",
        "description": "",
        "payload": {},
        "guard": null,
        "requires_confirmation": true,
        "confirmation_message": null,
        "validation_rules": [],
        "validation_messages": {},
        "updates": [
          {
            "target": "state.deleteModalVisible",
            "expr": "false"
          },
          {
            "target": "state.selectedCalculation",
            "expr": "null"
          }
        ],
        "api_endpoint": "87da7eb50269421c8ffaf313131b0189",
        "api_body": null,
        "side_effects": [
          {
            "type": "toast",
            "config": {
              "message": "Calculation deleted",
              "type": "success"
            }
          },
          {
            "type": "refresh",
            "config": {
              "target": "fetchCalculations"
            }
          }
        ],
        "then": null,
        "catch": null,
        "data_action": null
      },
      "f5bc0e3939574572b6da1385e022e8f0": {
        "action_id": "f5bc0e3939574572b6da1385e022e8f0",
        "trigger": "button_click",
        "target_component_id": "export_dropdown",
        "operation": "custom",
        "description": "",
        "payload": {
          "format": "csv"
        },
        "guard": null,
        "requires_confirmation": false,
        "confirmation_message": null,
        "validation_rules": [],
        "validation_messages": {},
        "updates": [],
        "api_endpoint": null,
        "api_body": null,
        "side_effects": [
          {
            "type": "download",
            "config": {
              "format": "csv",
              "filename": "bmi_history_export.csv",
              "data_source": "state.calculations"
            }
          }
        ],
        "then": null,
        "catch": null,
        "data_action": null
      },
      "e2f15718f8b243b5bda4365b6c05bccf": {
        "action_id": "e2f15718f8b243b5bda4365b6c05bccf",
        "trigger": "button_click",
        "target_component_id": "export_dropdown",
        "operation": "custom",
        "description": "",
        "payload": {
          "format": "pdf"
        },
        "guard": null,
        "requires_confirmation": false,
        "confirmation_message": null,
        "validation_rules": [],
        "validation_messages": {},
        "updates": [],
        "api_endpoint": null,
        "api_body": null,
        "side_effects": [
          {
            "type": "download",
            "config": {
              "format": "pdf",
              "filename": "bmi_history_export.pdf",
              "data_source": "state.calculations"
            }
          }
        ],
        "then": null,
        "catch": null,
        "data_action": null
      },
      "926e3280fe9c4b4ebf7655918deb3312": {
        "action_id": "926e3280fe9c4b4ebf7655918deb3312",
        "trigger": "button_click",
        "target_component_id": "nav_calculator_btn",
        "operation": "custom",
        "description": "",
        "payload": {},
        "guard": null,
        "requires_confirmation": false,
        "confirmation_message": null,
        "validation_rules": [],
        "validation_messages": {},
        "updates": [],
        "api_endpoint": null,
        "api_body": null,
        "side_effects": [
          {
            "type": "navigate",
            "config": {
              "path": "/"
            }
          }
        ],
        "then": null,
        "catch": null,
        "data_action": null
      },
      "32f1a5ea84e74619ad78dd5c30cb91cd": {
        "action_id": "32f1a5ea84e74619ad78dd5c30cb91cd",
        "trigger": "button_click",
        "target_component_id": "nav_dashboard_btn",
        "operation": "custom",
        "description": "",
        "payload": {},
        "guard": null,
        "requires_confirmation": false,
        "confirmation_message": null,
        "validation_rules": [],
        "validation_messages": {},
        "updates": [],
        "api_endpoint": null,
        "api_body": null,
        "side_effects": [
          {
            "type": "navigate",
            "config": {
              "path": "/dashboard"
            }
          }
        ],
        "then": null,
        "catch": null,
        "data_action": null
      },
      "e7a5dd6b8e944749a197fbd82a5f98f6": {
        "action_id": "e7a5dd6b8e944749a197fbd82a5f98f6",
        "trigger": "button_click",
        "target_component_id": "nav_goals_btn",
        "operation": "custom",
        "description": "",
        "payload": {},
        "guard": null,
        "requires_confirmation": false,
        "confirmation_message": null,
        "validation_rules": [],
        "validation_messages": {},
        "updates": [],
        "api_endpoint": null,
        "api_body": null,
        "side_effects": [
          {
            "type": "navigate",
            "config": {
              "path": "/goals"
            }
          }
        ],
        "then": null,
        "catch": null,
        "data_action": null
      },
      "7f4cb919dd0e46c4b31431192b8f5f8c": {
        "action_id": "7f4cb919dd0e46c4b31431192b8f5f8c",
        "trigger": "button_click",
        "target_component_id": "nav_profile_btn",
        "operation": "custom",
        "description": "",
        "payload": {},
        "guard": null,
        "requires_confirmation": false,
        "confirmation_message": null,
        "validation_rules": [],
        "validation_messages": {},
        "updates": [],
        "api_endpoint": null,
        "api_body": null,
        "side_effects": [
          {
            "type": "navigate",
            "config": {
              "path": "/profile"
            }
          }
        ],
        "then": null,
        "catch": null,
        "data_action": null
      }
    },
    "feedback": {
      "13c482e4120140fa97139b68e8786f50": {
        "action_id": "13c482e4120140fa97139b68e8786f50",
        "loading_indicator": "spinner",
        "loading_text": null,
        "success_message": null,
        "error_message": "Failed to load calculation history",
        "ui_updates": [
          "state.loading = false"
        ]
      },
      "7ca9df4baa0a48488efec911262585d8": {
        "action_id": "7ca9df4baa0a48488efec911262585d8",
        "loading_indicator": "spinner",
        "loading_text": null,
        "success_message": "Notes updated successfully",
        "error_message": "Failed to update notes",
        "ui_updates": []
      },
      "92f17a7c2fb94743aba75b129b5c56b3": {
        "action_id": "92f17a7c2fb94743aba75b129b5c56b3",
        "loading_indicator": "spinner",
        "loading_text": null,
        "success_message": "Calculation deleted",
        "error_message": "Failed to delete calculation",
        "ui_updates": []
      },
      "f5bc0e3939574572b6da1385e022e8f0": {
        "action_id": "f5bc0e3939574572b6da1385e022e8f0",
        "loading_indicator": "spinner",
        "loading_text": null,
        "success_message": "CSV export started",
        "error_message": "Export failed",
        "ui_updates": []
      },
      "e2f15718f8b243b5bda4365b6c05bccf": {
        "action_id": "e2f15718f8b243b5bda4365b6c05bccf",
        "loading_indicator": "spinner",
        "loading_text": null,
        "success_message": "PDF export started",
        "error_message": "Export failed",
        "ui_updates": []
      },
      "926e3280fe9c4b4ebf7655918deb3312": {
        "action_id": "926e3280fe9c4b4ebf7655918deb3312",
        "loading_indicator": null,
        "loading_text": null,
        "success_message": null,
        "error_message": null,
        "ui_updates": []
      },
      "32f1a5ea84e74619ad78dd5c30cb91cd": {
        "action_id": "32f1a5ea84e74619ad78dd5c30cb91cd",
        "loading_indicator": null,
        "loading_text": null,
        "success_message": null,
        "error_message": null,
        "ui_updates": []
      },
      "e7a5dd6b8e944749a197fbd82a5f98f6": {
        "action_id": "e7a5dd6b8e944749a197fbd82a5f98f6",
        "loading_indicator": null,
        "loading_text": null,
        "success_message": null,
        "error_message": null,
        "ui_updates": []
      },
      "7f4cb919dd0e46c4b31431192b8f5f8c": {
        "action_id": "7f4cb919dd0e46c4b31431192b8f5f8c",
        "loading_indicator": null,
        "loading_text": null,
        "success_message": null,
        "error_message": null,
        "ui_updates": []
      }
    }
  },
  "component_ir": {
    "library": "antd",
    "theme": {
      "primaryColor": "#1677ff",
      "secondaryColor": "#000000",
      "successColor": null,
      "warningColor": null,
      "errorColor": null,
      "fontFamily": "sans-serif",
      "fontSize": null,
      "borderRadius": 6
    },
    "components": {
      "main_container": {
        "type": "div",
        "label": null,
        "description": null,
        "bind": null,
        "onClick": null,
        "onChange": null,
        "onSubmit": null,
        "onHover": null,
        "onKeyPress": null,
        "props": {},
        "dynamic_props": {},
        "styles": {
          "minHeight": "100vh",
          "width": "100%",
          "background": "#f5f5f5",
          "padding": "24px"
        },
        "dynamic_styles": {},
        "class_name": null,
        "dynamic_class": null,
        "transitions": [],
        "visible_when": null,
        "disabled_when": null,
        "repeat": null,
        "slots": {},
        "a11y_role": null,
        "a11y_label": null
      },
      "page_header": {
        "type": "div",
        "label": null,
        "description": null,
        "bind": null,
        "onClick": null,
        "onChange": null,
        "onSubmit": null,
        "onHover": null,
        "onKeyPress": null,
        "props": {},
        "dynamic_props": {},
        "styles": {
          "display": "flex",
          "justifyContent": "space-between",
          "alignItems": "center",
          "marginBottom": "24px"
        },
        "dynamic_styles": {},
        "class_name": null,
        "dynamic_class": null,
        "transitions": [],
        "visible_when": null,
        "disabled_when": null,
        "repeat": null,
        "slots": {},
        "a11y_role": null,
        "a11y_label": null
      },
      "page_title": {
        "type": "Typography.Title",
        "label": "Calculation History",
        "description": null,
        "bind": null,
        "onClick": null,
        "onChange": null,
        "onSubmit": null,
        "onHover": null,
        "onKeyPress": null,
        "props": {
          "level": 2
        },
        "dynamic_props": {},
        "styles": {
          "margin": 0
        },
        "dynamic_styles": {},
        "class_name": null,
        "dynamic_class": null,
        "transitions": [],
        "visible_when": null,
        "disabled_when": null,
        "repeat": null,
        "slots": {},
        "a11y_role": null,
        "a11y_label": null
      },
      "header_actions": {
        "type": "Space",
        "label": null,
        "description": null,
        "bind": null,
        "onClick": null,
        "onChange": null,
        "onSubmit": null,
        "onHover": null,
        "onKeyPress": null,
        "props": {
          "size": "middle"
        },
        "dynamic_props": {},
        "styles": {},
        "dynamic_styles": {},
        "class_name": null,
        "dynamic_class": null,
        "transitions": [],
        "visible_when": null,
        "disabled_when": null,
        "repeat": null,
        "slots": {},
        "a11y_role": null,
        "a11y_label": null
      },
      "nav_calculator_btn": {
        "type": "Button",
        "label": "Calculator",
        "description": null,
        "bind": null,
        "onClick": "navigateToCalculator",
        "onChange": null,
        "onSubmit": null,
        "onHover": null,
        "onKeyPress": null,
        "props": {
          "type": "default",
          "icon": "CalculatorOutlined"
        },
        "dynamic_props": {},
        "styles": {},
        "dynamic_styles": {},
        "class_name": null,
        "dynamic_class": null,
        "transitions": [],
        "visible_when": null,
        "disabled_when": null,
        "repeat": null,
        "slots": {},
        "a11y_role": null,
        "a11y_label": null
      },
      "nav_dashboard_btn": {
        "type": "Button",
        "label": "Dashboard",
        "description": null,
        "bind": null,
        "onClick": "navigateToDashboard",
        "onChange": null,
        "onSubmit": null,
        "onHover": null,
        "onKeyPress": null,
        "props": {
          "type": "default",
          "icon": "DashboardOutlined"
        },
        "dynamic_props": {},
        "styles": {},
        "dynamic_styles": {},
        "class_name": null,
        "dynamic_class": null,
        "transitions": [],
        "visible_when": null,
        "disabled_when": null,
        "repeat": null,
        "slots": {},
        "a11y_role": null,
        "a11y_label": null
      },
      "nav_goals_btn": {
        "type": "Button",
        "label": "Goals",
        "description": null,
        "bind": null,
        "onClick": "navigateToGoals",
        "onChange": null,
        "onSubmit": null,
        "onHover": null,
        "onKeyPress": null,
        "props": {
          "type": "default",
          "icon": "AimOutlined"
        },
        "dynamic_props": {},
        "styles": {},
        "dynamic_styles": {},
        "class_name": null,
        "dynamic_class": null,
        "transitions": [],
        "visible_when": null,
        "disabled_when": null,
        "repeat": null,
        "slots": {},
        "a11y_role": null,
        "a11y_label": null
      },
      "nav_profile_btn": {
        "type": "Button",
        "label": "Profile",
        "description": null,
        "bind": null,
        "onClick": "navigateToProfile",
        "onChange": null,
        "onSubmit": null,
        "onHover": null,
        "onKeyPress": null,
        "props": {
          "type": "default",
          "icon": "UserOutlined"
        },
        "dynamic_props": {},
        "styles": {},
        "dynamic_styles": {},
        "class_name": null,
        "dynamic_class": null,
        "transitions": [],
        "visible_when": null,
        "disabled_when": null,
        "repeat": null,
        "slots": {},
        "a11y_role": null,
        "a11y_label": null
      },
      "chart_card": {
        "type": "Card",
        "label": null,
        "description": null,
        "bind": null,
        "onClick": null,
        "onChange": null,
        "onSubmit": null,
        "onHover": null,
        "onKeyPress": null,
        "props": {
          "title": "BMI Trend"
        },
        "dynamic_props": {},
        "styles": {
          "marginBottom": "24px"
        },
        "dynamic_styles": {},
        "class_name": null,
        "dynamic_class": null,
        "transitions": [],
        "visible_when": null,
        "disabled_when": null,
        "repeat": null,
        "slots": {},
        "a11y_role": null,
        "a11y_label": null
      },
      "chart_header_row": {
        "type": "div",
        "label": null,
        "description": null,
        "bind": null,
        "onClick": null,
        "onChange": null,
        "onSubmit": null,
        "onHover": null,
        "onKeyPress": null,
        "props": {},
        "dynamic_props": {},
        "styles": {
          "display": "flex",
          "justifyContent": "flex-end",
          "marginBottom": "16px"
        },
        "dynamic_styles": {},
        "class_name": null,
        "dynamic_class": null,
        "transitions": [],
        "visible_when": null,
        "disabled_when": null,
        "repeat": null,
        "slots": {},
        "a11y_role": null,
        "a11y_label": null
      },
      "chart_mode_toggle": {
        "type": "Radio.Group",
        "label": "Chart View",
        "description": null,
        "bind": "state.chartMode",
        "onClick": "onChartModeToggle",
        "onChange": null,
        "onSubmit": null,
        "onHover": null,
        "onKeyPress": null,
        "props": {
          "optionType": "button",
          "buttonStyle": "solid",
          "options": [
            {
              "label": "BMI Trend",
              "value": "bmi"
            },
            {
              "label": "Weight Trend",
              "value": "weight"
            }
          ]
        },
        "dynamic_props": {},
        "styles": {},
        "dynamic_styles": {},
        "class_name": null,
        "dynamic_class": null,
        "transitions": [],
        "visible_when": null,
        "disabled_when": null,
        "repeat": null,
        "slots": {},
        "a11y_role": null,
        "a11y_label": null
      },
      "trend_chart": {
        "type": "custom:LineChart",
        "label": "BMI/Weight Trend Over Time",
        "description": null,
        "bind": "derived.chartData",
        "onClick": null,
        "onChange": null,
        "onSubmit": null,
        "onHover": null,
        "onKeyPress": null,
        "props": {
          "xField": "date",
          "yField": "state.chartMode === 'bmi' ? 'bmi' : 'weight'",
          "categoryZones": [
            {
              "label": "Underweight",
              "min": 0,
              "max": 18.5,
              "color": "#5B8FF9"
            },
            {
              "label": "Normal",
              "min": 18.5,
              "max": 24.9,
              "color": "#5AD8A6"
            },
            {
              "label": "Overweight",
              "min": 25,
              "max": 29.9,
              "color": "#F6BD16"
            },
            {
              "label": "Obese",
              "min": 30,
              "max": 50,
              "color": "#E8684A"
            }
          ],
          "height": 300,
          "smooth": true,
          "point": {
            "size": 4
          }
        },
        "dynamic_props": {},
        "styles": {
          "width": "100%"
        },
        "dynamic_styles": {},
        "class_name": null,
        "dynamic_class": null,
        "transitions": [],
        "visible_when": null,
        "disabled_when": null,
        "repeat": null,
        "slots": {},
        "a11y_role": null,
        "a11y_label": null
      },
      "table_card": {
        "type": "Card",
        "label": null,
        "description": null,
        "bind": null,
        "onClick": null,
        "onChange": null,
        "onSubmit": null,
        "onHover": null,
        "onKeyPress": null,
        "props": {},
        "dynamic_props": {},
        "styles": {},
        "dynamic_styles": {},
        "class_name": null,
        "dynamic_class": null,
        "transitions": [],
        "visible_when": null,
        "disabled_when": null,
        "repeat": null,
        "slots": {},
        "a11y_role": null,
        "a11y_label": null
      },
      "filter_row": {
        "type": "div",
        "label": null,
        "description": null,
        "bind": null,
        "onClick": null,
        "onChange": null,
        "onSubmit": null,
        "onHover": null,
        "onKeyPress": null,
        "props": {},
        "dynamic_props": {},
        "styles": {
          "display": "flex",
          "justifyContent": "space-between",
          "alignItems": "center",
          "marginBottom": "16px",
          "flexWrap": "wrap",
          "gap": "12px"
        },
        "dynamic_styles": {},
        "class_name": null,
        "dynamic_class": null,
        "transitions": [],
        "visible_when": null,
        "disabled_when": null,
        "repeat": null,
        "slots": {},
        "a11y_role": null,
        "a11y_label": null
      },
      "filter_controls": {
        "type": "Space",
        "label": null,
        "description": null,
        "bind": null,
        "onClick": null,
        "onChange": null,
        "onSubmit": null,
        "onHover": null,
        "onKeyPress": null,
        "props": {
          "size": "middle",
          "wrap": true
        },
        "dynamic_props": {},
        "styles": {},
        "dynamic_styles": {},
        "class_name": null,
        "dynamic_class": null,
        "transitions": [],
        "visible_when": null,
        "disabled_when": null,
        "repeat": null,
        "slots": {},
        "a11y_role": null,
        "a11y_label": null
      },
      "search_input": {
        "type": "Input.Search",
        "label": "Search calculations",
        "description": null,
        "bind": "state.searchText",
        "onClick": null,
        "onChange": null,
        "onSubmit": null,
        "onHover": null,
        "onKeyPress": null,
        "props": {
          "placeholder": "Search notes...",
          "allowClear": true,
          "style": {
            "width": 250
          }
        },
        "dynamic_props": {},
        "styles": {},
        "dynamic_styles": {},
        "class_name": null,
        "dynamic_class": null,
        "transitions": [],
        "visible_when": null,
        "disabled_when": null,
        "repeat": null,
        "slots": {},
        "a11y_role": null,
        "a11y_label": null
      },
      "date_range_picker": {
        "type": "DatePicker.RangePicker",
        "label": "Date range filter",
        "description": null,
        "bind": "state.dateRange",
        "onClick": null,
        "onChange": null,
        "onSubmit": null,
        "onHover": null,
        "onKeyPress": null,
        "props": {
          "format": "YYYY-MM-DD",
          "allowClear": true,
          "placeholder": [
            "Start Date",
            "End Date"
          ]
        },
        "dynamic_props": {},
        "styles": {},
        "dynamic_styles": {},
        "class_name": null,
        "dynamic_class": null,
        "transitions": [],
        "visible_when": null,
        "disabled_when": null,
        "repeat": null,
        "slots": {},
        "a11y_role": null,
        "a11y_label": null
      },
      "export_dropdown": {
        "type": "Dropdown",
        "label": "Export",
        "description": null,
        "bind": null,
        "onClick": null,
        "onChange": null,
        "onSubmit": null,
        "onHover": null,
        "onKeyPress": null,
        "props": {
          "menu": {
            "items": [
              {
                "key": "csv",
                "label": "Export as CSV",
                "icon": "FileExcelOutlined"
              },
              {
                "key": "pdf",
                "label": "Export as PDF",
                "icon": "FilePdfOutlined"
              }
            ]
          },
          "trigger": [
            "click"
          ]
        },
        "dynamic_props": {},
        "styles": {},
        "dynamic_styles": {},
        "class_name": null,
        "dynamic_class": null,
        "transitions": [],
        "visible_when": null,
        "disabled_when": null,
        "repeat": null,
        "slots": {},
        "a11y_role": null,
        "a11y_label": null
      },
      "export_button": {
        "type": "Button",
        "label": "Export",
        "description": null,
        "bind": null,
        "onClick": null,
        "onChange": null,
        "onSubmit": null,
        "onHover": null,
        "onKeyPress": null,
        "props": {
          "type": "primary",
          "icon": "DownloadOutlined"
        },
        "dynamic_props": {},
        "styles": {},
        "dynamic_styles": {},
        "class_name": null,
        "dynamic_class": null,
        "transitions": [],
        "visible_when": null,
        "disabled_when": null,
        "repeat": null,
        "slots": {},
        "a11y_role": null,
        "a11y_label": null
      },
      "history_table": {
        "type": "Table",
        "label": "BMI history table",
        "description": null,
        "bind": "state.calculations",
        "onClick": null,
        "onChange": null,
        "onSubmit": null,
        "onHover": null,
        "onKeyPress": null,
        "props": {
          "rowKey": "calculation_id",
          "loading": "state.loading",
          "columns": [
            {
              "title": "Date",
              "dataIndex": "calculated_at",
              "key": "calculated_at",
              "sorter": true,
              "defaultSortOrder": "descend",
              "render": "date"
            },
            {
              "title": "Height",
              "dataIndex": "height_cm",
              "key": "height_cm",
              "render": "height_with_unit"
            },
            {
              "title": "Weight",
              "dataIndex": "weight_kg",
              "key": "weight_kg",
              "render": "weight_with_unit"
            },
            {
              "title": "BMI Value",
              "dataIndex": "bmi_value",
              "key": "bmi_value",
              "sorter": true,
              "render": "number_1dp"
            },
            {
              "title": "Category",
              "dataIndex": "bmi_category",
              "key": "bmi_category",
              "render": "color_coded_tag"
            },
            {
              "title": "Notes",
              "dataIndex": "notes",
              "key": "notes",
              "ellipsis": true
            },
            {
              "title": "Actions",
              "key": "actions",
              "render": "action_buttons"
            }
          ],
          "pagination": {
            "current": "state.currentPage",
            "pageSize": "state.pageSize",
            "total": "state.calculationsTotal",
            "showSizeChanger": true,
            "pageSizeOptions": [
              "10",
              "15",
              "20"
            ],
            "showTotal": true
          },
          "scroll": {
            "x": 800
          }
        },
        "dynamic_props": {},
        "styles": {},
        "dynamic_styles": {},
        "class_name": null,
        "dynamic_class": null,
        "transitions": [],
        "visible_when": null,
        "disabled_when": null,
        "repeat": null,
        "slots": {},
        "a11y_role": null,
        "a11y_label": null
      },
      "edit_action_btn": {
        "type": "Button",
        "label": "Edit Notes",
        "description": null,
        "bind": null,
        "onClick": "onEditModalOpen",
        "onChange": null,
        "onSubmit": null,
        "onHover": null,
        "onKeyPress": null,
        "props": {
          "type": "link",
          "icon": "EditOutlined",
          "size": "small"
        },
        "dynamic_props": {},
        "styles": {},
        "dynamic_styles": {},
        "class_name": null,
        "dynamic_class": null,
        "transitions": [],
        "visible_when": null,
        "disabled_when": null,
        "repeat": null,
        "slots": {},
        "a11y_role": null,
        "a11y_label": null
      },
      "delete_action_btn": {
        "type": "Button",
        "label": "Delete",
        "description": null,
        "bind": null,
        "onClick": "onDeleteModalOpen",
        "onChange": null,
        "onSubmit": null,
        "onHover": null,
        "onKeyPress": null,
        "props": {
          "type": "link",
          "danger": true,
          "icon": "DeleteOutlined",
          "size": "small"
        },
        "dynamic_props": {},
        "styles": {},
        "dynamic_styles": {},
        "class_name": null,
        "dynamic_class": null,
        "transitions": [],
        "visible_when": null,
        "disabled_when": null,
        "repeat": null,
        "slots": {},
        "a11y_role": null,
        "a11y_label": null
      },
      "edit_notes_modal": {
        "type": "Modal",
        "label": "Edit Notes",
        "description": null,
        "bind": "state.editModalVisible",
        "onClick": null,
        "onChange": null,
        "onSubmit": null,
        "onHover": null,
        "onKeyPress": null,
        "props": {
          "title": "Edit Calculation Notes",
          "okText": "Save",
          "cancelText": "Cancel",
          "destroyOnClose": true
        },
        "dynamic_props": {},
        "styles": {},
        "dynamic_styles": {},
        "class_name": null,
        "dynamic_class": null,
        "transitions": [],
        "visible_when": null,
        "disabled_when": null,
        "repeat": null,
        "slots": {},
        "a11y_role": null,
        "a11y_label": null
      },
      "edit_notes_form": {
        "type": "Form",
        "label": null,
        "description": null,
        "bind": null,
        "onClick": "saveNotes",
        "onChange": null,
        "onSubmit": null,
        "onHover": null,
        "onKeyPress": null,
        "props": {
          "layout": "vertical",
          "initialValues": {
            "notes": "state.selectedCalculation?.notes"
          }
        },
        "dynamic_props": {},
        "styles": {},
        "dynamic_styles": {},
        "class_name": null,
        "dynamic_class": null,
        "transitions": [],
        "visible_when": null,
        "disabled_when": null,
        "repeat": null,
        "slots": {},
        "a11y_role": null,
        "a11y_label": null
      },
      "notes_field": {
        "type": "Form.Item",
        "label": "Notes",
        "description": null,
        "bind": null,
        "onClick": null,
        "onChange": null,
        "onSubmit": null,
        "onHover": null,
        "onKeyPress": null,
        "props": {
          "name": "notes",
          "rules": [
            {
              "max": 500,
              "message": "Notes must be 500 characters or less"
            }
          ]
        },
        "dynamic_props": {},
        "styles": {},
        "dynamic_styles": {},
        "class_name": null,
        "dynamic_class": null,
        "transitions": [],
        "visible_when": null,
        "disabled_when": null,
        "repeat": null,
        "slots": {},
        "a11y_role": null,
        "a11y_label": null
      },
      "notes_textarea": {
        "type": "Input.TextArea",
        "label": null,
        "description": null,
        "bind": null,
        "onClick": null,
        "onChange": null,
        "onSubmit": null,
        "onHover": null,
        "onKeyPress": null,
        "props": {
          "rows": 4,
          "maxLength": 500,
          "showCount": true,
          "placeholder": "Add notes about this calculation..."
        },
        "dynamic_props": {},
        "styles": {},
        "dynamic_styles": {},
        "class_name": null,
        "dynamic_class": null,
        "transitions": [],
        "visible_when": null,
        "disabled_when": null,
        "repeat": null,
        "slots": {},
        "a11y_role": null,
        "a11y_label": null
      },
      "delete_confirm_modal": {
        "type": "Modal",
        "label": "Delete Confirmation",
        "description": null,
        "bind": "state.deleteModalVisible",
        "onClick": null,
        "onChange": null,
        "onSubmit": null,
        "onHover": null,
        "onKeyPress": null,
        "props": {
          "title": "Delete Calculation",
          "okText": "Delete",
          "okButtonProps": {
            "danger": true
          },
          "cancelText": "Cancel"
        },
        "dynamic_props": {},
        "styles": {},
        "dynamic_styles": {},
        "class_name": null,
        "dynamic_class": null,
        "transitions": [],
        "visible_when": null,
        "disabled_when": null,
        "repeat": null,
        "slots": {},
        "a11y_role": null,
        "a11y_label": null
      },
      "delete_confirm_content": {
        "type": "Typography.Text",
        "label": "Are you sure you want to delete this calculation? This action can be undone by an administrator.",
        "description": null,
        "bind": null,
        "onClick": null,
        "onChange": null,
        "onSubmit": null,
        "onHover": null,
        "onKeyPress": null,
        "props": {},
        "dynamic_props": {},
        "styles": {},
        "dynamic_styles": {},
        "class_name": null,
        "dynamic_class": null,
        "transitions": [],
        "visible_when": null,
        "disabled_when": null,
        "repeat": null,
        "slots": {},
        "a11y_role": null,
        "a11y_label": null
      },
      "delete_confirm_details": {
        "type": "Descriptions",
        "label": null,
        "description": null,
        "bind": "state.selectedCalculation",
        "onClick": null,
        "onChange": null,
        "onSubmit": null,
        "onHover": null,
        "onKeyPress": null,
        "props": {
          "column": 1,
          "size": "small",
          "bordered": true,
          "items": [
            {
              "label": "Date",
              "field": "calculated_at"
            },
            {
              "label": "BMI",
              "field": "bmi_value"
            },
            {
              "label": "Category",
              "field": "bmi_category"
            }
          ]
        },
        "dynamic_props": {},
        "styles": {
          "marginTop": "16px"
        },
        "dynamic_styles": {},
        "class_name": null,
        "dynamic_class": null,
        "transitions": [],
        "visible_when": null,
        "disabled_when": null,
        "repeat": null,
        "slots": {},
        "a11y_role": null,
        "a11y_label": null
      }
    }
  },
  "layout_ir": {
    "root": "main_container",
    "children": {
      "main_container": [
        "page_header",
        "chart_card",
        "table_card",
        "edit_notes_modal",
        "delete_confirm_modal"
      ],
      "page_header": [
        "page_title",
        "header_actions"
      ],
      "header_actions": [
        "nav_calculator_btn",
        "nav_dashboard_btn",
        "nav_goals_btn",
        "nav_profile_btn"
      ],
      "chart_card": [
        "chart_header_row",
        "trend_chart"
      ],
      "chart_header_row": [
        "chart_mode_toggle"
      ],
      "table_card": [
        "filter_row",
        "history_table"
      ],
      "filter_row": [
        "filter_controls",
        "export_dropdown"
      ],
      "filter_controls": [
        "search_input",
        "date_range_picker"
      ],
      "export_dropdown": [
        "export_button"
      ],
      "edit_notes_modal": [
        "edit_notes_form"
      ],
      "edit_notes_form": [
        "notes_field"
      ],
      "notes_field": [
        "notes_textarea"
      ],
      "delete_confirm_modal": [
        "delete_confirm_content",
        "delete_confirm_details"
      ]
    },
    "layout": {
      "main_container": {
        "type": "vertical",
        "gap": 0,
        "padding": null,
        "columns": null,
        "column_template": null,
        "row_template": null,
        "align_items": null,
        "justify_content": null,
        "wrap": false,
        "min_height": null,
        "overflow": null
      },
      "page_header": {
        "type": "horizontal",
        "gap": 16,
        "padding": null,
        "columns": null,
        "column_template": null,
        "row_template": null,
        "align_items": null,
        "justify_content": null,
        "wrap": false,
        "min_height": null,
        "overflow": null
      },
      "header_actions": {
        "type": "horizontal",
        "gap": 8,
        "padding": null,
        "columns": null,
        "column_template": null,
        "row_template": null,
        "align_items": null,
        "justify_content": null,
        "wrap": false,
        "min_height": null,
        "overflow": null
      },
      "chart_card": {
        "type": "vertical",
        "gap": 0,
        "padding": null,
        "columns": null,
        "column_template": null,
        "row_template": null,
        "align_items": null,
        "justify_content": null,
        "wrap": false,
        "min_height": null,
        "overflow": null
      },
      "chart_header_row": {
        "type": "horizontal",
        "gap": 8,
        "padding": null,
        "columns": null,
        "column_template": null,
        "row_template": null,
        "align_items": null,
        "justify_content": null,
        "wrap": false,
        "min_height": null,
        "overflow": null
      },
      "table_card": {
        "type": "vertical",
        "gap": 0,
        "padding": null,
        "columns": null,
        "column_template": null,
        "row_template": null,
        "align_items": null,
        "justify_content": null,
        "wrap": false,
        "min_height": null,
        "overflow": null
      },
      "filter_row": {
        "type": "horizontal",
        "gap": 12,
        "padding": null,
        "columns": null,
        "column_template": null,
        "row_template": null,
        "align_items": null,
        "justify_content": null,
        "wrap": false,
        "min_height": null,
        "overflow": null
      },
      "filter_controls": {
        "type": "horizontal",
        "gap": 12,
        "padding": null,
        "columns": null,
        "column_template": null,
        "row_template": null,
        "align_items": null,
        "justify_content": null,
        "wrap": false,
        "min_height": null,
        "overflow": null
      },
      "export_dropdown": {
        "type": "vertical",
        "gap": 0,
        "padding": null,
        "columns": null,
        "column_template": null,
        "row_template": null,
        "align_items": null,
        "justify_content": null,
        "wrap": false,
        "min_height": null,
        "overflow": null
      },
      "edit_notes_modal": {
        "type": "vertical",
        "gap": 16,
        "padding": null,
        "columns": null,
        "column_template": null,
        "row_template": null,
        "align_items": null,
        "justify_content": null,
        "wrap": false,
        "min_height": null,
        "overflow": null
      },
      "edit_notes_form": {
        "type": "vertical",
        "gap": 16,
        "padding": null,
        "columns": null,
        "column_template": null,
        "row_template": null,
        "align_items": null,
        "justify_content": null,
        "wrap": false,
        "min_height": null,
        "overflow": null
      },
      "notes_field": {
        "type": "vertical",
        "gap": 0,
        "padding": null,
        "columns": null,
        "column_template": null,
        "row_template": null,
        "align_items": null,
        "justify_content": null,
        "wrap": false,
        "min_height": null,
        "overflow": null
      },
      "delete_confirm_modal": {
        "type": "vertical",
        "gap": 12,
        "padding": null,
        "columns": null,
        "column_template": null,
        "row_template": null,
        "align_items": null,
        "justify_content": null,
        "wrap": false,
        "min_height": null,
        "overflow": null
      }
    },
    "layout_zones": [
      {
        "zone_id": "zone_page_header",
        "component": "page_header",
        "anchor": "top-left",
        "size_hint": "full-width",
        "z_layer": "base",
        "notes": "Page title and navigation buttons"
      },
      {
        "zone_id": "zone_chart",
        "component": "chart_card",
        "anchor": "center",
        "size_hint": "full-width",
        "z_layer": "base",
        "notes": "BMI/Weight trend line chart with category zone bands"
      },
      {
        "zone_id": "zone_table",
        "component": "table_card",
        "anchor": "center",
        "size_hint": "full-width",
        "z_layer": "base",
        "notes": "Filterable, sortable, paginated history table"
      },
      {
        "zone_id": "zone_edit_modal",
        "component": "edit_notes_modal",
        "anchor": "center",
        "size_hint": "auto",
        "z_layer": "overlay",
        "notes": "Modal for editing calculation notes"
      },
      {
        "zone_id": "zone_delete_modal",
        "component": "delete_confirm_modal",
        "anchor": "center",
        "size_hint": "auto",
        "z_layer": "overlay",
        "notes": "Confirmation modal for soft-deleting a calculation"
      }
    ],
    "responsive_overrides": []
  },
  "navigation_ir": {
    "tabs": [],
    "modals": {},
    "drawers": {},
    "routes": [],
    "breadcrumb": null,
    "default_tab": null
  },
  "realtime_ir": {
    "timers": {},
    "polling": {}
  },
  "metadata": {
    "ir_version": "3.5",
    "generated_at": "",
    "source_prompt": null,
    "schema_session_id": null,
    "warnings": []
  },
  "page_data_contract": null,
  "schema_ir": null
}
