cornfield 0.56.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/strings.js +1 -1
- 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/sheets.css +1 -1
- package/explorer/css/work.css +6 -4
- 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/proposal.js +3 -3
- package/explorer/engine/sheets.js +3 -3
- package/explorer/focus-room.js +1 -1
- package/explorer/forge-panel.js +1 -1
- package/explorer/index.html +1 -1
- package/explorer/instance.js +6 -4
- package/explorer/page-pieces.js +1 -1
- package/explorer/pieces/decision.js +3 -3
- package/explorer/pieces/layers.js +1 -1
- package/explorer/pieces/node-panel.js +29 -9
- package/explorer/pieces/proposal.js +6 -6
- package/explorer/pieces/review.js +2 -2
- package/explorer/pieces/work-paint.js +17 -0
- package/explorer/pieces/work.js +10 -0
- package/explorer/proposal-model.js +1 -1
- package/explorer/proposal.js +1 -1
- package/explorer/sheets.js +1 -1
- package/explorer/tokens.css +2 -2
- package/explorer/work-badge-model.js +161 -0
- package/explorer/work-badges.js +143 -0
- package/explorer/work-model.js +1 -1
- package/explorer/work-view.css +8 -0
- package/explorer/work-view.js +119 -22
- package/package.json +1 -1
package/core/strings.js
CHANGED
|
@@ -62,7 +62,7 @@ export const STRINGS = Object.freeze({
|
|
|
62
62
|
playAgain: 'Play again',
|
|
63
63
|
nextScenario: 'Next scenario',
|
|
64
64
|
notChecked: 'Not checked',
|
|
65
|
-
// The Work
|
|
65
|
+
// The Work list: its tabs run in the order of the loop
|
|
66
66
|
tabSpecs: 'Specs',
|
|
67
67
|
tabPulls: 'PRs',
|
|
68
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/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,6 +1,6 @@
|
|
|
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;
|
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
.hx-forge { --hx-forge-status-w: 56px; }
|
|
13
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; }
|
|
14
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; }
|
|
15
17
|
.hx-forge.forge-open { pointer-events: auto; }
|
|
16
18
|
.hx-forge:not(.forge-open) { box-shadow: none; }
|
|
17
19
|
@container corn-box (min-width: 768px) {
|
|
@@ -181,7 +183,7 @@ a.hx-forge-row:hover, button.hx-forge-row:hover { background: var(--corn-surface
|
|
|
181
183
|
.hx-run .hx-link, .hx-forge-check .hx-link { display: inline-flex; align-items: center; min-height: 44px; }
|
|
182
184
|
}
|
|
183
185
|
/* ==========================================================================
|
|
184
|
-
The Work
|
|
186
|
+
The Work list's states, results, disabled controls, loading and empty lists, and its fixed top (the 0.34 design review)
|
|
185
187
|
========================================================================== */
|
|
186
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
|
|
187
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. */
|
|
@@ -258,7 +260,7 @@ a.hx-forge-row:hover, button.hx-forge-row:hover { background: var(--corn-surface
|
|
|
258
260
|
.hx-forge-unread .hx-btn { min-height: 44px; }
|
|
259
261
|
}
|
|
260
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; }
|
|
261
|
-
/* 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 */
|
|
262
264
|
.hx-forge-head { min-height: var(--corn-panel-head-height); }
|
|
263
265
|
/* The controls of a bar that had no height of their own */
|
|
264
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/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');
|
|
@@ -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.
|
package/explorer/forge-panel.js
CHANGED
|
@@ -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
|
|
package/explorer/index.html
CHANGED
|
@@ -162,7 +162,7 @@
|
|
|
162
162
|
<!-- Review tokens (explorer/review-tokens.js): shown only when somebody is signed in to a forge -->
|
|
163
163
|
<button type="button" id="tokens-btn" class="hx-account-item" aria-haspopup="dialog" aria-expanded="false" aria-controls="tokens-dialog" title="Review tokens: let a script or a chat bot approve or send back a proposal as you" hidden data-corn="tokens-button">Review tokens</button>
|
|
164
164
|
|
|
165
|
-
<!-- Proposals: what a change would add, change and remove, drawn on the map. It is part of the proposal piece (explorer/pieces/proposal.js): page.js mounts it here. Only without the Work
|
|
165
|
+
<!-- Proposals: what a change would add, change and remove, drawn on the map. It is part of the proposal piece (explorer/pieces/proposal.js): page.js mounts it here. Only without the Work list (no forge, or no sign-in): with it, its Specs tab lists them and forge-panel.js hides this -->
|
|
166
166
|
<!--corn-piece:proposal/menu-->
|
|
167
167
|
|
|
168
168
|
<!-- The config's links (cornfield.config.js `links`), the forge and Docs, then Sign out: filled by explorer/plugins.js -->
|
package/explorer/instance.js
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* inst.touchScene / onSceneTouch a change the picture is built from, and who follows it
|
|
14
14
|
* inst.on / emit what a piece tells its neighbours, per instance: `emit(name, detail)` calls every `on(name, fn)`, and `on` returns how to stop.
|
|
15
15
|
* inst.ask what a piece asks of a neighbour that may or may not be there: the first answer other than `undefined` from the
|
|
16
|
-
* handlers of `on(name, ...)`, else `undefined`. A piece that finds no answer does without (the Work
|
|
16
|
+
* handlers of `on(name, ...)`, else `undefined`. A piece that finds no answer does without (the Work list is not part of every page)
|
|
17
17
|
* inst.setSelection(node, edge, { source, quiet }) the one way the converted pieces change what is selected (explorer/engine/selection.js);
|
|
18
18
|
* returns the change, whose `announce()` says it when `quiet` held it back (the caller touches the scene first)
|
|
19
19
|
* inst.offline() whether the browser has no network; inst.onNetwork(fn(offline)), inst.onWindowFocus(fn), inst.onPageHide(fn), inst.onPageShow(fn), inst.onResize(fn), inst.onHide(fn): the few window facts the review needs;
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
* work:waiting { total } what waits on the maintainer changed (specs to decide plus runs that need an answer; pieces/work.js): the page puts the number before its title
|
|
62
62
|
* work:available { on } the Work piece started (a forge in the config and somebody signed in), or ended: the Work view's List toggle shows, and the account menu's Proposals entry is only for a cornfield without it
|
|
63
63
|
* runs:map { active } runs are on the map, or none is (pieces/work.js, runs-map.js): the Layers menu shows its legend while there are
|
|
64
|
-
* thread:open { number } a thread listed in the node panel was chosen; thread:start { node }: "Start a thread about this" (pieces/node-panel.js; the Work
|
|
64
|
+
* thread:open { number } a thread listed in the node panel was chosen; thread:start { node }: "Start a thread about this" (pieces/node-panel.js; the Work list opens the thread, or its New idea form)
|
|
65
65
|
* announce text what a screen reader is told (engine/keyboard.js `announce`; the piece that owns a live region writes it: `announce:write`)
|
|
66
66
|
* root:changed (none) the primary root moved (`attach`) or a root joined or left (engine/roots.js): what listens on every root puts itself right
|
|
67
67
|
* map:ready (none) the map piece is mounted and has its topology (pieces/map.js); map:gone: it ended. The pieces around it (pieces/around.js) mount and unmount with it
|
|
@@ -97,11 +97,13 @@
|
|
|
97
97
|
* proposal:seat-column { column, phone } -> true the bar seats the review column: under it, or in its body on a phone (pieces/proposal.js); proposal:bar-bottom (none) -> px,
|
|
98
98
|
* how far down the bar reaches, and proposal:bar-resize (emit): the bar's height changed, so the column starts under it again
|
|
99
99
|
* player:seat bar -> true the dock's owner (engine/sheets.js) seats the scenario player's bar as a sheet above the node panel's
|
|
100
|
-
* threads:index nodeId -> { threads: thread[] | null, forge: string, start: true } | undefined the Work
|
|
101
|
-
* threads:ensure (none) (emit) the node panel was filled: the Work
|
|
100
|
+
* threads:index nodeId -> { threads: thread[] | null, forge: string, start: true } | undefined the Work list's list of the threads that mention a node, for the node panel's "Threads"; `threads` is null until the list was read; no answer: no Threads section
|
|
101
|
+
* threads:ensure (none) (emit) the node panel was filled: the Work list reads the threads list once; threads:changed: it was read, or the map changed, so the node panel draws "Threads" again
|
|
102
102
|
* work:list { open } the Work list opened or closed (pieces/work-list.js)
|
|
103
103
|
* work:pick { kind, key } -> true (ask, answered by the Work view: explorer/work-view.js) select the node of that piece of work (`pull`, `issue`, `thread`, `run`, `deploy`, `proposal`, and its number, id or slug) on the map; no answer: the Work piece shows it in the node panel alone, as it shows work older than the graph's 14 days
|
|
104
104
|
* work:panel node -> { replace, badge, title, html } | undefined (ask, answered by the Work view) what the node panel shows for a piece of work or, in the Work view, a node of code; the html holds `forge-detail`, where the Work piece draws the actions
|
|
105
|
+
* work:changed (none) (emit) the work changed (the Work layer came on or went off, or the graph was read again): the open node panel asks `work:panel` again for its node of code and draws that section again
|
|
106
|
+
* node:words node -> string | undefined (ask, answered by the Work view) what the keyboard adds to its words on landing on a node: the Work layer's ", 2 open: PR #27, Issue #14"
|
|
105
107
|
* node:back (none) -> (() => boolean) | undefined (ask, answered by the Work list) the node panel is about to close: what gives the focus back to the row of the open list that chose what it shows (true when it did); else the map has it
|
|
106
108
|
* work:on (none) -> boolean whether the Work piece has started (a piece mounted after it asks rather than waits for `work:available`)
|
|
107
109
|
* work:answer { run } (emit) "Answer" on the proposal bar's line: the run is shown in the node panel, its reply field focused
|
package/explorer/page-pieces.js
CHANGED
|
@@ -41,7 +41,7 @@ function markersOf(doc, name) {
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
|
-
* The Work
|
|
44
|
+
* The Work list says what waits on the maintainer (`work:waiting`); the browser tab's title is the page's, so the page puts "(3) " before its own
|
|
45
45
|
* title while something waits. A host app keeps its own title and does not listen.
|
|
46
46
|
*/
|
|
47
47
|
let titleOff = null;
|
|
@@ -248,7 +248,7 @@ export function mount(root, inst, options = {}) {
|
|
|
248
248
|
list.replaceChildren(...ui.sent.lines.map((text) => { const li = inst.doc.createElement('li'); li.className = 'hx-whatif-edit'; li.textContent = text; return li; }));
|
|
249
249
|
}
|
|
250
250
|
}
|
|
251
|
-
// A landing that waits on this PR: Cancel landing, brought here from the Work
|
|
251
|
+
// A landing that waits on this PR: Cancel landing, brought here from the Work list (D3)
|
|
252
252
|
const landing = q('[data-review-landing]');
|
|
253
253
|
const landingNow = ui.reviewable && ui.facts && ui.facts.landing ? ui.facts.landing : null;
|
|
254
254
|
landing.hidden = !landingNow;
|
|
@@ -513,7 +513,7 @@ export function mount(root, inst, options = {}) {
|
|
|
513
513
|
await sendReview(hold.verdict, { body: hold.body });
|
|
514
514
|
}
|
|
515
515
|
|
|
516
|
-
/** Cancel landing (D3): the Work
|
|
516
|
+
/** Cancel landing (D3): the Work list's Cancel, here; a POST from this page, then the facts are read again */
|
|
517
517
|
async function cancelLanding() {
|
|
518
518
|
const n = pullNumberOf(state.proposalSource);
|
|
519
519
|
if (!n) return;
|
|
@@ -597,7 +597,7 @@ export function mount(root, inst, options = {}) {
|
|
|
597
597
|
return false;
|
|
598
598
|
}
|
|
599
599
|
ui.busy = false;
|
|
600
|
-
if (key !== ui.key) { inst.emit('decision', { outcome: verdict, review: saved, slug, source, open: false }); return true; } // another proposal opened while it was being saved: it is saved, the foot is not this one's any more (`open: false`: the page's Work
|
|
600
|
+
if (key !== ui.key) { inst.emit('decision', { outcome: verdict, review: saved, slug, source, open: false }); return true; } // another proposal opened while it was being saved: it is saved, the foot is not this one's any more (`open: false`: the page's Work list does not read its list again then, as before)
|
|
601
601
|
ui.review = { verdict: saved.verdict, at: saved.at, current: saved.verdict === 'approved' };
|
|
602
602
|
ui.hint = verdict === 'approved' ? editsHint(verdict, body.edits.length) : '';
|
|
603
603
|
// The same approval stood already (another tab, or a send that was retried): the server posted nothing, and the page says so
|
|
@@ -316,7 +316,7 @@ export function mount(root, inst, options = {}) {
|
|
|
316
316
|
scope.on('layers:redraw', renderLayerToggles);
|
|
317
317
|
scope.on('theme', renderLayerToggles); // the dots and the legends are drawn in the theme's colours
|
|
318
318
|
scope.on('view', syncView);
|
|
319
|
-
scope.on('runs:map', ({ active }) => { const legend = own('runs-legend'); if (legend) legend.hidden = !active; }); // runs are on the map (the Work
|
|
319
|
+
scope.on('runs:map', ({ active }) => { const legend = own('runs-legend'); if (legend) legend.hidden = !active; }); // runs are on the map (the Work list): the legend says what each mark is
|
|
320
320
|
// The marks legend is there while a proposal is open (the proposal's bar says so: engine/proposal.js)
|
|
321
321
|
const showLegend = (open) => { const legend = own('proposal-legend'); if (legend) legend.hidden = !open; };
|
|
322
322
|
scope.on('proposal:draw', ({ open }) => showLegend(open));
|
|
@@ -252,9 +252,9 @@ function sectionsOf(inst) {
|
|
|
252
252
|
return '';
|
|
253
253
|
}
|
|
254
254
|
|
|
255
|
-
/** "Threads": the threads whose text names the node (an idea, or a spec PR's conversation); each opens in the Work
|
|
255
|
+
/** "Threads": the threads whose text names the node (an idea, or a spec PR's conversation); each opens in the Work list */
|
|
256
256
|
function threadsSection(node) {
|
|
257
|
-
// The Work
|
|
257
|
+
// The Work list answers (threads:index) when threads are on and a maintainer is signed in; nobody answering is no Threads section
|
|
258
258
|
const index = inst.ask('threads:index', node.id);
|
|
259
259
|
if (!index) return '';
|
|
260
260
|
const threads = index.threads;
|
|
@@ -391,6 +391,27 @@ export function mount(root, inst, options = {}) {
|
|
|
391
391
|
addParts(box);
|
|
392
392
|
}
|
|
393
393
|
|
|
394
|
+
/** What the Work view put first in the panel for a node of code (the Work layer's "Open work", or the work touching it in the Work view): its elements and its markup */
|
|
395
|
+
let workShown = { node: null, html: '', els: [] };
|
|
396
|
+
function putWork(node, html) {
|
|
397
|
+
for (const el of workShown.els) el.remove();
|
|
398
|
+
const before = metaList.firstChild;
|
|
399
|
+
if (html) metaList.insertAdjacentHTML('afterbegin', html);
|
|
400
|
+
const els = [];
|
|
401
|
+
for (let el = metaList.firstChild; el && el !== before; el = el.nextSibling) els.push(el);
|
|
402
|
+
if (html) addParts(metaList);
|
|
403
|
+
workShown = { node, html, els };
|
|
404
|
+
}
|
|
405
|
+
/** The work changed (`work:changed`: the Work layer came on or went off, or a new answer): the open panel's section for it is drawn again, and nothing else in it moves */
|
|
406
|
+
function repaintWork() {
|
|
407
|
+
const node = state.selectedNode;
|
|
408
|
+
if (gone || !node || !workShown.node || node.id !== workShown.node.id || !drawer.classList.contains('drawer-open')) return;
|
|
409
|
+
const work = inst.ask('work:panel', node);
|
|
410
|
+
if (work && work.replace) return; // a piece of work is drawn whole when it is shown
|
|
411
|
+
const html = work ? work.html : '';
|
|
412
|
+
if (html !== workShown.html) putWork(node, html); // the same markup: left alone, with the focus in it
|
|
413
|
+
}
|
|
414
|
+
|
|
394
415
|
/** Fills the panel for a node and opens it. The selection itself is the instance's (engine/selection.js); this is what is shown for it. */
|
|
395
416
|
function show(node, { frame = false } = {}) {
|
|
396
417
|
if (!node || gone) return;
|
|
@@ -418,7 +439,7 @@ export function mount(root, inst, options = {}) {
|
|
|
418
439
|
<div id="drawer-threads">${sections.threadsSection(node)}</div>
|
|
419
440
|
${sections.diffSection(node)}`;
|
|
420
441
|
addParts(metaList);
|
|
421
|
-
inst.emit('threads:ensure'); // the Work
|
|
442
|
+
inst.emit('threads:ensure'); // the Work list reads the threads once, for "Mentioned in"
|
|
422
443
|
inst.emit('live:hydrate', own('drawer-live'));
|
|
423
444
|
|
|
424
445
|
// The actions: Open file (the node's file on the forge) is the primary one; with an address too, Open route is the quiet one.
|
|
@@ -439,6 +460,7 @@ export function mount(root, inst, options = {}) {
|
|
|
439
460
|
// The Work view (spec 0012 D5): a piece of work is shown by the page's own answer (work-view.js); a node of code in it keeps its own sections, with the work touching it first
|
|
440
461
|
const work = inst.ask('work:panel', node);
|
|
441
462
|
own('drawer-copy-btn').hidden = !!(work && work.replace); // a piece of work is no spec to copy: its JSON is the forge's, not the map's
|
|
463
|
+
workShown = { node: null, html: '', els: [] }; // the markup above replaced what was there
|
|
442
464
|
if (work && work.replace) {
|
|
443
465
|
title.textContent = work.title;
|
|
444
466
|
title.classList.remove('hx-mono');
|
|
@@ -451,10 +473,7 @@ export function mount(root, inst, options = {}) {
|
|
|
451
473
|
fileBtn.hidden = true;
|
|
452
474
|
openBtn.hidden = true;
|
|
453
475
|
own('drawer-run-btn').hidden = true;
|
|
454
|
-
} else
|
|
455
|
-
metaList.insertAdjacentHTML('afterbegin', work.html);
|
|
456
|
-
addParts(metaList);
|
|
457
|
-
}
|
|
476
|
+
} else putWork(node, work ? work.html : '');
|
|
458
477
|
|
|
459
478
|
drawer.classList.add('drawer-open');
|
|
460
479
|
drawer.inert = false; // closed, it waits off screen: inert, so Tab never reaches its buttons (MAP-02)
|
|
@@ -520,7 +539,7 @@ export function mount(root, inst, options = {}) {
|
|
|
520
539
|
if (!inline) collapseSheet(inst, 'drawer'); // the next node opens as a peek on a phone
|
|
521
540
|
}
|
|
522
541
|
|
|
523
|
-
/** Start a run: the Start dialog of the Work
|
|
542
|
+
/** Start a run: the Start dialog of the Work list, on the proposal that is open */
|
|
524
543
|
function startRun() {
|
|
525
544
|
if (state.proposalSlug) inst.emit('forge:start', { slug: state.proposalSlug, returnTo: '#drawer-run-btn' });
|
|
526
545
|
}
|
|
@@ -545,7 +564,7 @@ export function mount(root, inst, options = {}) {
|
|
|
545
564
|
// The panel's ✕: the focus would be left on a hidden button, so it goes back to that row, else to the map
|
|
546
565
|
if (shut) scope.timeout(() => { if (!(back && back()) && state.canvas) state.canvas.focus(); }, 0);
|
|
547
566
|
});
|
|
548
|
-
// A thread listed in the panel opens in the Work
|
|
567
|
+
// A thread listed in the panel opens in the Work list, and "Start a thread about this" opens its New idea form (the Work list hears both)
|
|
549
568
|
scope.listen(drawer, 'click', (e) => {
|
|
550
569
|
const open = e.target.closest && e.target.closest('[data-thread-open]');
|
|
551
570
|
if (open) { inst.emit('thread:open', { number: Number(open.dataset.threadOpen) }); return; }
|
|
@@ -554,6 +573,7 @@ export function mount(root, inst, options = {}) {
|
|
|
554
573
|
});
|
|
555
574
|
// The threads that mention nodes changed (the list was read, or the map changed): the section is drawn again
|
|
556
575
|
scope.on('threads:changed', () => repaintThreads());
|
|
576
|
+
scope.on('work:changed', () => repaintWork());
|
|
557
577
|
// The dim layer behind the panel: on a phone a tap there folds the panel to its peek; elsewhere it closes it
|
|
558
578
|
if (!inline) {
|
|
559
579
|
scope.listen(backdrop, 'click', (e) => {
|
|
@@ -130,7 +130,7 @@ export function mount(root, inst, options = {}) {
|
|
|
130
130
|
...place(inst, root, html.bar, options.slots, 'bar'),
|
|
131
131
|
...(inline ? [] : place(inst, root, html.menu, options.slots, 'menu')),
|
|
132
132
|
];
|
|
133
|
-
/** What hears the clicks and keys of this piece: the instance's root, which holds the Work
|
|
133
|
+
/** What hears the clicks and keys of this piece: the instance's root, which holds the Work list's Specs list too (cornfield's page), or the box's own root */
|
|
134
134
|
const hear = inline ? root : inst.root;
|
|
135
135
|
/** An element of this piece by id (the piece's own, whatever else the root holds) */
|
|
136
136
|
const own = (id) => {
|
|
@@ -391,7 +391,7 @@ export function mount(root, inst, options = {}) {
|
|
|
391
391
|
if (state.canvas) state.canvas.focus();
|
|
392
392
|
}
|
|
393
393
|
|
|
394
|
-
/** A bad link's way on: the Work
|
|
394
|
+
/** A bad link's way on: the Work list's Specs tab when there is one, else the header's Proposals menu */
|
|
395
395
|
function openSpecs() {
|
|
396
396
|
if (inst.ask('work:open-specs') === true) return;
|
|
397
397
|
if (!menuOpen()) toggleMenu();
|
|
@@ -410,7 +410,7 @@ export function mount(root, inst, options = {}) {
|
|
|
410
410
|
'proposal-way': (el) => (el.dataset.way === 'open' ? openProposal(inst, el.dataset.slug, el.dataset.source || null) : el.dataset.way === 'retry' ? retryOpen(el.dataset.slug, el.dataset.source || null) : el.dataset.way === 'close' ? closeAfterFailure() : openSpecs()),
|
|
411
411
|
};
|
|
412
412
|
|
|
413
|
-
// The root hears every control: the bar's, the menu's and a row of the Work
|
|
413
|
+
// The root hears every control: the bar's, the menu's and a row of the Work list's Specs list (`open-proposal`), as the document did
|
|
414
414
|
scope.listen(hear, 'click', (e) => {
|
|
415
415
|
const target = e.target.closest ? e.target.closest('[data-action]') : null;
|
|
416
416
|
const action = target && Object.hasOwn(ACTIONS, target.dataset.action) && ACTIONS[target.dataset.action];
|
|
@@ -425,15 +425,15 @@ export function mount(root, inst, options = {}) {
|
|
|
425
425
|
// too, as it does on cornfield's page. The open menu holds the focus (on an item), and such a click takes it out of the bar: the menu closes when the focus
|
|
426
426
|
// leaves the bar (to nothing, or to anything outside it), which holds in a host's closed shadow root too and needs no listener on the page
|
|
427
427
|
if (inline) scope.listen(bar, 'focusout', (e) => { if (moreOpen() && !(e.relatedTarget && bar.contains(e.relatedTarget))) closeMore(); });
|
|
428
|
-
// Answer, on the bar's line (a run waits on this proposal): the Work
|
|
428
|
+
// Answer, on the bar's line (a run waits on this proposal): the Work list opens on that run with its reply field focused (work:answer)
|
|
429
429
|
scope.listen(bar, 'click', (e) => {
|
|
430
430
|
const go = e.target.closest && e.target.closest('[data-waiting-answer]');
|
|
431
431
|
if (go) { e.preventDefault(); e.stopPropagation(); inst.emit('work:answer', { run: go.dataset.waitingAnswer }); }
|
|
432
432
|
}, true);
|
|
433
|
-
// With the Work
|
|
433
|
+
// With the Work list on, its Specs tab lists the proposals: the account menu's Proposals entry is only for a cornfield without it (no forge, or no sign-in)
|
|
434
434
|
const proposalsEntry = (workOn) => { const wrap = own('proposal-wrap'); if (wrap) wrap.hidden = !!workOn; };
|
|
435
435
|
scope.on('work:available', ({ on }) => proposalsEntry(on));
|
|
436
|
-
if (inst.ask('work:on')) proposalsEntry(true); // the Work
|
|
436
|
+
if (inst.ask('work:on')) proposalsEntry(true); // the Work list started before this piece was mounted: it said so to nobody
|
|
437
437
|
scope.listen(hear, 'keydown', (e) => {
|
|
438
438
|
if (e.key === 'Escape' && menuOpen()) closeMenu();
|
|
439
439
|
onMoreKey(e);
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* review needs, and mounts the pieces of the explorer into it through their own `mount(root, inst, { slots })`: the map (pieces/map.js), the proposal's
|
|
6
6
|
* bar (pieces/proposal.js, without the what-if editor's buttons: the editor is not converted), the change list with the scenario player
|
|
7
7
|
* (pieces/changes.js), the decision's foot (pieces/decision.js, in the column's foot) and the node panel (pieces/node-panel.js). It is not cornfield's
|
|
8
|
-
* page: no header, Work
|
|
8
|
+
* page: no header, Work list, search, Layers chip, account menu or hint, and cornfield's page does not use it (it keeps its own layout).
|
|
9
9
|
*
|
|
10
10
|
* const review = mount(root, inst, options) -> { update, destroy, ... }
|
|
11
11
|
*
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
* Nothing leaves the box: no listener on `document` or `window`, nothing appended outside it, no id looked up outside it, keys act only with the focus
|
|
54
54
|
* inside, no `location`, no `history`; the wheel is the page's until the map has the focus or Ctrl or Cmd is held (input.js).
|
|
55
55
|
*
|
|
56
|
-
* Not in it: the what-if editor, the mockups, the Work
|
|
56
|
+
* Not in it: the what-if editor, the mockups, the Work list, search, the Layers menu, the Proposals menu (its markup is kept in a spare, hidden place: the
|
|
57
57
|
* proposal piece makes it), signing in (the decision says `auth`).
|
|
58
58
|
*
|
|
59
59
|
* @param {Element|ShadowRoot} root
|
|
@@ -149,10 +149,27 @@ export function install(ctx) {
|
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
/** Says (on the panel's top, for the CSS) that the tabs run on past an edge: a fade shows on that side, so Deploys is not simply missing on a phone */
|
|
152
|
+
let tabsFor = null; // the tab the strip was last scrolled to show: the strip follows the tab that is on (and is left alone while the viewer scrolls it)
|
|
152
153
|
function paintTabsMore() {
|
|
153
154
|
const top = root.querySelector('#forge-panel .hx-forge-top');
|
|
154
155
|
const tabs = top && top.querySelector('.hx-forge-tabs');
|
|
155
156
|
if (!tabs) return;
|
|
157
|
+
// The tab that is on is brought into the strip (Deploys is the sixth: a list opened on it, or a tab pressed, must not leave it under the edge). A strip that is not laid out
|
|
158
|
+
// (the list shut, a phone's sheet in its peek) is asked again when it is
|
|
159
|
+
const active = tabs.clientWidth ? tabs.querySelector('[aria-pressed="true"]') : null;
|
|
160
|
+
if (!tabs.clientWidth) tabsFor = null;
|
|
161
|
+
else if (active && tabsFor !== ui.kind) {
|
|
162
|
+
tabsFor = ui.kind;
|
|
163
|
+
const box = tabs.getBoundingClientRect();
|
|
164
|
+
const at = active.getBoundingClientRect();
|
|
165
|
+
// Clear of the fade the strip puts on an edge it runs on past (css/work.css: one and a half `--corn-space-6`); the first and the last tab go to their end of the strip
|
|
166
|
+
const room = 1.5 * (parseFloat(inst.win.getComputedStyle(tabs).getPropertyValue('--corn-space-6')) || 24);
|
|
167
|
+
const shown = [...tabs.children].filter((c) => !c.hidden);
|
|
168
|
+
if (active === shown[0]) tabs.scrollLeft = 0;
|
|
169
|
+
else if (active === shown[shown.length - 1]) tabs.scrollLeft = tabs.scrollWidth;
|
|
170
|
+
else if (at.left < box.left + room) tabs.scrollLeft += at.left - box.left - room;
|
|
171
|
+
else if (at.right > box.right - room) tabs.scrollLeft += at.right - box.right + room;
|
|
172
|
+
}
|
|
156
173
|
const more = [];
|
|
157
174
|
if (tabs.scrollLeft > 1) more.push('start');
|
|
158
175
|
if (tabs.scrollWidth - tabs.clientWidth - tabs.scrollLeft > 1) more.push('end');
|
package/explorer/pieces/work.js
CHANGED
|
@@ -213,6 +213,16 @@ export function mount(root, inst, options = {}) {
|
|
|
213
213
|
scope.listen(ctx.root, 'focusin', (e) => { revealInStrip(e.target); });
|
|
214
214
|
const tabs = panel.querySelector('.hx-forge-tabs');
|
|
215
215
|
if (tabs) scope.listen(tabs, 'scroll', fn.paintTabsMore, { passive: true });
|
|
216
|
+
// A mouse wheel turns the strip sideways (its tabs run on past the panel's edge, and a vertical wheel has nothing else to do over a one-line strip); at either end it is left to the list below
|
|
217
|
+
if (tabs) {
|
|
218
|
+
scope.listen(tabs, 'wheel', (e) => {
|
|
219
|
+
if (e.deltaX || !e.deltaY || e.ctrlKey || e.defaultPrevented) return;
|
|
220
|
+
const end = tabs.scrollWidth - tabs.clientWidth;
|
|
221
|
+
if (end <= 1 || (e.deltaY < 0 ? tabs.scrollLeft <= 0 : tabs.scrollLeft >= end - 1)) return;
|
|
222
|
+
tabs.scrollLeft += e.deltaY;
|
|
223
|
+
e.preventDefault();
|
|
224
|
+
}, { passive: false });
|
|
225
|
+
}
|
|
216
226
|
scope.own(inst.onResize(() => fn.paintTabsMore()));
|
|
217
227
|
// The strip's fade and the top's height follow their own size too: a phone's sheet expanding shows the tabs (they were not laid out in the
|
|
218
228
|
// peek), and a host's box resizes without the window doing so (F42)
|
|
@@ -170,7 +170,7 @@ export function proposalPanelHtml(item) {
|
|
|
170
170
|
}
|
|
171
171
|
|
|
172
172
|
// ---------------------------------------------------------------------------
|
|
173
|
-
// A proposal as a row of the Work
|
|
173
|
+
// A proposal as a row of the Work list's Specs tab
|
|
174
174
|
// ---------------------------------------------------------------------------
|
|
175
175
|
|
|
176
176
|
/** Where a listing entry is, as a line of meta: "PR #11", or the checkout or worktree it is in; a proposal that is also somewhere else says so ("PR #11, and a copy in the checkout") */
|
package/explorer/proposal.js
CHANGED
|
@@ -48,7 +48,7 @@ for (const name of Object.keys(ADAPT)) {
|
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
/** What the server listed last, for the Work
|
|
51
|
+
/** 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 */
|
|
52
52
|
export const proposalListing = () => E.proposalListing(pageInstance());
|
|
53
53
|
/** Calls `fn` each time the list is read again; returns the way to stop */
|
|
54
54
|
export const onProposalListing = (fn) => E.onProposalListing(pageInstance(), fn);
|
package/explorer/sheets.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* A bridge (spec 0011 D2, step 4): the phone's bottom sheets now live in engine/sheets.js, one set per instance (the node panel registers its
|
|
5
5
|
* own, pieces/node-panel.js, and so does the proposal's bar, pieces/proposal.js). This file keeps the old names for the modules that are not yet on an
|
|
6
|
-
* instance (the Work
|
|
6
|
+
* instance (the Work list, deep links, the House), bound to the page's instance. It goes when the last of them is converted.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { pageInstance } from './state.js';
|