@popcorn245/cornfield 0.55.0 → 0.57.0
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/core/contrast.js +12 -1
- package/core/schema.js +6 -0
- package/core/strings.js +1 -2
- package/explorer/css/account.css +1 -1
- package/explorer/css/changes.css +1 -1
- package/explorer/css/dialogs.css +1 -1
- package/explorer/css/node-panel.css +1 -1
- package/explorer/css/page.css +0 -8
- package/explorer/css/sheets.css +1 -1
- package/explorer/css/work.css +9 -30
- package/explorer/deep-link.js +11 -24
- package/explorer/engine/hint.js +2 -2
- package/explorer/engine/keyboard.js +1 -1
- package/explorer/engine/layers.js +4 -2
- package/explorer/engine/map-rect.js +2 -2
- package/explorer/engine/map-style.js +4 -1
- package/explorer/engine/proposal.js +3 -3
- package/explorer/engine/sheets.js +3 -3
- package/explorer/focus-room.js +1 -1
- package/explorer/forge-panel-model.js +2 -36
- package/explorer/forge-panel.js +4 -9
- package/explorer/index.html +2 -11
- package/explorer/instance-state.js +0 -6
- package/explorer/instance.js +15 -9
- package/explorer/page-pieces.js +1 -1
- package/explorer/page.js +5 -4
- package/explorer/pieces/decision.js +3 -3
- package/explorer/pieces/layers.js +1 -1
- package/explorer/pieces/node-panel.js +38 -14
- package/explorer/pieces/proposal.js +6 -6
- package/explorer/pieces/review.js +2 -2
- package/explorer/pieces/work-agent.js +3 -2
- package/explorer/pieces/work-common.js +14 -15
- package/explorer/pieces/work-confirm.js +11 -10
- package/explorer/pieces/work-data.js +24 -31
- package/explorer/pieces/work-deploys.js +42 -41
- package/explorer/pieces/work-issues.js +32 -29
- package/explorer/pieces/work-list.js +406 -0
- package/explorer/pieces/work-markup.js +9 -14
- package/explorer/pieces/work-notes.js +0 -1
- package/explorer/pieces/work-paint.js +74 -62
- package/explorer/pieces/work-prs.js +25 -66
- package/explorer/pieces/work-runs.js +47 -57
- package/explorer/pieces/work-specs.js +19 -2
- package/explorer/pieces/work-threads.js +28 -48
- package/explorer/pieces/work.js +38 -40
- package/explorer/proposal-model.js +6 -6
- package/explorer/proposal.js +1 -1
- package/explorer/runs-view.js +10 -18
- package/explorer/scene.js +1 -3
- package/explorer/sheets.js +1 -1
- package/explorer/tokens.css +6 -2
- package/explorer/waiting-view.js +3 -3
- package/explorer/work-badge-model.js +161 -0
- package/explorer/work-badges.js +143 -0
- package/explorer/work-model.js +80 -39
- package/explorer/work-view.css +11 -4
- package/explorer/work-view.js +193 -68
- package/package.json +1 -1
- package/explorer/pieces/work-events.js +0 -285
package/core/contrast.js
CHANGED
|
@@ -24,7 +24,7 @@ import { fileURLToPath } from 'node:url';
|
|
|
24
24
|
import { MAX_MIX_DEPTH, readColor, over, toHex, luminance, ratio, splitTop } from './color.js';
|
|
25
25
|
import { MAX_THEME_BYTES, cssProblems, withoutComments } from './theme.js';
|
|
26
26
|
import { MIN_SHAPE_DELTA_E, NODE_SHAPES, NODE_THEMES } from './schema.js';
|
|
27
|
-
import { WORK_KINDS, WORK_THEMES } from './schema.js';
|
|
27
|
+
import { WORK_KINDS, WORK_THEMES, WORK_EDGES, WORK_EDGE_THEMES } from './schema.js';
|
|
28
28
|
import { deltaE2000 } from './delta-e.js';
|
|
29
29
|
import { LAYER_KEY_RE, MAX_KEY, mapFillNames, parseKindToken } from './layers.js';
|
|
30
30
|
import { DIFF_MARK_COLORS, DIFF_LABEL_ALPHA, GREY_ALPHA, GREY_LABEL_ALPHA, GREY_MIN_RATIO, markOpacity } from '../explorer/diff-marks.js';
|
|
@@ -573,6 +573,17 @@ function mapFindings(props, theme, mode, grounds, extra = []) {
|
|
|
573
573
|
const weakest = onGround.ratio <= onFill ? { r: onGround.ratio, on: '--corn-ground', value: onGround.bgValue } : { r: onFill, on: name, value: toHex(over(fill, ground)) };
|
|
574
574
|
out.push({ ...base, fg: '--corn-map-stroke', bg: weakest.on, min: MAP_FILL_MIN, kind: 'ui', use: `the outline that carries ${use}, which is ${fmt(f.ratio)} on its own`, fgValue: onGround.fgValue, bgValue: weakest.value, ratio: weakest.r });
|
|
575
575
|
}
|
|
576
|
+
// The lines of the Work view (spec 0012 D3): each is drawn at full strength where it joins the selection, and read at 3:1 against the ground, as a map's line is
|
|
577
|
+
for (const edge of WORK_EDGES) {
|
|
578
|
+
const name = `--corn-work-edge-${edge}`;
|
|
579
|
+
const t = mapToken(props, name);
|
|
580
|
+
const use = `the ${edge === 'work' ? 'line between two pieces of work' : edge === 'code' ? 'line from a piece of work to the code it touches' : 'dashed line to the code a proposal adds'} in the Work view, where it joins the selection`;
|
|
581
|
+
if (t.problem) { out.push({ ...base, fg: name, bg: GROUND, min: MIN_UI, kind: 'ui', use, problem: t.problem }); continue; }
|
|
582
|
+
const own = !t.color;
|
|
583
|
+
const line = own ? readColor(mode === 'light' ? lightColor(WORK_EDGE_THEMES[edge]) : WORK_EDGE_THEMES[edge]) : t.color;
|
|
584
|
+
const f = worstOnGrounds(line, grounds);
|
|
585
|
+
out.push({ ...base, fg: own ? `${name}, auto: the line's own colour` : name, bg: GROUND, min: MIN_UI, kind: 'ui', use, fgValue: f.fgValue, bgValue: f.bgValue, ratio: f.ratio, ...(f.image ? { groundImage: true } : {}) });
|
|
586
|
+
}
|
|
576
587
|
// The ink of a glyph and of a finer kind's letters (spec 0008 D8), when the theme sets one: against every fill it can sit on (`auto` picks white or dark per fill, which a test holds)
|
|
577
588
|
const glyph = mapToken(props, '--corn-map-glyph');
|
|
578
589
|
if (glyph.problem) out.push({ ...base, fg: '--corn-map-glyph', bg: GROUND, min: MAP_FILL_MIN, kind: 'ui', use: 'the ink of a node\'s glyph', problem: glyph.problem });
|
package/core/schema.js
CHANGED
|
@@ -63,6 +63,12 @@ export const WORK_THEMES = Object.freeze({
|
|
|
63
63
|
pull: Object.freeze({ color: '#60a5fa', shape: 'rounded-square', letters: 'PR', r: 20 }),
|
|
64
64
|
deploy: Object.freeze({ color: '#4ade80', shape: 'square', letters: 'D', r: 20 }),
|
|
65
65
|
});
|
|
66
|
+
/**
|
|
67
|
+
* The three colours of the Work view's lines (spec 0012 D3): a link from one piece of work to another, a link to the code it touches, and what a proposal adds (dashed).
|
|
68
|
+
* A theme sets each with `--corn-work-edge-<name>` (explorer/tokens.css, docs/theming.md); these are what `auto` draws, written for the dark ground (the light one deepens them as it does every line).
|
|
69
|
+
*/
|
|
70
|
+
export const WORK_EDGES = Object.freeze(['work', 'code', 'adds']);
|
|
71
|
+
export const WORK_EDGE_THEMES = Object.freeze({ work: '#818cf8', code: '#cbd5e1', adds: '#2dd4bf' });
|
|
66
72
|
/** The node type a kind of work has in the Work view (`work-pull`): never in topology.json */
|
|
67
73
|
export const workType = (kind) => `work-${kind}`;
|
|
68
74
|
|
package/core/strings.js
CHANGED
|
@@ -21,7 +21,6 @@ export const STRINGS = Object.freeze({
|
|
|
21
21
|
house: 'House',
|
|
22
22
|
proposals: 'Proposals',
|
|
23
23
|
issuesAndPrs: 'Work',
|
|
24
|
-
workPanel: 'Work panel',
|
|
25
24
|
searchPlaceholder: 'Search...',
|
|
26
25
|
searchNoMatch: 'No match for',
|
|
27
26
|
signOut: 'Sign out',
|
|
@@ -63,7 +62,7 @@ export const STRINGS = Object.freeze({
|
|
|
63
62
|
playAgain: 'Play again',
|
|
64
63
|
nextScenario: 'Next scenario',
|
|
65
64
|
notChecked: 'Not checked',
|
|
66
|
-
// The Work
|
|
65
|
+
// The Work list: its tabs run in the order of the loop
|
|
67
66
|
tabSpecs: 'Specs',
|
|
68
67
|
tabPulls: 'PRs',
|
|
69
68
|
tabIssues: 'Issues',
|
package/explorer/css/account.css
CHANGED
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
.hx-account-foot a { color: inherit; text-decoration: none; }
|
|
34
34
|
.hx-account-foot a:hover { color: var(--corn-text-2); text-decoration: underline; }
|
|
35
35
|
.hx-account-foot:empty { display: none; }
|
|
36
|
-
/* The Proposals list opens inside the menu, under its entry, until the Specs tab of the Work
|
|
36
|
+
/* The Proposals list opens inside the menu, under its entry, until the Specs tab of the Work list takes it over */
|
|
37
37
|
.hx-account-menu .hx-menu--proposals { position: static; width: auto; max-width: none; max-height: calc(40 * var(--hx-vh, 1cqh)); margin: var(--corn-space-1) 0; padding: var(--corn-space-2); border-radius: var(--corn-radius-sm); border: var(--corn-border) solid var(--corn-line); background: var(--corn-surface-2); box-shadow: none; }
|
|
38
38
|
@container corn-box (max-width: 767px) {
|
|
39
39
|
.hx-account-btn { width: var(--hx-control-h); height: var(--hx-control-h); justify-content: center; padding: 0; border: 0; background: none; }
|
package/explorer/css/changes.css
CHANGED
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
.hx-review-column { width: 320px; }
|
|
85
85
|
}
|
|
86
86
|
@container corn-box (min-width: 1280px) {
|
|
87
|
-
/* The Work
|
|
87
|
+
/* The Work list: from 1280px the column moves over to make room for it; narrower, the panel lies over the column while it is open (moving it would leave the map a sliver) */
|
|
88
88
|
.hx-stage:has(.forge-open) .hx-review-column { left: calc(var(--hx-forge-w) + 12px); }
|
|
89
89
|
}
|
|
90
90
|
@container corn-box (min-width: 768px) and (max-width: 1023px) {
|
package/explorer/css/dialogs.css
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* dialogs.css: dialogs
|
|
3
|
-
* The review tokens dialog (review-tokens.js), the confirm dialog of the Work
|
|
3
|
+
* The review tokens dialog (review-tokens.js), the confirm dialog of the Work list, and a proposal's mockup window (mockups.js). They
|
|
4
4
|
* become native <dialog> elements in a later step (D8); until then three of them are `position: fixed` over the window, each marked below.
|
|
5
5
|
* No rule here asks what the document says (`:root`, `html`, `body`, `[data-theme]`), sizes from the window (`vw`, `vh`) or is `position: fixed` unless it says why;
|
|
6
6
|
* a width rule is a container query on `corn-box` (page.css), a height rule on `corn-page`. base.css loads first.
|
|
@@ -182,7 +182,7 @@
|
|
|
182
182
|
.hx-lines-kind { align-items: center; } /* in a 44px chip the words sit in the middle, not at the top */
|
|
183
183
|
.hx-lines-switch input { width: 24px; height: 24px; }
|
|
184
184
|
}
|
|
185
|
-
/* The title of a panel: the Work
|
|
185
|
+
/* The title of a panel: the Work list, the node panel, the proposal bar, a detail in the Work list and a dialog are one style. A node's name is long and
|
|
186
186
|
often a path, so it wraps (overflow-wrap) in this size rather than being set larger than the panel's own words. */
|
|
187
187
|
.hx-drawer-title { font-size: var(--corn-text-lg); font-weight: 700; line-height: 1.25; letter-spacing: normal; }
|
|
188
188
|
/* The head never shrinks: the body is a flex column that scrolls, and a short box (a panel in a host's 200px place, a short window) would squash the head to its
|
package/explorer/css/page.css
CHANGED
|
@@ -47,14 +47,6 @@ body {
|
|
|
47
47
|
/* The panel's width is the stage's `--hx-forge-w`, so what makes room for it reads the same number (the Runs view's compare widens it, below) */
|
|
48
48
|
.hx-stage { --hx-forge-w: min(400px, calc(100% - 24px)); }
|
|
49
49
|
}
|
|
50
|
-
@media (min-width: 1100px) {
|
|
51
|
-
.hx-stage:has(.hx-forge .hx-run-compare) { --hx-forge-w: min(780px, calc(100% - 24px)); }
|
|
52
|
-
}
|
|
53
|
-
@media (min-width: 1100px) and (max-width: 1599px) {
|
|
54
|
-
/* With the node panel open as well, a 780px compare only fits beside it from 1600px: below that the panel keeps its width and the
|
|
55
|
-
profiles stack, so neither panel nor the proposal bar between them is covered */
|
|
56
|
-
.hx-stage:has(.hx-forge .hx-run-compare):has(.drawer-open) { --hx-forge-w: min(400px, calc(100% - 24px)); }
|
|
57
|
-
}
|
|
58
50
|
/* The scenario player is one bar under the map (spec 0006 D6). From 768px it sits at the foot of the map area, to the right of the review column;
|
|
59
51
|
the stage tells it how wide the column is */
|
|
60
52
|
@media (min-width: 768px) {
|
package/explorer/css/sheets.css
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* sheets.css: phone sheets
|
|
3
|
-
* The phone's bottom sheets (sheets.js, TOPO-18; spec 0010 D7): the proposal bar, the scenario player, the node panel and the Work
|
|
3
|
+
* The phone's bottom sheets (sheets.js, TOPO-18; spec 0010 D7): the proposal bar, the scenario player, the node panel and the Work list
|
|
4
4
|
* stack in #sheet-dock at the bottom of the map, a peek until a tap or swipe on the handle opens one. Cornfield's page shell only: no piece
|
|
5
5
|
* sheets itself. The dock is a descendant of the stage; its height rules ask the screen's, which is the `corn-page` container (the body).
|
|
6
6
|
* No rule here asks what the document says (`:root`, `html`, `body`, `[data-theme]`), sizes from the window (`vw`, `vh`) or is `position: fixed` unless it says why;
|
package/explorer/css/work.css
CHANGED
|
@@ -1,26 +1,19 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* work.css: the Work
|
|
3
|
-
* The Work
|
|
2
|
+
* work.css: the Work list
|
|
3
|
+
* The Work list (forge-panel.js, runs-view.js) and its tabs (Specs, PRs, Issues, Threads, Runs, Deploys): the slide-over from the left from
|
|
4
4
|
* 768px, a bottom sheet below; the Work toggle in the header; the states, results and skeletons. Read by corn-work (D4); its tabs follow as
|
|
5
5
|
* pieces of their own.
|
|
6
6
|
* No rule here asks what the document says (`:root`, `html`, `body`, `[data-theme]`), sizes from the window (`vw`, `vh`) or is `position: fixed` unless it says why;
|
|
7
7
|
* a width rule is a container query on `corn-box` (page.css), a height rule on `corn-page`. base.css loads first.
|
|
8
8
|
*/
|
|
9
|
-
/*
|
|
10
|
-
.hx-work { display: inline-flex; align-items: center; gap: var(--corn-space-2); height: var(--hx-control-h); padding: 0 var(--corn-space-4); border-radius: var(--corn-radius-sm); border: var(--corn-border) solid var(--corn-line); background: var(--corn-surface-2); color: var(--corn-text-2); font-size: var(--corn-text-sm); font-weight: 600; white-space: nowrap; }
|
|
11
|
-
.hx-work:hover { background: var(--corn-surface-3); color: var(--corn-text); }
|
|
12
|
-
.hx-work[aria-expanded="true"] { background: var(--corn-accent); border-color: var(--corn-accent-text); color: var(--corn-text-on-accent); }
|
|
13
|
-
.hx-forge-lit { padding: 0 var(--corn-space-2); border-radius: var(--corn-radius-pill); border: var(--corn-border) solid var(--corn-warn); background: var(--corn-ground); color: var(--corn-warn); font-size: var(--corn-text-2xs); }
|
|
14
|
-
@container corn-box (max-width: 767px) {
|
|
15
|
-
.hx-work { height: var(--hx-control-h); min-width: var(--hx-control-h); justify-content: center; padding: 0 var(--corn-space-3); }
|
|
16
|
-
.hx-forge-lit { display: none; }
|
|
17
|
-
}
|
|
18
|
-
/* ---- the issues and PRs panel (forge-panel.js, CF-07) -------------------------------------------
|
|
9
|
+
/* ---- the Work list (pieces/work-list.js; spec 0012 D6; first CF-07's issues and PRs panel) -------------------------------------------
|
|
19
10
|
A slide-over from the left from 768px (the node panel is the one from the right), a bottom sheet in #sheet-dock below.
|
|
20
|
-
Closed, it is inert
|
|
11
|
+
Closed, it is inert, and off screen or not displayed. Only the tokens above are used, so it follows the theme. */
|
|
21
12
|
.hx-forge { --hx-forge-status-w: 56px; }
|
|
22
13
|
.hx-forge { display: flex; flex-direction: column; z-index: 40; border-color: var(--corn-line); pointer-events: none; touch-action: pan-y; transition: transform 0.2s ease-out; }
|
|
23
14
|
.hx-forge * { touch-action: pan-y; }
|
|
15
|
+
/* The tab strip scrolls sideways (its tabs run past the edge on a phone): a finger may pan it across, on the strip and on a tab */
|
|
16
|
+
.hx-forge .hx-forge-tabs, .hx-forge .hx-forge-tabs * { touch-action: pan-x pan-y; }
|
|
24
17
|
.hx-forge.forge-open { pointer-events: auto; }
|
|
25
18
|
.hx-forge:not(.forge-open) { box-shadow: none; }
|
|
26
19
|
@container corn-box (min-width: 768px) {
|
|
@@ -93,7 +86,6 @@ a.hx-forge-row:hover, button.hx-forge-row:hover { background: var(--corn-surface
|
|
|
93
86
|
.hx-forge-check { display: flex; flex-wrap: wrap; align-items: center; gap: calc(var(--corn-space-1) / 2) var(--corn-space-2); }
|
|
94
87
|
.hx-forge-check .hx-link { display: inline-flex; align-items: center; min-height: 24px; }
|
|
95
88
|
.hx-forge-lights { flex-basis: 100%; font-size: var(--corn-text-xs); line-height: 1.5; }
|
|
96
|
-
.hx-forge-key { display: flex; flex-wrap: wrap; align-items: center; gap: calc(var(--corn-space-1) / 2) var(--corn-space-1); font-size: var(--corn-text-xs); }
|
|
97
89
|
.hx-forge-file { display: flex; flex-wrap: wrap; align-items: baseline; gap: calc(var(--corn-space-1) / 2) var(--corn-space-2); padding: var(--corn-space-1) 0; border-top: var(--corn-border) solid var(--corn-line-soft); overflow-wrap: anywhere; }
|
|
98
90
|
.hx-forge-fstatus { flex: none; min-width: var(--hx-forge-status-w); color: var(--corn-text-3); font-size: var(--corn-text-xs); }
|
|
99
91
|
.hx-forge-del { color: var(--corn-bad); }
|
|
@@ -137,7 +129,6 @@ a.hx-forge-row:hover, button.hx-forge-row:hover { background: var(--corn-surface
|
|
|
137
129
|
/* A selection replaces the list, with a back control named by the list; Land it is the one primary action */
|
|
138
130
|
.hx-forge-back { align-self: flex-start; display: inline-flex; align-items: center; gap: var(--corn-space-2); min-height: 28px; margin-left: calc(var(--corn-space-2) * -1); padding: 0 var(--corn-space-3) 0 var(--corn-space-2); border: 0; border-radius: var(--corn-radius-sm); background: none; color: var(--corn-text-2); font-size: var(--corn-text-xs); }
|
|
139
131
|
.hx-forge-back:hover { background: var(--corn-surface-3); color: var(--corn-text); }
|
|
140
|
-
.hx-forge-dmeta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--corn-space-1) var(--corn-space-3); }
|
|
141
132
|
.hx-forge-cta { display: flex; flex-wrap: wrap; gap: var(--corn-space-3); }
|
|
142
133
|
.hx-forge-cta .hx-btn { min-height: 32px; justify-content: center; }
|
|
143
134
|
.hx-forge-cta .hx-btn[disabled] { background: var(--corn-surface-3); border-color: var(--corn-line); color: var(--corn-text-3); box-shadow: none; cursor: default; }
|
|
@@ -176,20 +167,11 @@ a.hx-forge-row:hover, button.hx-forge-row:hover { background: var(--corn-surface
|
|
|
176
167
|
.hx-run-timeline li { color: var(--corn-text-2); }
|
|
177
168
|
.hx-run-timeline time { color: var(--corn-text-2); margin-right: var(--corn-space-2); }
|
|
178
169
|
.hx-run-note { display: block; color: var(--corn-text-2); white-space: pre-wrap; }
|
|
179
|
-
.hx-run-compare { border: var(--corn-border) solid var(--corn-line); border-left: calc(var(--corn-border-strong) * 2) solid var(--corn-added-text); border-radius: var(--corn-radius); padding: var(--corn-space-3); display: flex; flex-direction: column; gap: var(--corn-space-2); }
|
|
180
|
-
.hx-run-compare-title { margin: 0; font-size: var(--corn-text-sm); font-weight: 700; color: var(--corn-text); }
|
|
181
|
-
.hx-run-columns { display: grid; grid-template-columns: 1fr; gap: var(--corn-space-3); margin: 0; padding: 0; list-style: none; }
|
|
182
|
-
@container corn-box (min-width: 1100px) {
|
|
183
|
-
.hx-run-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
184
|
-
}
|
|
185
|
-
@container corn-box (min-width: 1100px) and (max-width: 1599px) {
|
|
186
|
-
.hx-stage:has(.drawer-open) .hx-run-columns { grid-template-columns: 1fr; }
|
|
187
|
-
}
|
|
188
170
|
/* A scroll container never cuts a focus ring: a row that is tabbed to stops short of the edge by the ring's width and offset */
|
|
189
171
|
.hx-forge-body { scroll-padding-block: calc(var(--corn-focus-width) + var(--corn-focus-offset) + var(--corn-space-1)); }
|
|
190
172
|
/* The Work tabs scroll sideways: a tab brought into view stops short of the edge by the strip's own padding */
|
|
191
173
|
.hx-forge-tabs { scroll-padding-inline: var(--corn-space-4); }
|
|
192
|
-
.hx-forge-count, .hx-
|
|
174
|
+
.hx-forge-count, .hx-run-limits dd { font-family: var(--corn-font-num); font-variant-numeric: tabular-nums; }
|
|
193
175
|
@media (prefers-reduced-motion: reduce) {
|
|
194
176
|
.hx-forge { transition: none; animation: none; }
|
|
195
177
|
}
|
|
@@ -201,7 +183,7 @@ a.hx-forge-row:hover, button.hx-forge-row:hover { background: var(--corn-surface
|
|
|
201
183
|
.hx-run .hx-link, .hx-forge-check .hx-link { display: inline-flex; align-items: center; min-height: 44px; }
|
|
202
184
|
}
|
|
203
185
|
/* ==========================================================================
|
|
204
|
-
The Work
|
|
186
|
+
The Work list's states, results, disabled controls, loading and empty lists, and its fixed top (the 0.34 design review)
|
|
205
187
|
========================================================================== */
|
|
206
188
|
/* A state is a word, an icon and a colour: the colour comes from a --corn-run-<state> token, the icon is a shape of its own (corn-state.js), and
|
|
207
189
|
the waiting pill is solid, since a run that waits needs the maintainer and should stand out most. A pill is never a button: it has no hover. */
|
|
@@ -256,7 +238,6 @@ a.hx-forge-row:hover, button.hx-forge-row:hover { background: var(--corn-surface
|
|
|
256
238
|
right padding, by a margin that gives the room back (content-box, so the padding is added to the count's 2ch and the margin takes exactly that away
|
|
257
239
|
again), and keeps the tab's gap from its word on the left */
|
|
258
240
|
.hx-forge-tab .hx-forge-count.hx-forge-count--waiting, .hx-forge-tab[aria-pressed="true"] .hx-forge-count.hx-forge-count--waiting { box-sizing: content-box; padding: 0 var(--corn-space-1); margin: 0 calc(var(--corn-space-1) * -2) 0 0; text-align: center; background: var(--corn-run-waiting); color: var(--corn-run-waiting-ink); }
|
|
259
|
-
.hx-work .hx-waiting-badge { margin-right: calc(var(--corn-space-2) * -1); }
|
|
260
241
|
/* A group of the Specs list: its header says who must act and how many; Drafts past ten rows fold behind it */
|
|
261
242
|
.hx-spec-group > .hx-forge-list { margin: 0; padding: 0; }
|
|
262
243
|
.hx-spec-group > .hx-forge-list[hidden] { display: none; }
|
|
@@ -278,10 +259,8 @@ a.hx-forge-row:hover, button.hx-forge-row:hover { background: var(--corn-surface
|
|
|
278
259
|
.hx-forge-gtoggle { min-height: 44px; }
|
|
279
260
|
.hx-forge-unread .hx-btn { min-height: 44px; }
|
|
280
261
|
}
|
|
281
|
-
.hx-runner-dot { display: inline-block; width: 8px; height: 8px; margin-left: var(--corn-space-1); border-radius: 50%; background: var(--corn-warn); vertical-align: middle; }
|
|
282
|
-
.hx-runner-dot[hidden] { display: none; }
|
|
283
262
|
.hx-forge-detail-title, .hx-forge-notes-title { font-size: var(--corn-text-lg); font-weight: 700; line-height: 1.25; letter-spacing: normal; }
|
|
284
|
-
/* The head of a panel: its title row. The Work
|
|
263
|
+
/* The head of a panel: its title row. The Work list and the node panel start at one edge (the padding is --corn-panel-pad) and the head is at least this tall */
|
|
285
264
|
.hx-forge-head { min-height: var(--corn-panel-head-height); }
|
|
286
265
|
/* The controls of a bar that had no height of their own */
|
|
287
266
|
/* (the waiting line's Answer is in the proposal bar too, so it is the bar's height; it is a strip's action elsewhere, at its own size) */
|
package/explorer/deep-link.js
CHANGED
|
@@ -1,44 +1,32 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module explorer/deep-link
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* The link from chat that starts an agent on a proposal (issue #103, docs/agents.md "Deep links"):
|
|
5
5
|
*
|
|
6
|
-
* ?run=<runId> the Runs tab, that run lit and in view
|
|
7
|
-
* ?issue=<n> the Issues tab, that issue's Start an agent button focused
|
|
8
6
|
* ?proposal=<slug>&start=1 the proposal opened (proposal.js) and the Start dialog on it
|
|
9
7
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
8
|
+
* (`?run=`, `?issue=`, `?pr=`, `?thread=` and `?spec=` are the Work view's: work-view.js `followWorkAddress`, spec 0012 D8.)
|
|
9
|
+
* On a phone the proposal bar it opens is expanded. A name that is not there is a line in the bar and said through the live
|
|
10
|
+
* region, never a blank. A link that is followed has its `start` taken out of the address at once, so a reload does not open
|
|
11
|
+
* it again; `?proposal=` stays, as it always has (it follows the open proposal).
|
|
13
12
|
* Without a live sign-in the server asks for it first and returns here with the same query (server/auth.js).
|
|
14
13
|
*/
|
|
15
14
|
|
|
16
15
|
import { announce } from './keyboard.js';
|
|
17
16
|
import { isPhone, expandSheet } from './sheets.js';
|
|
18
17
|
import { parseProposalQuery } from './proposal-model.js';
|
|
19
|
-
import {
|
|
18
|
+
import { openProposalStart } from './forge-panel.js';
|
|
20
19
|
|
|
21
|
-
const RUN_ID = /^run-[0-9A-Za-z]{26}$/;
|
|
22
|
-
const ISSUE = /^[1-9][0-9]{0,8}$/;
|
|
23
20
|
/** The parameters a followed link gives up */
|
|
24
|
-
const SPENT = ['
|
|
21
|
+
const SPENT = ['start'];
|
|
25
22
|
|
|
26
23
|
/**
|
|
27
|
-
* What a query asks for, or null
|
|
28
|
-
* cannot be a name is `{ kind, bad: words }`.
|
|
24
|
+
* What a query asks for, or null: `?proposal=<slug>&start=1`. A value that cannot be a name is `{ kind, bad: words }`.
|
|
29
25
|
* @param {string} search
|
|
30
|
-
* @returns {{ kind: '
|
|
26
|
+
* @returns {{ kind: 'proposal', slug: string } | { kind: string, bad: string } | null}
|
|
31
27
|
*/
|
|
32
28
|
export function parseDeepLink(search) {
|
|
33
29
|
const params = new URLSearchParams(search || '');
|
|
34
|
-
if (params.has('run')) {
|
|
35
|
-
const id = params.get('run');
|
|
36
|
-
return RUN_ID.test(id) ? { kind: 'run', id } : { kind: 'run', bad: `${id ? `"${id.slice(0, 40)}"` : 'That'} is not a run id.` };
|
|
37
|
-
}
|
|
38
|
-
if (params.has('issue')) {
|
|
39
|
-
const n = params.get('issue');
|
|
40
|
-
return ISSUE.test(n) ? { kind: 'issue', n: Number(n) } : { kind: 'issue', bad: `${n ? `"${n.slice(0, 40)}"` : 'That'} is not an issue number.` };
|
|
41
|
-
}
|
|
42
30
|
if (params.get('start') === '1' && params.has('proposal')) {
|
|
43
31
|
const asked = parseProposalQuery(search);
|
|
44
32
|
return asked ? { kind: 'proposal', slug: asked.slug } : { kind: 'proposal', bad: 'That is not a proposal name.' };
|
|
@@ -62,7 +50,7 @@ export function cleanAddress() {
|
|
|
62
50
|
const unavailable = (words) => { announce(words); return false; };
|
|
63
51
|
|
|
64
52
|
/**
|
|
65
|
-
* Follows the link in the address, once. Call it after the
|
|
53
|
+
* Follows the link in the address, once. Call it after the Work piece and the proposals are set up.
|
|
66
54
|
* @param {{ search?: string, proposalOpened?: boolean, forgeOn?: boolean }} [opts]
|
|
67
55
|
* `proposalOpened`: what `initProposals()` answered; `forgeOn`: whether `initForgePanel()` found a forge in the config
|
|
68
56
|
* @returns {Promise<boolean>} whether the link was followed to what it names
|
|
@@ -82,6 +70,5 @@ export async function followDeepLink({ search = typeof location === 'undefined'
|
|
|
82
70
|
if (isPhone()) expandSheet('proposal');
|
|
83
71
|
return openProposalStart(link.slug);
|
|
84
72
|
}
|
|
85
|
-
|
|
86
|
-
return link.kind === 'run' ? openRunLink(link.id) : openIssueLink(link.n);
|
|
73
|
+
return false;
|
|
87
74
|
}
|
package/explorer/engine/hint.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* main pointer is coarse (a finger). A repo that sets only `hintInspect` (or `hintDrag`) gets its words on both;
|
|
7
7
|
* - it goes once the person has selected a node, for the rest of the session (sessionStorage; the Flow view's own description stays,
|
|
8
8
|
* since it says what Flow is, not how to use the map);
|
|
9
|
-
* - it is never shown over an open proposal, a node panel, the Work
|
|
9
|
+
* - it is never shown over an open proposal, a node panel, the Work list or a sheet.
|
|
10
10
|
* The icon is `[data-corn="hint-icon"]`, so a theme can restyle or replace it. explorer/hint.js keeps the old names for the page's instance.
|
|
11
11
|
*/
|
|
12
12
|
import { isOverridden, t } from './strings.js';
|
|
@@ -56,7 +56,7 @@ export function resetHint(inst) {
|
|
|
56
56
|
try { const store = sessionOf(inst); if (store) store.removeItem(HINT_STORAGE_KEY); } catch { /* none */ }
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
/** What covers the map: an open proposal, the node panel, the Work
|
|
59
|
+
/** What covers the map: an open proposal, the node panel, the Work list, a sheet of the dock */
|
|
60
60
|
export function mapCovered(inst) {
|
|
61
61
|
const open = (id) => inst.el(id);
|
|
62
62
|
const bar = open('proposal-bar');
|
|
@@ -75,7 +75,7 @@ export function centreOn(inst, node) {
|
|
|
75
75
|
function land(inst, node, order) {
|
|
76
76
|
if (!node) { announce(inst, inst.ask('layers:present') ? 'No nodes are shown. Turn a layer on in the Layers menu.' : 'No nodes are shown.'); return; } // the Layers menu, when the instance has one
|
|
77
77
|
selectNode(inst, node, { frame: true, source: 'keyboard' }); // the keyboard's selection frames the node and what it lights (spec 0008 D6)
|
|
78
|
-
announce(inst, K.describeNode(node, order.length, order.indexOf(node)));
|
|
78
|
+
announce(inst, K.describeNode(node, order.length, order.indexOf(node)) + (inst.ask('node:words', node) || '')); // the Work layer adds the open work on a badged node
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
/** "Frame them" and the `F` key: the camera goes to the selected node and what it lights, and a screen reader is told how many that is */
|
|
@@ -25,7 +25,7 @@ export const typesOf = (l) => (l.match && l.match.type ? [].concat(l.match.type)
|
|
|
25
25
|
const NOT_A_TYPE = { flow: '#fb923c', runs: '#5eead4' };
|
|
26
26
|
const builtIn = (l) => { const type = typesOf(l)[0]; return type && NODE_THEMES[type] ? NODE_THEMES[type].color : NOT_A_TYPE[l.key]; };
|
|
27
27
|
/** The starting layers that start off: the infra layer is its own view, and the physical world's are loaded when first turned on (spec 0029) */
|
|
28
|
-
export const STARTS_OFF = new Set(['stack', 'machine', 'container', 'device', 'house', 'persona']);
|
|
28
|
+
export const STARTS_OFF = new Set(['stack', 'machine', 'container', 'device', 'house', 'persona', 'work-badges']);
|
|
29
29
|
|
|
30
30
|
/** The starting rows (core/layers.js STARTING_LAYERS) with the colour of their dot */
|
|
31
31
|
export const LAYER_DEFS = STARTING_LAYERS.map((l) => ({ ...l, color: builtIn(l) }));
|
|
@@ -93,6 +93,7 @@ export function layerRows(inst) {
|
|
|
93
93
|
const project = state.projectLayers.filter((l) => held.has(l.key)).map((l) => ({ key: l.key, label: l.label, desc: l.desc || '', project: true, ...projectDot(l) }));
|
|
94
94
|
// A starting row a project layer has taken every node from goes (spec 0009 D7, example 3); with no project layer, every starting row stays, as it always was
|
|
95
95
|
const starting = LAYER_DEFS.filter((l) => !l.overlay && (held.has(l.key) || !left.has(l.key))).map(dotted);
|
|
96
|
+
const badges = state.workRow && state.workRow(); // the Work layer's row, when the page has a forge and somebody is signed in (work-view.js): an overlay, off to start
|
|
96
97
|
const known = new Set([...LAYER_DEFS.map((l) => l.key), ...state.projectLayers.map((l) => l.key)]);
|
|
97
98
|
const extra = [];
|
|
98
99
|
held.forEach((key) => {
|
|
@@ -100,7 +101,7 @@ export function layerRows(inst) {
|
|
|
100
101
|
known.add(key);
|
|
101
102
|
extra.push({ key, label: key.charAt(0).toUpperCase() + key.slice(1), color: rowColor(inst, { type: key, group: key }, NO_COLOR), desc: `Nodes of the type ${key}` });
|
|
102
103
|
});
|
|
103
|
-
return { layers: [...orderRows(project, starting, state.layerOrder), ...extra], overlays: LAYER_DEFS.filter((l) => l.overlay).map(dotted) };
|
|
104
|
+
return { layers: [...orderRows(project, starting, state.layerOrder), ...extra], overlays: [...LAYER_DEFS.filter((l) => l.overlay).map(dotted), ...(badges ? [badges] : [])] };
|
|
104
105
|
}
|
|
105
106
|
|
|
106
107
|
// ---------------------------------------------------------------------------
|
|
@@ -139,6 +140,7 @@ export function setProjectLayers(inst, raw) {
|
|
|
139
140
|
const defaults = {};
|
|
140
141
|
for (const l of LAYER_DEFS) defaults[l.key] = !STARTS_OFF.has(l.key);
|
|
141
142
|
for (const l of cfg.add) defaults[l.key] = true;
|
|
143
|
+
defaults['work-badges'] = false;
|
|
142
144
|
for (const k of cfg.off) defaults[k] = false;
|
|
143
145
|
state.layerDefaults = defaults;
|
|
144
146
|
const mem = memoryOf(inst);
|
|
@@ -70,7 +70,7 @@ export function measureCovered(inst) {
|
|
|
70
70
|
/**
|
|
71
71
|
* The part of the map nothing covers, in the canvas's own CSS px: what the camera should frame a node into.
|
|
72
72
|
* On a phone the dock's sheets cover the bottom; from 768px the proposal bar covers the top (and the change list it grows to hold),
|
|
73
|
-
* the node panel the right, the Work
|
|
73
|
+
* the node panel the right, the Work list and the review column the left and the scenario player the bottom. Without a layout (no page) it is the whole canvas.
|
|
74
74
|
* @returns {{ x: number, y: number, width: number, height: number }}
|
|
75
75
|
*/
|
|
76
76
|
export function visibleMapRect(inst) {
|
|
@@ -89,7 +89,7 @@ export function visibleMapRect(inst) {
|
|
|
89
89
|
if (panel && panel.right) covers.right = panel.right;
|
|
90
90
|
const forge = inst.el('forge-panel');
|
|
91
91
|
if (shown(forge) && forge.classList.contains('forge-open')) covers.left = forge.offsetWidth;
|
|
92
|
-
// the review column (review-column.js) is docked on the left under the bar: its right edge is what it covers, past the Work
|
|
92
|
+
// the review column (review-column.js) is docked on the left under the bar: its right edge is what it covers, past the Work list's when both are open
|
|
93
93
|
const column = inst.ask('changes:covers');
|
|
94
94
|
if (column) covers.left = Math.max(covers.left, Math.max(0, column.right - c.left) + 8);
|
|
95
95
|
const player = inst.ask('player:covers');
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
*/
|
|
37
37
|
|
|
38
38
|
import { NODE_THEMES } from '../../core/schema.js';
|
|
39
|
-
import { WORK_KINDS } from '../../core/schema.js';
|
|
39
|
+
import { WORK_KINDS, WORK_EDGES } from '../../core/schema.js';
|
|
40
40
|
import { parseColor } from '../theme-model.js';
|
|
41
41
|
import { cssColor, rgbaText } from '../css-color.js';
|
|
42
42
|
export { cssColor };
|
|
@@ -88,6 +88,8 @@ export const ICON_URL_PREFIX = '/cornfield/theme/assets/';
|
|
|
88
88
|
export const nodeToken = (kind) => `--corn-map-node-${kind}`;
|
|
89
89
|
/** The fill token of a kind of work in the Work view (spec 0012 D2) */
|
|
90
90
|
export const workToken = (kind) => `--corn-work-${kind}`;
|
|
91
|
+
/** The colour token of a line of the Work view (`work`, `code`, `adds`) */
|
|
92
|
+
export const workEdgeToken = (name) => `--corn-work-edge-${name}`;
|
|
91
93
|
export const groupToken = (group) => `--corn-map-group-${group}`;
|
|
92
94
|
/** The fill token of a finer kind: `--corn-map-kind-service-timer`, or null for a kind that cannot be a part of a name (core/layers.js) */
|
|
93
95
|
export const kindToken = (type, kind) => mapKindToken(type, kind);
|
|
@@ -99,6 +101,7 @@ export const MAP_COLOR_TOKENS = Object.freeze([
|
|
|
99
101
|
...MAP_KINDS.map(nodeToken),
|
|
100
102
|
...MAP_GROUPS.map(groupToken),
|
|
101
103
|
...WORK_KINDS.map(workToken),
|
|
104
|
+
...WORK_EDGES.map(workEdgeToken),
|
|
102
105
|
STROKE_TOKEN,
|
|
103
106
|
LABEL_TOKEN,
|
|
104
107
|
LABEL_HALO_TOKEN,
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* What it tells its neighbours (`inst.on`):
|
|
13
13
|
* proposal { change: 'opened' | 'view' | 'closed', slug, source, pinSource, view, proposal } the open proposal changed
|
|
14
14
|
* proposal:draw { open } the bar and the review column draw again (pieces/proposal.js, pieces/changes.js), in that order
|
|
15
|
-
* proposal:bar { open } they have: the controls that sit on the bar draw again (the what-if editor, the decision, the mockups, the Work
|
|
15
|
+
* proposal:bar { open } they have: the controls that sit on the bar draw again (the what-if editor, the decision, the mockups, the Work list's line)
|
|
16
16
|
* proposal:mark { applied, effective, proposal } before the map is laid out: the what-if editor puts its `edit` mark on what the edits added or removed
|
|
17
17
|
* proposal:message { text, isError, ways } one line in the bar in place of a proposal: while one opens, or why it did not
|
|
18
18
|
* proposal:pull-head sha the PR of the open proposal was read: the review column keys what was seen by its head
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* What it asks (`inst.ask`; nobody answering is a no):
|
|
23
23
|
* proposal:effective proposal -> proposal the proposal the map is drawn from (the what-if editor's, with the edits in); no answer: the proposal itself
|
|
24
24
|
* proposal:before-close (none) -> false keeps the proposal open (the what-if editor is asking whether to keep its edits)
|
|
25
|
-
* work:open-specs (none) -> true the Work
|
|
25
|
+
* work:open-specs (none) -> true the Work list's Specs tab is open for a bad link's way on; no answer: the bar opens its Proposals menu
|
|
26
26
|
* proposal:specs-list (none) -> false there is no list of specs to open here (the review in another app): a bad link's ways leave that button out; no answer: there is one
|
|
27
27
|
* map:set { nodes, edges } -> true the page lays the map out again from these (view.js setMap, not yet an instance's)
|
|
28
28
|
* And emits to the node panel: node:show-edge { edge }.
|
|
@@ -58,7 +58,7 @@ const specsWay = (inst) => (inst.ask('proposal:specs-list') === false ? null : {
|
|
|
58
58
|
// The list the server gives
|
|
59
59
|
// ---------------------------------------------------------------------------
|
|
60
60
|
|
|
61
|
-
/** What the server listed last, for the Work
|
|
61
|
+
/** What the server listed last, for the Work list's Specs tab: the entries (null before the first answer), why the list could not be read, why the spec PRs are missing, and when */
|
|
62
62
|
export function proposalListing(inst) {
|
|
63
63
|
const m = memory(inst);
|
|
64
64
|
return { entries: m.listing, problem: m.listingProblem, forgeProblem: m.forgeProblem, at: m.listingAt };
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* the map (`#sheet-dock`, which is `display: contents` from 768px up, so the desktop layout is untouched).
|
|
7
7
|
* Each is a **peek** by default (a handle, a title and a line or two) and **expands** to at most half the
|
|
8
8
|
* screen (60% for the node panel) with its own scroll. A tap or a swipe on the handle expands or collapses it; a tap
|
|
9
|
-
* on the map collapses it. At most one is expanded at a time (sheet-model.js). Spec 0010 D7: the Work
|
|
9
|
+
* on the map collapses it. At most one is expanded at a time (sheet-model.js). Spec 0010 D7: the Work list is a sheet too, with the review
|
|
10
10
|
* (the proposal bar or the scenario player) and one other sheet at most (opening Work displaces the node panel and the reverse); while one is
|
|
11
11
|
* expanded the sheet of the other group folds to a **stub** (one 44px row: its title and its badge; a tap swaps them), and an expanded sheet is
|
|
12
12
|
* capped so the map keeps 35% of the screen (`--hx-sheet-cap`, sheet-model.js `sheetCap`). Escape folds an expanded sheet, then closes.
|
|
@@ -88,7 +88,7 @@ function apply(inst) {
|
|
|
88
88
|
S.listeners.forEach((fn) => fn());
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
/** Whether a sheet's element is open on the page (the proposal bar is shown, the Work
|
|
91
|
+
/** Whether a sheet's element is open on the page (the proposal bar is shown, the Work list and the node panel carry their open class) */
|
|
92
92
|
function isOpenOnPage(id, el) {
|
|
93
93
|
if (id === 'forge') return el.classList.contains('forge-open');
|
|
94
94
|
if (id === 'drawer') return el.classList.contains('drawer-open');
|
|
@@ -182,7 +182,7 @@ export function refreshStubs(inst) {
|
|
|
182
182
|
|
|
183
183
|
/**
|
|
184
184
|
* Opens a sheet's place in the dock without expanding it (Work opens as a peek, a node panel opens as a peek): the other sheet of its group is
|
|
185
|
-
* displaced, and this one is no longer away. Called by what opens a sheet (the node panel's code); the Work
|
|
185
|
+
* displaced, and this one is no longer away. Called by what opens a sheet (the node panel's code); the Work list's open class is seen too.
|
|
186
186
|
*/
|
|
187
187
|
export function showSheet(inst, id) {
|
|
188
188
|
const S = sheetsOf(inst);
|
package/explorer/focus-room.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module explorer/focus-room
|
|
3
3
|
*
|
|
4
|
-
* A control that is tabbed to inside a strip that scrolls sideways (the Work
|
|
4
|
+
* A control that is tabbed to inside a strip that scrolls sideways (the Work list's tabs) is brought fully into view, ring and all
|
|
5
5
|
* (CF review F54). A browser scrolls a focused control only until it is "mostly" visible, and the last tab was left a few pixels under
|
|
6
6
|
* the strip's edge, with its focus ring cut. `scroll-padding-inline` in css/work.css says how much room to leave; this asks for the scroll.
|
|
7
7
|
* The Work piece (pieces/work.js) listens for focus in its own root and asks.
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
* nodesForFile the node(s) whose `file` holds a path: the deepest `file` that is the path or a folder of it
|
|
13
13
|
* testFilesOf the test files a check's name names
|
|
14
14
|
* litFor for one pull request: which nodes its files are, and which a failing check's tests are
|
|
15
|
-
* paintForge lights those in a built scene (scene.js calls it): the rest fades back
|
|
16
15
|
* nodesForRestarts, litForDeploy for one deploy (PIPE-03): the nodes the config says it restarted (a stack brings its containers),
|
|
17
16
|
* and the refs that are on no node; the deploys list's filters and words (matchesDeploy, deployWords, deployMeta)
|
|
18
17
|
* errorWords a failed request, in words
|
|
@@ -43,11 +42,6 @@ export const STATES = Object.freeze({
|
|
|
43
42
|
});
|
|
44
43
|
/** How many a list asks for (the server's own default; its most is 300) */
|
|
45
44
|
export const LIST_LIMIT = 100;
|
|
46
|
-
/** How bright what the selected pull request does not touch is, once some nodes are lit */
|
|
47
|
-
export const FORGE_DIM_ALPHA = 0.2;
|
|
48
|
-
/** A node a failing check's test is: red (the light theme deepens it like any node colour) */
|
|
49
|
-
export const FORGE_FAIL_COLOR = '#f87171';
|
|
50
|
-
|
|
51
45
|
export const defaultFilters = (kind = 'pulls') => ({ state: kind === 'deploys' ? 'all' : 'open', label: '', author: '', text: '' });
|
|
52
46
|
|
|
53
47
|
/** What the server is asked for: a merged pull request is a closed one, filtered after */
|
|
@@ -354,34 +348,6 @@ export function ideaWords(forgeName, res) {
|
|
|
354
348
|
// The picture
|
|
355
349
|
// ---------------------------------------------------------------------------
|
|
356
350
|
|
|
357
|
-
/**
|
|
358
|
-
* Lights a pull request's (or a deploy's) nodes in a built scene: the nodes its files are get the amber glow of a search match, the
|
|
359
|
-
* tests of a failing check turn red as well, and everything else fades back (nodes and the lines between them), so
|
|
360
|
-
* the lit ones stand out whatever the selection or a proposal did before. Changes alpha, glow, halo, colour and label
|
|
361
|
-
* only. Nothing lit (a pull request whose files are on no node) leaves the scene as it is.
|
|
362
|
-
* @param {import('./scene.js').Scene} scene
|
|
363
|
-
* @param {{ changed: Set<string>, failing: Set<string> } | null} lit
|
|
364
|
-
*/
|
|
365
|
-
export function paintForge(scene, lit) {
|
|
366
|
-
if (!lit || (!lit.changed.size && !lit.failing.size)) return;
|
|
367
|
-
const on = (id) => lit.changed.has(id) || lit.failing.has(id);
|
|
368
|
-
for (const n of scene.nodes) {
|
|
369
|
-
if (on(n.id)) {
|
|
370
|
-
n.alpha = 1;
|
|
371
|
-
n.labelAlpha = 1;
|
|
372
|
-
n.glow = Math.max(n.glow, 14);
|
|
373
|
-
n.labelKeep = true;
|
|
374
|
-
if (n.halo !== 'selected') n.halo = 'match';
|
|
375
|
-
if (lit.failing.has(n.id)) n.color = FORGE_FAIL_COLOR;
|
|
376
|
-
} else {
|
|
377
|
-
n.alpha = Math.min(n.alpha, FORGE_DIM_ALPHA);
|
|
378
|
-
n.labelAlpha = n.alpha;
|
|
379
|
-
n.glow = 0;
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
for (const e of scene.edges) if (!on(e.from) && !on(e.to)) e.alpha = Math.min(e.alpha, FORGE_DIM_ALPHA / 2);
|
|
383
|
-
}
|
|
384
|
-
|
|
385
351
|
// ---------------------------------------------------------------------------
|
|
386
352
|
// Actions: land a green pull request, re-run a failed check (the server decides again, see server/forge-actions.js)
|
|
387
353
|
// ---------------------------------------------------------------------------
|
|
@@ -423,7 +389,7 @@ export function mergeBlock(detail) {
|
|
|
423
389
|
export function approvalWarning(detail) {
|
|
424
390
|
if (!detail || detail.pull.state !== 'open') return '';
|
|
425
391
|
const open = (detail.specs || []).filter((s) => !s.approved).map((s) => s.slug);
|
|
426
|
-
return open.length ? `Its proposal${open.length > 1 ? 's' : ''} ${open.join(', ')} ${open.length > 1 ? 'are' : 'is'} not approved yet. Next: approve ${open.length > 1 ? 'them' : 'it'} first (
|
|
392
|
+
return open.length ? `Its proposal${open.length > 1 ? 's' : ''} ${open.join(', ')} ${open.length > 1 ? 'are' : 'is'} not approved yet. Next: approve ${open.length > 1 ? 'them' : 'it'} first (Review in the node panel, then Approve), then land this.` : '';
|
|
427
393
|
}
|
|
428
394
|
|
|
429
395
|
/**
|
|
@@ -515,7 +481,7 @@ export function errorWords(status, body, { offline = false, what = '' } = {}) {
|
|
|
515
481
|
/** What a list says when it has nothing in it: what would appear here and how to make one (the `kind` is the tab) */
|
|
516
482
|
export function emptyWords(kind, forgeName = 'the forge') {
|
|
517
483
|
return {
|
|
518
|
-
specs: 'No proposals yet. A proposal is a change to the map written down before it is built. Start one from an issue (
|
|
484
|
+
specs: 'No proposals yet. A proposal is a change to the map written down before it is built. Start one from an issue (select it, then Start a spec in the node panel), or push one as a file to the proposals folder.',
|
|
519
485
|
pulls: `No open pull requests. Agents open one when a run makes code, and you can open one on ${forgeName}.`,
|
|
520
486
|
issues: `No open issues. Open one on ${forgeName}, or write a New idea in Threads.`,
|
|
521
487
|
threads: 'No threads. A thread is an idea or a spec conversation; start one with New idea below.',
|
package/explorer/forge-panel.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module explorer/forge-panel
|
|
3
3
|
*
|
|
4
|
-
* A bridge (spec 0011 D2 and D3, step 6): the Work
|
|
4
|
+
* A bridge (spec 0011 D2 and D3, step 6): the Work list and the actions of a piece of work are the Work piece on the instance (pieces/work.js, with a part per tab in pieces/work-*.js) and its
|
|
5
5
|
* pure half is forge-panel-model.js. This file keeps the old names for the page (page.js, deep-link.js, panels.js) and for the tests that drive the
|
|
6
6
|
* panel through cornfield's own page, bound to the page's instance and to the piece the page mounts at the places in index.html. It goes when
|
|
7
7
|
* those callers are on the instance (the `corn-work` shell for a host, and a page shell that mounts the piece itself).
|
|
@@ -29,7 +29,7 @@ export function initForgePanel(config, opts = {}) {
|
|
|
29
29
|
if (!p) return false;
|
|
30
30
|
p.update(opts.clock ? { clock: opts.clock, config } : { config });
|
|
31
31
|
const on = p.isOn();
|
|
32
|
-
if (on) initConnection(); // the offline banner (explorer/connection.js) is the page's; it follows the Work
|
|
32
|
+
if (on) initConnection(); // the offline banner (explorer/connection.js) is the page's; it follows the Work list, as it always has
|
|
33
33
|
return on;
|
|
34
34
|
}
|
|
35
35
|
|
|
@@ -45,12 +45,7 @@ export const openForge = (opts) => { const p = piece(); if (p) p.openForge(opts)
|
|
|
45
45
|
export const closeForge = (opts) => { const p = piece(); if (p) p.closeForge(opts); };
|
|
46
46
|
export const toggleForge = () => { const p = piece(); if (p) p.toggleForge(); };
|
|
47
47
|
export const refreshForge = (opts) => { const p = piece(); return p ? p.refreshForge(opts) : Promise.resolve(); };
|
|
48
|
-
export const clearPull = () => { const p = piece(); if (p) p.clearPull(); };
|
|
49
|
-
export const clearDeploy = () => { const p = piece(); if (p) p.clearDeploy(); };
|
|
50
|
-
export const clearThread = () => { const p = piece(); if (p) p.clearThread(); };
|
|
51
|
-
export const selectDeploy = (id) => { const p = piece(); if (p) p.selectDeploy(id); };
|
|
52
|
-
export const openRunLink = (id) => { const p = piece(); return p && p.isOn() ? p.openRunLink(id) : Promise.resolve(false); };
|
|
53
|
-
export const openIssueLink = (n) => { const p = piece(); return p && p.isOn() ? p.openIssueLink(n) : Promise.resolve(false); };
|
|
54
48
|
export const openProposalStart = (slug, opener) => { const p = piece(); return p && p.isOn() ? p.openProposalStart(slug, opener) : Promise.resolve(false); };
|
|
55
|
-
|
|
49
|
+
/** A piece of work by what a row of the list names (the Work view's way to show one the graph does not draw) */
|
|
50
|
+
export const showWorkRef = (kind, key) => { const p = piece(); return p && p.isOn() ? p.showRef(kind, key) : Promise.resolve(false); };
|
|
56
51
|
export const canStartAgent = () => { const p = piece(); return !!p && p.canStartAgent(); };
|