Skip to content

build error due to exercise & calculation tsx type error#794

Merged
CodeWithCJ merged 5 commits intomainfrom
dev
Mar 1, 2026
Merged

build error due to exercise & calculation tsx type error#794
CodeWithCJ merged 5 commits intomainfrom
dev

Conversation

@CodeWithCJ
Copy link
Owner

Description

Provide a brief summary of your changes.

Related Issue

PR type [x] Issue [ ] New Feature [ ] Documentation
Linked Issue: # #776

Checklist

Please check all that apply:

  • Alignment: I have raised a GitHub issue and it was reviewed/approved by maintainers (required for new features).
  • Tests: I have included automated tests for my changes.
  • Screenshots: I have attached "Before" vs "After" screenshots below (required for UI changes).
  • Quality: I have run npm run lint and npm run format (especially for Frontend).
  • Translations: I have only updated the English (en) translation file (if applicable).
  • Architecture: My code follows the existing architecture standards.
  • Database Security: I have updated rls_policies.sql for any new user-specific tables.
  • Integrity: I certify this is my own work, free of malicious code(phishing, malware, etc.)
  • License: I agree to the License terms.

Screenshots (if applicable)

Before

[Insert screenshot/GIF here]

After

[Insert screenshot/GIF here]

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request primarily focuses on enhancing the frontend build's robustness by integrating pre-build validation steps, including type checking and code formatting. It also resolves specific TypeScript-related build errors affecting exercise and calculation functionalities, and refactors the import structure for certain custom hooks to improve consistency.

Highlights

  • Build Process Enhancement: The frontend build process was updated to include comprehensive validation steps, such as type checking, linting, and format checks, ensuring code quality and preventing build errors.
  • Type Error Resolution: Addressed a build error related to TypeScript type mismatches, specifically impacting exercise and calculation-related components by importing necessary types and refactoring hook imports.
  • Refactored Invalidation Hooks: The import paths for useDiaryInvalidation and useDailyProgressInvalidation were updated in CalculationSettings.tsx, centralizing hook management and improving consistency.
Changelog
  • .github/pull_request_template.md
    • Updated the "Quality" checklist item to refer to npm run build instead of npm run lint and npm run format.
  • SparkyFitnessFrontend/package.json
    • Added new typecheck, format:check, and validate scripts.
    • Modified the build script to execute the validate script before running vite build.
  • SparkyFitnessFrontend/src/api/Exercises/exerciseEntryService.ts
    • Imported the ExerciseProgressData type.
  • SparkyFitnessFrontend/src/pages/Settings/CalculationSettings.tsx
    • Updated the import statement for useDiaryInvalidation and added useDailyProgressInvalidation from a centralized hooks/useInvalidateKeys file.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/ci-tests.yml
Activity
  • The author has confirmed the inclusion of automated tests.
  • Code quality checks, architectural standards, integrity, and license terms have been affirmed by the author.
  • The pull request is linked to issue Flexible Exercise Calorie Adjustments #776.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request addresses build errors by updating npm scripts and fixing type issues. The package.json is updated to include validation steps (type checking, linting, format checking) in the build process, which is a great improvement for code quality. The changes also include fixing type errors by adding a missing import in exerciseEntryService.ts and updating an import path in CalculationSettings.tsx.

My review includes a suggestion to maintain consistency in the package manager used in the PR template and points out a potential bug in CalculationSettings.tsx where a newly added query invalidation hook is not being used, which could lead to stale data being displayed to the user.

CodeWithCJ and others added 4 commits February 28, 2026 21:32
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@CodeWithCJ CodeWithCJ merged commit dfe9610 into main Mar 1, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant