Skip to content
Open
1 change: 1 addition & 0 deletions frontend/messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2759,6 +2759,7 @@
"doraAttributes": "DORA Attributes",
"doraAssessment": "DORA Assessment",
"moreOnTerminologiesHelpText": "Hint: more options can be defined through terminologies",
"selectPlaceholder": "Select...",
"updated": "Updated",
"deleted": "Deleted",
"ebiosRmSyncModalTitle": "Risk Assessment Options",
Expand Down
1 change: 1 addition & 0 deletions frontend/messages/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -2755,6 +2755,7 @@
"webhookSecret": "Secret webhook",
"webhookSecretAlreadySetHelpText": "Le secret webhook est déjà défini.",
"webhookUrl": "URL webhook",
"selectPlaceholder": "Sélectionner...",
"ebiosRmSyncModalTitle": "Options d'analyse de risque",
"ebiosRmSyncModalBody": "Une analyse de risque existe déjà pour cette étude EBIOS RM : \"{name}\"\n\nQue souhaitez-vous faire :",
"ebiosRmSyncExisting": "Synchroniser l'existante",
Expand Down
12 changes: 11 additions & 1 deletion frontend/src/lib/components/Forms/AutocompleteSelect.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
disabled?: boolean;
hidden?: boolean;
translateOptions?: boolean;
placeholder?: string | null;
options?: Option[];
optionsEndpoint?: string;
optionsDetailedUrlParameters?: [string, string][];
Expand Down Expand Up @@ -88,6 +89,7 @@
disabled = false,
hidden = false,
translateOptions = true,
placeholder = m.selectPlaceholder(),
options = [],
optionsEndpoint = '',
optionsDetailedUrlParameters = [],
Expand Down Expand Up @@ -371,7 +373,7 @@
cachedOptions = selected;
});
run(() => {
$effect(() => {
Copy link

Copilot AI Dec 3, 2025

Choose a reason for hiding this comment

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

[nitpick] Only one run() call was changed to $effect() while three other run() calls remain on lines 364, 371, and 386. If this change is intentional due to different reactivity requirements, it would be helpful to add a comment explaining why. Otherwise, consider updating all run() calls consistently for uniformity.

Copilot uses AI. Check for mistakes.
// Only update value after options are loaded
if (!isInternalUpdate && optionsLoaded && !arraysEqual(selectedValues, $value)) {
isInternalUpdate = true;
Expand Down Expand Up @@ -457,6 +459,8 @@
duplicates={false}
key={JSON.stringify}
filterFunc={fastFilter}
{placeholder}
--sms-placeholder-color="#9ca3af"
Copy link

Copilot AI Dec 3, 2025

Choose a reason for hiding this comment

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

[nitpick] The hardcoded color value #9ca3af (gray-400) is used here. Consider using a Tailwind CSS variable or class for consistency with the design system, especially since the codebase already uses Tailwind extensively. For example, you could use a CSS custom property like --color-gray-400 that maps to the Tailwind color.

Copilot uses AI. Check for mistakes.
>
{#snippet option({ option })}
{#if optionSnippet}
Expand Down Expand Up @@ -552,3 +556,9 @@
<p class="text-sm text-gray-500 whitespace-pre-line">{helpText}</p>
{/if}
</div>

<style>
.control :global(input::placeholder) {
font-style: italic;
}
</style>
6 changes: 4 additions & 2 deletions frontend/src/lib/components/ModelTable/ModelTable.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,9 @@
const rows = handler.getRows();
let invalidateTable = $state(false);

// Hide search field when table is empty to avoid user confusion
let showSearch = $derived(search && $rows.length > 0);

$tableHandlers[baseEndpoint] = handler;

handler.onChange((state: State) =>
Expand All @@ -251,7 +254,6 @@
featureFlags: page.data?.featureflags
})
);

onMount(() => {
if (orderBy) {
orderBy.direction === 'asc'
Expand Down Expand Up @@ -499,7 +501,7 @@
{/snippet}
</Popover>
{/if}
{#if search}
{#if showSearch}
<Search {handler} />
{/if}
{#if pagination && rowsPerPage}
Expand Down
7 changes: 7 additions & 0 deletions frontend/src/lib/components/ModelTable/Search.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,10 @@
bind:value
oninput={search}
/>

<style>
#search-input::placeholder {
font-style: italic;
color: #9ca3af;
Copy link

Copilot AI Dec 3, 2025

Choose a reason for hiding this comment

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

[nitpick] The hardcoded color value #9ca3af (gray-400) is used here. Consider using a Tailwind CSS variable or class for consistency with the design system. This would make it easier to maintain color consistency across the application and support theme changes.

Suggested change
color: #9ca3af;
color: theme('colors.gray.400');

Copilot uses AI. Check for mistakes.
}
</style>
Loading