Skip to content

feat(TecanWorklist): GWL-Vorschau in die Library ziehen - #332

Merged
simbig merged 12 commits into
masterfrom
tecan-worklist-preview
Aug 24, 2026
Merged

feat(TecanWorklist): GWL-Vorschau in die Library ziehen#332
simbig merged 12 commits into
masterfrom
tecan-worklist-preview

Conversation

@simbig

@simbig simbig commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Zieht die GWL-Vorschau aus NeMo in die Library, ohne den dortigen Editor-Stack mitzunehmen. NeMo rendert Worklists über CodeMirror plus einen generierten lezer-Parser; für reines Anzeigen ist das deutlich mehr, als die Grammatik hergibt. parseGwl ist deshalb eine Feldtabelle, keine Grammatik, und die Feldindizes für Volumen und Positionen stammen aus MLL\Utils\Tecan. Keine neue Dependency.

Zwei Komponenten statt einer, weil es drei Use Cases gibt und nur einer davon eine Auswahl braucht:

  • TecanWorklist — reiner Renderer, nimmt nur den String. Deckt „bestehende GWL anzeigen" ab, und mit toolbar auch den Fall, dass das Gerät feststeht und der Consumer es benennen will.
  • TecanWorklistPreview — legt die Auswahl darüber, für den Fall, dass die GWL noch nicht existiert. Angeboten werden Tip-Counts, nicht Tecans, weil der Tip-Count die GWL formt. Welches Gerät einen Tip-Count bedient, ist das Mapping des Consumers und wird unverändert zurückgegeben.

Bewusste Entscheidungen, die im Diff nicht selbst erklärt sind:

  • Die Zeilennummern sind CSS-generated content statt Text. user-select: none allein landet in Chromium trotzdem im Clipboard, und eine kopierte Selektion muss wieder gültige GWL sein. Aus demselben Grund bleibt das C; vor Kommentaren sichtbar statt weggeschnitten.
  • Der Gutter zeigt die echten Quellzeilennummern. Klappt man die Befehle zu, bleiben die Nummern damit auf die Datei bezogen — NeMos CodeMirror nummeriert das gefilterte Dokument neu und zeigt dann etwas anderes als die Datei.
  • loading und der Leerzustand gehören zum Consumer, der die Query hält, nicht in die Komponente.
  • Hervorgehoben wird nur, was die Feldtabelle auch belegen kann: parseGwl prüft die Feldanzahl, die ein Befehlsbuchstabe laut MLL\Utils\Tecan serialisiert (A/D genau 10, R mindestens 16 wegen der optional angehängten ausgeschlossenen Zielpositionen). Passt sie nicht, fällt die Zeile auf ungefärbte Felder zurück, statt eine falsche Zahl als Volumen einzufärben. Ein Fallback und kein Throw, weil ein reiner Renderer den Subtree des Consumers nicht mitreißen soll — der Test highlights a volume in every pipetting command of a worklist schlägt an, falls die Serialisierung in php-utils wandert und der stumme Fallback sonst niemandem auffällt.
  • Ein Schritt ohne Kommentar zeigt seine Befehle immer. Sonst rendert eine GWL ohne ein einziges C; eine komplett leere Karte, und nichts deutet darauf hin, dass es etwas aufzuklappen gibt.

Die Beispiel-Worklist endet auf Q2, was erst mit dem MM-Rack aus #333 stimmt — das ist inzwischen gemergt und in 20.6.1 released.

Nicht-funktional mit drin: Storybook hat src/Provider direkt importiert und lief damit nie durch den antd.less-Import aus src/index.ts — alle Stories zeigten antd-Komponenten unstyled, was die visuelle Review irreführend machte. Der Import geht jetzt über den Barrel, wie von @spawnia vorgeschlagen.

Vorschau

Story TecanWorklist/Preview, Befehle aufgeklappt:

TecanWorklistPreview

Test Plan

Was CI nicht abdeckt: in der Story TecanWorklist/Preview die Befehle aufklappen, den Codeblock mit der Maus markieren und kopieren. Im Clipboard muss wortwörtlich die GWL stehen — ohne Zeilennummern und mit C; vor den Kommentaren.

simbig added 4 commits August 24, 2026 09:56
Storybook renders src/Provider directly, so it never ran the antd.less
import that src/index.ts gives consumers. Every story showed antd
components unstyled, which made visual review misleading.
TecanWorklist renders a Tecan Gemini worklist as a code view, grouped
into the steps its C; comments describe. The commands carrying out a
step stay collapsed behind "Befehle anzeigen", and the gutter keeps the
true source line numbers so the collapsed view still points at the file.

