Skip to content

changed the default for widgets with new and cumulative tabs#149

Merged
emlimlf merged 1 commit intomainfrom
improvement/INS-354-cumulative-new
Apr 7, 2025
Merged

changed the default for widgets with new and cumulative tabs#149
emlimlf merged 1 commit intomainfrom
improvement/INS-354-cumulative-new

Conversation

@emlimlf
Copy link
Copy Markdown
Collaborator

@emlimlf emlimlf commented Apr 2, 2025

In this PR

Changed the default view for widgets that have new and cumulative tabs:

  • Forks
  • Stars
  • Github Mentions
  • Social Mentions
  • Package Downloads

Ticket

INS-354

Summary by CodeRabbit

  • New Features
    • Updated default views in several project popularity modules so that the initial tab now showcases the most recent data.
    • Streamlined tab options by removing duplicate entries, ensuring a clearer and more consistent user experience across forks, GitHub mentions, package downloads, social mentions, and stars.

Signed-off-by: Efren Lim <elim@linuxfoundation.org>
Copilot AI review requested due to automatic review settings April 2, 2025 04:38
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 2, 2025

Walkthrough

The changes update the default active tab values and simplify the tabs array in multiple popularity components. Each component now initializes with a new default value (e.g., 'new', 'new-mentions', or 'new-downloads') and removes duplicate tab entries so that the UI displays a single, unique option for the new tab alongside the cumulative view. The computed property that depends on the active tab remains in place to control data fetching and rendering.

Changes

File(s) Change Summary
frontend/.../forks.vue, frontend/.../stars.vue Updated activeTab from 'cumulative' to 'new' and adjusted the tabs array by removing duplicate 'New' tab entries.
frontend/.../github-mentions.vue, frontend/.../social-mentions.vue Updated activeTab from 'cumulative' to 'new-mentions'; modified the tabs array by removing duplicate 'New Mentions' entries (and reordered in social mentions).
frontend/.../package-downloads.vue Updated activeTab from 'cumulative' to 'new-downloads' and revised the tabs array to remove the duplicate 'New Downloads' entry.

Sequence Diagram(s)

sequenceDiagram
    participant U as User
    participant C as Component
    participant CP as Computed Property (granularity)
    participant API as Data Fetch

    U->>C: Load popularity component
    C->>C: Initialize with activeTab (new/new-mentions/new-downloads)
    C->>CP: Compute granularity based on activeTab
    CP->>API: Trigger API call with granularity parameter
    API-->>CP: Return data
    CP-->>C: Update chart/data rendering
Loading

Possibly related PRs

Suggested labels

enhancement

Suggested reviewers

  • gaspergrom

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b862c3b and db891b1.

📒 Files selected for processing (5)
  • frontend/app/components/modules/project/components/popularity/forks.vue (2 hunks)
  • frontend/app/components/modules/project/components/popularity/github-mentions.vue (2 hunks)
  • frontend/app/components/modules/project/components/popularity/package-downloads.vue (2 hunks)
  • frontend/app/components/modules/project/components/popularity/social-mentions.vue (2 hunks)
  • frontend/app/components/modules/project/components/popularity/stars.vue (2 hunks)
🔇 Additional comments (10)
frontend/app/components/modules/project/components/popularity/stars.vue (2)

90-90: Default tab changed to "new" as required

This change sets the default active tab to "new" instead of "cumulative", aligning with ticket INS-354 requirements to prioritize showing new data by default.


128-131: Tabs array simplified

The tabs array has been simplified to contain only one instance of the "New" tab option, maintaining a clean structure while achieving the required default behavior.

frontend/app/components/modules/project/components/popularity/github-mentions.vue (2)

94-94: Default tab changed to "new-mentions" as required

This change sets the default active tab to "new-mentions" instead of "cumulative", aligning with ticket INS-354 requirements to prioritize showing new data by default.


132-135: Tabs array simplified

The tabs array has been simplified to contain only one instance of the "New Mentions" tab option, maintaining a clean structure while achieving the required default behavior.

frontend/app/components/modules/project/components/popularity/forks.vue (2)

