Conversation
Signed-off-by: Gašper Grom <gasper.grom@gmail.com>
There was a problem hiding this comment.
Pull request overview
This PR disables a tooltip component in the score tab view by adding the :disabled="true" prop. The change prevents the tooltip from displaying when users interact with the score tabs in the project overview section.
Changes:
- Added
:disabled="true"prop to thelfx-tooltipcomponent in the score tab template
Comments suppressed due to low confidence (1)
frontend/app/components/modules/project/components/overview/score-details/score-tab-view.vue:65
- The tooltip is permanently disabled with
:disabled="true", which creates dead code. The tooltip content template (lines 16-40) will never be displayed to users.
Consider removing the lfx-tooltip wrapper entirely and keeping just the inner content div (lines 41-64). This would:
- Eliminate the unused tooltip content
- Simplify the component structure
- Make the code's intent clearer
- Remove the overhead of the tooltip component
If the tooltip needs to be conditionally shown in the future based on specific criteria, use a reactive property instead of a hardcoded boolean (e.g., :disabled="!shouldShowTooltip" following the pattern seen in other components like contributor-row.vue:21 where :disabled="!item.githubHandle" is used).
<lfx-tooltip
class="!w-full"
:disabled="true"
>
<template #content>
<p
v-if="!scoreDisplay[option.value as keyof typeof scoreDisplay]"
class="max-w-60"
>
{{ option.label }} metrics are unavailable because the required data isn't available for this project.
<a
:href="links.securityScore"
target="_blank"
class="text-brand-500"
>Learn more</a
>
</p>
<p
v-else
class="max-w-60"
>
<a
:href="links.securityScore"
target="_blank"
class="text-brand-500"
>Learn more</a
>
</p>
</template>
<div class="flex flex-col gap-2 items-start cursor-not-allowed">
<div
class="text-sm tab-label"
:class="{
'text-neutral-400': !scoreDisplay[option.value as keyof typeof scoreDisplay],
'text-neutral-900': scoreDisplay[option.value as keyof typeof scoreDisplay],
}"
>
{{ option.label }}
</div>
<div class="text-sm text-gray-500 w-full">
<lfx-skeleton-state
:status="status"
height=".188rem"
width="100%"
>
<lfx-progress-bar
size="small"
:values="[getValues(option.value)]"
:color="getColor(getValues(option.value))"
/>
</lfx-skeleton-state>
</div>
</div>
</lfx-tooltip>
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.