(featureId: RuntimeFeatureId)
| 553 | } |
| 554 | |
| 555 | function updateFeatureCardStatus(featureId: RuntimeFeatureId): void { |
| 556 | const card = document.querySelector<HTMLElement>(`.settings-feat[data-feature-id="${featureId}"]`); |
| 557 | if (!card) return; |
| 558 | const feature = RUNTIME_FEATURES.find(f => f.id === featureId); |
| 559 | if (!feature) return; |
| 560 | |
| 561 | const available = isFeatureAvailable(featureId); |
| 562 | const effectiveSecrets = getEffectiveSecrets(feature); |
| 563 | const allStaged = !available && effectiveSecrets.every( |
| 564 | k => getSecretState(k).valid || (settingsManager.hasPending(k) && settingsManager.getValidationState(k).validated !== false) |
| 565 | ); |
| 566 | |
| 567 | const wasExpanded = card.classList.contains('expanded'); |
| 568 | card.className = `settings-feat ${available ? 'ready' : allStaged ? 'staged' : 'needs'}${wasExpanded ? ' expanded' : ''}`; |
| 569 | |
| 570 | const pill = card.querySelector('.settings-feat-pill'); |
| 571 | if (pill) { |
| 572 | pill.className = `settings-feat-pill ${available ? 'ok' : allStaged ? 'staged' : 'warn'}`; |
| 573 | pill.textContent = available ? 'Ready' : allStaged ? 'Staged' : 'Needs keys'; |
| 574 | } |
| 575 | } |
| 576 | |
| 577 | async function loadOllamaModelsIntoSelect(select: HTMLSelectElement): Promise<void> { |
| 578 | const snapshot = getRuntimeConfigSnapshot(); |
no test coverage detected