Skip to content

Conversation

emlimlf
Copy link
Collaborator

@emlimlf emlimlf commented Oct 9, 2025

In this PR

Added the nuxt link to the score item in the overview tab that links to their respective widget

Ticket

IN-669

@Copilot Copilot AI review requested due to automatic review settings October 9, 2025 07:50
Copy link
Contributor

@Copilot 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 adds click-to-navigate functionality to score items in the project overview tab, allowing users to click on benchmark scores to navigate directly to their corresponding widget pages.

  • Added nuxt-link wrapper around score items to enable navigation
  • Implemented logic to determine the appropriate widget area and route for each score
  • Added query parameter support to preserve current state when navigating

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

const query = {
...route.query,
widget: widgetKebabCase.value // remove the widget from the query
Copy link

Copilot AI Oct 9, 2025

Choose a reason for hiding this comment

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

Comment is incorrect - the code is adding the widget to the query, not removing it.

Suggested change
widget: widgetKebabCase.value // remove the widget from the query
widget: widgetKebabCase.value // add the widget to the query

Copilot uses AI. Check for mistakes.

if (selectedRepositoryGroup.value) {
name = link.value.repoGroupRouteName;
}
else if(repoName.value) {
Copy link

Copilot AI Oct 9, 2025

Choose a reason for hiding this comment

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

Missing space after 'if' keyword. Should be 'else if (repoName.value)' for consistent code formatting.

Suggested change
else if(repoName.value) {
else if (repoName.value) {

Copilot uses AI. Check for mistakes.

Comment on lines +64 to +67
const widgetKebabCase = computed(
() => props.widgetKey ?
props.widgetKey.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase() as Widget : undefined
);
Copy link

Copilot AI Oct 9, 2025

Choose a reason for hiding this comment

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

Type assertion 'as Widget' is unsafe here. The kebab-case string transformation doesn't guarantee the result will be a valid Widget type. Consider using proper type validation or a mapping function instead.

Suggested change
const widgetKebabCase = computed(
() => props.widgetKey ?
props.widgetKey.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase() as Widget : undefined
);
const validWidgetKeys = Object.values(lfxWidgets).map(w => w.key);
const widgetKebabCase = computed(() => {
if (!props.widgetKey) return undefined;
const kebabKey = props.widgetKey.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
return validWidgetKeys.includes(kebabKey) ? kebabKey : undefined;
});

Copilot uses AI. Check for mistakes.

@emlimlf emlimlf requested a review from gaspergrom October 9, 2025 09:01
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