This commit is contained in:
2026-05-27 23:24:12 +03:00
parent 3e566a229f
commit ebf40c8466
36 changed files with 1348 additions and 306 deletions

View File

@@ -46,6 +46,7 @@
import { api } from "../../lib/api.js";
import { selectedTask } from "../../lib/stores.js";
import { resumeTask } from "../../services/taskService.js";
import { environmentContextStore } from '$lib/stores/environmentContext.js';
import type {
DashboardMetadata,
DashboardSelection,
@@ -88,6 +89,7 @@
// [/SECTION]
const selectedTaskState = fromStore(selectedTask);
const envContextState = fromStore(environmentContextStore);
const belief_scope = <T>(_id: string, fn: () => T): T => fn();
@@ -104,6 +106,11 @@
console.info("[EXT:frontend:fetchEnvironments][REASON] Initializing environment list for selection");
try {
environments = await api.getEnvironmentsList();
// Pre-fill source with active environment, leave target empty
const activeEnvId = envContextState.current?.selectedEnvId;
if (activeEnvId && environments.some((env) => env.id === activeEnvId)) {
sourceEnvId = activeEnvId;
}
console.info("[EXT:frontend:fetchEnvironments][REFLECT] Environments loaded", { count: environments.length });
} catch (e) {
console.error("[EXT:frontend:fetchEnvironments][EXPLORE] Failed to fetch environments", e);