clavarium 0.2.19 → 0.2.20-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/web/app.js +230 -5
- package/web/style.css +36 -0
package/README.md
CHANGED
|
@@ -176,6 +176,14 @@ send"): the server fetches the commits into a copy of its own, shows them, and
|
|
|
176
176
|
pushes exactly what was shown with a key it keeps sealed (`server/gitpush.mjs`).
|
|
177
177
|
The tool never holds that key.
|
|
178
178
|
|
|
179
|
+
"To send", first in a conversation's Assets, shows every repository of that
|
|
180
|
+
conversation on one screen: each one its agent committed to is ticked, with
|
|
181
|
+
its branch and where it goes, and its checks run by themselves. One review
|
|
182
|
+
shows the changes of all those ticked; one button sends them one after the
|
|
183
|
+
other, each exactly as its own review would (the same commit, the same
|
|
184
|
+
target, the same guards). One refused, for example because its remote moved,
|
|
185
|
+
does not hold the others back, and each says what became of it.
|
|
186
|
+
|
|
179
187
|
A repository may also be cloned from a private remote (`server/gitaccess.mjs`),
|
|
180
188
|
over SSH (`user@host:path`, `ssh://...`) or HTTPS. The safest way in comes
|
|
181
189
|
first: an SSH key made by the server, whose private half is sealed in the vault
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clavarium",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.20-next.1",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "clavarium",
|
|
9
|
-
"version": "0.2.
|
|
9
|
+
"version": "0.2.20-next.1",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@xterm/addon-fit": "^0.11.0",
|
package/package.json
CHANGED
package/web/app.js
CHANGED
|
@@ -2769,7 +2769,7 @@
|
|
|
2769
2769
|
const ASSET_KINDS = [['git', 'Git repositories', 'git-branch'], ['folder', 'Folders', 'folder'], ['mailbox', 'Mailboxes', 'mail'], ['secret', 'Secrets', 'key-round']];
|
|
2770
2770
|
const getJson = (path, fallback) => fetch(`${API}${path}`).then((r) => (r.ok ? r.json() : fallback)).catch(() => fallback);
|
|
2771
2771
|
const el = (tag, cls, text) => { const e = document.createElement(tag); if (cls) e.className = cls; if (text !== undefined) e.textContent = text; return e; };
|
|
2772
|
-
const kindIcon = (kind) => { const name = ASSET_KINDS.find((k) => k[0] === kind)?.[2]; const holder = el('span', 'as-ic'); holder.dataset.kind = kind; const svg = name ? window.clavariumIcons?.icon(name) : null; if (svg) holder.append(svg); return holder; };
|
|
2772
|
+
const kindIcon = (kind) => { const name = kind === 'send' ? 'arrow-up' : ASSET_KINDS.find((k) => k[0] === kind)?.[2]; const holder = el('span', 'as-ic'); holder.dataset.kind = kind; const svg = name ? window.clavariumIcons?.icon(name) : null; if (svg) holder.append(svg); return holder; };
|
|
2773
2773
|
const roundPlus = (label, onclick) => { const b = el('button', 'as-add', '+'); b.type = 'button'; b.setAttribute('aria-label', label); b.title = label; b.addEventListener('click', onclick); return b; };
|
|
2774
2774
|
/* The rows, by kind. items: [{key, kind, name, sub, badge, badgeTitle, tone}]. */
|
|
2775
2775
|
function paintAsList(holder, items, { chosen, choose, add, empty }) {
|
|
@@ -2811,7 +2811,7 @@
|
|
|
2811
2811
|
const gitSub = (r) => (r.from ? `from ${hostOf(r.from)}` : 'repository');
|
|
2812
2812
|
|
|
2813
2813
|
/* A repository, on the right: its branch, what would go, the diagram. */
|
|
2814
|
-
async function gitDetail(holder, name, { place = false } = {}) {
|
|
2814
|
+
async function gitDetail(holder, name, { place = false, others = false } = {}) {
|
|
2815
2815
|
const facts = el('div', 'as-facts'); facts.append(el('p', 'hint busy', 'Looking at its branches...'));
|
|
2816
2816
|
const acts = el('div', 'as-acts');
|
|
2817
2817
|
const review = el('button', '', 'Open the review'); review.type = 'button'; review.dataset.act = 'review';
|
|
@@ -2838,7 +2838,7 @@
|
|
|
2838
2838
|
facts.append(line, cards);
|
|
2839
2839
|
const last = lastFor(keep?.last, out);
|
|
2840
2840
|
if (last) facts.append(lastChecksCard(name, { ...last, outdated: moved(last, out) }, back));
|
|
2841
|
-
if (out.state === 'ahead' && out.target) { send.hidden = false; send.textContent = `Send to ${out.target}...`; send.addEventListener('click', () => { void openGit(name, { back, target: out.target, branch: out.branch ?? '' }); }); }
|
|
2841
|
+
if (out.state === 'ahead' && out.target) { send.hidden = false; send.textContent = `Send to ${out.target}...`; send.addEventListener('click', () => { if (others) pickRoomAsset('send:all'); else void openGit(name, { back, target: out.target, branch: out.branch ?? '' }); }); }
|
|
2842
2842
|
}
|
|
2843
2843
|
diagram.replaceChildren(graph ? window.clavariumGraph.draw(graph, { pick: (c) => { void openGit(name, { commit: c.id, back }); } }) : el('p', 'hint', 'The branches could not be read.'));
|
|
2844
2844
|
}
|
|
@@ -2878,6 +2878,219 @@
|
|
|
2878
2878
|
box.append(head, line, acts);
|
|
2879
2879
|
return box;
|
|
2880
2880
|
}
|
|
2881
|
+
/* TO SEND: every repository of a conversation on one screen. What its
|
|
2882
|
+
agent committed, ticked when there is something to send; the checks run
|
|
2883
|
+
by themselves; one review of them all; one button sends them one after
|
|
2884
|
+
the other, each by the same route as its own review (the same commit,
|
|
2885
|
+
the same target, the same guards). One refused does not hold the
|
|
2886
|
+
others back: each says what became of it. */
|
|
2887
|
+
const STATE_SAID = { 'up-to-date': 'up to date', diverged: 'behind: its agent must pull first', 'no-remote': 'no remote', unreachable: 'remote not answering', empty: 'empty' };
|
|
2888
|
+
async function sendDetail(holder, names) {
|
|
2889
|
+
const list = el('div', 'ts-rows'); list.append(el('p', 'hint busy', 'Looking at every repository...'));
|
|
2890
|
+
const bar = el('div', 'as-acts ts-bar');
|
|
2891
|
+
const together = el('button', '', 'Review together'); together.type = 'button'; together.dataset.act = 'send-review';
|
|
2892
|
+
const go = el('button', 'primary', 'Send'); go.type = 'button'; go.dataset.act = 'send-all';
|
|
2893
|
+
const why = el('span', 'hint ts-why');
|
|
2894
|
+
bar.append(together, go, why);
|
|
2895
|
+
const said = el('p', 'ts-said'); said.hidden = true; said.setAttribute('role', 'status');
|
|
2896
|
+
const review = el('div', 'ts-review'); review.hidden = true;
|
|
2897
|
+
holder.append(el('p', 'hint', 'What its agent committed, in every repository of this conversation. The checks run by themselves.'), list, bar, said, review);
|
|
2898
|
+
const rows = names.map((name) => ({ name, out: null, keep: null, branch: '', target: '', picked: false, check: null, sent: null }));
|
|
2899
|
+
let sending = false;
|
|
2900
|
+
let sure = '';
|
|
2901
|
+
const picked = () => rows.filter((r) => r.picked && r.out?.state === 'ahead');
|
|
2902
|
+
/* One row looked at again: its branch and target as chosen; its checks run when it has something to send. */
|
|
2903
|
+
async function look(r) {
|
|
2904
|
+
const query = new URLSearchParams();
|
|
2905
|
+
if (r.branch) query.set('branch', r.branch);
|
|
2906
|
+
if (r.target) query.set('target', r.target);
|
|
2907
|
+
const [out, keep] = await Promise.all([fetch(`${API}/git/${r.name}/outgoing${query.size ? `?${query}` : ''}`).then(async (x) => { const j = await x.json().catch(() => ({})); return x.ok ? j : { state: 'error', message: j.error || 'It could not be read.' }; }).catch(() => ({ state: 'error', message: 'It could not be read.' })), r.keep ? r.keep : getJson(`/git/${r.name}/keep`, null)]);
|
|
2908
|
+
r.out = out; r.keep = keep; r.branch = out.branch ?? r.branch; r.target = out.target ?? r.target; r.check = null;
|
|
2909
|
+
if (out.state !== 'ahead') r.picked = false;
|
|
2910
|
+
paint();
|
|
2911
|
+
if (out.state === 'ahead') void checkRow(r, out.head, out.target);
|
|
2912
|
+
}
|
|
2913
|
+
async function checkRow(r, head, target) {
|
|
2914
|
+
r.check = { status: 'running' }; paint();
|
|
2915
|
+
let result;
|
|
2916
|
+
try { result = await post(`${API}/git/${r.name}/check`, { head, target }); }
|
|
2917
|
+
catch (error) { result = { status: 'unavailable', output: error.message }; }
|
|
2918
|
+
if (r.out?.head !== head || r.out?.target !== target) return;
|
|
2919
|
+
r.check = result; paint();
|
|
2920
|
+
}
|
|
2921
|
+
const stopped = (r) => Boolean(r.keep?.settings?.requireForSend) && r.check?.status !== 'passed';
|
|
2922
|
+
function paintButtons() {
|
|
2923
|
+
const p = picked();
|
|
2924
|
+
const targets = [...new Set(p.map((r) => r.target))];
|
|
2925
|
+
const where = targets.length === 1 ? ` to ${targets[0]}` : '';
|
|
2926
|
+
together.disabled = p.length === 0;
|
|
2927
|
+
together.textContent = p.length > 1 ? `Review the ${p.length} together` : 'Review';
|
|
2928
|
+
const running = p.filter((r) => r.check?.status === 'running');
|
|
2929
|
+
const held = p.filter((r) => r.check?.status !== 'running' && stopped(r));
|
|
2930
|
+
const failed = p.filter((r) => r.check?.status === 'failed');
|
|
2931
|
+
const word = p.length > 1 ? `the ${p.length}` : 'it';
|
|
2932
|
+
go.disabled = sending || p.length === 0 || running.length > 0 || held.length > 0;
|
|
2933
|
+
why.textContent = p.length === 0 ? 'Nothing ticked.' : running.length ? 'Waits for the checks.' : held.length ? `Its owner asked for passing checks: ${held.map((r) => r.name).join(', ')}.` : failed.length ? `Checks failed in ${failed.map((r) => r.name).join(', ')}.` : '';
|
|
2934
|
+
if (sending) { go.textContent = 'Sending...'; return; }
|
|
2935
|
+
const all = p.some((r) => r.out?.guards?.confirm);
|
|
2936
|
+
go.textContent = sure === 'yes' ? (all ? `Not all of it could be shown here: send ${word}${where} anyway` : `Yes, send ${word}${where}: this cannot be undone`) : sure === 'all' ? `Yes, send ${word}${where}: this cannot be undone` : `Send ${word}${where}${failed.length ? ' anyway' : ''}`;
|
|
2937
|
+
}
|
|
2938
|
+
function paint() {
|
|
2939
|
+
list.replaceChildren();
|
|
2940
|
+
for (const r of rows) {
|
|
2941
|
+
const row = el('div', 'ts-row'); row.dataset.repo = r.name;
|
|
2942
|
+
const out = r.out;
|
|
2943
|
+
const ahead = out?.state === 'ahead';
|
|
2944
|
+
row.classList.toggle('off', !ahead);
|
|
2945
|
+
const tick = el('input'); tick.type = 'checkbox'; tick.checked = r.picked; tick.disabled = !ahead || sending; tick.setAttribute('aria-label', `Send ${r.name}`);
|
|
2946
|
+
tick.addEventListener('change', () => { r.picked = tick.checked; sure = ''; paintButtons(); if (!review.hidden) paintReview(); });
|
|
2947
|
+
const who = el('div', 'ts-who'); who.append(el('b', '', r.name), el('small', 'hint', out?.remote ? hostOf(out.remote) : out ? 'no remote' : ''));
|
|
2948
|
+
const way = el('div', 'ts-way');
|
|
2949
|
+
if (out?.branch) {
|
|
2950
|
+
const branches = out.agentBranches ?? [];
|
|
2951
|
+
if (branches.length > 1) {
|
|
2952
|
+
const pick = el('select'); pick.setAttribute('aria-label', `The branch of ${r.name}`); pick.disabled = sending;
|
|
2953
|
+
for (const b of branches) { const o = el('option', '', b.name); o.value = b.name; pick.append(o); }
|
|
2954
|
+
pick.value = out.branch;
|
|
2955
|
+
pick.addEventListener('change', () => { r.branch = pick.value; r.target = ''; sure = ''; void look(r); });
|
|
2956
|
+
way.append(pick);
|
|
2957
|
+
} else way.append(el('code', 'ts-branch', out.branch));
|
|
2958
|
+
if (['ahead', 'up-to-date', 'diverged'].includes(out.state) && out.target) {
|
|
2959
|
+
way.append(el('span', 'ts-arrow', '→'));
|
|
2960
|
+
const to = el('select'); to.setAttribute('aria-label', `Where ${r.name} goes`); to.disabled = sending;
|
|
2961
|
+
const names2 = [...(out.branches ?? [])]; if (!names2.includes(out.target)) names2.unshift(out.target);
|
|
2962
|
+
for (const b of names2) { const o = el('option', '', b === out.target && !out.targetExists ? `${b} (new branch)` : b); o.value = b; to.append(o); }
|
|
2963
|
+
to.value = out.target;
|
|
2964
|
+
to.addEventListener('change', () => { r.target = to.value; sure = ''; void look(r); });
|
|
2965
|
+
way.append(to);
|
|
2966
|
+
}
|
|
2967
|
+
}
|
|
2968
|
+
const size = el('div', 'ts-size');
|
|
2969
|
+
if (!out) size.append(el('span', 'hint busy', 'Looking...'));
|
|
2970
|
+
else if (ahead) {
|
|
2971
|
+
const files = diffFiles(out.diff);
|
|
2972
|
+
size.append(el('span', '', out.count === null || out.count === undefined ? 'some commits' : `${out.count} commit${out.count === 1 ? '' : 's'}`), el('br'),
|
|
2973
|
+
el('span', 'plus', `+${files.reduce((n, f) => n + f.added, 0)}`), ' ', el('span', 'minus', `−${files.reduce((n, f) => n + f.removed, 0)}`));
|
|
2974
|
+
} else size.append(el('span', 'hint', out.state === 'up-to-date' ? 'nothing' : '-'));
|
|
2975
|
+
const state = el('div', 'ts-state');
|
|
2976
|
+
if (r.sent) state.append(el('b', r.sent.ok ? 'ok' : 'bad', r.sent.ok ? r.sent.text : '\u2717 Not sent'));
|
|
2977
|
+
else if (!out) state.append('');
|
|
2978
|
+
else if (!ahead) state.append(el('span', out.state === 'diverged' || out.state === 'unreachable' || out.state === 'error' ? 'bad' : 'hint', STATE_SAID[out.state] ?? out.message ?? out.state));
|
|
2979
|
+
else if (!r.check || r.check.status === 'running') state.append(el('span', 'warn', 'Checks running...'));
|
|
2980
|
+
else {
|
|
2981
|
+
const [word, tone] = CHECK_WORDS[r.check.status] ?? [String(r.check.status), ''];
|
|
2982
|
+
state.append(el('b', tone || 'quiet', r.check.status === 'passed' ? '✓ Checks passed' : r.check.status === 'failed' ? '✗ Checks failed' : word));
|
|
2983
|
+
}
|
|
2984
|
+
row.append(tick, who, way, size, state);
|
|
2985
|
+
if (r.sent && !r.sent.ok) row.append(el('p', 'ts-note bad', r.sent.text));
|
|
2986
|
+
list.append(row);
|
|
2987
|
+
}
|
|
2988
|
+
if (rows.length === 0) list.append(el('p', 'hint', 'No repository is given to it.'));
|
|
2989
|
+
paintButtons();
|
|
2990
|
+
}
|
|
2991
|
+
/* ONE REVIEW of them all: the files of each under its name, then each one's changes, commits and checks. */
|
|
2992
|
+
let tab = 'changes';
|
|
2993
|
+
function paintReview() {
|
|
2994
|
+
review.replaceChildren();
|
|
2995
|
+
const p = picked();
|
|
2996
|
+
if (p.length === 0) { review.hidden = true; return; }
|
|
2997
|
+
const all = p.map((r) => ({ r, files: diffFiles(r.out.diff) }));
|
|
2998
|
+
const nFiles = all.reduce((n, x) => n + x.files.length, 0);
|
|
2999
|
+
const added = all.reduce((n, x) => n + x.files.reduce((m, f) => m + f.added, 0), 0);
|
|
3000
|
+
const removed = all.reduce((n, x) => n + x.files.reduce((m, f) => m + f.removed, 0), 0);
|
|
3001
|
+
const commits = p.reduce((n, r) => n + (r.out.count ?? r.out.commits.length), 0);
|
|
3002
|
+
const head = el('div', 'ts-review-head');
|
|
3003
|
+
head.append(el('h3', '', `${p.length} repositor${p.length === 1 ? 'y' : 'ies'}`), el('p', 'as-line', `${commits} commit${commits === 1 ? '' : 's'} · ${nFiles} file${nFiles === 1 ? '' : 's'} · `));
|
|
3004
|
+
head.lastChild.append(el('span', 'plus', `+${added}`), ' ', el('span', 'minus', `−${removed}`));
|
|
3005
|
+
const tabs = el('div', 'rv-tabs ts-tabs'); tabs.setAttribute('role', 'tablist');
|
|
3006
|
+
const passed = p.filter((r) => r.check?.status === 'passed').length;
|
|
3007
|
+
for (const [key, word] of [['changes', `Changes ${nFiles}`], ['commits', `Commits ${commits}`], ['checks', `Checks ${passed}/${p.length}`]]) {
|
|
3008
|
+
const b = el('button', '', word); b.type = 'button'; b.dataset.tab = key; b.setAttribute('role', 'tab'); b.setAttribute('aria-selected', String(key === tab));
|
|
3009
|
+
b.addEventListener('click', () => { tab = key; paintReview(); });
|
|
3010
|
+
tabs.append(b);
|
|
3011
|
+
}
|
|
3012
|
+
const body = el('div', 'ts-review-body');
|
|
3013
|
+
review.append(head, tabs, body);
|
|
3014
|
+
if (tab === 'changes') {
|
|
3015
|
+
const tree = el('div', 'rv-tree ts-tree'); const diffs = el('div', 'rv-diff ts-diffs');
|
|
3016
|
+
for (const { r, files } of all) {
|
|
3017
|
+
tree.append(el('small', 'ts-tree-repo', r.name));
|
|
3018
|
+
const box = el('div', 'ts-diff'); box.dataset.repo = r.name;
|
|
3019
|
+
box.append(el('h4', '', `${r.name}: ${r.out.branch} → ${r.out.target}`));
|
|
3020
|
+
const inner = el('div'); box.append(inner);
|
|
3021
|
+
files.forEach((f, i) => {
|
|
3022
|
+
const b = el('button'); b.type = 'button'; b.dataset.how = f.how;
|
|
3023
|
+
b.append(el('span', 'rv-path', f.path), el('small', 'plus', `+${f.added}`), el('small', 'minus', `−${f.removed}`));
|
|
3024
|
+
b.addEventListener('click', () => { inner.querySelectorAll('.d2h-file-wrapper')[i]?.scrollIntoView({ block: 'start' }); });
|
|
3025
|
+
tree.append(b);
|
|
3026
|
+
});
|
|
3027
|
+
const Ui = window.Diff2HtmlUI;
|
|
3028
|
+
if (!r.out.diff) inner.append(el('p', 'hint', 'No change to show.'));
|
|
3029
|
+
else if (!Ui) inner.append(el('pre', '', r.out.diff));
|
|
3030
|
+
else {
|
|
3031
|
+
const ui = new Ui(inner, r.out.diff, { outputFormat: 'line-by-line', drawFileList: false, matching: 'lines', diffStyle: 'word', fileContentToggle: false, stickyFileHeaders: false, highlight: true, colorScheme: document.documentElement.dataset.theme === 'light' ? 'light' : 'dark' });
|
|
3032
|
+
ui.draw();
|
|
3033
|
+
try { ui.highlightCode(); } catch { /* the plain diff stays */ }
|
|
3034
|
+
}
|
|
3035
|
+
if (r.out.cut) inner.append(el('p', 'hint', '... (the rest is not shown here: too long)'));
|
|
3036
|
+
diffs.append(box);
|
|
3037
|
+
}
|
|
3038
|
+
body.append(tree, diffs);
|
|
3039
|
+
} else if (tab === 'commits') {
|
|
3040
|
+
for (const r of p) {
|
|
3041
|
+
body.append(el('h4', '', `${r.name}: ${r.out.branch} → ${r.out.target}`));
|
|
3042
|
+
for (const c of r.out.commits) { const line = el('div', 'commit'); line.append(el('code', '', c.id.slice(0, 8)), el('b', '', c.subject), el('small', '', `${c.author}, ${new Date(c.date).toLocaleString()}`)); body.append(line); }
|
|
3043
|
+
if ((r.out.count ?? 0) > r.out.commits.length) body.append(el('p', 'hint', `Only the last ${r.out.commits.length} of ${r.out.count} are listed.`));
|
|
3044
|
+
}
|
|
3045
|
+
} else {
|
|
3046
|
+
for (const r of p) {
|
|
3047
|
+
const [word] = CHECK_WORDS[r.check?.status] ?? [r.check?.status === 'running' ? 'Running...' : 'Not run'];
|
|
3048
|
+
body.append(el('h4', '', `${r.name}: ${word}`));
|
|
3049
|
+
if (r.check?.output) body.append(el('pre', 'ts-output', r.check.output));
|
|
3050
|
+
}
|
|
3051
|
+
}
|
|
3052
|
+
}
|
|
3053
|
+
let reviewStep = null;
|
|
3054
|
+
together.addEventListener('click', () => {
|
|
3055
|
+
if (!review.hidden) { review.scrollIntoView({ block: 'start' }); return; }
|
|
3056
|
+
review.hidden = false; tab = 'changes'; paintReview();
|
|
3057
|
+
reviewStep = nav.over('send-review', () => { review.hidden = true; reviewStep = null; });
|
|
3058
|
+
review.scrollIntoView({ block: 'start' });
|
|
3059
|
+
});
|
|
3060
|
+
go.addEventListener('click', async () => {
|
|
3061
|
+
const p = picked();
|
|
3062
|
+
if (p.length === 0 || go.disabled) return;
|
|
3063
|
+
/* Two clicks: what leaves cannot be called back. Three when a review could not show it all. */
|
|
3064
|
+
const all = p.some((r) => r.out?.guards?.confirm);
|
|
3065
|
+
if (!sure) { sure = 'yes'; paintButtons(); return; }
|
|
3066
|
+
if (all && sure === 'yes') { sure = 'all'; paintButtons(); return; }
|
|
3067
|
+
sending = true; sure = ''; said.hidden = true;
|
|
3068
|
+
for (const r of rows) r.sent = null;
|
|
3069
|
+
paint();
|
|
3070
|
+
for (const r of p) {
|
|
3071
|
+
try {
|
|
3072
|
+
const sent = await post(`${API}/git/${r.name}/push`, { head: r.out.head, target: r.out.target, ...(r.out.guards?.confirm ? { sure: true } : {}) });
|
|
3073
|
+
r.sent = { ok: true, text: sent.already ? `✓ Already in ${sent.branch}` : sent.commits > 0 ? `✓ Sent to ${sent.branch}` : `✓ Made ${sent.branch}` };
|
|
3074
|
+
} catch (error) { r.sent = { ok: false, text: /^Not sent/.test(error.message) ? error.message : `Not sent: ${error.message}` }; }
|
|
3075
|
+
paint();
|
|
3076
|
+
}
|
|
3077
|
+
sending = false; paint();
|
|
3078
|
+
const ok = p.filter((r) => r.sent?.ok).length;
|
|
3079
|
+
said.textContent = ok === p.length ? `Sent: ${ok === 1 ? 'it went' : `all ${ok} went`}.` : `${ok} of ${p.length} sent; the others say why.`;
|
|
3080
|
+
said.className = `ts-said ${ok === p.length ? 'ok' : 'bad'}`; said.hidden = false;
|
|
3081
|
+
if (reviewStep) nav.drop(reviewStep);
|
|
3082
|
+
/* What is left to send, read again; what became of each stays said. */
|
|
3083
|
+
const kept = new Map(rows.map((r) => [r.name, r.sent]));
|
|
3084
|
+
await Promise.all(rows.map((r) => look(r)));
|
|
3085
|
+
for (const r of rows) r.sent = kept.get(r.name);
|
|
3086
|
+
paint();
|
|
3087
|
+
});
|
|
3088
|
+
paint();
|
|
3089
|
+
await Promise.all(rows.map(async (r) => { await look(r); }));
|
|
3090
|
+
/* Ticked at first: each one with something to send. */
|
|
3091
|
+
for (const r of rows) r.picked = r.out?.state === 'ahead';
|
|
3092
|
+
paint();
|
|
3093
|
+
}
|
|
2881
3094
|
/* The files of a folder or a mailbox, in a conversation: the Files sheet, moved into the detail. */
|
|
2882
3095
|
let filesHome = null;
|
|
2883
3096
|
function embedFiles(holder, name) {
|
|
@@ -2914,11 +3127,22 @@
|
|
|
2914
3127
|
sub: kind === 'git' ? gitSub(r) : kind === 'mailbox' ? boxSub(box) : 'folder', tone: box?.failure ? 'bad' : '' });
|
|
2915
3128
|
}
|
|
2916
3129
|
for (const s2 of secrets.filter((x) => x.conversations.includes(current))) items.push({ key: `secret:${s2.name}`, kind: 'secret', name: s2.name, secret: s2, sub: 'name only · used by its agent' });
|
|
2917
|
-
|
|
3130
|
+
/* TO SEND, above them all, once it has a repository: every one of them on one screen. */
|
|
3131
|
+
const gits = items.filter((i) => i.kind === 'git').map((i) => i.name);
|
|
3132
|
+
const outbox = gits.length ? { key: 'send:all', kind: 'send', name: 'To send', sub: 'every repository, reviewed and sent at once' } : null;
|
|
3133
|
+
const chosen = (outbox && roomPick === outbox.key ? outbox : null) ?? items.find((i) => i.key === roomPick) ?? null;
|
|
2918
3134
|
const as = $('cassets-as');
|
|
2919
3135
|
as.dataset.open = chosen ? 'detail' : 'list';
|
|
2920
3136
|
paintAsList($('cassets-rows'), items, { chosen: chosen?.key, choose: (key) => pickRoomAsset(key), empty: 'Nothing is given to it yet.' });
|
|
2921
3137
|
const top = el('div', 'as-kind-head as-list-top'); top.append(el('h3', '', 'This conversation'), roundPlus('Attach an asset', () => { void openAccess(true); }));
|
|
3138
|
+
if (outbox) {
|
|
3139
|
+
const row = el('button', 'as-row ts-entry'); row.type = 'button'; row.dataset.asset = outbox.key;
|
|
3140
|
+
if (chosen === outbox) row.setAttribute('aria-current', 'true');
|
|
3141
|
+
const words = el('span', 'as-words'); words.append(el('b', '', outbox.name), el('small', 'as-sub', outbox.sub));
|
|
3142
|
+
row.append(kindIcon('send'), words);
|
|
3143
|
+
row.addEventListener('click', () => pickRoomAsset(outbox.key));
|
|
3144
|
+
$('cassets-rows').prepend(row);
|
|
3145
|
+
}
|
|
2922
3146
|
$('cassets-rows').prepend(top);
|
|
2923
3147
|
if (c?.work === 'disk') $('cassets-rows').append(el('p', 'hint as-disk', 'Its work is on the disk of its machine: nothing of it is kept here.'));
|
|
2924
3148
|
const detail = $('cassets-detail');
|
|
@@ -2932,7 +3156,8 @@
|
|
|
2932
3156
|
if (chosen.kind === 'folder' || chosen.kind === 'mailbox') {
|
|
2933
3157
|
if (chosen.kind === 'mailbox') detail.append(el('p', chosen.box?.failure ? 'error' : 'hint', boxSub(chosen.box)));
|
|
2934
3158
|
embedFiles(detail, chosen.name);
|
|
2935
|
-
} else if (chosen.kind === '
|
|
3159
|
+
} else if (chosen.kind === 'send') await sendDetail(detail, gits);
|
|
3160
|
+
else if (chosen.kind === 'git') await gitDetail(detail, chosen.name, { others: gits.length > 1 });
|
|
2936
3161
|
else {
|
|
2937
3162
|
detail.append(el('p', 'hint', 'Handed to its tool as a variable and a file, the next time it starts. Its value is never shown.'), chapter('Used by'));
|
|
2938
3163
|
const list = el('div', 'as-chips');
|
package/web/style.css
CHANGED
|
@@ -1383,3 +1383,39 @@ button.inline.more-recent { text-decoration: none; }
|
|
|
1383
1383
|
.wifi-lock { width: 12px; height: 12px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
|
|
1384
1384
|
.wifi-join { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; margin: 8px 0; }
|
|
1385
1385
|
.wifi-join p { margin: 0; }
|
|
1386
|
+
|
|
1387
|
+
/* TO SEND: every repository of a conversation, one row each, then one review of those ticked. */
|
|
1388
|
+
.ts-entry .as-ic { color: var(--brass); }
|
|
1389
|
+
.ts-rows { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
|
|
1390
|
+
.ts-row { display: grid; grid-template-columns: 24px minmax(0, 1.1fr) minmax(0, 1.7fr) minmax(0, .8fr) minmax(0, 1.1fr); gap: 10px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
|
|
1391
|
+
.ts-row.off { opacity: .6; }
|
|
1392
|
+
.ts-row input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--brass); }
|
|
1393
|
+
.ts-who { display: flex; flex-direction: column; min-width: 0; }
|
|
1394
|
+
.ts-who b { overflow-wrap: anywhere; }
|
|
1395
|
+
.ts-way { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
|
|
1396
|
+
.ts-way select { max-width: 100%; font: .875rem var(--sans); color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 7px; padding: 5px 8px; }
|
|
1397
|
+
.ts-bar button:disabled { opacity: .5; cursor: default; }
|
|
1398
|
+
.ts-state .quiet { color: var(--ink2); font-weight: 400; }
|
|
1399
|
+
.ts-branch { font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--brass); overflow-wrap: anywhere; }
|
|
1400
|
+
.ts-size .plus, .ts-review-head .plus { color: var(--ok); } .ts-size .minus, .ts-review-head .minus { color: var(--danger); }
|
|
1401
|
+
.ts-state .ok { color: var(--ok); } .ts-state .bad { color: var(--danger); } .ts-state .warn { color: var(--warn); }
|
|
1402
|
+
.ts-bar { align-items: center; margin-top: 14px; }
|
|
1403
|
+
.ts-why { font-size: .875rem; }
|
|
1404
|
+
.ts-said { margin: 10px 0 0; font-weight: 700; }
|
|
1405
|
+
.ts-said.ok { color: var(--ok); } .ts-said.bad { color: var(--danger); }
|
|
1406
|
+
.ts-review { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
|
|
1407
|
+
.ts-review-head h3 { margin: 0; }
|
|
1408
|
+
.ts-tree-repo { padding: 8px 8px 2px; color: var(--ink2); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: .75rem; overflow-wrap: anywhere; }
|
|
1409
|
+
.ts-diff h4, .ts-review h4 { margin: 12px 0 8px; }
|
|
1410
|
+
.ts-diff:first-child h4 { margin-top: 0; }
|
|
1411
|
+
.ts-tree { position: static; max-height: none; margin-bottom: 12px; }
|
|
1412
|
+
.ts-diffs { min-width: 0; }
|
|
1413
|
+
.ts-diffs .d2h-code-linenumber { position: static; }
|
|
1414
|
+
.ts-note { grid-column: 2 / -1; margin: 0; font-size: .875rem; }
|
|
1415
|
+
.ts-note.bad { color: var(--danger); }
|
|
1416
|
+
.ts-output { white-space: pre-wrap; max-height: 40vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 8px; font-size: .8125rem; }
|
|
1417
|
+
@media (max-width: 700px) {
|
|
1418
|
+
.ts-row { grid-template-columns: 24px minmax(0, 1fr) auto; }
|
|
1419
|
+
.ts-way { grid-column: 2 / -1; }
|
|
1420
|
+
.ts-size { grid-column: 2; } .ts-state { grid-column: 3; text-align: right; }
|
|
1421
|
+
}
|