INNER CODE UNIT · JavaScript

activeSessionValue

Dsadd4/AgentFigureGallery · frontend/reference_gallery/app.js:50

function activeSessionValue() {
  return el.sessionSelect.value || (state.session && state.session.session_json) || "";
}

async function loadSessions(preferred) {
  const payload = await api("/api/sessions");
  state.sessions = payload.sessions || [];
  el.sessionSelect.innerHTML = "";
  for (const session of state.sessions) {
    const option = document.createElement("option");
    option.value = session.session_json;
    option.textContent = `${session.session_id} (${session.plot_type || "unknown"}, ${session.candidate_count})`;
    el.sessionSelect.appendChild(option);
  }
  if (preferred) {
    const match = state.sessions.find((session) => session.session_json === preferred || session.session_id === preferred);
    if (match) el.sessionSelect.value = match.session_json;
  }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…