Highlights the command letter, the pipetted volume and the rack
positions. The field indexes come from MLL\Utils\Tecan, so no grammar
and no parser dependency is needed - parseGwl is a field map.

The line numbers render as CSS generated content: user-select: none
alone still lands in the clipboard, and a copied selection has to be
valid GWL again. For the same reason the C; prefix stays visible.

TecanWorklistPreview adds a selection on top, for the case where the
worklist does not exist yet. It offers tip counts rather than Tecans,
because the tip count is what shapes the worklist. Which device serves
a tip count is the consumer's mapping, passed in and handed back
unchanged. A worklist that already exists needs no selection and
renders through TecanWorklist directly.

Loading and empty states belong to the consumer, which holds the query -
the components take the finished worklist string.
MasterMixRack in php-utils uses CoordinateSystem2x16NoJ, and limes-api
derives MasterMixBlockItem coordinates from it, so everything from K down
sat one row too low and Q wells fell out of the lookup unnoticed.

Also hardens the worklist rendering the review turned up: highlighting
now requires the field count a command letter serializes, and a step
without a comment always shows its commands so a worklist without any
C; line does not render an empty card.
MasterMixRack in php-utils uses CoordinateSystem2x16NoJ, whose rows run
A-I and K-Q, and limes-api derives the MasterMixBlockItem coordinates
from it. Rendering those against a row list containing J put everything
from K onwards one row too low, and Q wells fell out of the position
lookup without any error.

COORDINATE_SYSTEM_2X16 stays as it is, so this only adds a coordinate
system rather than changing one.
@simbig
simbig changed the base branch from master to master-mix-rack-without-row-j August 24, 2026 09:30
@simbig simbig changed the title feat(TecanWorklist): Tecan-Worklist als Code-Ansicht mit Syntax-Highlighting feat(TecanWorklist): GWL-Vorschau in die Library ziehen Aug 24, 2026
simbig added 6 commits August 24, 2026 12:22
Comments restating a name or a type were removed, the remaining ones
carry a why: the php-utils field indexes, the clipboard constraint on
the gutter, the always-visible undocumented step.

Dropped three parseGwl tests that were subsets of others: the cut-short
command and the too-many-fields command exercise the same guard, a
second comment mid-worklist is already covered by the grouping test,
and the field-count drift test reads the whole fixture anyway.
Follows the layout of src/Plate: a PascalCase file per component,
lowercase files for helpers.
…ng them

A COMMAND constant translates the letters once, so the field index maps
and the color map read themselves. An isUndocumented binding replaces the
comment on the always-visible step.
PIPETTING_COMMAND_COLOR says which commands get a color. fieldRole takes
an object, so its two numbers cannot be swapped at the call site. The
story docs went nowhere without autodocs and only repeated the story name.
Toggling the commands re-parsed the whole worklist, which is free for a
34 line example and is not for a real dilution run.

Collapsing the commands again is now covered too, and GwlCommandLine
stops being exported to nobody.
Comment thread src/TecanWorklist/index.stories.tsx
@simbig
simbig requested review from spawnia and a lite review from Copilot and removed request for Copilot August 24, 2026 11:01
Base automatically changed from master-mix-rack-without-row-j to master August 24, 2026 12:48

@spawnia spawnia left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strukturell ok

Comment thread .storybook/preview.tsx Outdated
Comment thread src/Plate/coordinateSystem2x16NoJ.ts Outdated
simbig added 2 commits August 24, 2026 16:03
The barrel already imports antd.less, so Storybook no longer needs its
own stylesheet import.

Links the php-utils class the MM coordinate system mirrors, rather than
naming it.
@simbig
simbig requested a review from spawnia August 24, 2026 14:14
@simbig
simbig marked this pull request as ready for review August 24, 2026 14:15
@simbig
simbig merged commit 3f664bd into master Aug 24, 2026
10 checks passed
@simbig
simbig deleted the tecan-worklist-preview branch August 24, 2026 14:34
github-actions Bot pushed a commit that referenced this pull request Aug 24, 2026
# [20.7.0](v20.6.1...v20.7.0) (2026-08-24)

### Features

* **TecanWorklist:** GWL-Vorschau in die Library ziehen ([#332](#332)) ([3f664bd](3f664bd))
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 20.7.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants