From 0670858785fa2ef9797b9a2170e13460ac1672ed Mon Sep 17 00:00:00 2001 From: vaibhav-xp Date: Wed, 20 Nov 2024 09:16:30 +0530 Subject: [PATCH 1/2] Bug: Charts hover states are not standalone #4189 --- components/Graphs/ForksChart.tsx | 9 +++++---- components/Graphs/IssuesChart.tsx | 8 +++++--- components/Graphs/PRChart.tsx | 8 +++++--- components/Graphs/StarsChart.tsx | 10 ++++++---- pages/s/[org]/[repo]/index.tsx | 10 +++++----- 5 files changed, 26 insertions(+), 19 deletions(-) diff --git a/components/Graphs/ForksChart.tsx b/components/Graphs/ForksChart.tsx index c9010c3e33..a479914c04 100644 --- a/components/Graphs/ForksChart.tsx +++ b/components/Graphs/ForksChart.tsx @@ -25,7 +25,7 @@ import humanizeNumber from "lib/utils/humanizeNumber"; type ForksChartProps = { stats: StatsType[] | undefined; total: number; - syncId: number; + // syncId: number; range: DayRange; isLoading: boolean; onCategoryClick?: (category: string) => void; @@ -35,7 +35,7 @@ type ForksChartProps = { export default function ForksChart({ stats, total, - syncId, + // syncId, range = 30, isLoading, onCategoryClick, @@ -52,7 +52,8 @@ export default function ForksChart({ switch (category) { case "daily": return ( - + // + + getDailyIssuesHistogramToDays({ stats, range }), [stats, range]); const bucketTicks = useMemo(() => getTicks({ histogram: dailyData, range }), [dailyData, range]); const { openedRangedTotal, closedRangedTotal } = useMemo( @@ -87,7 +88,8 @@ export default function IssuesChart({ stats, velocity, syncId, range = 30, isLoa {isLoading ? ( ) : ( - + // + getDailyPullRequestsHistogramToDays({ stats, range }), [stats, range]); const bucketTicks = useMemo(() => getTicks({ histogram: dailyData, range }), [dailyData, range]); const { openedRangedTotal, closedRangedTotal } = useMemo( @@ -87,7 +88,8 @@ export default function PRChart({ stats, velocity, syncId, range = 30, isLoading {isLoading ? ( ) : ( - + // + void; @@ -35,7 +35,7 @@ type StarsChartProps = { export default function StarsChart({ stats, total, - syncId, + // syncId, range = 30, isLoading, onCategoryClick, @@ -52,7 +52,8 @@ export default function StarsChart({ switch (category) { case "daily": return ( - + // + + // + @@ -599,7 +599,7 @@ export default function RepoPage({ repoData, ogImageUrl }: RepoPageProps) { stats={prStats} range={range} velocity={repoStats?.pr_velocity_count ?? 0} - syncId={syncId} + // syncId={syncId} isLoading={isPrDataLoading} /> @@ -631,7 +631,7 @@ export default function RepoPage({ repoData, ogImageUrl }: RepoPageProps) { stats={starsData} total={repoData.stars} range={range} - syncId={syncId} + // syncId={syncId} isLoading={isStarsDataLoading} onCategoryClick={(category) => posthog.capture("Repo Pages: clicked Stars Chart category", { @@ -665,7 +665,7 @@ export default function RepoPage({ repoData, ogImageUrl }: RepoPageProps) { stats={forkStats} total={repoData.forks} range={range} - syncId={syncId} + // syncId={syncId} isLoading={isForksDataLoading} onCategoryClick={(category) => posthog.capture("Repo Pages: clicked Forks Chart category", { From 1424c721835819c02f04111988370c392caaaf68 Mon Sep 17 00:00:00 2001 From: vaibhav-xp Date: Wed, 20 Nov 2024 09:16:30 +0530 Subject: [PATCH 2/2] fix: Charts hover states are not standalone #4189 --- components/Graphs/ForksChart.tsx | 9 +++++---- components/Graphs/IssuesChart.tsx | 8 +++++--- components/Graphs/PRChart.tsx | 8 +++++--- components/Graphs/StarsChart.tsx | 10 ++++++---- pages/s/[org]/[repo]/index.tsx | 10 +++++----- 5 files changed, 26 insertions(+), 19 deletions(-) diff --git a/components/Graphs/ForksChart.tsx b/components/Graphs/ForksChart.tsx index c9010c3e33..a479914c04 100644 --- a/components/Graphs/ForksChart.tsx +++ b/components/Graphs/ForksChart.tsx @@ -25,7 +25,7 @@ import humanizeNumber from "lib/utils/humanizeNumber"; type ForksChartProps = { stats: StatsType[] | undefined; total: number; - syncId: number; + // syncId: number; range: DayRange; isLoading: boolean; onCategoryClick?: (category: string) => void; @@ -35,7 +35,7 @@ type ForksChartProps = { export default function ForksChart({ stats, total, - syncId, + // syncId, range = 30, isLoading, onCategoryClick, @@ -52,7 +52,8 @@ export default function ForksChart({ switch (category) { case "daily": return ( - + // + + getDailyIssuesHistogramToDays({ stats, range }), [stats, range]); const bucketTicks = useMemo(() => getTicks({ histogram: dailyData, range }), [dailyData, range]); const { openedRangedTotal, closedRangedTotal } = useMemo( @@ -87,7 +88,8 @@ export default function IssuesChart({ stats, velocity, syncId, range = 30, isLoa {isLoading ? ( ) : ( - + // + getDailyPullRequestsHistogramToDays({ stats, range }), [stats, range]); const bucketTicks = useMemo(() => getTicks({ histogram: dailyData, range }), [dailyData, range]); const { openedRangedTotal, closedRangedTotal } = useMemo( @@ -87,7 +88,8 @@ export default function PRChart({ stats, velocity, syncId, range = 30, isLoading {isLoading ? ( ) : ( - + // + void; @@ -35,7 +35,7 @@ type StarsChartProps = { export default function StarsChart({ stats, total, - syncId, + // syncId, range = 30, isLoading, onCategoryClick, @@ -52,7 +52,8 @@ export default function StarsChart({ switch (category) { case "daily": return ( - + // + + // + @@ -599,7 +599,7 @@ export default function RepoPage({ repoData, ogImageUrl }: RepoPageProps) { stats={prStats} range={range} velocity={repoStats?.pr_velocity_count ?? 0} - syncId={syncId} + // syncId={syncId} isLoading={isPrDataLoading} /> @@ -631,7 +631,7 @@ export default function RepoPage({ repoData, ogImageUrl }: RepoPageProps) { stats={starsData} total={repoData.stars} range={range} - syncId={syncId} + // syncId={syncId} isLoading={isStarsDataLoading} onCategoryClick={(category) => posthog.capture("Repo Pages: clicked Stars Chart category", { @@ -665,7 +665,7 @@ export default function RepoPage({ repoData, ogImageUrl }: RepoPageProps) { stats={forkStats} total={repoData.forks} range={range} - syncId={syncId} + // syncId={syncId} isLoading={isForksDataLoading} onCategoryClick={(category) => posthog.capture("Repo Pages: clicked Forks Chart category", {