fix(astrolabe): address review feedback for Vue 3 bindings
- Change limit initialization from string '20' to number 20 in App.vue - Update AdminSettings.vue NcTextField to use v-model instead of legacy :value/@update:value bindings - Update AdminSettings.vue NcSelect components to use :model-value with computed getters and @update:model-value for proper object-to-id conversion (same pattern as App.vue) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.5
parent
cb4e8acd9f
commit
006a3d95d6
Vendored
+1
-1
@@ -443,7 +443,7 @@ export default {
|
|||||||
algorithm: 'hybrid',
|
algorithm: 'hybrid',
|
||||||
showAdvanced: false,
|
showAdvanced: false,
|
||||||
selectedDocTypes: [],
|
selectedDocTypes: [],
|
||||||
limit: '20',
|
limit: 20,
|
||||||
scoreThreshold: 0,
|
scoreThreshold: 0,
|
||||||
loading: false,
|
loading: false,
|
||||||
error: null,
|
error: null,
|
||||||
|
|||||||
@@ -152,19 +152,21 @@
|
|||||||
|
|
||||||
<div class="settings-form">
|
<div class="settings-form">
|
||||||
<NcSelect
|
<NcSelect
|
||||||
v-model="settings.algorithm"
|
:model-value="selectedAlgorithmOption"
|
||||||
:options="algorithmOptions"
|
:options="algorithmOptions"
|
||||||
:label="t('astrolabe', 'Search Algorithm')"
|
:label="t('astrolabe', 'Search Algorithm')"
|
||||||
class="form-field" />
|
class="form-field"
|
||||||
|
@update:model-value="settings.algorithm = $event ? $event.id : 'hybrid'" />
|
||||||
<p class="help-text">
|
<p class="help-text">
|
||||||
{{ t('astrolabe', 'Hybrid combines semantic understanding with keyword matching. Semantic finds conceptually similar content. BM25 matches exact keywords.') }}
|
{{ t('astrolabe', 'Hybrid combines semantic understanding with keyword matching. Semantic finds conceptually similar content. BM25 matches exact keywords.') }}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<NcSelect
|
<NcSelect
|
||||||
v-model="settings.fusion"
|
:model-value="selectedFusionOption"
|
||||||
:options="fusionOptions"
|
:options="fusionOptions"
|
||||||
:label="t('astrolabe', 'Fusion Method')"
|
:label="t('astrolabe', 'Fusion Method')"
|
||||||
class="form-field" />
|
class="form-field"
|
||||||
|
@update:model-value="settings.fusion = $event ? $event.id : 'rrf'" />
|
||||||
<p class="help-text">
|
<p class="help-text">
|
||||||
{{ t('astrolabe', 'Only applies to hybrid search. RRF balances results well for most queries. DBSF may work better when keyword matches are over/under-weighted.') }}
|
{{ t('astrolabe', 'Only applies to hybrid search. RRF balances results well for most queries. DBSF may work better when keyword matches are over/under-weighted.') }}
|
||||||
</p>
|
</p>
|
||||||
@@ -184,14 +186,13 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<NcTextField
|
<NcTextField
|
||||||
:value="settings.limit"
|
v-model="settings.limit"
|
||||||
:label="t('astrolabe', 'Maximum Results')"
|
:label="t('astrolabe', 'Maximum Results')"
|
||||||
type="number"
|
type="number"
|
||||||
:min="5"
|
:min="5"
|
||||||
:max="100"
|
:max="100"
|
||||||
:step="5"
|
:step="5"
|
||||||
class="form-field"
|
class="form-field" />
|
||||||
@update:value="settings.limit = Number($event)" />
|
|
||||||
<p class="help-text">
|
<p class="help-text">
|
||||||
{{ t('astrolabe', 'Maximum number of results to return per search query (5-100).') }}
|
{{ t('astrolabe', 'Maximum number of results to return per search query (5-100).') }}
|
||||||
</p>
|
</p>
|
||||||
@@ -276,6 +277,15 @@ const fusionOptions = computed(() => [
|
|||||||
{ id: 'dbsf', label: t('astrolabe', 'DBSF - Distribution-Based Score Fusion') },
|
{ id: 'dbsf', label: t('astrolabe', 'DBSF - Distribution-Based Score Fusion') },
|
||||||
])
|
])
|
||||||
|
|
||||||
|
// Computed properties for NcSelect (converts between stored ID and option object)
|
||||||
|
const selectedAlgorithmOption = computed(() =>
|
||||||
|
algorithmOptions.value.find(opt => opt.id === settings.value.algorithm) || algorithmOptions.value[0],
|
||||||
|
)
|
||||||
|
|
||||||
|
const selectedFusionOption = computed(() =>
|
||||||
|
fusionOptions.value.find(opt => opt.id === settings.value.fusion) || fusionOptions.value[0],
|
||||||
|
)
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
async function loadServerStatus() {
|
async function loadServerStatus() {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
|
|||||||
Reference in New Issue
Block a user