Skip to content

Wellness dashboard api#2094

Open
Yuvraj-Sarathe wants to merge 16 commits into
SB2318:mainfrom
Yuvraj-Sarathe:wellness-dashboard-api
Open

Wellness dashboard api#2094
Yuvraj-Sarathe wants to merge 16 commits into
SB2318:mainfrom
Yuvraj-Sarathe:wellness-dashboard-api

Conversation

@Yuvraj-Sarathe

Copy link
Copy Markdown

PR Description

The issue was easy, but I ran into multiple layered errors of pre-existing frontend when I was trying to check my results locally. I have solved those alongside the issue. So please review them as well, and hence, please give me enhanced labels for this PR!

Type of Change

  • Bug fix (change which fixes an issue)
  • New feature (change which adds functionality)
  • Documentation update

Select your work-area

  • Frontend
  • Backend
  • Documentation
  • Others

Related Issue

#2092

Add your Work Example

even though this is a frontend PR, it does not require a screenshot.

Fixes (mention the issue number which this fixes)

#2092

Checklist

  • I have updated my branch and synced it with the project's 'develop' branch before making this PR.
  • I have optimized the file changes.
  • I have added a snapshot of my work example.
  • I have made a PR to the project's development branch.

Undertaking

  • My code follows the style guidelines of this project.

  • I have performed a self-review of my code.

  • I have commented on my code, particularly in hard-to-understand areas.

  • I have made corresponding changes to the documentation.

  • I have checked for plagiarism and ensured its authenticity.

  • I have read and followed the code of conduct for this repository. I understand that violation of this undertaking may have legal consequences.

  • I agree.

…eklyChart, and WellnessDashboardScreen

- ManualLogCard: integrates useLogWellnessMetric mutation and useGetWeeklyWellness query with Zod validation, pre-fills from today's existing data, shows loading state on Save button, displays error alerts
- WeeklyChart: replaces hardcoded data with live API data from useGetWeeklyWellness, adds water/steps metric toggle, shows loading skeleton and empty state
- WellnessDashboardScreen: adds offline banner using Redux isConnected state
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Thank you @, for creating the PR and contributing to our UltimateHealth project 💗.
Our team will review the PR and will reach out to you soon! 😇
Make sure that you have marked all the tasks that you are done with ✅.
Thank you for your patience! 😀

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Automated Review Feedback

Provide actionable comments grouped by severity:

Important

  1. Unnecessary files committed: The files REVIEW.md and DEBUG-FINDINGS.md appear to be audit/review reports. These types of temporary reports or findings documents should generally not be committed to the repository's main branch. Please remove these files from the pull request.
  2. Package Manager Setup Clarity: The package.json has been updated to use yarn run for scripts, which aligns with the presence of yarn.lock. However, the DEBUG-FINDINGS.md report (which this PR addresses) noted that yarn was not globally installed on the audit system. For a consistent developer experience, please ensure that yarn is either a globally installed prerequisite for all contributors, or consider using npm (which ships with Node.js) for all scripts, or leverage corepack enable to manage package manager versions. The current change to yarn run might break for developers who do not have yarn installed globally.

Suggestions

  1. Unused _idx parameter: In frontend/src/screens/WellnessDashboard/WeeklyChart.tsx on line 33, the _idx parameter in the map callback is unused. It can be removed for clarity:
    // Before
    return sorted.map((log, _idx) => {
    // After
    return sorted.map((log) => {
  2. Zod import style inconsistency: In frontend/src/schemas/wellnessSchemas.ts, import { z } from 'zod' is used. For consistency with other schema files in the repository (e.g., profileSchemas.ts), which typically use import * as z from 'zod', consider aligning the import style.
  3. Robust maxValue calculation: In frontend/src/screens/WellnessDashboard/WeeklyChart.tsx on line 47, the maxValue calculation uses Math.max(...chartData.map((d) => d.value), 1). While this is harmless for small arrays (like 7 weekly entries), using the spread operator with Math.max can lead to a stack overflow for very large arrays. A more robust approach for general use would be to use reduce:
    const max = chartData.reduce((max, d) => Math.max(max, d.value), 1);

Maintainer Note:

Once the initial automated feedback has been addressed, maintainer @SB2318 will review the pull request for final evaluation.

@Yuvraj-Sarathe

Copy link
Copy Markdown
Author

Automated Review Feedback

Provide actionable comments grouped by severity:

Important

  1. Unnecessary files committed: The files REVIEW.md and DEBUG-FINDINGS.md appear to be audit/review reports. These types of temporary reports or findings documents should generally not be committed to the repository's main branch. Please remove these files from the pull request.
  2. Package Manager Setup Clarity: The package.json has been updated to use yarn run for scripts, which aligns with the presence of yarn.lock. However, the DEBUG-FINDINGS.md report (which this PR addresses) noted that yarn was not globally installed on the audit system. For a consistent developer experience, please ensure that yarn is either a globally installed prerequisite for all contributors, or consider using npm (which ships with Node.js) for all scripts, or leverage corepack enable to manage package manager versions. The current change to yarn run might break for developers who do not have yarn installed globally.

Suggestions

  1. Unused _idx parameter: In frontend/src/screens/WellnessDashboard/WeeklyChart.tsx on line 33, the _idx parameter in the map callback is unused. It can be removed for clarity:
    // Before
    return sorted.map((log, _idx) => {
    // After
    return sorted.map((log) => {
  2. Zod import style inconsistency: In frontend/src/schemas/wellnessSchemas.ts, import { z } from 'zod' is used. For consistency with other schema files in the repository (e.g., profileSchemas.ts), which typically use import * as z from 'zod', consider aligning the import style.
  3. Robust maxValue calculation: In frontend/src/screens/WellnessDashboard/WeeklyChart.tsx on line 47, the maxValue calculation uses Math.max(...chartData.map((d) => d.value), 1). While this is harmless for small arrays (like 7 weekly entries), using the spread operator with Math.max can lead to a stack overflow for very large arrays. A more robust approach for general use would be to use reduce:
    const max = chartData.reduce((max, d) => Math.max(max, d.value), 1);

Maintainer Note:
Once the initial automated feedback has been addressed, maintainer @SB2318 will review the pull request for final evaluation.

Please re-review!

Also I edited more files due to local bugs i was facing in running my development locally.

Please consider that when assessing my work!

I will also like to request to add PRs like

level:advanced
type:frontend

You currently put level:frontend

@SB2318 please look into this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant