mirror of
https://github.com/jparkerweb/plan2code.git
synced 2026-11-16 20:45:33 -08:00
Carry the spec into the app's New Session and name it beside the meter
AI Assisted
This commit is contained in:
1 parent
7856618a4c
commit
7891c06642
14 files changed
+320
-6
No files matched your search
@@ -145,6 +145,9 @@
|
||||
<button type="button" class="linky" id="meter-help">What is this?</button>
|
||||
</div>
|
||||
</span>
|
||||
<!-- The spec this session works on (the dashboard picker's pick on the
|
||||
dashboard), quiet beside the meter. Hidden when there is none. -->
|
||||
<span class="spec-tag" id="spec-tag" hidden></span>
|
||||
</div>
|
||||
<div class="progress-block">
|
||||
<div class="progress-label">
|
||||
@@ -436,6 +439,13 @@
|
||||
<path d="M10 3v14.5a2 2 0 0 0 4 0V3" />
|
||||
<path d="M10 12h4" />
|
||||
</symbol>
|
||||
<!-- Clear out dead code: a skull. -->
|
||||
<symbol id="ci-dead-code" viewBox="0 0 24 24" fill="none">
|
||||
<path d="M12 3a7 7 0 0 0-7 7c0 2.4 1.2 4.1 3 5.2V18a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1v-2.8c1.8-1.1 3-2.8 3-5.2a7 7 0 0 0-7-7z" />
|
||||
<circle cx="9.5" cy="11" r="1.5" />
|
||||
<circle cx="14.5" cy="11" r="1.5" />
|
||||
<path d="M10 19v2M12 19v2M14 19v2" />
|
||||
</symbol>
|
||||
<!-- Changelog: a version tag. -->
|
||||
<symbol id="ci-changelog" viewBox="0 0 24 24" fill="none">
|
||||
<path d="M3 4a1 1 0 0 1 1-1h7.6a2 2 0 0 1 1.4.6l7.4 7.4a2 2 0 0 1 0 2.8l-5.6 5.6a2 2 0 0 1-2.8 0L4.6 12a2 2 0 0 1-.6-1.4z" />
|
||||
@@ -901,6 +911,35 @@
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
<!-- Dead code: clearing out code nothing uses. He holds up a small
|
||||
skull whose jaw chatters, his star glancing over at it, before it
|
||||
settles and the chatter starts again. -->
|
||||
<svg class="pose pose-dead-code" data-pose="dead-code" viewBox="0 4 240 216" aria-hidden="true" focusable="false">
|
||||
<ellipse class="shadow" cx="126" cy="198" rx="44" ry="5" />
|
||||
<g class="bob">
|
||||
<g class="dd-skull">
|
||||
<g class="dd-jaw">
|
||||
<rect class="dd-bone" x="176" y="112" width="22" height="16" rx="5" />
|
||||
<line class="lt" x1="183" y1="120" x2="183" y2="127" />
|
||||
<line class="lt" x1="191" y1="120" x2="191" y2="127" />
|
||||
</g>
|
||||
<path class="dd-bone" d="M187 88 A17 17 0 0 0 170 105 C170 112 173 116 178 119 L196 119 C201 116 204 112 204 105 A17 17 0 0 0 187 88 Z" />
|
||||
<circle class="fl" cx="180" cy="105" r="4.5" />
|
||||
<circle class="fl" cx="194" cy="105" r="4.5" />
|
||||
<path class="fl" d="M187 110 L184.5 115 L189.5 115 Z" />
|
||||
</g>
|
||||
<g transform="translate(-14 0)">
|
||||
<rect class="fl foot f1" x="94" y="179" width="20" height="10" rx="5" />
|
||||
<rect class="fl foot f2" x="126" y="179" width="20" height="10" rx="5" />
|
||||
<rect class="sh" x="80" y="72" width="80" height="108" rx="16" />
|
||||
<path class="ln" d="M80 126 L66 150" /><circle class="fl" cx="66" cy="150" r="5.5" />
|
||||
<g class="dd-look"><path class="ey blink" d="M126 86 L129.64 94.98 L139.31 95.67 L131.9 101.92 L134.23 111.33 L126 106.2 L117.77 111.33 L120.1 101.92 L112.69 95.67 L122.36 94.98 Z" /></g>
|
||||
<path class="es" d="M110 120 Q122 129 134 120" />
|
||||
<line class="ln" x1="160" y1="126" x2="196" y2="136" />
|
||||
<circle class="fl" cx="200" cy="136" r="5.5" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
<!-- Agent setup: waving hello at a terminal window, its prompt waiting
|
||||
for the command line that brings an agent. -->
|
||||
<svg class="pose pose-setup" data-pose="setup" viewBox="0 4 240 216" aria-hidden="true" focusable="false">
|
||||
|
||||
@@ -54,8 +54,8 @@ import { helperRows, showTab } from "../subagents.js";
|
||||
import { FOOTER_TIERS, footerLabel } from "../workspace.js";
|
||||
import {
|
||||
activity, agentAdrift, agentWorking, askBusy, loopDriving, loopWaiting, loopWaitingKey, asked, awaitingReply, byId, dashboardLive, docs, doingNow,
|
||||
AGENTS_VIEW, agentsTabShown, finish, gitAwaiting, isDashboard, isGitBoard, isOpen, isSpecFileView, items, loadAgentsDoc, loadOverview, myTurn, openItems,
|
||||
finishKey, patience, pressStranded, reviewPending, scan, selSpec, sendCollected, specFileTabs, stagedCount, stranded,
|
||||
AGENTS_VIEW, agentsTabShown, finish, gitAwaiting, isDashboard, isGitBoard, isOpen, isSpecFileView, items, loadAgentsDoc, loadOverview, loadSpecCarry, myTurn, openItems,
|
||||
finishKey, overviewSpec, patience, pressStranded, reviewPending, scan, selSpec, sendCollected, specFileTabs, stagedCount, stranded,
|
||||
topics, workingMs, WORKING_GRACE_MS,
|
||||
workspaceFolders,
|
||||
} from "../selectors.js";
|
||||
@@ -550,6 +550,8 @@ export function adopt(body) {
|
||||
// A spec file tab's file changes under a build, so a tab you are watching
|
||||
// refetches on every new frame too, not only on the click that opened it.
|
||||
if (firstLoad || page.S.specDir !== prevSpecDir || page.S.workflow !== prevWorkflow || isSpecFileView(page.view)) loadOverview();
|
||||
// A New Session in the app leaves the spec it was in; the fresh dashboard picks it up once its scan is here.
|
||||
loadSpecCarry();
|
||||
// The Dashboard's AGENTS.md tab: found on arrival, re-read while it is open.
|
||||
if (firstLoad || page.S.workflow !== prevWorkflow || page.view === AGENTS_VIEW) loadAgentsDoc();
|
||||
if (announce) showArrival(announce);
|
||||
@@ -1131,8 +1133,20 @@ function renderMeter() {
|
||||
);
|
||||
}
|
||||
|
||||
// The spec in hand, quiet beside the meter: the picker's pick on the
|
||||
// dashboard, the session's own spec everywhere else (overviewSpec()).
|
||||
function renderSpecTag() {
|
||||
const tag = $("spec-tag");
|
||||
const dir = isAgentless(page.S.workflow) ? "" : overviewSpec();
|
||||
const name = dir ? (isDashboard() && selSpec()?.name) || dir.replace(/^specs\//, "") : "";
|
||||
tag.hidden = !name;
|
||||
tag.textContent = name;
|
||||
tag.title = name ? "Spec: " + dir : "";
|
||||
}
|
||||
|
||||
function renderChrome() {
|
||||
renderMeter();
|
||||
renderSpecTag();
|
||||
$("title").textContent = page.S.title || "Session";
|
||||
$("badge").textContent = workflowLabel(page.S.workflow);
|
||||
renderTabTitle();
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// Plain functions over `page` (state.js) that more than one screen asks the
|
||||
// same question of, kept here so no screen has to import another to ask it.
|
||||
|
||||
import { page, redraw } from "./state.js";
|
||||
import { page, redraw, saveNow } from "./state.js";
|
||||
import { boardAwaiting } from "./git-board.js";
|
||||
import { defaultSpec, reviewOffer, dashboardOffer, submittedAwaiting, quietLimitMs } from "./answers.js";
|
||||
import { isAgentless } from "./skills.js";
|
||||
@@ -338,6 +338,26 @@ export async function loadOverview() {
|
||||
if (changed) redraw();
|
||||
}
|
||||
|
||||
// A New Session in the desktop app leaves the spec it was in for the fresh
|
||||
// dashboard (spec-carry.mjs). Asked once per page, before the picker is
|
||||
// touched; used only if the picker lists that spec, else the default stands.
|
||||
let specCarryAsked = false;
|
||||
export async function loadSpecCarry() {
|
||||
if (specCarryAsked || !isDashboard() || !scan() || page.local.specSel !== undefined) return;
|
||||
specCarryAsked = true;
|
||||
try {
|
||||
const res = await fetch("/spec-carry", { method: "POST", cache: "no-store" });
|
||||
const { spec } = res.status === 200 ? await res.json() : {};
|
||||
if (!spec || page.local.specSel !== undefined || !specList().some((s) => s.dir === spec)) return;
|
||||
page.local.specSel = spec;
|
||||
saveNow();
|
||||
redraw();
|
||||
loadOverview();
|
||||
} catch {
|
||||
/* no hint: the picker keeps its default */
|
||||
}
|
||||
}
|
||||
|
||||
// The Dashboard's AGENTS.md tab: its view id, and whether it is on now (the
|
||||
// dashboard, with an AGENTS.md the last read found).
|
||||
export const AGENTS_VIEW = "agents-md";
|
||||
|
||||
@@ -151,6 +151,14 @@
|
||||
.meter-fresh-row .handoff-code { flex-basis: 180px; font-size: 12px; padding: 6px 10px; }
|
||||
.meter-item-points { flex: none; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
|
||||
|
||||
/* The spec in hand: small and muted so it never competes with the title. */
|
||||
.spec-tag {
|
||||
flex: 0 1 auto; min-width: 0; max-width: 220px; align-self: center;
|
||||
font-size: 11.5px; color: var(--ink-3);
|
||||
overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
|
||||
}
|
||||
.spec-tag[hidden] { display: none; }
|
||||
|
||||
.badge {
|
||||
font-size: 11px;
|
||||
font-weight: 700;
|
||||
|
||||
Reference in new issue
Block a user