Refactor: Standardize Measurement Precision and Improve UI Layout#915
Refactor: Standardize Measurement Precision and Improve UI Layout#915CodeWithCJ merged 4 commits intomainfrom
Conversation
Summary of ChangesHello, 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 significantly refactors the application's measurement handling to ensure consistent precision and improve data integrity. By centralizing precision rules and storing weights in a single metric unit, the system avoids common floating-point issues and provides a more reliable user experience. Additionally, UI adjustments to input fields enhance usability for entering precise decimal values. Highlights
Changelog
Activity
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
Code Review
This pull request effectively standardizes measurement precision across the application by introducing a centralized configuration in the shared workspace. The refactoring to use a new UnitInput component for weight inputs is well-executed, simplifying various forms and dialogs and ensuring that weight is consistently handled in metric units (kg) in the state, which is a great improvement for data integrity. The changes in services and utility functions to adopt the new precision rules are consistent and complete. My feedback includes a suggestion to improve type safety in the new getPrecision function by avoiding @ts-ignore.
Description
Provide a brief summary of your changes.
Related Issue
PR type [x] Issue [ ] New Feature [ ] Documentation
Linked Issue: # #898
Refactored application-wide measurement handling to ensure consistent 1-decimal precision for weight, body fat, and body measurements.
Key Changes:
10.5 kg) are fully visible.Checklist
Please check all that apply:
pnpm run validate(especially for Frontend).en) translation file (if applicable).rls_policies.sqlfor any new user-specific tables.Screenshots (if applicable)
Before
[Insert screenshot/GIF here]
After
[Insert screenshot/GIF here]