fix(site): make the full agent prompt natively expandable

This commit is contained in:
Wayner Barrios
2026-08-13 22:46:13 -05:00
parent 10e56a869e
commit 0c19b5bd9d
3 changed files with 79 additions and 44 deletions
+3 -19
View File
@@ -30,36 +30,20 @@ for (const button of copyButtons) {
const value = source?.textContent.trim() || button.dataset.copy;
const copyLabel = button.dataset.copyLabel ?? "Command";
const status = button.closest(".terminal-shell")?.querySelector(".copy-status");
const revealTarget = button.dataset.revealTarget
? document.getElementById(button.dataset.revealTarget)
: null;
if (revealTarget) {
revealTarget.hidden = false;
button.setAttribute("aria-expanded", "true");
}
try {
if (!value) throw new Error("No copyable content was found.");
await copyText(value);
if (status) {
status.textContent = revealTarget
? `${copyLabel} copied. The complete prompt is shown below.`
: `${copyLabel} copied to clipboard.`;
}
if (status) status.textContent = `${copyLabel} copied to clipboard.`;
const label = button.querySelector("b") ?? button;
const original = label.textContent;
label.textContent = revealTarget ? "Copied + shown" : "Copied";
label.textContent = "Copied";
window.setTimeout(() => {
label.textContent = original;
if (status) status.textContent = "";
}, 1800);
} catch {
if (status) {
status.textContent = revealTarget
? "The complete prompt is shown below. Select it and copy it manually."
: "Copy failed. Select the command manually.";
}
if (status) status.textContent = "Copy failed. Select the complete prompt above and copy it manually.";
}
});
}
+28 -18
View File
@@ -274,24 +274,19 @@
<span>AGENT INSTALL</span>
<span>DRY RUN → INSTALL → VERIFY</span>
</div>
<button
class="copy-command"
type="button"
data-copy-label="Agent prompt"
data-copy-target="agent-install-prompt"
data-reveal-target="agent-install-prompt"
aria-controls="agent-install-prompt"
aria-expanded="false"
>
<span class="copy-command-text">
<small>Paste this into your coding agent</small>
<code>Ask what I need. Recommend the smallest pack. Preview, install, and verify it.</code>
</span>
<b>Copy + show prompt</b>
</button>
<p class="copy-status" aria-live="polite"></p>
</div>
<pre id="agent-install-prompt" class="agent-prompt-full" tabindex="0" hidden>Help me choose and install the right OpenCode Power Pack skills safely and project-locally in the current Git repository.
<details class="agent-prompt-disclosure">
<summary class="copy-command agent-prompt-summary">
<span class="copy-command-text">
<small>Full agent installation runbook</small>
<code>Ask what I need. Recommend the smallest pack. Preview, install, and verify it.</code>
</span>
<b>
<span class="prompt-show-label">Show full prompt</span>
<span class="prompt-hide-label">Hide prompt</span>
</b>
</summary>
<div class="agent-prompt-expanded">
<pre id="agent-install-prompt" class="agent-prompt-full" tabindex="0">Help me choose and install the right OpenCode Power Pack skills safely and project-locally in the current Git repository.
Your goal is to understand what I need, recommend the smallest useful profile or set of individual skills, obtain my explicit selection, install it for the active coding-agent host, preserve all existing project work, and leave a reproducible verification report.
@@ -361,6 +356,21 @@ Phase 6: verify and report.
- OpenCode: run opencode debug skill, then invoke /code-review.
- Pi: run pi list, then request a task that matches an installed workflow.
6. Finish with a concise structured report containing: stated need, approved selection and rationale, alternatives not chosen, host, Node/npm versions, Git root, destination, exact commands run, resolved skill count and names, installed entries, preserved/skipped entries, warnings or failures, worktree comparison, verification result, and any user action still required.</pre>
<div class="agent-prompt-actions">
<button
type="button"
class="small-copy"
data-copy-label="Agent prompt"
data-copy-target="agent-install-prompt"
>
Copy complete prompt
</button>
<a href="agent-install.md">Open the Markdown guide</a>
</div>
<p class="copy-status" aria-live="polite"></p>
</div>
</details>
</div>
<p class="hero-install-note">
Copies a needs-based selection, preflight, install, and verification runbook. <a href="agent-install.md">Read it first.</a>
</p>
+48 -7
View File
@@ -321,13 +321,38 @@ code {
width: 100%;
}
.agent-prompt-summary {
list-style: none;
}
.agent-prompt-summary::-webkit-details-marker {
display: none;
}
.agent-prompt-summary .prompt-hide-label {
display: none;
}
.agent-prompt-disclosure[open] .prompt-show-label {
display: none;
}
.agent-prompt-disclosure[open] .prompt-hide-label {
display: inline;
}
.agent-prompt-expanded {
padding: 0 var(--space-5) var(--space-5);
border-top: 1px solid var(--line);
}
.agent-prompt-full {
width: 100%;
max-height: 32rem;
margin: var(--space-4) 0 0;
padding: var(--space-5);
margin: 0;
padding: var(--space-5) 0;
overflow: auto;
border: 1px solid var(--line-strong);
border: 0;
color: #dce3e9;
background: var(--ink);
font-family: var(--mono);
@@ -337,15 +362,31 @@ code {
white-space: pre-wrap;
}
.agent-prompt-full[hidden] {
display: none;
}
.agent-prompt-full:focus-visible {
outline: 2px solid var(--power);
outline-offset: 2px;
}
.agent-prompt-actions {
display: flex;
flex-wrap: wrap;
gap: var(--space-4);
align-items: center;
padding-top: var(--space-4);
border-top: 1px solid var(--line);
}
.agent-prompt-actions a {
color: var(--muted);
font-size: 0.75rem;
}
.agent-prompt-expanded .copy-status {
position: static;
min-height: 1.2rem;
margin: var(--space-3) 0 0;
}
.terminal-bar {
display: flex;
justify-content: space-between;