@biolibs/bionet-panels 0.3.9 → 0.3.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/dist/index.d.ts CHANGED
@@ -17,6 +17,7 @@
17
17
  * - `sharing.tsx` — what other labs are shown, and the lab's web peer
18
18
  * - `adviser.tsx` — the adviser a device hosts: letting it in, and the door an agent reaches it by
19
19
  * - `strains.tsx` — what the lab keeps alive: every strain, its cultures, and what is proposed for one
20
+ * - `specimens.tsx` — the tubes nobody has read yet, and saying what one turned out to be
20
21
  * - `parts.tsx` — the small pieces they are made of
21
22
  * - `public.tsx` — a lab's public page: what it holds, and what it can see of another lab
22
23
  *
@@ -29,6 +30,7 @@ export * from "./places.js";
29
30
  export * from "./backup.js";
30
31
  export * from "./people.js";
31
32
  export * from "./strains.js";
33
+ export * from "./specimens.js";
32
34
  export * from "./adviser.js";
33
35
  export * from "./history.js";
34
36
  export * from "./sharing.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC"}
package/dist/index.js CHANGED
@@ -17,6 +17,7 @@
17
17
  * - `sharing.tsx` — what other labs are shown, and the lab's web peer
18
18
  * - `adviser.tsx` — the adviser a device hosts: letting it in, and the door an agent reaches it by
19
19
  * - `strains.tsx` — what the lab keeps alive: every strain, its cultures, and what is proposed for one
20
+ * - `specimens.tsx` — the tubes nobody has read yet, and saying what one turned out to be
20
21
  * - `parts.tsx` — the small pieces they are made of
21
22
  * - `public.tsx` — a lab's public page: what it holds, and what it can see of another lab
22
23
  *
@@ -29,6 +30,7 @@ export * from "./places.js";
29
30
  export * from "./backup.js";
30
31
  export * from "./people.js";
31
32
  export * from "./strains.js";
33
+ export * from "./specimens.js";
32
34
  export * from "./adviser.js";
33
35
  export * from "./history.js";
34
36
  export * from "./sharing.js";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Every specimen, the tubes of each, and the way to say what one turned out to be. Draws nothing
