Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #124
What changed:
Refactored the frontend chart system so every chart and KPI component is fully self-contained.
Why:
Charts were externally wrapped with card divs, titles, and info tooltips by parent pages, leading to inconsistent presentation and tight coupling. Hook return names were generic (
data,isLoading) instead of descriptive. File organization was flat and hard to navigate.Technical decisions worth noting:
ChartCardwrapper with optionalheaderRightslot for inline KPIs (e.g. Mean GCT badge next to chart title).VisualizationConfigsimplified from{ title, description, component }to justComponentType<ChartProps>since charts own their metadata.domain={["auto", "auto"]}so minimum bars are visible and maximums don't clip.{noun}/{noun}IsLoading/{noun}Error/{noun}Refetchpattern matching the existing athlete hooks.useLROverlayDatais called in bothGroundContactTimeChartandLROverlayLineChart— TanStack Query deduplicates the request via shared query key.useCreateAthleteintouseAthletes.hooks.ts. Renamed hook files for.hooks.tsconsistency.GraphInfoCarduses lucideInfoicon with click-outside-to-close for mobile support.Screenshot
Notes
charts/shared/, universal charts →charts/universal/, history charts →charts/history/,reaction_time/→reaction-time/,QueryError/QueryLoading→ui/VisualizationsPageinto their respective chart componentsVisualizationsPagesimplified — no more double-wrapping or external mean computation