Skip to content

Commit a457626

Browse files
fix suggesting
1 parent 60b52a5 commit a457626

File tree

3 files changed

+40
-2
lines changed

3 files changed

+40
-2
lines changed

src/components/ExternalFeaturesDiscoveryModal.vue

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,14 @@
130130
<div class="flex items-center gap-2 flex-grow">
131131
<v-icon size="16" color="blue-lighten-2">mdi-folder-outline</v-icon>
132132
<span class="text-sm font-semibold text-grey-lighten-1">{{ group.name }}</span>
133+
<v-tooltip v-if="group.description" location="top" max-width="320">
134+
<template #activator="{ props: tooltipProps }">
135+
<v-icon v-bind="tooltipProps" size="14" color="grey-lighten-1" class="cursor-help">
136+
mdi-information-outline
137+
</v-icon>
138+
</template>
139+
<span class="text-xs">{{ group.description }}</span>
140+
</v-tooltip>
133141
<v-chip size="x-small" variant="outlined" color="blue">
134142
{{ group.buttonMappingSuggestions.length }}
135143
</v-chip>
@@ -156,6 +164,9 @@
156164
</div>
157165
</v-expansion-panel-title>
158166
<v-expansion-panel-text>
167+
<p v-if="group.description" class="text-sm text-grey-lighten-1 mb-3">
168+
{{ group.description }}
169+
</p>
159170
<div class="flex flex-wrap gap-4 justify-start pt-2">
160171
<div
161172
v-for="suggestion in group.buttonMappingSuggestions"
@@ -252,12 +263,23 @@
252263
<div class="flex items-center gap-2">
253264
<v-icon size="16" color="green-lighten-2">mdi-folder-outline</v-icon>
254265
<span class="text-sm font-semibold text-grey-lighten-1">{{ group.name }}</span>
266+
<v-tooltip v-if="group.description" location="top" max-width="320">
267+
<template #activator="{ props: tooltipProps }">
268+
<v-icon v-bind="tooltipProps" size="14" color="grey-lighten-1" class="cursor-help">
269+
mdi-information-outline
270+
</v-icon>
271+
</template>
272+
<span class="text-xs">{{ group.description }}</span>
273+
</v-tooltip>
255274
<v-chip size="x-small" variant="outlined" color="green">
256275
{{ group.buttonMappingSuggestions.length }}
257276
</v-chip>
258277
</div>
259278
</v-expansion-panel-title>
260279
<v-expansion-panel-text>
280+
<p v-if="group.description" class="text-sm text-grey-lighten-1 mb-3">
281+
{{ group.description }}
282+
</p>
261283
<div class="flex flex-wrap gap-4 justify-start pt-2">
262284
<div
263285
v-for="suggestion in group.buttonMappingSuggestions"
@@ -351,12 +373,23 @@
351373
<div class="flex items-center gap-2">
352374
<v-icon size="16" color="orange-lighten-2">mdi-folder-outline</v-icon>
353375
<span class="text-sm font-semibold text-grey-lighten-1">{{ group.name }}</span>
376+
<v-tooltip v-if="group.description" location="top" max-width="320">
377+
<template #activator="{ props: tooltipProps }">
378+
<v-icon v-bind="tooltipProps" size="14" color="grey-lighten-1" class="cursor-help">
379+
mdi-information-outline
380+
</v-icon>
381+
</template>
382+
<span class="text-xs">{{ group.description }}</span>
383+
</v-tooltip>
354384
<v-chip size="x-small" variant="outlined" color="orange">
355385
{{ group.buttonMappingSuggestions.length }}
356386
</v-chip>
357387
</div>
358388
</v-expansion-panel-title>
359389
<v-expansion-panel-text>
390+
<p v-if="group.description" class="text-sm text-grey-lighten-1 mb-3">
391+
{{ group.description }}
392+
</p>
360393
<div class="flex flex-wrap gap-4 justify-start pt-2">
361394
<div
362395
v-for="suggestion in group.buttonMappingSuggestions"
@@ -871,10 +904,10 @@ interface FilteredExtensionGroups {
871904
* @returns {boolean} True when the group is compatible with the selected profile
872905
*/
873906
const suggestionGroupMatchesSelectedProfile = (group: JoystickMapSuggestionGroup): boolean => {
874-
if (!group.target?.length) return true
907+
if (!group.targetVehicleTypes?.length) return true
875908
if (!selectedProfileHash.value) return false
876909
877-
return group.target.includes(selectedProfileHash.value)
910+
return group.targetVehicleTypes.includes(selectedProfileHash.value)
878911
}
879912
880913
/**

src/libs/blueos/schemas.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ const JoystickButtonMappingSuggestionSchema = z
100100
const JoystickMapSuggestionGroupSchema = z.object({
101101
id: z.string(),
102102
name: z.string(),
103+
description: z.string().optional(),
103104
buttonMappingSuggestions: z.array(JoystickButtonMappingSuggestionSchema),
104105
targetVehicleTypes: z.array(z.string()).optional(),
105106
version: z.string().optional(),

src/types/joystick.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,10 @@ export interface JoystickMapSuggestionGroup {
577577
* Display name for the suggestion group
578578
*/
579579
name: string
580+
/**
581+
* Optional description for the suggestion group
582+
*/
583+
description?: string
580584
/**
581585
* List of button mapping suggestions in this group
582586
*/

0 commit comments

Comments
 (0)