Merge branch 'worktree-agent-a5237c6dc3ebf4b7c'
This commit is contained in:
commit
9a73d0eb8f
7 files changed
+133
-34
No files matched your search
+14
-2
@@ -192,6 +192,13 @@ button.secondary {
|
|||||||
font-size: 0.8rem;
|
font-size: 0.8rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* -- pulls ------------------------------------------------------------------ */
|
||||||
|
/* "Run one stage" on the Pulls page: extract, embed and score on their own,
|
||||||
|
under the schedule rather than beside Pull now. */
|
||||||
|
|
||||||
|
details.stage summary { cursor: pointer; color: var(--dim); font-size: 0.95rem; font-weight: 600; }
|
||||||
|
details.stage[open] summary { margin-bottom: 0.75rem; }
|
||||||
|
|
||||||
/* -- the notice log ------------------------------------------------------- */
|
/* -- the notice log ------------------------------------------------------- */
|
||||||
|
|
||||||
.notice {
|
.notice {
|
||||||
@@ -277,8 +284,13 @@ desk-jobs, desk-schedules, auth-account {
|
|||||||
--desk-jobs-gap: var(--gap);
|
--desk-jobs-gap: var(--gap);
|
||||||
--desk-jobs-radius: var(--radius);
|
--desk-jobs-radius: var(--radius);
|
||||||
}
|
}
|
||||||
/* The schedule table has no narrow layout of its own yet, and what overflows
|
/* pipeline 21c5faa gave the schedule table a narrow layout, but its
|
||||||
a shadow root widens the page. It scrolls inside its own box instead. */
|
kind/next/last columns are sized to their untruncated content rather than
|
||||||
|
the width their own ellipsis implies, which still squeezes the name and
|
||||||
|
cadence columns to a sliver at 375px -- a fix that has to land in
|
||||||
|
../boilerplate first, or the next refresh reverts it (see CLAUDE.md). Kept
|
||||||
|
until then so the odd pixel that still overflows scrolls inside its own
|
||||||
|
box rather than widening the page. */
|
||||||
desk-schedules { overflow-x: auto; }
|
desk-schedules { overflow-x: auto; }
|
||||||
|
|
||||||
/* -- roledesk's tabs ------------------------------------------------------ */
|
/* -- roledesk's tabs ------------------------------------------------------ */
|
||||||
|
|||||||
+14
-4
@@ -1,8 +1,11 @@
|
|||||||
/* The Pulls page: a button per kind.
|
/* The Pulls page: Pull now on top, one button per remaining kind under
|
||||||
|
* "Run one stage".
|
||||||
*
|
*
|
||||||
* The list comes from `/api/jobs/kinds`, which is the registry, so a new
|
* The list comes from `/api/jobs/kinds`, which is the registry, so a new
|
||||||
* `@job` in `app/jobs.py` is a new button and this file is not edited. What
|
* `@job` in `app/jobs.py` is a new button and this file is not edited --
|
||||||
* the queue is doing is `<desk-jobs>`'s business, and it draws itself.
|
* except that `pull` itself is pulled out of the list and wired to the
|
||||||
|
* dedicated button instead of appearing twice. What the queue is doing is
|
||||||
|
* `<desk-jobs>`'s business, and it draws itself.
|
||||||
*
|
*
|
||||||
* Failures are the server's sentence through `api()`, which toasts it -- so
|
* Failures are the server's sentence through `api()`, which toasts it -- so
|
||||||
* there is no error handling here beyond keeping the button usable.
|
* there is no error handling here beyond keeping the button usable.
|
||||||
@@ -12,7 +15,7 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
const host = document.getElementById("kinds");
|
const host = document.getElementById("kinds");
|
||||||
if (!host) return;
|
const pullButton = document.getElementById("pull-now");
|
||||||
|
|
||||||
async function start(kind, button) {
|
async function start(kind, button) {
|
||||||
button.disabled = true;
|
button.disabled = true;
|
||||||
@@ -26,7 +29,12 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pullButton) {
|
||||||
|
pullButton.addEventListener("click", () => start("pull", pullButton));
|
||||||
|
}
|
||||||
|
|
||||||
async function draw() {
|
async function draw() {
|
||||||
|
if (!host) return;
|
||||||
let kinds;
|
let kinds;
|
||||||
try {
|
try {
|
||||||
kinds = await window.api("/api/jobs/kinds");
|
kinds = await window.api("/api/jobs/kinds");
|
||||||
@@ -34,6 +42,7 @@
|
|||||||
host.innerHTML = '<span class="muted">could not read the job kinds</span>';
|
host.innerHTML = '<span class="muted">could not read the job kinds</span>';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
kinds = kinds.filter((k) => k.kind !== "pull");
|
||||||
if (!kinds.length) {
|
if (!kinds.length) {
|
||||||
host.innerHTML = '<span class="muted">nothing is registered</span>';
|
host.innerHTML = '<span class="muted">nothing is registered</span>';
|
||||||
return;
|
return;
|
||||||
@@ -42,6 +51,7 @@
|
|||||||
kinds.forEach((k) => {
|
kinds.forEach((k) => {
|
||||||
const button = document.createElement("button");
|
const button = document.createElement("button");
|
||||||
button.type = "button";
|
button.type = "button";
|
||||||
|
button.className = "secondary";
|
||||||
button.textContent = k.label || k.kind;
|
button.textContent = k.label || k.kind;
|
||||||
button.title = k.solo ? `${k.kind} -- one at a time` : k.kind;
|
button.title = k.solo ? `${k.kind} -- one at a time` : k.kind;
|
||||||
button.dataset.kind = k.kind;
|
button.dataset.kind = k.kind;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<h1>Settings</h1>
|
<h1>Settings</h1>
|
||||||
{% include "settings/_tabs.html" %}
|
{% include "settings/_tabs.html" %}
|
||||||
|
|
||||||
<p class="lede">What the server said that nobody has cleared yet, newest first, with the fix when there is one. A message goes when you clear it, or two weeks after it was last said.</p>
|
<p class="lede">What the server said that nobody has cleared, newest first. A message goes when you clear it, or a fortnight after it was last said.</p>
|
||||||
|
|
||||||
<section class="card">
|
<section class="card">
|
||||||
<div class="row-between">
|
<div class="row-between">
|
||||||
|
|||||||
@@ -8,21 +8,16 @@
|
|||||||
<p class="lede">Every 6 hours roledesk reads every board and search, then fills in what each posting says, embeds and scores. Change the cadence below.</p>
|
<p class="lede">Every 6 hours roledesk reads every board and search, then fills in what each posting says, embeds and scores. Change the cadence below.</p>
|
||||||
|
|
||||||
<section class="card">
|
<section class="card">
|
||||||
<h2>Start something</h2>
|
<div class="row-between">
|
||||||
<div id="kinds" class="buttons">
|
<h2>What is running</h2>
|
||||||
<span class="muted">loading…</span>
|
<button type="button" id="pull-now" class="secondary">Pull now</button>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
{# The heading and the idle line are the app's: the element takes up no
|
||||||
|
space while the queue is idle — that is its `idle="hide"` default, and a
|
||||||
<section class="card">
|
strip that is always there is furniture — and a card with nothing in it
|
||||||
{# The queue's own element, served by its own router. Two lines, and the
|
and nothing above it reads as something that failed to load. The element
|
||||||
module owns what they draw — see pipeline/web/static/jobs.js.
|
and its script are the queue's own, served by its own router — see
|
||||||
|
pipeline/web/static/jobs.js. #}
|
||||||
The heading is the app's, because the element takes up no space while
|
|
||||||
nothing is running — that is its `idle="hide"` default, and a strip that
|
|
||||||
is always there is furniture — and a card with nothing in it and nothing
|
|
||||||
above it reads as something that failed to load. #}
|
|
||||||
<h2>What is running</h2>
|
|
||||||
<p class="muted small" id="idle">Nothing at the moment.</p>
|
<p class="muted small" id="idle">Nothing at the moment.</p>
|
||||||
<script type="module" src="/_jobs/jobs.js"></script>
|
<script type="module" src="/_jobs/jobs.js"></script>
|
||||||
<desk-jobs></desk-jobs>
|
<desk-jobs></desk-jobs>
|
||||||
@@ -30,13 +25,20 @@
|
|||||||
|
|
||||||
<section class="card">
|
<section class="card">
|
||||||
{# The element and its script are the scheduler's own, served by its own
|
{# The element and its script are the scheduler's own, served by its own
|
||||||
router — see pipeline/web/static/schedules.js. Two lines, as with jobs.
|
router — see pipeline/web/static/schedules.js. A cadence is typed as
|
||||||
A cadence is typed as `every 15m`, `every 6h`, `daily at 06:00` or
|
`every 15m`, `every 6h`, `daily at 06:00` or `weekly mon 07:00`; its add
|
||||||
`weekly mon 07:00`; its add row's placeholder shows two. #}
|
row's placeholder shows two. #}
|
||||||
<h2>Schedule</h2>
|
<h2>Schedule</h2>
|
||||||
<script type="module" src="/_jobs/schedules.js"></script>
|
<script type="module" src="/_jobs/schedules.js"></script>
|
||||||
<desk-schedules></desk-schedules>
|
<desk-schedules></desk-schedules>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
<details class="stage">
|
||||||
|
<summary>Run one stage</summary>
|
||||||
|
<div id="kinds" class="buttons">
|
||||||
|
<span class="muted">loading…</span>
|
||||||
|
</div>
|
||||||
|
</details>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block scripts %}
|
{% block scripts %}
|
||||||
|
|||||||
+2
-2
@@ -58,7 +58,7 @@ That mounts `GET /api/jobs`, `POST /api/jobs`, `POST /api/jobs/{id}/cancel`, the
|
|||||||
<desk-jobs></desk-jobs>
|
<desk-jobs></desk-jobs>
|
||||||
```
|
```
|
||||||
|
|
||||||
It themes from CSS custom properties (`--desk-jobs-bg`, `--desk-jobs-accent`, …) and raises a `desk-jobs:notice` DOM event for failures instead of wording them. The wording is the app's.
|
It themes from CSS custom properties (`--desk-jobs-bg`, `--desk-jobs-accent`, …) and raises a `desk-jobs:notice` DOM event for failures instead of wording them. The wording is the app's. On a phone it drops its own padding (the app's card around it is the gutter) and under a coarse pointer Kill is a thumb's height; the width it calls a phone is `40rem`, the same number the app's stylesheet uses.
|
||||||
|
|
||||||
## Many jobs and one report
|
## Many jobs and one report
|
||||||
|
|
||||||
@@ -144,7 +144,7 @@ Over HTTP, from `pipeline.web.connect`: `GET/POST /api/schedules`, `PATCH`/`DELE
|
|||||||
<desk-schedules></desk-schedules>
|
<desk-schedules></desk-schedules>
|
||||||
```
|
```
|
||||||
|
|
||||||
`<desk-schedules>` is the table: name, kind, cadence edited in place, an on/off toggle, next and last run with the last job's state, Run now, Delete, and a row for adding one. Same `--desk-jobs-*` custom properties as `<desk-jobs>`, and just as silent about failures — it raises `desk-schedules:error` carrying the server's `detail` and leaves the wording to the app.
|
`<desk-schedules>` is the table: name, kind, cadence edited in place, an on/off toggle, next and last run with the last job's state, Run now, Delete, and a row for adding one. Same `--desk-jobs-*` custom properties as `<desk-jobs>`, and just as silent about failures — it raises `desk-schedules:error` carrying the server's `detail` and leaves the wording to the app. Under `40rem` the table is a card per schedule — the name and the switch on the first line, the other columns labelled under it, the two buttons across the bottom — from the same markup, because each cell carries its column's name as `data-label`.
|
||||||
|
|
||||||
## A worker without the web app
|
## A worker without the web app
|
||||||
|
|
||||||
|
|||||||
@@ -89,6 +89,18 @@ button:hover { color: var(--desk-jobs-error); }
|
|||||||
button[disabled] { opacity: .4; cursor: default; }
|
button[disabled] { opacity: .4; cursor: default; }
|
||||||
|
|
||||||
.offline { color: var(--desk-jobs-error); }
|
.offline { color: var(--desk-jobs-error); }
|
||||||
|
|
||||||
|
/* A finger: Kill is a thumb's height. Sizes only; the layout is the width
|
||||||
|
* query below, and neither reads the other. */
|
||||||
|
@media (pointer: coarse) {
|
||||||
|
button { min-height: 2.5rem; padding: 4px 12px; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/* A phone: the app's card around the strip is the gutter, and a second one
|
||||||
|
* inside it wasted a fifth of the width. 40rem is app.css's number. */
|
||||||
|
@media (max-width: 40rem) {
|
||||||
|
.strip { padding: 0; }
|
||||||
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
/** Backing off rather than hammering. The usual reason a socket closed is the
|
/** Backing off rather than hammering. The usual reason a socket closed is the
|
||||||
|
|||||||
@@ -118,6 +118,61 @@ button[disabled] { opacity: .4; cursor: default; }
|
|||||||
|
|
||||||
.empty, .offline { color: var(--desk-jobs-dim); padding: 6px 0; }
|
.empty, .offline { color: var(--desk-jobs-dim); padding: 6px 0; }
|
||||||
.offline { color: var(--desk-jobs-error); }
|
.offline { color: var(--desk-jobs-error); }
|
||||||
|
|
||||||
|
/* A finger: every control a thumb's height, and no field under 16px, which
|
||||||
|
* is where iOS zooms the page in on focus and never back out. Sizes only;
|
||||||
|
* the layout is the width query below, and neither reads the other. */
|
||||||
|
@media (pointer: coarse) {
|
||||||
|
button { min-height: 2.5rem; padding: 4px 12px; }
|
||||||
|
input, select { font-size: 16px; padding: 6px 8px; }
|
||||||
|
input[type="checkbox"] { width: 1.4rem; height: 1.4rem; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/* A phone: seven columns do not fit in 375 pixels, so each row folds to two
|
||||||
|
* lines instead -- name, kind and the switch on top, cadence, next, last and
|
||||||
|
* the actions underneath -- and the header goes, since there is nothing left
|
||||||
|
* to label. */
|
||||||
|
@media (max-width: 40rem) {
|
||||||
|
.panel { padding: 0; }
|
||||||
|
table, tbody { display: block; }
|
||||||
|
thead { display: none; }
|
||||||
|
tr {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 1fr auto auto auto;
|
||||||
|
column-gap: 8px;
|
||||||
|
row-gap: 2px;
|
||||||
|
align-items: center;
|
||||||
|
padding: 8px 0;
|
||||||
|
border-bottom: 1px solid color-mix(in srgb, var(--desk-jobs-fg) 12%, transparent);
|
||||||
|
}
|
||||||
|
tr:last-child { border-bottom: 0; }
|
||||||
|
td, th { display: block; padding: 0; border: 0; min-width: 0; }
|
||||||
|
td:empty { display: none; }
|
||||||
|
td.name { grid-column: 1; grid-row: 1; font-size: 14px; }
|
||||||
|
td.kind { grid-column: 2 / 4; grid-row: 1; }
|
||||||
|
td.on { grid-column: 4; grid-row: 1; justify-self: end; }
|
||||||
|
td.cadence { grid-column: 1; grid-row: 2; }
|
||||||
|
td.next { grid-column: 2; grid-row: 2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||||
|
td.last { grid-column: 3; grid-row: 2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||||
|
td.actions {
|
||||||
|
grid-column: 4; grid-row: 2; justify-self: end;
|
||||||
|
display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px;
|
||||||
|
}
|
||||||
|
td.actions button { margin: 0; }
|
||||||
|
/* A box that looks like text until hovered has nothing to hover with. */
|
||||||
|
input.cadence { border-color: color-mix(in srgb, var(--desk-jobs-fg) 20%, transparent); min-width: 0; width: 100%; }
|
||||||
|
/* The add row: label over field, each field the width of the card. */
|
||||||
|
tr.adder { grid-template-columns: 1fr; }
|
||||||
|
tr.adder td { grid-column: 1; }
|
||||||
|
tr.adder td[data-label]::before {
|
||||||
|
content: attr(data-label) " ";
|
||||||
|
display: block;
|
||||||
|
font-size: 11px;
|
||||||
|
color: var(--desk-jobs-dim);
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
tr.adder input, tr.adder select { width: 100%; min-width: 0; border-color: color-mix(in srgb, var(--desk-jobs-fg) 20%, transparent); }
|
||||||
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
/** The same backoff as `<desk-jobs>`: the usual reason a socket closed is the
|
/** The same backoff as `<desk-jobs>`: the usual reason a socket closed is the
|
||||||
@@ -381,7 +436,7 @@ class DeskSchedules extends HTMLElement {
|
|||||||
|
|
||||||
row.append(this.#cell("name", schedule.name));
|
row.append(this.#cell("name", schedule.name));
|
||||||
|
|
||||||
const kind = this.#cell("kind", schedule.kind);
|
const kind = this.#cell("kind", schedule.kind, "Kind");
|
||||||
if (schedule.unknown) {
|
if (schedule.unknown) {
|
||||||
// Never fires, and says so rather than sitting there with a next run it
|
// Never fires, and says so rather than sitting there with a next run it
|
||||||
// is not going to keep. Deleting it is the only thing left to do.
|
// is not going to keep. Deleting it is the only thing left to do.
|
||||||
@@ -393,6 +448,8 @@ class DeskSchedules extends HTMLElement {
|
|||||||
row.append(kind);
|
row.append(kind);
|
||||||
|
|
||||||
const cadence = document.createElement("td");
|
const cadence = document.createElement("td");
|
||||||
|
cadence.className = "cadence";
|
||||||
|
cadence.dataset.label = "Cadence";
|
||||||
const box = document.createElement("input");
|
const box = document.createElement("input");
|
||||||
box.className = "cadence";
|
box.className = "cadence";
|
||||||
box.value = schedule.cadence;
|
box.value = schedule.cadence;
|
||||||
@@ -413,6 +470,7 @@ class DeskSchedules extends HTMLElement {
|
|||||||
row.append(cadence);
|
row.append(cadence);
|
||||||
|
|
||||||
const onOff = document.createElement("td");
|
const onOff = document.createElement("td");
|
||||||
|
onOff.className = "on";
|
||||||
const toggle = document.createElement("input");
|
const toggle = document.createElement("input");
|
||||||
toggle.type = "checkbox";
|
toggle.type = "checkbox";
|
||||||
toggle.checked = !!schedule.enabled;
|
toggle.checked = !!schedule.enabled;
|
||||||
@@ -424,9 +482,9 @@ class DeskSchedules extends HTMLElement {
|
|||||||
onOff.append(toggle);
|
onOff.append(toggle);
|
||||||
row.append(onOff);
|
row.append(onOff);
|
||||||
|
|
||||||
row.append(this.#cell("when", schedule.enabled ? when(schedule.next_run) : "—"));
|
row.append(this.#cell("when next", schedule.enabled ? when(schedule.next_run) : "—", "Next"));
|
||||||
|
|
||||||
const last = this.#cell("when", when(schedule.last_run));
|
const last = this.#cell("when last", when(schedule.last_run), "Last");
|
||||||
if (schedule.last_state) {
|
if (schedule.last_state) {
|
||||||
const state = document.createElement("span");
|
const state = document.createElement("span");
|
||||||
state.className = `state ${schedule.last_state}`;
|
state.className = `state ${schedule.last_state}`;
|
||||||
@@ -454,9 +512,12 @@ class DeskSchedules extends HTMLElement {
|
|||||||
return row;
|
return row;
|
||||||
}
|
}
|
||||||
|
|
||||||
#cell(className, text) {
|
/** `label` is the column's name, which the phone layout writes in front of
|
||||||
|
* the value once the header row is gone. */
|
||||||
|
#cell(className, text, label) {
|
||||||
const cell = document.createElement("td");
|
const cell = document.createElement("td");
|
||||||
cell.className = className;
|
cell.className = className;
|
||||||
|
if (label) cell.dataset.label = label;
|
||||||
const span = document.createElement("span");
|
const span = document.createElement("span");
|
||||||
span.textContent = text;
|
span.textContent = text;
|
||||||
cell.append(span);
|
cell.append(span);
|
||||||
@@ -468,13 +529,14 @@ class DeskSchedules extends HTMLElement {
|
|||||||
* each box is for. */
|
* each box is for. */
|
||||||
#adder() {
|
#adder() {
|
||||||
const row = document.createElement("tr");
|
const row = document.createElement("tr");
|
||||||
|
row.className = "adder";
|
||||||
const busy = this.#busy.has(0);
|
const busy = this.#busy.has(0);
|
||||||
|
|
||||||
const name = document.createElement("input");
|
const name = document.createElement("input");
|
||||||
name.className = "text";
|
name.className = "text";
|
||||||
name.placeholder = "optional";
|
name.placeholder = "optional";
|
||||||
name.disabled = busy;
|
name.disabled = busy;
|
||||||
row.append(this.#wrap(name));
|
row.append(this.#wrap(name, "Name"));
|
||||||
|
|
||||||
const kind = document.createElement("select");
|
const kind = document.createElement("select");
|
||||||
kind.disabled = busy || !this.#kinds.length;
|
kind.disabled = busy || !this.#kinds.length;
|
||||||
@@ -489,14 +551,14 @@ class DeskSchedules extends HTMLElement {
|
|||||||
none.textContent = this.#loaded ? "nothing registered" : "loading…";
|
none.textContent = this.#loaded ? "nothing registered" : "loading…";
|
||||||
kind.append(none);
|
kind.append(none);
|
||||||
}
|
}
|
||||||
row.append(this.#wrap(kind));
|
row.append(this.#wrap(kind, "Kind"));
|
||||||
|
|
||||||
const cadence = document.createElement("input");
|
const cadence = document.createElement("input");
|
||||||
cadence.className = "text";
|
cadence.className = "text";
|
||||||
cadence.placeholder = HINT;
|
cadence.placeholder = HINT;
|
||||||
cadence.title = FORMS;
|
cadence.title = FORMS;
|
||||||
cadence.disabled = busy;
|
cadence.disabled = busy;
|
||||||
row.append(this.#wrap(cadence));
|
row.append(this.#wrap(cadence, "Cadence"));
|
||||||
|
|
||||||
row.append(document.createElement("td"), document.createElement("td"),
|
row.append(document.createElement("td"), document.createElement("td"),
|
||||||
document.createElement("td"));
|
document.createElement("td"));
|
||||||
@@ -529,8 +591,9 @@ class DeskSchedules extends HTMLElement {
|
|||||||
return row;
|
return row;
|
||||||
}
|
}
|
||||||
|
|
||||||
#wrap(control) {
|
#wrap(control, label) {
|
||||||
const cell = document.createElement("td");
|
const cell = document.createElement("td");
|
||||||
|
cell.dataset.label = label;
|
||||||
cell.append(control);
|
cell.append(control);
|
||||||
return cell;
|
return cell;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user