Show a loading state in the strategy dropdown

While the strategy list is being fetched the dropdown now shows a disabled
"Loading strategies…" option instead of an empty select, and "No strategies
available" once loading finishes with no results. Applies to the strategy,
backtest and sweep panels via a loading prop. Adds tests.
This commit is contained in:
matitos committed 2026-09-21 18:26:01 +00:00
1 parent def86d7f56
commit 5a8c7ecc58
6 files changed
+72 -5

No files matched your search

+5 -1
View File
@@ -7,6 +7,7 @@ import CollapsiblePanel from './CollapsiblePanel.vue'
const props = defineProps({
strategies: { type: Array, required: true },
status: { type: Object, required: true },
loading: { type: Boolean, default: false },
})
const running = ref(false)
@@ -97,7 +98,10 @@ async function run() {
<div class="grid gap-2 sm:grid-cols-4">
<label class="space-y-1">
<span class="label">Strategy</span>
<select v-model="selectedKey" class="input" :disabled="running">
<select v-model="selectedKey" class="input" :disabled="running || !strategies.length">
<option v-if="!strategies.length" value="" disabled>
{{ loading ? 'Loading strategies…' : 'No strategies available' }}
</option>
<option v-for="s in strategies" :key="s.key" :value="s.key">{{ s.name }}</option>
</select>
</label>