MCPcopy
hub / github.com/koala73/worldmonitor / updateFeatureCardStatus

Function updateFeatureCardStatus

src/settings-main.ts:555–575  ·  view source on GitHub ↗
(featureId: RuntimeFeatureId)

Source from the content-addressed store, hash-verified

553}
554
555function 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
577async function loadOllamaModelsIntoSelect(select: HTMLSelectElement): Promise<void> {
578 const snapshot = getRuntimeConfigSnapshot();

Callers 2

Calls 5

isFeatureAvailableFunction · 0.90
getEffectiveSecretsFunction · 0.90
getSecretStateFunction · 0.90
hasPendingMethod · 0.80
getValidationStateMethod · 0.80

Tested by

no test coverage detected