Skip to content

Preserve Current Leaderboard Timeframe in Compare Modal #345

Description

@jagdish-15

Currently, when a user is browsing a specific timeframe on the leaderboard (e.g. Weekly, Monthly, or Daily) and clicks Compare, the Compare Modal always opens with the Overall timeframe selected.

Instead, the modal should automatically inherit the currently selected leaderboard timeframe. For example:

  • If the user is viewing the Weekly leaderboard, the Compare Modal should open with the Weekly graphs selected.
  • If the user is viewing the Monthly leaderboard, the Compare Modal should open with the Monthly graphs selected.
  • and so on

This provides a more seamless user experience by preserving the user's context and eliminating the need to manually switch timeframes after opening the modal.

Implementation Steps

  1. Determine the currently selected leaderboard timeframe when the Compare button is clicked.
  2. Pass that timeframe to the Compare Modal during initialisation.
  3. Initialise the modal with the corresponding graph tab already selected instead of always defaulting to overall.
  4. Ensure manual tab switching inside the Compare Modal continues to work as before.

Metadata

Metadata

Assignees

Labels

FrontendTask mainly involving frontendlevel:intermediateIndicates the difficultytype:featureNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions