Skip to content

Conversation

@Ammaar-Alam
Copy link
Member

Summary

  • replace the leaderboard duration/period controls with a single sliding segmented toggle that matches
    the statistics cards
  • remove the extra landing wrapper chrome so the leaderboard fills its space cleanly
  • refine hover/focus behavior so selections keep the bright orange slider while non-active options get a
    subtle text-only glow with no background shift

Copilot AI review requested due to automatic review settings November 4, 2025 17:48
Copy link

Copilot AI left a 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 refactors the leaderboard UI from button-based controls to a segmented toggle control component, with improved mobile responsiveness and layout adjustments. The changes modernize the leaderboard interface with a more polished, iOS-style segmented control for period and duration selection.

  • Introduces a new SegmentedToggle component to replace existing button-based controls for period and duration selection
  • Refactors landing page leaderboard layout from flexbox to CSS Grid for better responsive behavior
  • Improves mobile experience with conditional rendering and compact styling

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
client/src/components/Leaderboard.jsx Adds SegmentedToggle component and refactors leaderboard controls to use it in both landing and modal layouts
client/src/components/Leaderboard.css Adds comprehensive styling for SegmentedToggle component with animations and responsive adjustments
client/src/pages/Landing.css Converts leaderboard section from flexbox to CSS Grid layout with updated responsive breakpoints

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

top: 0.2rem;
bottom: 0.2rem;
left: 0.2rem;
width: calc((100% - 0.4rem) / var(--segments));
Copy link

Copilot AI Nov 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The magic number 0.4rem (padding * 2) is hardcoded in the calculation. Consider defining this as a CSS custom property like --toggle-padding: 0.2rem and using it here as calc((100% - calc(var(--toggle-padding) * 2)) / var(--segments)) for better maintainability.

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings November 4, 2025 18:13
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +329 to +335
const formatDisplayDate = useCallback((timestamp) => {
if (period === 'daily') return formatRelativeTime(timestamp);
const date = new Date(timestamp);
return isLandingMobile
? date.toLocaleDateString(undefined, { month: 'numeric', day: 'numeric' })
: date.toLocaleDateString();
}, [period, isLandingMobile]);
Copy link

Copilot AI Nov 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The formatDisplayDate function should be memoized with useMemo instead of useCallback, since it's not being passed as a callback prop but is called directly within the JSX (line 433). Using useMemo would cache the function itself rather than its definition, though in practice this won't cause issues since the function is only called during rendering.

Copilot uses AI. Check for mistakes.
@Ammaar-Alam Ammaar-Alam merged commit 4023e82 into master Nov 4, 2025
@Ammaar-Alam Ammaar-Alam deleted the feature/title-hover branch November 4, 2025 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants