Let the in-play Scripts panel show each script's code

The panel only showed a name + on/off toggle, so demo (server-owned)
scripts — which never appear on the personal Scripts page — had no
in-app way to inspect their code. AdventureScriptOut already ships the
hook sources, so add a "View code" expander that renders the non-empty
hooks (library / onInput / onModelContext / onOutput) read-only.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TEpWMjnfPqzZ13nPMoGhs5
This commit is contained in:
parththakkar106
2026-07-20 19:11:39 +05:30
co-authored by Claude Opus 4.8
parent 2fc167327d
commit 73f43efbe7
2 changed files with 79 additions and 7 deletions
+39
View File
@@ -440,6 +440,45 @@ button:disabled { opacity: 0.45; cursor: default; transform: none; box-shadow: n
animation: panel-in 0.25s ease both;
}
/* ---------- In-play script viewer ---------- */
.adv-script {
border-bottom: 1px solid var(--border);
padding: 10px 0;
}
.adv-script-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.adv-script-desc { font-size: 0.82rem; margin-top: 4px; }
.linklike {
border: none;
background: none;
padding: 0;
color: var(--accent-bright);
font-size: 0.8rem;
cursor: pointer;
flex-shrink: 0;
}
.linklike:hover { text-decoration: underline; }
.adv-script-code { margin-top: 8px; }
.adv-script-hook {
font-size: 0.72rem;
text-transform: uppercase;
letter-spacing: 0.08em;
color: var(--text-dim);
margin: 8px 0 2px;
}
.adv-script-code pre {
margin: 0;
padding: 10px;
background: var(--bg-input);
border: 1px solid var(--border);
border-radius: 6px;
overflow-x: auto;
font-family: var(--font-mono, monospace);
font-size: 0.76rem;
line-height: 1.5;
white-space: pre;
}
/* ---------- Left status drawer (script state) ---------- */
.status-drawer {