3
+ * until the lab has arrived.
4
+ */
5
+ export declare function Specimens(): import("react").JSX.Element | null;
6
+ //# sourceMappingURL=specimens.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"specimens.d.ts","sourceRoot":"","sources":["../src/specimens.tsx"],"names":[],"mappings":"AAqBA;;;GAGG;AACH,wBAAgB,SAAS,uCA8FxB"}
@@ -0,0 +1,43 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ /**
4
+ * The tubes nobody has read yet.
5
+ *
6
+ * A part is known by the checksum of its sequence, so a tube of something nobody has sequenced
7
+ * cannot be a tube of a part. Until there was a specimen it could not be anything, which left a
8
+ * real freezer — full of plasmids somebody was given years ago, labels worn off — with no way into
9
+ * the lab at all.
10
+ *
11
+ * So this panel is deliberately not a place to guess. What goes on the tube is what somebody would
12
+ * write on it, never a claim about what is inside; nothing here matches a specimen to a part by
13
+ * name or by size; and the only thing that resolves one is somebody saying what a read came back
14
+ * as. Once they do, the same tube keeps its place and how much is left, because the tube never
15
+ * changed — only what is known about it did.
16
+ */
17
+ import { useAct, useLab } from "@biolibs/bionet-react";
18
+ import { amountOf } from "./freezer.js";
19
+ import { Ask } from "./parts.js";
20
+ import { PutItem } from "./places.js";
21
+ /**
22
+ * Every specimen, the tubes of each, and the way to say what one turned out to be. Draws nothing
23
+ * until the lab has arrived.
24
+ */
25
+ export function Specimens() {
26
+ const state = useLab();
27
+ const act = useAct();
28
+ const lab = state?.lab;
29
+ if (state === null || lab === null || lab === undefined)
30
+ return null;
31
+ const partName = (checksum) => lab.parts.find((one) => one.checksum === checksum)?.name ?? "a part the lab no longer lists";
32
+ const unknown = lab.specimens.filter((one) => one.is === null);
33
+ return (_jsxs(_Fragment, { children: [lab.specimens.length === 0 ? (_jsx("p", { className: "empty", children: "No unidentified tubes. A specimen is something the lab physically has and cannot yet name: the plasmid from the back of the freezer, the gift with the label worn off. Hold it here and it can be counted, put somewhere and used, and it stays unnamed until a read says what it is." })) : lab.specimens.map((specimen) => {
34
+ const tubes = lab.items.filter((one) => one.specimen === specimen.specimen && !one.retired);
35
+ return (_jsxs("section", { className: "card", children: [_jsxs("div", { className: "toolhead", children: [_jsx("h2", { children: specimen.name }), _jsx("span", { className: "dim small", children: specimen.is === null ? "not identified" : "identified" })] }), specimen.note !== null && _jsx("p", { className: "small why", children: specimen.note }), specimen.is === null
36
+ ? _jsx("p", { className: "small", children: "Nobody has said what this is. It can be held, counted and used; it cannot stand in for a molecule a plan asks for, and it will not travel in a method." })
37
+ : _jsxs("p", { className: "small", children: ["A read said this is ", _jsx("strong", { children: partName(specimen.is) }), ". The tubes below are the same tubes, in the same places, with the same amounts left \u2014 what changed is what is known about them."] }), tubes.length === 0 ? _jsx("p", { className: "dim small", children: "No tubes of it. Add one below." }) : (_jsxs("table", { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "Tube" }), _jsx("th", { children: "How much" }), _jsx("th", { children: "Where" }), _jsx("th", {})] }) }), _jsx("tbody", { children: tubes.map((one) => (_jsxs("tr", { children: [_jsxs("td", { children: [_jsx("code", { children: one.item.slice(0, 8) }), one.needsRecount && _jsx("span", { className: "badge", children: "needs counting" })] }), _jsx("td", { children: amountOf(one) }), _jsx("td", { children: _jsx(PutItem, { item: one }) }), _jsx("td", { children: _jsx("button", { type: "button", className: "plain", onClick: () => void act("retire", { item: one.item }), children: "retire" }) })] }, one.item))) })] })), _jsxs(Ask, { onAsk: (data) => act("addItem", { specimen: specimen.specimen, amount: Number(String(data.get("amount") ?? "")), unit: String(data.get("unit") ?? "") }), className: "row", children: [_jsxs("label", { children: ["Add a tube", _jsx("input", { name: "amount", type: "number", min: 0, step: 1, defaultValue: 30, required: true, "aria-label": "How much" })] }), _jsxs("label", { children: ["of", _jsx("input", { name: "unit", defaultValue: "\u00B5L", maxLength: 20, "aria-label": "Unit" })] }), _jsx("button", { type: "submit", children: "Add" })] }), specimen.is === null && lab.parts.length > 0 && (_jsxs(Ask, { onAsk: (data) => act("identifySpecimen", { specimen: specimen.specimen, part: String(data.get("part") ?? "") }), className: "row", children: [_jsxs("label", { children: ["A read says it is", _jsxs("select", { name: "part", required: true, "aria-label": "What it turned out to be", children: [_jsx("option", { value: "", children: "choose what came back\u2026" }), lab.parts.map((one) => _jsx("option", { value: one.checksum, children: one.name }, one.checksum))] })] }), _jsx("button", { type: "submit", children: "That is what it is" })] })), specimen.is === null && lab.parts.length === 0 && (_jsx("p", { className: "dim small", children: "Once the read is in as a part, it can be named here." }))] }, specimen.specimen));
38
+ }), _jsxs("section", { className: "card", children: [_jsx("h2", { children: "Hold a tube you cannot name" }), _jsx("p", { className: "dim small", children: "What to write is what you would write on the tube, not what you think is in it. A guess recorded here would be read later as a fact, and the whole point of a specimen is that nothing claims to know." }), _jsxs(Ask, { onAsk: (data) => act("addSpecimen", {
39
+ name: String(data.get("name") ?? ""),
40
+ note: String(data.get("note") ?? "") === "" ? null : String(data.get("note")),
41
+ }), className: "stack", children: [_jsxs("label", { children: ["On the tube", _jsx("input", { name: "name", required: true, maxLength: 200, placeholder: "pET, back of the \u221280, no date" })] }), _jsxs("label", { children: ["Where it came from", _jsx("input", { name: "note", maxLength: 2000, placeholder: "in the box Ed handed over" })] }), _jsx("button", { type: "submit", children: "Hold it" })] })] }), unknown.length > 0 && (_jsxs("p", { className: "dim small", children: [unknown.length === 1 ? "One tube is" : `${unknown.length} tubes are`, " being held without a name. Sequencing ", unknown.length === 1 ? "it" : "them", " is what turns ", unknown.length === 1 ? "it" : "them", " into something a plan can use."] }))] }));
42
+ }
43
+ //# sourceMappingURL=specimens.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"specimens.js","sourceRoot":"","sources":["../src/specimens.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC;;;GAGG;AACH,MAAM,UAAU,SAAS;IACvB,MAAM,KAAK,GAAG,MAAM,EAAE,CAAC;IACvB,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC;IACrB,MAAM,GAAG,GAAG,KAAK,EAAE,GAAG,CAAC;IACvB,IAAI,KAAK,KAAK,IAAI,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IACrE,MAAM,QAAQ,GAAG,CAAC,QAAgB,EAAU,EAAE,CAC5C,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,KAAK,QAAQ,CAAC,EAAE,IAAI,IAAI,gCAAgC,CAAC;IAC/F,MAAM,OAAO,GAAG,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE,KAAK,IAAI,CAAC,CAAC;IAE/D,OAAO,CACL,8BACG,GAAG,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CAC5B,YAAG,SAAS,EAAC,OAAO,sSAKhB,CACL,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,E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B,GAAG,IAAQ,EACpH,kDAAyB,gBAAO,IAAI,EAAC,MAAM,EAAC,SAAS,EAAE,IAAI,EAAE,WAAW,EAAC,2BAA2B,GAAG,IAAQ,EAC/G,iBAAQ,IAAI,EAAC,QAAQ,wBAAiB,IAClC,IACE,EAET,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,CACrB,aAAG,SAAS,EAAC,WAAW,aACrB,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,YAAY,6CACnD,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,qBAAiB,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,uCAEzG,CACL,IACA,CACJ,CAAC;AACJ,CAAC"}
package/dist/window.d.ts CHANGED
@@ -29,8 +29,16 @@ export interface ExtraTab {
29
29
  * over a file, for a host that cannot use the browser's own way; `extra` are views the host adds,
30
30
  * shown after the window's own.
31
31
  */
32
- export declare function LabWindow({ tab: first, copy, save, extra }: {
32
+ export declare function LabWindow({ tab: first, at, copy, save, extra }: {
33
33
  tab?: Tab | string;
34
+ /**
35
+ * A tab to move to, followed whenever it changes.
36
+ *
37
+ * `tab` says where to open; this says where to go. Without it nothing in the window can send
38
+ * anybody anywhere — a list of work could show that a step is ready and had no way to take
39
+ * somebody to the machine that would do it.
40
+ */
41
+ at?: string;
34
42
  copy?: (words: string) => Promise<void>;
35
43
  save?: (name: string, text: string) => Promise<boolean | void>;
36
44
  extra?: readonly ExtraTab[];
@@ -1 +1 @@
1
- {"version":3,"file":"window.d.ts","sourceRoot":"","sources":["../src/window.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAUjD,oCAAoC;AACpC,eAAO,MAAM,IAAI,gE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yBAAyB;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,+EAA+E;IAC/E,IAAI,EAAE,SAAS,CAAC;CACjB;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,EAAE,GAAG,EAAE,KAAiB,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,KAAU,EAAE,EAAE;IAChF,GAAG,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC;IACnB;;;;;;OAMG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAAC,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC;IAAC,KAAK,CAAC,EAAE,SAAS,QAAQ,EAAE,CAAC;CACtI,+BAKA;AAiDD,0DAA0D;AAC1D,wBAAgB,GAAG,gCAYlB;AAED,sCAAsC;AACtC,wBAAgB,KAAK,uCA4BpB;AAED,+CAA+C;AAC/C,wBAAgB,OAAO,uCAYtB"}
package/dist/window.js CHANGED
@@ -10,7 +10,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
10
10
  * It walks a person through the three places they can be: nobody has said who is at this device,
11
11
  * the device is in no lab, the device is waiting to be let into one — and then the lab itself.
12
12
  */
13
- import { useState } from "react";
13
+ import { useEffect, useState } from "react";
14
14
  import { Logo, Mark, useAct, useLab } from "@biolibs/bionet-react";
15
15
  import { Freezer } from "./freezer.js";
16
16
  import { History } from "./history.js";
@@ -28,17 +28,20 @@ export const TABS = ["freezer", "places", "people", "history", "sharing"];
28
28
  * over a file, for a host that cannot use the browser's own way; `extra` are views the host adds,
29
29
  * shown after the window's own.
30
30
  */
31
- export function LabWindow({ tab: first = "freezer", copy, save, extra = [] }) {
32
- let window = _jsx(Body, { first: first, extra: extra });
31
+ export function LabWindow({ tab: first = "freezer", at, copy, save, extra = [] }) {
32
+ let window = _jsx(Body, { first: first, extra: extra, ...(at === undefined ? {} : { at }) });
33
33
  if (save !== undefined)
34
34
  window = _jsx(SaveContext.Provider, { value: save, children: window });
35
35
  if (copy !== undefined)
36
36
  window = _jsx(CopyContext.Provider, { value: copy, children: window });
37
37
  return _jsx("div", { className: "bionet", children: window });
38
38
  }
39
- function Body({ first, extra }) {
39
+ function Body({ first, at, extra }) {
40
40
  const state = useLab();
41
41
  const [tab, setTab] = useState(first);
42
+ // Followed rather than read once, so that a host asking for the same tab twice still moves there.
43
+ useEffect(() => { if (at !== undefined && at !== "")
44
+ setTab(at); }, [at]);
42
45
  if (state === null)
43
46
  return _jsx("main", { className: "centre", children: _jsx("p", { className: "dim", children: "Opening the lab\u2026" }) });
44
47
  if (state.device.person === null)
@@ -1 +1 @@
1
- {"version":3,"file":"window.js","sourceRoot":"","sources":["../src/window.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb;;;;;;;;;GASG;AACH,OAAO,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,oCAAoC;AACpC,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC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AI,EAAE,CAAC,CAAC,EAAE,SAAS,EAAC,OAAO,aACpF,0CAAiB,gBAAO,IAAI,EAAC,QAAQ,EAAC,WAAW,EAAC,oCAA+B,EAAC,QAAQ,SAAG,IAAQ,EACrG,iBAAQ,IAAI,EAAC,QAAQ,qBAAc,IAC/B,EACN,KAAC,UAAU,KAAG,EACd,KAAC,UAAU,KAAG,IACN,IACN,CACP,CAAC;AACJ,CAAC;AAED,+CAA+C;AAC/C,MAAM,UAAU,OAAO;IACrB,MAAM,KAAK,GAAG,MAAM,EAAE,CAAC;IACvB,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAChC,OAAO,CACL,mBAAS,SAAS,EAAC,aAAa,aAC9B,gDAA6B,EAC7B,mLAA+J,EAC/J,KAAC,SAAS,IAAC,MAAM,EAAE,KAAK,CAAC,MAAM,GAAI,EACnC,KAAC,UAAU,IAAC,IAAI,EAAE,KAAK,CAAC,IAAI,GAAI,EAC/B,KAAK,CAAC,IAAI,CAAC,OAAO,KAAK,IAAI,IAAI,YAAG,SAAS,EAAC,WAAW,YAAE,KAAK,CAAC,IAAI,CAAC,OAAO,GAAK,IACzE,CACX,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  },
5
5
  "dependencies": {
6
6
  "@biolibs/bionet": "^1.5.0",
7
- "@biolibs/bionet-client": "^0.2.4",
7
+ "@biolibs/bionet-client": "^0.2.10",
8
8
  "@biolibs/bionet-react": "^0.2.0",
9
9
  "@biolibs/bionet-space": "^0.3.0",
10
10
  "@biolibs/opencloning": "^2.0.0"
@@ -54,5 +54,5 @@
54
54
  ],
55
55
  "type": "module",
56
56
  "types": "dist/index.d.ts",
57
- "version": "0.3.9"
57
+ "version": "0.3.11"
58
58
  }
package/src/index.ts CHANGED
@@ -17,6 +17,7 @@
17
17
  * - `sharing.tsx` — what other labs are shown, and the lab's web peer
18
18
  * - `adviser.tsx` — the adviser a device hosts: letting it in, and the door an agent reaches it by
19
19
  * - `strains.tsx` — what the lab keeps alive: every strain, its cultures, and what is proposed for one
20
+ * - `specimens.tsx` — the tubes nobody has read yet, and saying what one turned out to be
20
21
  * - `parts.tsx` — the small pieces they are made of
21
22
  * - `public.tsx` — a lab's public page: what it holds, and what it can see of another lab
22
23
  *
@@ -29,6 +30,7 @@ export * from "./places.js";
29
30
  export * from "./backup.js";
30
31
  export * from "./people.js";
31
32
  export * from "./strains.js";
33
+ export * from "./specimens.js";
32
34
  export * from "./adviser.js";
33
35
  export * from "./history.js";
34
36
  export * from "./sharing.js";
@@ -0,0 +1,120 @@
1
+ "use client";
2
+
3
+ /**
4
+ * The tubes nobody has read yet.
5
+ *
6
+ * A part is known by the checksum of its sequence, so a tube of something nobody has sequenced
7
+ * cannot be a tube of a part. Until there was a specimen it could not be anything, which left a
8
+ * real freezer — full of plasmids somebody was given years ago, labels worn off — with no way into
9
+ * the lab at all.
10
+ *
11
+ * So this panel is deliberately not a place to guess. What goes on the tube is what somebody would
12
+ * write on it, never a claim about what is inside; nothing here matches a specimen to a part by
13
+ * name or by size; and the only thing that resolves one is somebody saying what a read came back
14
+ * as. Once they do, the same tube keeps its place and how much is left, because the tube never
15
+ * changed — only what is known about it did.
16
+ */
17
+ import { useAct, useLab } from "@biolibs/bionet-react";
18
+ import { amountOf } from "./freezer.js";
19
+ import { Ask } from "./parts.js";
20
+ import { PutItem } from "./places.js";
21
+
22
+ /**
23
+ * Every specimen, the tubes of each, and the way to say what one turned out to be. Draws nothing
24
+ * until the lab has arrived.
25
+ */
26
+ export function Specimens() {
27
+ const state = useLab();
28
+ const act = useAct();
29
+ const lab = state?.lab;
30
+ if (state === null || lab === null || lab === undefined) return null;
31
+ const partName = (checksum: string): string =>
32
+ lab.parts.find((one) => one.checksum === checksum)?.name ?? "a part the lab no longer lists";
33
+ const unknown = lab.specimens.filter((one) => one.is === null);
34
+
35
+ return (
36
+ <>
37
+ {lab.specimens.length === 0 ? (
38
+ <p className="empty">
39
+ No unidentified tubes. A specimen is something the lab physically has and cannot yet name:
40
+ the plasmid from the back of the freezer, the gift with the label worn off. Hold it here
41
+ and it can be counted, put somewhere and used, and it stays unnamed until a read says what
42
+ it is.
43
+ </p>
44
+ ) : lab.specimens.map((specimen) => {
45
+ const tubes = lab.items.filter((one) => one.specimen === specimen.specimen && !one.retired);
46
+ return (
47
+ <section className="card" key={specimen.specimen}>
48
+ <div className="toolhead">
49
+ <h2>{specimen.name}</h2>
50
+ <span className="dim small">{specimen.is === null ? "not identified" : "identified"}</span>
51
+ </div>
52
+ {specimen.note !== null && <p className="small why">{specimen.note}</p>}
53
+ {specimen.is === null
54
+ ? <p className="small">Nobody has said what this is. It can be held, counted and used; it cannot stand in for a molecule a plan asks for, and it will not travel in a method.</p>
55
+ : <p className="small">A read said this is <strong>{partName(specimen.is)}</strong>. The tubes below are the same tubes, in the same places, with the same amounts left &#8212; what changed is what is known about them.</p>}
56
+ {tubes.length === 0 ? <p className="dim small">No tubes of it. Add one below.</p> : (
57
+ <table>
58
+ <thead><tr><th>Tube</th><th>How much</th><th>Where</th><th /></tr></thead>
59
+ <tbody>
60
+ {tubes.map((one) => (
61
+ <tr key={one.item}>
62
+ <td><code>{one.item.slice(0, 8)}</code>{one.needsRecount && <span className="badge">needs counting</span>}</td>
63
+ <td>{amountOf(one)}</td>
64
+ <td><PutItem item={one} /></td>
65
+ <td><button type="button" className="plain" onClick={() => void act("retire", { item: one.item })}>retire</button></td>
66
+ </tr>
67
+ ))}
68
+ </tbody>
69
+ </table>
70
+ )}
71
+ <Ask onAsk={(data) => act("addItem", { specimen: specimen.specimen, amount: Number(String(data.get("amount") ?? "")), unit: String(data.get("unit") ?? "") })} className="row">
72
+ <label>Add a tube<input name="amount" type="number" min={0} step={1} defaultValue={30} required aria-label="How much" /></label>
73
+ <label>of<input name="unit" defaultValue="µL" maxLength={20} aria-label="Unit" /></label>
74
+ <button type="submit">Add</button>
75
+ </Ask>
76
+ {specimen.is === null && lab.parts.length > 0 && (
77
+ <Ask onAsk={(data) => act("identifySpecimen", { specimen: specimen.specimen, part: String(data.get("part") ?? "") })} className="row">
78
+ <label>A read says it is
79
+ <select name="part" required aria-label="What it turned out to be">
80
+ <option value="">choose what came back…</option>
81
+ {lab.parts.map((one) => <option key={one.checksum} value={one.checksum}>{one.name}</option>)}
82
+ </select>
83
+ </label>
84
+ <button type="submit">That is what it is</button>
85
+ </Ask>
86
+ )}
87
+ {specimen.is === null && lab.parts.length === 0 && (
88
+ <p className="dim small">Once the read is in as a part, it can be named here.</p>
89
+ )}
90
+ </section>
91
+ );
92
+ })}
93
+
94
+ <section className="card">
95
+ <h2>Hold a tube you cannot name</h2>
96
+ <p className="dim small">
97
+ What to write is what you would write on the tube, not what you think is in it. A guess
98
+ recorded here would be read later as a fact, and the whole point of a specimen is that
99
+ nothing claims to know.
100
+ </p>
101
+ <Ask onAsk={(data) => act("addSpecimen", {
102
+ name: String(data.get("name") ?? ""),
103
+ note: String(data.get("note") ?? "") === "" ? null : String(data.get("note")),
104
+ })} className="stack">
105
+ <label>On the tube<input name="name" required maxLength={200} placeholder="pET, back of the −80, no date" /></label>
106
+ <label>Where it came from<input name="note" maxLength={2000} placeholder="in the box Ed handed over" /></label>
107
+ <button type="submit">Hold it</button>
108
+ </Ask>
109
+ </section>
110
+
111
+ {unknown.length > 0 && (
112
+ <p className="dim small">
113
+ {unknown.length === 1 ? "One tube is" : `${unknown.length} tubes are`} being held without a
114
+ name. Sequencing {unknown.length === 1 ? "it" : "them"} is what turns {unknown.length === 1 ? "it" : "them"} into
115
+ something a plan can use.
116
+ </p>
117
+ )}
118
+ </>
119
+ );
120
+ }
package/src/window.tsx CHANGED
@@ -10,7 +10,7 @@
10
10
  * It walks a person through the three places they can be: nobody has said who is at this device,
11
11
  * the device is in no lab, the device is waiting to be let into one — and then the lab itself.
12
12
  */
13
- import { useState, type ReactNode } from "react";
13
+ import { useEffect, useState, type ReactNode } from "react";
14
14
  import { Logo, Mark, useAct, useLab } from "@biolibs/bionet-react";
15
15
  import { Freezer } from "./freezer.js";
16
16
  import { History } from "./history.js";
@@ -43,18 +43,29 @@ export interface ExtraTab {
43
43
  * over a file, for a host that cannot use the browser's own way; `extra` are views the host adds,
44
44
  * shown after the window's own.
45
45
  */
46
- export function LabWindow({ tab: first = "freezer", copy, save, extra = [] }: {
47
- tab?: Tab | string; copy?: (words: string) => Promise<void>; save?: (name: string, text: string) => Promise<boolean | void>; extra?: readonly ExtraTab[];
46
+ export function LabWindow({ tab: first = "freezer", at, copy, save, extra = [] }: {
47
+ tab?: Tab | string;
48
+ /**
49
+ * A tab to move to, followed whenever it changes.
50
+ *
51
+ * `tab` says where to open; this says where to go. Without it nothing in the window can send
52
+ * anybody anywhere — a list of work could show that a step is ready and had no way to take
53
+ * somebody to the machine that would do it.
54
+ */
55
+ at?: string;
56
+ copy?: (words: string) => Promise<void>; save?: (name: string, text: string) => Promise<boolean | void>; extra?: readonly ExtraTab[];
48
57
  }) {
49
- let window = <Body first={first} extra={extra} />;
58
+ let window = <Body first={first} extra={extra} {...(at === undefined ? {} : { at })} />;
50
59
  if (save !== undefined) window = <SaveContext.Provider value={save}>{window}</SaveContext.Provider>;
51
60
  if (copy !== undefined) window = <CopyContext.Provider value={copy}>{window}</CopyContext.Provider>;
52
61
  return <div className="bionet">{window}</div>;
53
62
  }
54
63
 
55
- function Body({ first, extra }: { first: string; extra: readonly ExtraTab[] }) {
64
+ function Body({ first, at, extra }: { first: string; at?: string; extra: readonly ExtraTab[] }) {
56
65
  const state = useLab();
57
66
  const [tab, setTab] = useState<string>(first);
67
+ // Followed rather than read once, so that a host asking for the same tab twice still moves there.
68
+ useEffect(() => { if (at !== undefined && at !== "") setTab(at); }, [at]);
58
69
  if (state === null) return <main className="centre"><p className="dim">Opening the lab…</p></main>;
59
70
  if (state.device.person === null) return <main className="centre"><Logo /><Trouble /><Who /></main>;
60
71
  if (state.lab === null) return <main className="centre"><Logo /><Trouble /><NoLab /></main>;