@biolibs/bionet-tools 0.1.9 → 0.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +139 -2
- package/dist/digest-tool.d.ts +12 -3
- package/dist/digest-tool.d.ts.map +1 -1
- package/dist/digest-tool.js +10 -4
- package/dist/digest-tool.js.map +1 -1
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -1
- package/dist/induce-bench.d.ts +91 -0
- package/dist/induce-bench.d.ts.map +1 -0
- package/dist/induce-bench.js +201 -0
- package/dist/induce-bench.js.map +1 -0
- package/dist/induce.d.ts +280 -0
- package/dist/induce.d.ts.map +1 -0
- package/dist/induce.js +353 -0
- package/dist/induce.js.map +1 -0
- package/dist/modify.d.ts +197 -0
- package/dist/modify.d.ts.map +1 -0
- package/dist/modify.js +253 -0
- package/dist/modify.js.map +1 -0
- package/dist/ordering.d.ts +147 -0
- package/dist/ordering.d.ts.map +1 -0
- package/dist/ordering.js +203 -0
- package/dist/ordering.js.map +1 -0
- package/dist/protein.d.ts.map +1 -1
- package/dist/protein.js +3 -1
- package/dist/protein.js.map +1 -1
- package/dist/run.d.ts +1 -1
- package/dist/run.d.ts.map +1 -1
- package/dist/run.js +1 -1
- package/dist/run.js.map +1 -1
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +9 -4
- package/dist/tools.js.map +1 -1
- package/dist/work.d.ts +18 -0
- package/dist/work.d.ts.map +1 -0
- package/dist/work.js +145 -0
- package/dist/work.js.map +1 -0
- package/package.json +4 -4
- package/src/digest-tool.tsx +14 -5
- package/src/index.ts +10 -0
- package/src/induce-bench.tsx +406 -0
- package/src/induce.ts +448 -0
- package/src/modify.ts +350 -0
- package/src/ordering.ts +301 -0
- package/src/protein.ts +3 -1
- package/src/run.ts +2 -2
- package/src/tools.tsx +8 -3
- package/src/work.tsx +277 -0
- package/tools.css +11 -0
package/src/run.ts
CHANGED
|
@@ -386,10 +386,10 @@ export function ligationRun(lab: ToolLab, choice: LigationChoice): LigationRun {
|
|
|
386
386
|
}
|
|
387
387
|
|
|
388
388
|
/** The tools there are. */
|
|
389
|
-
export type ToolName = "pcr" | "digest" | "ligation";
|
|
389
|
+
export type ToolName = "pcr" | "digest" | "ligation" | "induction";
|
|
390
390
|
|
|
391
391
|
/** The model of instrument each tool is used at. */
|
|
392
|
-
export const TOOL_AT: Readonly<Record<ToolName, string>> = { pcr: "thermocycler", digest: "gel-station", ligation: "heat-block" };
|
|
392
|
+
export const TOOL_AT: Readonly<Record<ToolName, string>> = { pcr: "thermocycler", digest: "gel-station", ligation: "heat-block", induction: "shaking-incubator" };
|
|
393
393
|
|
|
394
394
|
/**
|
|
395
395
|
* Which tool an instrument opens.
|
package/src/tools.tsx
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
/** Getting to a tool: from the instrument it is used at, or from a list of them all. */
|
|
4
|
-
import { useState, type ReactNode } from "react";
|
|
4
|
+
import { useEffect, useState, type ReactNode } from "react";
|
|
5
5
|
import { useLab } from "@biolibs/bionet-react";
|
|
6
6
|
import { DigestTool } from "./digest-tool.js";
|
|
7
|
+
import { InductionTool } from "./induce-bench.js";
|
|
7
8
|
import { PcrTool } from "./pcr-tool.js";
|
|
8
9
|
import { instrumentFor, toolFor, type ToolName } from "./run.js";
|
|
9
10
|
import { LigationTool } from "./ligate-bench.js";
|
|
@@ -17,12 +18,13 @@ import { SequencesTool } from "./sequences-tool.js";
|
|
|
17
18
|
export type DeskTool = "sequences" | "primers" | "codons" | "assembly" | "verify";
|
|
18
19
|
|
|
19
20
|
/** What each tool is called. */
|
|
20
|
-
export const TOOL_NAMES: Readonly<Record<ToolName, string>> = { pcr: "PCR", digest: "Digest and gel", ligation: "Ligation" };
|
|
21
|
+
export const TOOL_NAMES: Readonly<Record<ToolName, string>> = { pcr: "PCR", digest: "Digest and gel", ligation: "Ligation", induction: "Induction" };
|
|
21
22
|
|
|
22
23
|
function Tool({ tool, instrument, onDone }: { tool: ToolName; instrument: { id: string; name: string } | null; onDone?: (() => void) | undefined }) {
|
|
23
24
|
const more = onDone === undefined ? {} : { onDone };
|
|
24
25
|
return tool === "pcr" ? <PcrTool instrument={instrument} {...more} />
|
|
25
26
|
: tool === "ligation" ? <LigationTool instrument={instrument} {...more} />
|
|
27
|
+
: tool === "induction" ? <InductionTool instrument={instrument} {...more} />
|
|
26
28
|
: <DigestTool instrument={instrument} {...more} />;
|
|
27
29
|
}
|
|
28
30
|
|
|
@@ -42,7 +44,7 @@ export function InstrumentTool({ place, onDone }: { place: string; onDone?: () =
|
|
|
42
44
|
<div className="toolhead">
|
|
43
45
|
<div>
|
|
44
46
|
<h2>{found?.name ?? "This place"}</h2>
|
|
45
|
-
<p className="dim">There is no tool for this yet. A thermocycler opens PCR,
|
|
47
|
+
<p className="dim">There is no tool for this yet. A thermocycler opens PCR, a gel station opens digest and gel, and a shaking incubator opens induction.</p>
|
|
46
48
|
</div>
|
|
47
49
|
{onDone !== undefined && <button type="button" className="quiet" onClick={onDone}>Back to the lab</button>}
|
|
48
50
|
</div>
|
|
@@ -63,6 +65,9 @@ export function InstrumentTool({ place, onDone }: { place: string; onDone?: () =
|
|
|
63
65
|
export function Tools({ tool: first = "pcr", views = {} }: { tool?: ToolName | DeskTool; views?: Partial<Record<ToolName | DeskTool, ReactNode | ((go: (tool: ToolName | DeskTool) => void) => ReactNode)>> }) {
|
|
64
66
|
const lab = useLab()?.lab;
|
|
65
67
|
const [tool, setTool] = useState<ToolName | DeskTool>(first);
|
|
68
|
+
// Followed rather than read once, so that something elsewhere in the window — a list of the work
|
|
69
|
+
// to be done, say — can send somebody to the tool that would carry a step out.
|
|
70
|
+
useEffect(() => { setTool(first); }, [first]);
|
|
66
71
|
if (lab === null || lab === undefined) return null;
|
|
67
72
|
const shown = views[tool];
|
|
68
73
|
const names: [ToolName | DeskTool, string][] = [["sequences", "Sequences"], ["primers", "Primers"], ["codons", "Codons"], ["assembly", "Assembly"], ["verify", "Check"], ...(Object.keys(TOOL_NAMES) as ToolName[]).map((one): [ToolName, string] => [one, TOOL_NAMES[one]])];
|
package/src/work.tsx
ADDED
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Every open proposal, read as one piece of work rather than as a pile of cards.
|
|
5
|
+
*
|
|
6
|
+
* The tools each show the proposals for their own machine, which is right when somebody is standing
|
|
7
|
+
* at that machine. It is no use at all for seeing where a build has got to: eleven proposals spread
|
|
8
|
+
* over four tabs, in the order they happened to be made, with nothing saying which comes first or
|
|
9
|
+
* what is waiting on what. This is the other view — the whole of it, in order, in chains.
|
|
10
|
+
*
|
|
11
|
+
* It asserts nothing. Everything here comes from `planOfWork`, which works the order out from what
|
|
12
|
+
* each proposal makes and what each one needs, so what is drawn cannot drift from what is true.
|
|
13
|
+
*/
|
|
14
|
+
import { useState, type ReactNode } from "react";
|
|
15
|
+
import { useAct, useLab } from "@biolibs/bionet-react";
|
|
16
|
+
import { Glossed } from "@biolibs/glossary-react";
|
|
17
|
+
import { FILED_UNDER, UNFILED, planOfWork, saysWork, type Project, type Step } from "./ordering.js";
|
|
18
|
+
|
|
19
|
+
/** What a step is called, by what kind of run it is. */
|
|
20
|
+
const CALLED: Readonly<Record<string, string>> = {
|
|
21
|
+
pcr: "Copy it", digest: "Cut it", ligation: "Join it", assembly: "Build the ring",
|
|
22
|
+
transformation: "Put it into a host", induction: "Grow it and look for the protein",
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* The lab's open proposals as one piece of work: in order, in chains, with what can start now.
|
|
27
|
+
*
|
|
28
|
+
* @param props - `onOpen`, if given, offers a way to go to the tool that would carry a step out,
|
|
29
|
+
* and is handed the proposal.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```tsx
|
|
33
|
+
* import { WorkToDo } from "@biolibs/bionet-tools";
|
|
34
|
+
*
|
|
35
|
+
* <WorkToDo onOpen={(plan) => goToTool(plan.kind)} />
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
export function WorkToDo({ onOpen }: { onOpen?: (plan: Step["plan"]) => void } = {}) {
|
|
39
|
+
const lab = useLab()?.lab;
|
|
40
|
+
const act = useAct();
|
|
41
|
+
// Which project is being looked at, or null for all of them at once.
|
|
42
|
+
const [only, setOnly] = useState<string | null>(null);
|
|
43
|
+
const [filing, setFiling] = useState<string | null>(null);
|
|
44
|
+
const [into, setInto] = useState("");
|
|
45
|
+
// Writing the method out, and taking one somebody else wrote.
|
|
46
|
+
const [method, setMethod] = useState<string | null>(null);
|
|
47
|
+
const [taking, setTaking] = useState("");
|
|
48
|
+
const [told, setTold] = useState<string | null>(null);
|
|
49
|
+
if (lab === null || lab === undefined) return null;
|
|
50
|
+
const whole = planOfWork(lab);
|
|
51
|
+
const shown: Project | undefined = only === null ? undefined : whole.projects.find((one) => one.name === only);
|
|
52
|
+
// Looking at one project shows its chains and its steps, and nothing of anybody else's.
|
|
53
|
+
const work = shown === undefined ? whole : (() => {
|
|
54
|
+
const mine = new Set(shown.order.map((one) => one.plan.plan));
|
|
55
|
+
return {
|
|
56
|
+
...whole, threads: shown.threads, order: shown.order, ready: shown.ready,
|
|
57
|
+
held: shown.order.filter((one) => one.held !== null),
|
|
58
|
+
// What to get first is this project's, not the lab's: showing another project's missing part
|
|
59
|
+
// here would have somebody ordering something their own work does not need.
|
|
60
|
+
toGet: whole.toGet.flatMap((one) => {
|
|
61
|
+
const forSteps = one.forSteps.filter((each) => mine.has(each));
|
|
62
|
+
return forSteps.length === 0 ? [] : [{ ...one, forSteps }];
|
|
63
|
+
}),
|
|
64
|
+
tangled: whole.tangled.filter((one) => mine.has(one)),
|
|
65
|
+
};
|
|
66
|
+
})();
|
|
67
|
+
const said = saysWork(whole);
|
|
68
|
+
const projects = whole.projects;
|
|
69
|
+
const filedAs = (plan: Step["plan"]): string => {
|
|
70
|
+
const says = plan.fields[FILED_UNDER];
|
|
71
|
+
return typeof says === "string" && says.trim() !== "" ? says.trim() : UNFILED;
|
|
72
|
+
};
|
|
73
|
+
const writeOut = async (): Promise<void> => {
|
|
74
|
+
const answer = await act("publishMethod", { ...(only === null ? {} : { project: only }) });
|
|
75
|
+
setTold(answer.ok ? null : answer.error);
|
|
76
|
+
setMethod(answer.ok ? JSON.stringify(answer.result, null, 2) : null);
|
|
77
|
+
};
|
|
78
|
+
const take = async (): Promise<void> => {
|
|
79
|
+
const answer = await act("takeMethod", { method: taking, ...(only === null || only === UNFILED ? {} : { project: only }) });
|
|
80
|
+
if (!answer.ok) { setTold(answer.error); return; }
|
|
81
|
+
const got = answer.result as { proposed: string[]; missing: { name: string }[]; alive: { name: string }[] };
|
|
82
|
+
setTaking("");
|
|
83
|
+
setTold(`${got.proposed.length} ${got.proposed.length === 1 ? "step is" : "steps are"} proposed here.`
|
|
84
|
+
+ (got.missing.length === 0 ? "" : ` ${got.missing.map((one) => one.name).join(" and ")} has to be got first.`)
|
|
85
|
+
+ (got.alive.length === 0 ? "" : ` ${got.alive.map((one) => one.name).join(" and ")} is alive and cannot be sent: make your own.`));
|
|
86
|
+
};
|
|
87
|
+
const file = async (plan: string, name: string): Promise<void> => {
|
|
88
|
+
await act("setField", { on: "plan", id: plan, field: FILED_UNDER, value: name.trim() === "" ? null : name.trim() });
|
|
89
|
+
setFiling(null); setInto("");
|
|
90
|
+
};
|
|
91
|
+
const person = (key: string): string => lab.roster.find((one) => one.key === key)?.person ?? "a device";
|
|
92
|
+
const partName = (checksum: string | undefined): string => lab.parts.find((one) => one.checksum === checksum)?.name ?? "a part";
|
|
93
|
+
const tubeName = (item: string | undefined): string => {
|
|
94
|
+
const held = lab.items.find((one) => one.item === item);
|
|
95
|
+
if (held === undefined) return "a tube";
|
|
96
|
+
return held.part === null ? lab.strains.find((one) => one.strain === held.strain)?.name ?? "a culture" : partName(held.part);
|
|
97
|
+
};
|
|
98
|
+
const stepName = (plan: Step["plan"]): string => CALLED[plan.kind] ?? plan.kind;
|
|
99
|
+
/**
|
|
100
|
+
* Where a step sits in its own piece of work.
|
|
101
|
+
*
|
|
102
|
+
* Counted inside the chain and not across the whole lot, which is safe because a chain is every
|
|
103
|
+
* step joined to every other by what they make and need: a step can only ever wait on one in the
|
|
104
|
+
* same chain. Numbering across all of them would make the numbers in one card jump wherever
|
|
105
|
+
* another chain's steps fell between, for no gain.
|
|
106
|
+
*/
|
|
107
|
+
const at = (id: string): number => {
|
|
108
|
+
const thread = work.threads.find((one) => one.steps.some((step) => step.plan.plan === id));
|
|
109
|
+
return (thread?.steps.findIndex((step) => step.plan.plan === id) ?? 0) + 1;
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
const why = (step: Step): ReactNode => {
|
|
113
|
+
if (step.held === null) return <span className="good">could be done now</span>;
|
|
114
|
+
if (step.held.why === "a step before it") {
|
|
115
|
+
return <>waiting on {step.held.steps.map((one) => `step ${at(one)}`).join(" and ")}</>;
|
|
116
|
+
}
|
|
117
|
+
if (step.held.why === "something nobody is making") {
|
|
118
|
+
return <span className="attention">{step.held.parts.map((one) => partName(one)).join(" and ")} has to be ordered or made first</span>;
|
|
119
|
+
}
|
|
120
|
+
return <span className="attention">{step.held.tubes.map(tubeName).join(" and ")} has been retired or run short</span>;
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Giving the work to somebody else, and taking somebody's.
|
|
125
|
+
*
|
|
126
|
+
* Shown whether or not this lab has any work of its own, because a lab taking a method for the
|
|
127
|
+
* first time has none — which is exactly the lab that needs this, and the one that would have
|
|
128
|
+
* found nothing here if it were only drawn beside work that already existed.
|
|
129
|
+
*/
|
|
130
|
+
const crossing = (
|
|
131
|
+
<section className="card">
|
|
132
|
+
<h2>Giving it to somebody else</h2>
|
|
133
|
+
<p className="small"><Glossed text="A method is this plan written so another lab can carry it out: every tube replaced by the checksum of what is in it, which is the one name two labs that have never spoken already agree on." /></p>
|
|
134
|
+
<p className="dim small">
|
|
135
|
+
Two things cannot be sent, and it says so rather than pretending. Anything alive: a strain is this lab’s own, so whoever follows it makes their own.
|
|
136
|
+
And a starting molecule’s sequence, if a keeper chose not to publish it — then it says which molecules are needed and not what they are.
|
|
137
|
+
</p>
|
|
138
|
+
{work.order.length > 0 && (
|
|
139
|
+
<div className="row tight">
|
|
140
|
+
<button type="button" onClick={() => void writeOut()}>Write {only === null ? "it all" : only} out</button>
|
|
141
|
+
{method !== null && <button type="button" className="quiet" onClick={() => setMethod(null)}>Hide it</button>}
|
|
142
|
+
</div>
|
|
143
|
+
)}
|
|
144
|
+
{method !== null && <textarea className="method" value={method} readOnly rows={12} aria-label="The method, to give to somebody" onFocus={(event) => event.currentTarget.select()} />}
|
|
145
|
+
<p className="voice">Taking one</p>
|
|
146
|
+
<form className="stack" onSubmit={(event) => { event.preventDefault(); void take(); }}>
|
|
147
|
+
<label>A method somebody published
|
|
148
|
+
<textarea value={taking} onChange={(event) => setTaking(event.target.value)} rows={4} spellCheck={false}
|
|
149
|
+
placeholder="Paste it here" aria-label="A method to take" />
|
|
150
|
+
</label>
|
|
151
|
+
<div className="row"><button type="submit" disabled={taking.trim() === ""}>Propose its steps here</button></div>
|
|
152
|
+
</form>
|
|
153
|
+
<p className="dim small">Nothing is used and nothing is recorded as done: what lands is proposals, as if somebody here had made them. A molecule it needs that this lab has never heard of is said rather than guessed at.</p>
|
|
154
|
+
{told !== null && <p className="small" role="status">{told}</p>}
|
|
155
|
+
</section>
|
|
156
|
+
);
|
|
157
|
+
|
|
158
|
+
if (work.order.length === 0 && work.tangled.length === 0) {
|
|
159
|
+
return (
|
|
160
|
+
<div className="bionet work">
|
|
161
|
+
<section className="card">
|
|
162
|
+
<h2>The work</h2>
|
|
163
|
+
<p className="empty">Nothing is proposed here. A proposal is a run somebody could carry out, and a lab member or its adviser makes one at the tool that would do it. Several together are read as one piece of work.</p>
|
|
164
|
+
</section>
|
|
165
|
+
{crossing}
|
|
166
|
+
</div>
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
return (
|
|
171
|
+
<div className="bionet work">
|
|
172
|
+
<section className="card">
|
|
173
|
+
<h2>The work</h2>
|
|
174
|
+
<p className="small"><Glossed text="Each step is a proposed run: nothing has been used and nothing is recorded as done until somebody carries it out and says so." /></p>
|
|
175
|
+
{said.map((one) => <p key={one} className="small">{one}</p>)}
|
|
176
|
+
{projects.length > 1 && (
|
|
177
|
+
<div className="row tight pick" role="tablist" aria-label="Projects">
|
|
178
|
+
<button type="button" role="tab" aria-selected={only === null} className={only === null ? "" : "quiet"} onClick={() => setOnly(null)}>Everything</button>
|
|
179
|
+
{projects.map((one) => (
|
|
180
|
+
<button key={one.name} type="button" role="tab" aria-selected={only === one.name} className={only === one.name ? "" : "quiet"} onClick={() => setOnly(one.name)}>
|
|
181
|
+
{one.name}{one.ready.length > 0 ? ` · ${one.ready.length} ready` : ""}
|
|
182
|
+
</button>
|
|
183
|
+
))}
|
|
184
|
+
</div>
|
|
185
|
+
)}
|
|
186
|
+
<p className="dim small">
|
|
187
|
+
Nothing here was declared. A proposal says what it expects to make and what it needs, and where one expects what another needs, the first has to happen first.
|
|
188
|
+
The chain stops at a transformation: what that makes is alive and has no checksum to point at, so what follows is proposed afresh once there is something growing.
|
|
189
|
+
</p>
|
|
190
|
+
</section>
|
|
191
|
+
|
|
192
|
+
{crossing}
|
|
193
|
+
|
|
194
|
+
{work.toGet.length > 0 && (
|
|
195
|
+
<section className="card">
|
|
196
|
+
<h2>To get first</h2>
|
|
197
|
+
<p className="small">Nothing proposed makes {work.toGet.length === 1 ? "this" : "these"}, and the lab has no tube of {work.toGet.length === 1 ? "it" : "them"}. Until {work.toGet.length === 1 ? "it arrives" : "they arrive"} the steps that need {work.toGet.length === 1 ? "it" : "them"} cannot start.</p>
|
|
198
|
+
<table>
|
|
199
|
+
<thead><tr><th>What</th><th>For</th></tr></thead>
|
|
200
|
+
<tbody>
|
|
201
|
+
{work.toGet.map((one) => (
|
|
202
|
+
<tr key={one.checksum}>
|
|
203
|
+
<td>{partName(one.checksum) === "a part" ? one.name : partName(one.checksum)} <code>{one.checksum.slice(0, 12)}</code></td>
|
|
204
|
+
<td className="dim">{[...new Set(one.forSteps.map((each) => {
|
|
205
|
+
const thread = work.threads.find((who) => who.steps.some((step) => step.plan.plan === each));
|
|
206
|
+
return `step ${at(each)} of ${thread?.name ?? "the work"}`;
|
|
207
|
+
}))].join(", ")}</td>
|
|
208
|
+
</tr>
|
|
209
|
+
))}
|
|
210
|
+
</tbody>
|
|
211
|
+
</table>
|
|
212
|
+
</section>
|
|
213
|
+
)}
|
|
214
|
+
|
|
215
|
+
{work.threads.map((thread) => (
|
|
216
|
+
<section className="card" key={thread.name + thread.steps[0]!.plan.plan}>
|
|
217
|
+
<div className="toolhead">
|
|
218
|
+
<h2>{thread.name}</h2>
|
|
219
|
+
<span className="dim small">
|
|
220
|
+
{[...new Set(thread.steps.map((one) => filedAs(one.plan)))].join(", ")} · {thread.steps.length} {thread.steps.length === 1 ? "step" : "steps"}
|
|
221
|
+
</span>
|
|
222
|
+
</div>
|
|
223
|
+
{!thread.clear && <p className="small attention">Something in this one has to be dealt with before it can be finished.</p>}
|
|
224
|
+
<ol className="steps">
|
|
225
|
+
{thread.steps.map((step) => (
|
|
226
|
+
<li key={step.plan.plan} className={step.held === null ? "ready" : "held"}>
|
|
227
|
+
<p className="small">
|
|
228
|
+
<strong>{at(step.plan.plan)}. {stepName(step.plan)}</strong>
|
|
229
|
+
<span className="dim"> · {step.plan.kind}</span>
|
|
230
|
+
{" — "}{why(step)}
|
|
231
|
+
</p>
|
|
232
|
+
<p className="dim small">
|
|
233
|
+
Uses {step.plan.inputs.map((one) => `${one.item === undefined ? partName(one.part) : tubeName(one.item)} as ${one.role}`).join(", ") || "nothing the lab holds"}
|
|
234
|
+
{step.plan.expects.length > 0 && <>, making {step.plan.expects.map((one) => `${one.name} (${one.length.toLocaleString("en-US")} bp${one.circular ? ", circular" : ""})`).join(" and ")}</>}
|
|
235
|
+
{step.plan.expects.length === 0 && <>, making nothing the lab can name: what comes of it is alive</>}
|
|
236
|
+
. Proposed by {person(step.plan.by)}.
|
|
237
|
+
</p>
|
|
238
|
+
{step.plan.note !== null && <p className="small why">{step.plan.note}</p>}
|
|
239
|
+
<div className="row tight">
|
|
240
|
+
{onOpen !== undefined && step.held === null && <button type="button" onClick={() => onOpen(step.plan)}>Set it up</button>}
|
|
241
|
+
<button type="button" className="quiet" onClick={() => { setFiling(filing === step.plan.plan ? null : step.plan.plan); setInto(filedAs(step.plan) === UNFILED ? "" : filedAs(step.plan)); }}>
|
|
242
|
+
{filedAs(step.plan) === UNFILED ? "File it under…" : "Move it…"}
|
|
243
|
+
</button>
|
|
244
|
+
<button type="button" className="quiet" onClick={() => void act("settlePlan", { plan: step.plan.plan })}>Set it aside</button>
|
|
245
|
+
</div>
|
|
246
|
+
{filing === step.plan.plan && (
|
|
247
|
+
<form className="row tight" onSubmit={(event) => { event.preventDefault(); void file(step.plan.plan, into); }}>
|
|
248
|
+
<input value={into} onChange={(event) => setInto(event.target.value)} maxLength={200} list="bionet-projects"
|
|
249
|
+
placeholder="Which project" aria-label="Which project to file it under" />
|
|
250
|
+
<datalist id="bionet-projects">{projects.filter((one) => one.filed).map((one) => <option key={one.name} value={one.name} />)}</datalist>
|
|
251
|
+
<button type="submit">{into.trim() === "" ? "Take it out" : "File it"}</button>
|
|
252
|
+
</form>
|
|
253
|
+
)}
|
|
254
|
+
</li>
|
|
255
|
+
))}
|
|
256
|
+
</ol>
|
|
257
|
+
{thread.ends.length > 0 && (
|
|
258
|
+
<p className="dim small">It ends with {thread.ends.map((one) => partName(one.checksum) === "a part" ? one.name : partName(one.checksum)).join(" and ")}.</p>
|
|
259
|
+
)}
|
|
260
|
+
</section>
|
|
261
|
+
))}
|
|
262
|
+
|
|
263
|
+
{work.tangled.length > 0 && (
|
|
264
|
+
<section className="card">
|
|
265
|
+
<h2>Cannot be ordered</h2>
|
|
266
|
+
<p className="small trouble">{work.tangled.length} {work.tangled.length === 1 ? "proposal depends" : "proposals depend"} on each other in a circle, so there is no order to carry them out in. Set one aside and propose it again.</p>
|
|
267
|
+
<ul className="checks">
|
|
268
|
+
{work.tangled.map((one) => {
|
|
269
|
+
const plan = lab.plans.find((each) => each.plan === one)!;
|
|
270
|
+
return <li key={one} className="stop">{stepName(plan)} · {plan.kind} · proposed by {person(plan.by)}</li>;
|
|
271
|
+
})}
|
|
272
|
+
</ul>
|
|
273
|
+
</section>
|
|
274
|
+
)}
|
|
275
|
+
</div>
|
|
276
|
+
);
|
|
277
|
+
}
|
package/tools.css
CHANGED
|
@@ -167,3 +167,14 @@
|
|
|
167
167
|
color: var(--bionet-ink); padding: .4rem .5rem; border: 1px solid var(--bionet-rule); border-radius: 6px; background: var(--bionet-field, var(--bionet-ground)) }
|
|
168
168
|
.bionet .verify .attention { color: var(--bionet-attention) }
|
|
169
169
|
.bionet .verify .checks .stop { color: var(--bionet-attention) }
|
|
170
|
+
|
|
171
|
+
/* The whole of a lab's open work, in chains and in order. A step that could be done now is marked
|
|
172
|
+
by its rule, not only by its words, so the shape of what is ready can be seen at a glance. */
|
|
173
|
+
.bionet .work ol.steps { margin: .4rem 0 0; padding: 0; list-style: none; display: grid; gap: .5rem }
|
|
174
|
+
.bionet .work ol.steps > li { border-left: 3px solid var(--bionet-rule); padding: .2rem 0 .2rem .7rem }
|
|
175
|
+
.bionet .work ol.steps > li.ready { border-left-color: var(--bionet-good) }
|
|
176
|
+
.bionet .work ol.steps > li.held { border-left-color: var(--bionet-dim) }
|
|
177
|
+
.bionet .work ol.steps > li p { margin: .15rem 0 }
|
|
178
|
+
.bionet .work ol.steps > li .row { margin-top: .35rem }
|
|
179
|
+
.bionet .work .why { color: var(--bionet-dim); font-style: italic }
|
|
180
|
+
.bionet .work textarea.method { width: 100%; font-family: ui-monospace, monospace; font-size: .7rem; margin-top: .5rem }
|