-
Notifications
You must be signed in to change notification settings - Fork 4
feat(medium): Refactor ZoneDistribution and improve theme architecture #7666
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Moved HR zone colors to `lib/theme.ts` under `palette.custom.hrZones`. - Refactored `ZoneDistribution.tsx` to remove verbose comments and simplify color resolution. - Centralized `isTestEnvironment` check in `lib/utils.ts`. - Updated `ZoneDistribution.tsx` to use fixed decimal strings for percentages. - Lazy loaded `ZoneDistribution` in `SessionDetail` and `ExperimentalAnalyticsPage`. - Updated unit tests to match new formatting and stricter type checking. Co-authored-by: arii <342438+arii@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
This PR introduces several positive changes, primarily focused on refactoring the Strengths
Issues and Suggestions
|
Thank you for the review! I have addressed your feedback:
|
Description
This PR addresses architectural feedback on the
ZoneDistributioncomponent and theme management.Key Changes:
custom.hrZonesto the MUI theme inlib/theme.tsto centralize zone colors, removing hardcoded or repetitive logic in components.ZoneDistribution.tsxto remove verbose comments and simplify the color resolution logic usingZONE_COLOR_MAPand the new theme property.__IS_TEST_ENV__check to a shared helperisTestEnvironment()inlib/utils.tsto avoid embedding raw test environment checks in production components.ZoneDistributionto use fixed decimals (e.g., "60.0%") for consistent layout.ZoneDistributionusingnext/dynamicinSessionDetailandExperimentalAnalyticsPage.ZONE_PRIORITYinZoneDistributionto include all enum members, satisfying strict TypeScript checks.Verified with unit tests (
tests/unit/app/client/experimental/components/ZoneDistribution.test.tsx) and frontend verification via Playwright.Fixes #
Change Type: 🏗️ Refactoring (code change that neither fixes bug nor adds feature)
PR Scope Checklist
This checklist is mandatory for all PRs.
Impact Assessment
Original PR Body
This PR addresses architectural feedback on the ZoneDistribution component and theme management.
Key Changes:
custom.hrZonesto the MUI theme inlib/theme.tsto centralize zone colors, removing hardcoded or repetitive logic in components.ZoneDistribution.tsxto remove verbose comments and simplify the color resolution logic usingZONE_COLOR_MAPand the new theme property.__IS_TEST_ENV__check to a shared helperisTestEnvironment()inlib/utils.tsto avoid embedding raw test environment checks in production components.ZoneDistributionto use fixed decimals (e.g., "60.0%") for consistent layout.ZoneDistributionusingnext/dynamicinSessionDetailandExperimentalAnalyticsPage.ZONE_PRIORITYinZoneDistributionto include all enum members, satisfying strict TypeScript checks.Verified with unit tests (
tests/unit/app/client/experimental/components/ZoneDistribution.test.tsx) and frontend verification via Playwright.PR created automatically by Jules for task 6693765866534748708 started by @arii