Repository navigation
Conversation
A first, graph-only prototype of the experiment-design editor on a new "Design" page. State is local; block args and the workflow are not changed. - `ui/src/design-graph/` holds the editor. It uses plain Vue and `@milaboratories/uikit` only and imports nothing from the rest of the block UI, so it can move to a shared package later. - `toGraph` converts the authored materials into nodes and edges. A material with several parents gets an inserted `<child>::pool` node. - `withJunctions` adds a hidden junction for each separation with two or more partitions. Junctions are derived, not stored. - `layout` is a pure function: columns are step positions (a `round` label pushes a material to its round), rows follow a tree order, and edges are right-angle lines. - Nodes and edges have separate panels. Edits are immutable and keep an undo history. - Four example designs: one follows a synthetic study, three are invented.
Replace the right-angle edges with horizontal S-curves. - `layout` returns each edge's two ends and the x range of the column gap where it may change rows (`PlacedEdge`). The view draws straight leads up to that range and a cubic Bézier inside it, so a curve never crosses a node card. Edges between nodes on one row stay straight. - A separation's line runs into its junction, and each partition leaves the junction on its own curve. Merges into a pool mirror this. - Junctions of one parent share the gap center and differ by row, so the per-separation x offset is gone.
Every unsequenced node is now a shadow node: a faint dashed circle that shows on hover. Starting materials, unsequenced steps, split points and merges share one style. - Shadow materials carry no labels, only an optional `name`. Their ids are generated (`shadow-N`); unnamed ones show a grey placeholder. - Shadows are created only through actions: Start (toolbar), Add step (node panel), Insert step and Add partition (edge panel), and Add partition (split panel). "Add material" and the sequenced checkbox are gone. - Split points and merges stay derived from the design.
Each material gets two ports: the right one adds children, the left one adds parents. The node and edge properties move into a sidebar. - Clicking a port opens a sample picker in the sidebar: a mock sample table filtered by a metadata column and its values. The picked samples are added with the chosen connection type; slices added together form one split, several parents form a merge. - Dragging a port draws a connection. A drop on a node connects to it (a second parent makes a merge), a drop on an edge or split point joins that separation, a drop on empty space opens the picker. A drop that would make a cycle, drop other parents, or change nothing is refused while dragging. - The ends of a selected edge can be dragged to another node, or to another edge to make a partition. A moved edge keeps its type. - `connect.ts` holds the drop rules as pure functions; `edit.ts` gains the material-level edits. - When the sidebar opens, the selected node or edge is panned out from under it.
A first version of acting on several nodes at once. - Cmd/Ctrl+click (or Shift+click) toggles a node. Shift+drag on the background draws a selection box; a plain drag still pans. - With two or more nodes selected, a bar at the bottom of the canvas shows the count and the actions: set the connection type, add a step to each, merge them into one new shadow node, make one split of siblings, and move them under a new parent (the next node clicked). - The actions are pure edits in `edit.ts`: `setPartOf`, `addStepsTo`, `mergeInto`, `makeSplit` and `moveUnder`. Partitions of one split stay together when they move.
All actions now live in the right sidebar. With two or more nodes selected, the sidebar shows the count and the bulk actions in the same header layout as the node and edge panels. The floating bottom bar is gone. - "Cancel" takes the place of "Move under…" while picking a parent. - The view pans so the selected nodes are not under the sidebar.
- Delete any node from the sidebar or with Delete/Backspace. A deleted material's children take its parents and keep how they were made; slices that shared a split stay together. A deleted sample is free to place again. Deleting a split point dissolves the split; deleting a merge keeps the child's first parent. Several selected nodes are deleted together. - "Replace with sample" swaps a material for a sample from a single-choice picker and keeps every connection. - "Start" opens a picker that adds samples as roots, or a shadow node. - Escape cancels picking a parent, otherwise closes the sidebar. - Label fields in the sidebar no longer overlap: uikit text fields have a 160px minimum width.
- The sample picker has one filter: pick "column: value" options in a single dropdown. Values of one column match any of them; different columns must all match. The rule lives in `filter.ts` with tests. - Whole connections are solid and slices are dashed; remade stays dotted. The legend follows the new order.
- With several nodes selected, "Add children" opens the sample picker. The picked samples become children of one new shadow step made from all of the selected nodes (`of: [...]`, part `whole`); slices form one split. This replaces "Add step to each". - Cmd+drag (or Ctrl+drag) on the background draws the selection box, as Shift+drag does. - A merge refuses parents that are not in the design.
Columns now come only from the graph: one step per edge, half a step for a pool. A `round` label no longer moves a material to that round's column, so samples added to an empty canvas no longer form a staircase. Nodes with no parents and no children stack in the first column, in design order, below the connected trees.
The Design page now reads samples from the block's own table and keeps the design in the block data. - The block data gets an optional `design`: materials with their id, name (shadow nodes only) and how each was made. A sequenced material references a sample by its sample id. No new data version: the field is optional, so older packs keep it untouched. - Sample labels and metadata come live from the table and are never copied into the design. The sample panel shows them read-only. - A sample deleted from the table stays in the design as "Removed sample" in an error state. Duplicate or empty column labels get unique names. A stored design that cannot be drawn shows an alert with "Clear design". - The mock sample table and the example switcher are gone; the example designs remain as test fixtures. - Args, workflow and exports are unchanged. Undo stays local.
A shadow node with several parents is itself the merge, and a shadow node with one separation is itself the split, so the graph no longer adds a pool or a junction around it. Merging two nodes now adds one node, and adding children to several parents adds one node plus the children. The stored design is unchanged. - Only a whole merge without a step collapses; its parent edges are drawn as pooled edges. A slice or remade merge keeps its pool. - A shadow node with two or more separations keeps its junctions, so the separations stay apart. - Merge always stores a whole step. - A selected connection can be deleted, from the panel or with Delete; this drops one parent of a merge. - Selecting one edge into a merge no longer selects another, and "Add partition" shows only where it can act.
- The sidebar is uikit's PlSlideModal (non-modal), so its title, close button and spacing match the app. It starts below the canvas toolbar and pans the selection out from under it. - The sample list fills the panel and the Add button stays at the bottom. Rows show only the sample label, cut with an ellipsis; the full metadata is in a hover tooltip. - The filter picks a column, then its values; each filtered column shows as a chip. "Show in list" adds up to two columns as tags. - Escape in a sidebar field or dropdown no longer closes the sidebar. - No "shadow node" in the UI: the legend says "unsequenced", an unnamed one is "Unsequenced N", and the Start panel offers "Unsequenced start". - Panel titles name what is selected; Delete sits with the other actions.
- The block data holds a list of designs, each with an id, a label
and its materials, in place of the single unreleased `design`. It
stays an optional field on the current data version, so older packs
keep it untouched.
- The block sidebar lists the designs after a separator and ends
with "New Design", like the dataset entries.
- Each design has its own page: rename it in the title, delete it
with a confirmation. A new design starts empty, with a gray
placeholder name ("Design N").
- Designs are independent; a sample can be in several.
- "Insert step" on a multi-selection adds one unsequenced step between the nodes and their old parents, with no duplicate links. - "Connect to…" starts a pick mode: click or box-select children, then confirm. One unsequenced step joins all selected parents to all picked children; a single parent connects directly. Escape or Cancel ends the pick, and cycles are refused. - A port drag from a multi-selection does the same join. - Children left with one parent form one separation; a drop that changes nothing is refused.
…data into claude/design-graph-prototype-239b69 # Conflicts: # model/src/args.ts # pnpm-lock.yaml # pnpm-workspace.yaml
Unsequenced nodes already express which pieces came out of one separation, so the checkbox group on an edge is not needed. joinSplit went with it; leaveSplit stays for removing a junction.
Ports approach B of experimental-design-ui-wizard: one role per metadata column with its follow-up answers, parents inferred from the labels. The wizard page pre-fills roles from column names and values, shows the draft graph live, and replaces the design's graph on "Create draft"; its answers are kept on the design. Tests check the port builds the same designs as the original on the synthetic studies.
Copies tensor_derivation STEP 1 to 3 into the model and turns each design into the tensor JSON analysis blocks read, with one STEP 3 label per tensor kept apart from the tensors. The design page shows the tensors and their labels as text under the graph. Tests check the copy against tensor_derivation's expected outputs for the synthetic studies.
The model derives every design's tensors and labels into the args, and the workflow exports them as pl7.app/design/tensors and pl7.app/design/labels on [designId, tensorId], with the block's sample axis in pl7.app/design/sampleAxis. This is the shape the design-aware Enrichment block reads.
Stored block data comes back with map keys sorted, which lost the column order the wizard uses to break ties and nest splits, and made unchanged answers look changed. Answers are now saved as an ordered list and compared regardless of key order.
Drops the intro and draft-count notes, spaces the column cards so dropdown labels no longer overlap, and names every role in the plural.
Each tensor is one row: its axis columns, its groups as named chips (sample labels on hover) and its constant columns, replacing the raw text dump.
The role covers any branch split off a shared parent, not only selections, and rounds already name the selection steps.
A value removed from the input values now goes first in the order instead of dropping the whole order back to row order, which also scrambled the draft graph.
"Input" read like the wizard's whole input table; these values are the material before any step.
Both build the same graph and tensors and export the same step kind; they only differed in the edge's Round tag.
Only one of 39 studies needs the side-sample answer, and the graph editor can fix that draft; the wizard keeps its default.
Only one study needed blanks as a group, and blank cells in a control arm go wrong with either answer; typing a value in the cells always works.
No study in the corpus has blank cells that form a group of their own, so the hint described a case users will not meet.
Sibling trajectories often share an axis and the same group names and differ only in a column their shared start pools, which STEP 3 files under `within` and drops; six selectors on one library all read "ref to abneg". The label now carries `end`, the last position's value for every column the published axis and the constants do not already name, and the list prefers it over the values a comparison passed through.
The comparisons header and the collapsed section lines always wrote the plural, so a design with one trajectory read "1 trajectories". A countOf helper in string_utils now picks the form, and the counts, the section lines and a panel's arm count all go through it.
An arm is its own material, so two arms never belonged on one line: a design of four arms of three gates read as twelve trajectories, one per chain, antigen and gate. A trajectory now carries the arms it runs through, and a line holds one arm, collapsing the pieces of it. Arms holding a single comparison still collapse together, so a panning study with one arm per target stays one line.
A column filled for one gate alone names that gate's trajectory while its siblings are named by round and population, so the gates of one arm were landing on separate lines. Rows of an arm that holds several comparisons now group by the arm itself, and the line reads from the row on the axis most of them share.
The per-card role description is replaced by one help dialog behind a question mark in the page header, the column name carries the visual weight, and the follow-up questions sit in their own band under a divider. Columns set to info only drop to a group of their own at the end, so the top of the list is only answers that shape the lineage.
"Lineage" is the word the code uses, not one the reader has been given. The group heading, the info-only role and the rounds role now say what happens to the samples instead.
A replicate is never the material its peers were made from, so an answer there can only invent a line that was not run: setting one changes the tensors in 11 of the 15 replicate columns in the corpus, usually by inventing trajectories. No study has such a value, so the question is hidden, no longer suggested, and no longer carried over when a column is switched to that role.
A generation value is always a library that was built, so there is no value there meaning the step had not happened yet. The three generation columns in the corpus never get one suggested and never need one, while setting one changes the tensors in all three.
The word list now covers bulk, stock, parental, unpanned, the pre- forms and day or passage zero, while control arms (mock, untreated) stay out: those were run beside the others, not before them. "Starting material" is manufacturing language; the display and sort-seq literature says input or unsorted, so the field is now Input / baseline. No study in the corpus changes.
Neither earns its place against the authored designs: "one new library per value of" never recovers a tensor in any study that has a generation column, and "new library designed from" helped only one, where the column is a confounded arm label and the Parallel arms role already matches the design. The algorithm keeps both fields at their defaults.
"A selected part went on" and "only part goes on over time" give identical tensors on all 29 series columns in the corpus; they differ only in whether the edge reads as a round or a time point, which the suggestion already takes from the column name. The question is now binary and that label is inferred.
Nesting is an order, so it is now shown as one: the splits as chips, outermost first, moved with the same arrows that order round values, under a sentence that says what the order means. The two per-column questions that described a relative position in prose are gone.
The sentence under the chips restated the chain one pair at a time and grew with every split. Two muted words at the ends of the row say the same thing in place, and the header is a noun like every other label in the block.
The cards were a hairline on the page background, so a long list read as one run of fields. Each one now sits on an elevated surface with a defined border and a small shadow, and the space between cards is wider than the space inside one, so a card reads as one answer.
The hand-rolled cards are replaced by the platform's own element list, so a column reads like every other listed element: translucent surface, head band that lights up on hover, no bespoke elevation. Dragging, removing, expanding, toggling and pinning are all off, and the items stay open. Info-only columns are a second list under the heading, recoloured through the item class.
Nothing in those cards answers to a click, so the list's lime head and focus border only drew the eye to the columns that do not matter.
The element list paints an open card's head band with the lime gradient, and these cards are always open, so they were green whether or not the pointer was over them. The override now pins the head background off in both states.
Dropped the matches the corpus shows are as often wrong as right (sort, step, tc as a series; the greedy uns.* and lib.* baselines), moved selection to the arms it usually names, and added the plurals and the obvious missing words. Against the 39 authored designs this goes from 16 exact matches to 17, with five fewer wrong tensors.
The split order and a column's value order were arrows only. Both strips now take a drag and drop as well, sharing one handler that keys each drag to its strip so a chip cannot land in the other one. The arrows stay for keyboards.
Both orderings were chips with arrows. The split order and a column's value order are now element lists, one row per item with the platform's drag handle on the left, which is how the enrichment block sorts its conditions.
Stacked full-width rows cost a lot of height for orders of a few short values. The list's root and track now run in a row that wraps, and each item sizes to its own text, while the drag handle and the dragging stay the list's.
They are values in an order, not things to click, so the list's lime head band only drew attention to nothing. The focus border stays on the pill being dragged, which is the one state worth showing.
The pie slice read as a progress indicator at the size the cards show it. A quadrant is what a sort gate looks like on screen in the lab.
The search took the smallest set of columns that tells the positions apart, so a column with a value on a handful of samples beat a real factor by being one column where the factor takes two: a lineage marker filled for a fifth of the table named one trajectory's positions while its siblings read round and population. A column the table mostly leaves blank now names positions only where nothing denser can. Across the study corpus no tensor changes its axis; two move one column out of the axis candidates into mixed, where it belongs.
A design was a set of rows in one column of JSON strings, held together by a design id, and every row repeated the design's name and carried its own labels. It is now one object in the result pool per design, picked the way a dataset is picked, with its tensors filed under four sections by type and every name in a labels section of its own. Ids come from the materials a tensor is made of rather than its place in derivation order, so adding a branch elsewhere leaves the others alone, and a panel's anchor is the material id with the name in labels. The spec carries the sample axis and the samples the design names, so a block can check coverage without reading the object.
An arm was labelled by its first position alone, so a column that tells those positions apart named the arm even when it went on changing inside it. A panning design came out with its arms called R1 and R2, which are rounds, while the column saying one arm was the target and the other the negative control sat unused. The search now sees the whole arm, and falls back to the first positions where no column holds still, since arms really can be told apart by a concentration that changes again at a final gate. The viewer also stops printing a tensor id, which reads as a sample id now that ids come from materials. Across the 39-study corpus 2 panels of 54 change, both dropping a round or day column for the one that says what the arm is. None loses its name.
The result pool is walked as if everything in it were a PColumn: the SDK's collectDatasetAxes reads axesSpec[1] off every spec it finds, before it ever looks at the kind, so a design object without that field threw a TypeError and took down any block calling deriveRecipeOptions. Lead Selection lost its filter and ranking column options that way. A design has no axes, so an empty list is both the fix and the truth.
Each dataset is clonotyped on its own, so a design reaching across two of them names positions that no analysis block can bring into one table: the enrichment block simply does not offer it, and says only that samples have no abundance. The scope is now one dataset, the picked one or the first, and the picker is a single required dropdown rather than a multi-select defaulting to all.
A comment that argues from a named study reads as a note about that study, and the reader has to know it before the rule makes sense. The cases are kept, as the reasoning needs them, but as kinds of design: a sort with a high and a low gate, a column filled for one line only.
mchernys
force-pushed
the
design-wizard-tensors
branch
from
November 26, 2026 19:02
d8b7883 to
c21e101
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.