-
Notifications
You must be signed in to change notification settings - Fork 36
feat: init stats page refresh (WIP/ON HOLD) #547
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
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a new statistics page refresh feature by implementing a radial chart for coding question difficulty data. Key changes include:
- Adding the DifficultyRadialChart component to visualize difficulty breakdown.
- Extending types to include difficulty records.
- Updating data fetching logic to support difficulty data.
- Integrating the new chart and updating page metadata in the statistics page.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
File | Description |
---|---|
src/components/app/statistics/difficulty-radial-chart.tsx | New chart component for displaying difficulty data with a custom legend and tooltip. |
src/types/Stats.ts | Extended StatsChartData type to optionally include difficulty records. |
src/utils/data/statistics/get-stats-chart-data.ts | Added parameters and logic for separating data by difficulty. |
src/app/(app)/(default_layout)/statistics/page.tsx | Updated page layout to include the new DifficultyRadialChart and improved metadata. |
Comments suppressed due to low confidence (2)
src/components/app/statistics/difficulty-radial-chart.tsx:28
- The 'backgroundColor' prop is accepted but not used anywhere in the component. Consider applying it to a container element if it is intended to style the background.
export default function DifficultyRadialChart({ questionData, step, backgroundColor }: { ... }) {
src/utils/data/statistics/get-stats-chart-data.ts:127
- The 'includeDifficultyData' flag is declared in the function signature and passed from getData but is never used in the logic. Clarify whether this flag should drive the inclusion of difficulty data, or remove it to avoid confusion.
if (separateByDifficulty) {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a new statistics page refresh with an added difficulty radial chart for visualizing question difficulty levels, and updates several stats data fetching functions to support a flexible date range. The key changes include:
- Adding the DifficultyRadialChart component to render difficulty statistics.
- Updating the getStatsChartData and related functions to handle an 'all' range and include difficulty data.
- Enhancing the statistics page layout and hero component with dynamic metadata and grid positioning.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
src/components/app/statistics/difficulty-radial-chart.tsx | New component for visualizing difficulty statistics using a radial chart. |
src/utils/data/statistics/get-stats-chart-data.ts | Modified stats functions to support an 'all' range and include difficulty data. |
src/types/Stats.ts | Updated type definitions to include difficulties data. |
src/app/(app)/(default_layout)/statistics/page.tsx | Updated statistics page to integrate the new chart and metadata generation. |
src/components/shared/hero.tsx | Added gridPosition prop for flexible hero layout. |
src/app/(app)/(default_layout)/layout.tsx | Minor layout adjustments for container usage. |
Comments suppressed due to low confidence (2)
src/utils/data/statistics/get-stats-chart-data.ts:356
- [nitpick] Consider extracting the default value '90d' into a well-named constant to improve clarity and maintainability across the similar functions.
getTotalQuestionCount(userUid, to, from === 'all' ? '90d' : from), // Default to 90d for count if 'all' is used
src/components/app/statistics/difficulty-radial-chart.tsx:70
- [nitpick] Using the index as a key may lead to unexpected behavior if the order of items changes; consider using a stable unique identifier such as the difficulty value as the key.
<div key={index} className="flex items-center">
Signed-off-by: Logan Ford <110533855+Logannford@users.noreply.github.com>
Signed-off-by: Logan Ford <110533855+Logannford@users.noreply.github.com>
Block one (wip):

Block two (wip):
