mirror of
https://github.com/jparkerweb/plan2code.git
synced 2026-11-19 13:11:18 -08:00
Make the console survive locked files and private handles, and start with Activities off
AI Assisted
This commit is contained in:
1 parent
c52244bee1
commit
2cb174ecf0
17 files changed
+160
-69
No files matched your search
@@ -22,7 +22,7 @@ import { hushMusic, music as playMusic } from "../music.js";
|
||||
const $ = (id) => document.getElementById(id);
|
||||
|
||||
// Every sound the window and its games make goes through these two, so
|
||||
// Preferences' Play game sounds silences them all (and Play sounds, which
|
||||
// Preferences' Play activity sounds silences them all (and Play sounds, which
|
||||
// tones.js checks, does too).
|
||||
const tone = (...args) => {
|
||||
if (looks.activitySounds) playTone(...args);
|
||||
@@ -30,7 +30,7 @@ const tone = (...args) => {
|
||||
const hum = (...args) => {
|
||||
if (looks.activitySounds) playHum(...args);
|
||||
};
|
||||
// And the music, which also needs Play game music, at the game's own
|
||||
// And the music, which also needs Play activity music, at the game's own
|
||||
// music volume (the window's Music slider). A song's "playing" or "ended"
|
||||
// goes back to the game, which moves on to its next song on "ended".
|
||||
const musicFor = (entry) => (name, intensity, options) => {
|
||||
@@ -38,7 +38,7 @@ const musicFor = (entry) => (name, intensity, options) => {
|
||||
return undefined;
|
||||
};
|
||||
const MUSIC_TITLE = "This game's music volume";
|
||||
const MUSIC_OFF_TITLE = "Turn on Play game music in User Preferences to hear it";
|
||||
const MUSIC_OFF_TITLE = "Turn on Play activity music in User Preferences to hear it";
|
||||
|
||||
// Quiets every held sound and the music: the window stopped ticking a game.
|
||||
function hushTones() {
|
||||
|
||||
@@ -391,7 +391,12 @@ export function renderCard(item) {
|
||||
const skip = el("button", "btn tiny", skipped ? "Do not skip" : "Skip this one");
|
||||
skip.type = "button";
|
||||
skip.style.marginTop = "16px";
|
||||
skip.addEventListener("click", () => (skipped ? stage(item.id, null) : skipAndMoveOn(item.id)));
|
||||
skip.addEventListener("click", () => {
|
||||
if (!skipped) return skipAndMoveOn(item.id);
|
||||
// Keep a note typed with the skip: the box still shows it, so the send must carry it.
|
||||
const kept = page.local.staged[item.id];
|
||||
stage(item.id, kept && kept.text ? { type: "answer", kind: item.kind, text: kept.text } : null);
|
||||
});
|
||||
card.appendChild(skip);
|
||||
if (page.local.skipFlash === item.id) {
|
||||
card.classList.add("is-skip-flash");
|
||||
|
||||
@@ -625,7 +625,7 @@ async function copyHandoffText(text, id, label) {
|
||||
// CLI reads the stored skill and spec, marks the handoff used and falls back
|
||||
// to Quick Task if either is gone.
|
||||
async function pickUpHandoff(h) {
|
||||
if (page.gone || page.pendingResult || page.local.launching || finish()) return;
|
||||
if (page.gone || page.pendingResult || page.local.launching || page.launchScoping || finish()) return;
|
||||
page.launchScoping = true;
|
||||
await hooks.syncWorkspaceScope(h.spec || "");
|
||||
try {
|
||||
@@ -1091,7 +1091,7 @@ export function renderConfirm(main, entry) {
|
||||
// marks the action as being about the session, and it reaches the agent
|
||||
// through the same wait loop. The dashboard reads `skill` off it.
|
||||
export async function launchSkill(entry) {
|
||||
if (page.gone || page.pendingResult || page.local.launching || finish()) return;
|
||||
if (page.gone || page.pendingResult || page.local.launching || page.launchScoping || finish()) return;
|
||||
const target = launchTarget(entry, selSpec());
|
||||
// The card was clickable, so this should never fire — but a spec picked in
|
||||
// one tab could have shifted the ground under a stale render in another.
|
||||
@@ -1351,7 +1351,7 @@ export function wireDashboard() {
|
||||
$("delete-name").addEventListener("keydown", (e) => {
|
||||
if (e.key === "Enter") {
|
||||
e.preventDefault();
|
||||
deleteStep();
|
||||
if (!$("delete-go").disabled) deleteStep();
|
||||
}
|
||||
});
|
||||
// `close` is queued, so it can land after the dialog was opened again for
|
||||
|
||||
@@ -899,7 +899,7 @@ export function renderStopping() {
|
||||
extra.replaceChildren();
|
||||
if (stuck) {
|
||||
extra.appendChild(
|
||||
el(
|
||||
textWithCode(
|
||||
"p",
|
||||
"stop-note",
|
||||
page.inApp
|
||||
|
||||
@@ -101,7 +101,8 @@ function posePane(main, cls, workflow) {
|
||||
const pane = el("div", cls);
|
||||
pane.dataset.pose = pose;
|
||||
pane.appendChild(startStage(workflow));
|
||||
if (held) main.insertBefore(pane, held);
|
||||
// The old pane (another pose) is replaced, not left beside the new one.
|
||||
if (held && held.parentNode === main) held.replaceWith(pane);
|
||||
else main.appendChild(pane);
|
||||
return pane;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user