# Bugfix Requirements Document

## Introduction

Two related bugs prevent users from fully accessing the visceral fat tracking feature:

1. The "Add Data" screen (the tabbed data entry hub) has no tab or link for waist/visceral fat tracking. Users who navigate to Add Data to log health entries cannot discover or reach the Track Visceral Fat screen from there.

2. On the Track Visceral Fat screen, the height and gender profile prompts never appear for new users. The prompts are conditionally rendered only when `userProfile != null`, but for users who have never saved profile data, the database returns `null` (no row exists). This means the exact users who need these prompts — those without height/gender set — never see them.

## Bug Analysis

### Current Behavior (Defect)

1.1 WHEN the user navigates to the Add Data screen THEN the system displays only three tabs (Weight, Blood Pressure, Mood) with no option to navigate to waist/visceral fat tracking

1.2 WHEN the user has never saved a user profile (no profile row in database) AND navigates to the Track Visceral Fat screen THEN the system does not display the height prompt because `userProfile` is null and the condition `userProfile != null && !userProfile.hasHeight` evaluates to false

1.3 WHEN the user has never saved a user profile (no profile row in database) AND navigates to the Track Visceral Fat screen THEN the system does not display the gender prompt because `userProfile` is null and the condition `userProfile != null && !userProfile.hasGender` evaluates to false

### Expected Behavior (Correct)

2.1 WHEN the user navigates to the Add Data screen THEN the system SHALL display a fourth tab (or navigation option) for waist/visceral fat tracking that navigates to the Track Visceral Fat screen

2.2 WHEN the user has never saved a user profile (no profile row in database) AND navigates to the Track Visceral Fat screen THEN the system SHALL display the height prompt, since having no profile means height has not been set

2.3 WHEN the user has never saved a user profile (no profile row in database) AND navigates to the Track Visceral Fat screen THEN the system SHALL display the gender prompt, since having no profile means gender has not been set

### Unchanged Behavior (Regression Prevention)

3.1 WHEN the user has a saved profile with height set AND navigates to the Track Visceral Fat screen THEN the system SHALL CONTINUE TO hide the height prompt

3.2 WHEN the user has a saved profile with gender set AND navigates to the Track Visceral Fat screen THEN the system SHALL CONTINUE TO hide the gender prompt

3.3 WHEN the user has a saved profile with neither height nor gender set AND navigates to the Track Visceral Fat screen THEN the system SHALL CONTINUE TO show both prompts (this case works correctly when a profile row exists with null fields)

3.4 WHEN the user dismisses the height or gender prompt THEN the system SHALL CONTINUE TO keep the prompt hidden for the remainder of the session

3.5 WHEN the user navigates to the Add Data screen THEN the system SHALL CONTINUE TO display the existing Weight, Blood Pressure, and Mood tabs with their current functionality unchanged