90-90: Default tab changed to "new" as required

This change sets the default active tab to "new" instead of "cumulative", aligning with ticket INS-354 requirements to prioritize showing new data by default.


128-131: Tabs array simplified

The tabs array has been simplified to contain only one instance of the "New" tab option, maintaining a clean structure while achieving the required default behavior.

frontend/app/components/modules/project/components/popularity/social-mentions.vue (2)

116-116: Default tab changed to "new-mentions" as required

This change sets the default active tab to "new-mentions" instead of "cumulative", aligning with ticket INS-354 requirements to prioritize showing new data by default.


157-160: Tabs array simplified

The tabs array has been simplified to contain only one instance of the "New mentions by platform" tab option, maintaining a clean structure while achieving the required default behavior.

frontend/app/components/modules/project/components/popularity/package-downloads.vue (2)

87-87: Great change to default view implementation.

Setting activeTab to 'new-downloads' by default aligns with the PR objective to make "new" the default option instead of "cumulative", which enhances user experience by prioritizing display of new data.


124-126: Tab order change helps reinforce the default view.

The tab configuration now properly lists 'New Downloads' first, which provides visual consistency with the new default selection. The removal of duplicate tab entries ensures a clean user interface.


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown
Contributor

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 updates the default view for various widget components to show the "new" data rather than the cumulative values.

  • Changes the active tab default value in stars.vue and forks.vue from "cumulative" to "new".
  • Updates social-mentions.vue and github-mentions.vue to use "new-mentions" and package-downloads.vue to use "new-downloads" as their default values and adjusts the tab ordering accordingly.

Reviewed Changes

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

Show a summary per file
File Description
frontend/app/components/modules/project/components/popularity/stars.vue Changed activeTab default from "cumulative" to "new" and reordered tabs.
frontend/app/components/modules/project/components/popularity/social-mentions.vue Changed activeTab default from "cumulative" to "new-mentions" and reordered tabs.
frontend/app/components/modules/project/components/popularity/package-downloads.vue Changed activeTab default from "cumulative" to "new-downloads" and reordered tabs.
frontend/app/components/modules/project/components/popularity/github-mentions.vue Changed activeTab default from "cumulative" to "new-mentions" and reordered tabs.
frontend/app/components/modules/project/components/popularity/forks.vue Changed activeTab default from "cumulative" to "new" and reordered tabs.
Comments suppressed due to low confidence (5)

frontend/app/components/modules/project/components/popularity/stars.vue:90

  • [nitpick] Verify that the activeTab value 'new' in stars.vue aligns with the naming conventions used in other widgets. If consistency is desired, consider using a widget-specific prefix similar to 'new-mentions' or 'new-downloads'.
const activeTab = ref('new');

frontend/app/components/modules/project/components/popularity/social-mentions.vue:116

  • [nitpick] Check that the 'new-mentions' value used in social-mentions.vue is consistent with the naming approach across similar components, ensuring clarity in representing the new view state.
const activeTab = ref('new-mentions');

frontend/app/components/modules/project/components/popularity/package-downloads.vue:87

  • [nitpick] Confirm that the activeTab value 'new-downloads' in package-downloads.vue consistently reflects the widget’s context when compared to other related components.
const activeTab = ref('new-downloads');

frontend/app/components/modules/project/components/popularity/github-mentions.vue:94

  • [nitpick] Ensure that the activeTab value 'new-mentions' meets the expected naming standard for this widget, especially in relation to similar components like social-mentions.vue.
const activeTab = ref('new-mentions');

frontend/app/components/modules/project/components/popularity/forks.vue:90

  • [nitpick] Evaluate if the simple 'new' value for activeTab in forks.vue should be aligned with the widget-specific naming seen in other components, or if its current form is intentional.
const activeTab = ref('new');

@emlimlf emlimlf requested a review from gaspergrom April 4, 2025 08:32
@emlimlf emlimlf merged commit afda332 into main Apr 7, 2025
4 checks passed
@emlimlf emlimlf deleted the improvement/INS-354-cumulative-new branch April 7, 2025 08:33
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.

3 participants