Skip to content

Workflow editor on the builder's shared chrome: one top bar, Audit, Assistant, badged pipes - #48

Merged
shahryarjb merged 192 commits into
masterfrom
feat/workflow-editor-2
Dec 5, 2026
Merged

shahryarjb merged 192 commits into
masterfrom
feat/workflow-editor-2

Conversation

@shahryarjb

@shahryarjb shahryarjb commented Dec 5, 2026 •

Copy link
Copy Markdown
Member

👀 At a glance

flowchart LR
  subgraph Top["🔝 one top bar (both editors)"]
    T["title · status chips · views · Undo/Redo · Publish"]
  end
  subgraph Left["⬅️ left"]
    L["📚 Library"] --- I["🔍 Inspector"]
  end
  subgraph Canvas["🖼️ graph canvas"]
    G["groups · steps · 🟢/🔴 badged pipes"]
  end
  subgraph Right["➡️ right"]
    Ly["🗂️ Layers"] --- As["🤖 Assistant"] --- Au["🩺 Audit"]
  end
  Top --- Left --- Canvas --- Right
Loading

The builder's second editor: a plugin-based graph canvas for any editor kind (Automation's workflows first), laid out and polished like the page editor, with history, drafts, versions, publish, preview, code and Audit lifted into the shared layer. Folds in #47 (autosave locale) and latest master.

Before Now Test it
A kind's editor had a plain top bar One 32 px top bar shared by both editors: title (15 px Manrope 800), status chips, view switch, Undo/Redo, Publish split Open a workflow and a page: the bars match
Panels differed per editor Library and Inspector left, Layers, Assistant and Audit right; widths and folds kept per browser tab Drag the rail grip, reload: same width
Pipes were thin arrows Kind-coloured lines with ringed ports, tinted badges, a ghost "Always ▾" badge on a chosen pipe; the badge opens its menu Press a pipe's badge: its menu opens; right-press shows only kinds it is not
Problems were a flat list Audit: summary ring, filter chips, groups, folded repeats, Fix and Fix all as one History row; a row about a field puts the cursor there Press an Audit row: its part is chosen and the field focused
No History for a kind History with Go back to here, named drafts, versions, snapshots; notes such as "Renamed to X" that undo passes over Rename the workflow: History shows "Renamed to …"; Undo does not undo it
Keyboard-only users could not draw Ports, arrows and ends reachable with the keyboard; ⌘C ⌘X ⌘V ⌘D ⌘A, ⌘K, ? Tab to a port, Enter, arrows, Enter: a pipe is drawn
The page editor's Assistant showed a sample chat Both editors show an honest empty state Open Assistant on a page: "No assistant is connected"
Autosave lost the admin's locale Autosave runs through MishkaGervaz.Messages.start_async (#47) Switch to another language, edit: saved notices in that language

Merge Danger

Door: two-way. Blast radius: both editors' chrome (top bar, panels), the page editor's Audit and Assistant tabs.

Needs core (mishka-group/mishka_cms_core#169) released first: CI on Hex core 0.0.8 lacks stage locked, a finding's field and the new kind DSL.

Closes #47.

Checks: mix ci green locally against the core PR branch: compile -Werr, format, credo --strict, sobelow, deps.audit, dialyzer (32 known skips, 0 unnecessary), ex_dna 4/4, test 3542 passed in 18 min; vitest 513/513.

Review fixes (#92)

Problem Before Now Test it
B1 A watching, snapshot or preview page could change the draft from a form The funnel keeps a per-page lock (DocumentSession.lock/2); tabs and windows get editable?; the Inspector is inert Watch from a second tab and type in a step's Setup: nothing changes
B2 Publish could make an older stored draft live Refused while the canvas is unsaved: "The last change is not saved yet…" Make a save fail, then press Publish
M3 Findings and stage were re-read on every message Findings are kept while the document and the save are unchanged; the stage is read once, off the page Select or zoom: no problems/2 call
M4 Tabs shared their selection, view and zoom; an old session overwrote newer work Each page keeps its own; a resumed session takes a newer saved draft (as an undo step when dirty) A/B/A test, two-tabs test
M5 A run announced no after_<op> Each op of a run is announced, with op and run document_session_test
M7 A check plugin got no document KindAudit.findings/4 hands it the document and ctx kind_audit_test
Gap config.shown got no item key It is handed action kind_frame_test
Minors m2, m4, m5, m6 (encrypted, site-bound, capped clipboard), m8, m10, m11, m12, m14, m15 see #92

Checks: mix ci green locally against the core PR branch; dialyzer 32/32 with 0 unnecessary; test 3564/3564.

Hand-test fixes

Problem Before Now Test it
Canvas opens blank Opened at the old zoom on the cards' corner, often empty air Opens with every card in view, zoomed out only as needed; Fit centres Open a large workflow
Library stays armed Esc did nothing, a drop left the entry picked Esc and any drop put it back Pick Wait, press Esc
Badge click Only chose an unchosen pipe Opens the pipe menu Click a pipe label
Fast rename lost A patch removed the Layers field The field floats over the row, saves on Enter or blur Double-click a step, type, Enter
Layers look Half-tinted chosen row, no hover, cut dot, plain pipe rows Page editor row: full tint, hover trash, arrow + tone pipe rows, no face dot Select and hover rows
Layers sync and keys Canvas choice not shown; arrows only scrolled Group unfolds and row scrolls in; Up/Down choose, Esc clears Click a step on the canvas
Fold all, Find None; Find missed the type Fold/unfold buttons; Find matches the type and marks rows Type delay in Find
Flaky resolve test Sometimes read the thread before the resolve's read answered Awaits the first read before resolving; 300/300 runs pass mix test ...canvas_and_sheets_test.exs --repeat-until-failure 300
Tidy up shape (V4, M1) Columns left to right; Start in the row under A workflow flows down: Decide on top, its targets side by side under it, the join centred under them, Start first Build Decide → Publish/Send back → Learn, press Tidy up
Pipe ends and trunks (V7) Pipes left from the side; two from one port drawn apart Bottom to top when below; a grey trunk then green/red branches with their badges; same into a join Look under Decide and over Learn
Route by hand (V7) No way to change a pipe's route Drag the bar under its badge, drag its end to another port (ports light), Reset the route in its menu; kept in the draft Choose a pipe, drag its bar and its arrow end
Grip drag (V6) A press on ⋮⋮ or the edge sometimes started a line The grip and the frame always drag the group Drag a group by ⋮⋮ and by its edge
Rename (V5) Slow window; typed words went to the field behind The name field opens in place at once, focused Choose a step, Rename, type, Enter
New part in view (M2) Centred, big jump Scrolls the least that shows it Press + Group a few times
Second press on a picked entry (M3) The note pushed the list down, so the press hit another entry The note floats at the foot; a second press puts the entry back Press Ask for approval twice
Esc in Layers (M4) Ring stayed on the row Nothing chosen, no ring Press a row, Esc

🤖 Generated with Claude Code

shahryarjb and others added 30 commits December 2, 2026 19:33
…ght-press menu, answers the second pass's events, and its tree, sheet, code, segment and stage parts take their final attributes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… not every open one

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…est first, and goes back to any of them as undo steps

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… back to here, the tabs plugins add, and the sheet of shortcuts

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s own form, and saves a named draft through its drafts tab

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…review:document, and a snapshot is drawn under its own bar

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d's code with Apply, Discard, findings by line and the leave question

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ops a view switch until the page asks

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…shes, previews and starts again from the live version

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s named drafts, publishes, looks at snapshots, applies code, previews and answers its keys

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r's, and the editor fires it

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…, and its sheet offers no way back

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…yzer reads the Advanced rows without a skip

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…the publish button, Undo and Redo, the problems dot and the ••• menu, shared by the page editor and every kind

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…fter what is chosen, the views are an icon segment, and a kind gets Undo and Redo, the ••• menu, the publish button, Preview, notices in the canvas column, every bar button in ⌘K and a Layers tab

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…iew it names

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… zone

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…leaves once typing starts, and a narrow header keeps its buttons

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ash key

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…he session's reviewed skip names the line it sits on now

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…words, the code view and drawer), leaves the sheet and the preview and snapshot bars to the host, and offers drafts only when a drafts tab exists

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…op lands at the nearest free place, and the graph has a clipboard and the builder's rule for a step put on an edge

`Op.new_id/1` mints `c_k3j9x0aa`-style ids, so a kind whose keys are narrower (a workflow's group
key) no longer re-keys a new container under the op that names it next. `Layout.land/3` takes
`at:`. `Graph.Clipboard` copies parts with what they hold and the edges among them, and pastes
them with new ids where theirs are taken (copy) or as they were (cut); a kind may refuse a copy.
`Graph.Splice` puts a node on an edge in a group of its own, the edge keeping its id. The Scene
carries its graph. Route cases from the editor walk are fixtures; `Place.search` keeps its seen
points in a map (dialyzer's opaque MapSet warnings).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e minimap drags, an arrow takes a step by its "+" or a drop, quick add, the right-press menu and clipboard, the Layers tree, and the run's walked arrows

The stage sits in a view of air on every side; Space, the middle button and the wheel pan, zoom
keeps the pointer's point, fit and ⇧2 fit the cards. The minimap moves the view as it is pressed
or dragged. An arrow's "+" (CSS hover, focusable) and a tile or step held over it put a step
between its cards (`graph_insert`, `graph_splice`). Quick add opens on a double press, Tab, an
arrow's "+" or a card's out-port "+" (`graph_quick_add`, `graph_add_after`). The right-press menu
lists the builder's and plugins' items; copy, cut, paste and duplicate work inside the workflow.
`tree/1` and `KindTree` give the Layers tab its rows, filter, folds, drag, rename and keys. An
overlay's `walked` edges are drawn full, the rest dulled.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ds only what this person may add

`graph_copy` keeps the copied parts in the page's LiveView process and answers an opaque id
and the counts; `graph_paste` takes only that id, so a copy the browser makes up is refused.
Every pasted or duplicated step, copied or cut, must be a type of the library this person may
add from, and goes through the kind's `new_node/3` with `copy_of`, which may refuse it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…holds with or without the host's code editor

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ode, preview) into feat/workflow-editor-2

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e copy test names what its id looks like

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
shahryarjb and others added 29 commits December 5, 2026 03:11
…nows who may publish now

The page keeps every command and leaves Publish out where ⌘K, its Enter
and the shortcut sheet draw them (KindHost.commands/2, from
@may_publish?), so a person made a publisher while the page is open finds
it without a reload.

Part of mishka-group/mishka_automation#92 (m15).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…on telemetry

[:mishka_cms, :document_session, :noted] is emitted once a note is
stored, with the section.

Part of mishka-group/mishka_automation#92 (m11).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…o both sides of it are tested

apply_op/3 and apply_ops/4 take opts[:now] (monotonic milliseconds) for
the two-second window; left out, the clock is read as before.

Part of mishka-group/mishka_automation#92 (m12).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…red the splice

A canvas outcome may end in {:then, fun}, which the host calls only after
the change before it in {:all, outcomes} was made, so a splice the funnel
refuses (a plugin, the kind, a locked page) is not counted.

Part of mishka-group/mishka_automation#92 (m2).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… of the same key

When the finding offers the fix with no run of its own, the kind's fix/5
runs; a builder:audit:fixes plugin under that key is left out and told in
the log.

Part of mishka-group/mishka_automation#92 (m4).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…'s site and capped in size

The copy kept in the browser is a Phoenix.Token encrypted for the person,
the kind and the site of the document it was copied from, so the browser
cannot read a step's settings and a master's copy from one site pastes
nothing into another. A token over 64 KB is never taken back, and a copy
that large stays in the page only.

Part of mishka-group/mishka_automation#92 (m6).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Part of mishka-group/mishka_automation#92 (m6).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…he page and the store, not the socket

Credo's strict check asks tests to read what a person sees: the chosen
part from #pb-root's data-selection, the zoom from the stage, a session
from the session store.

Part of mishka-group/mishka_automation#92 (M4).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Part of mishka-group/mishka_automation#92.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… fit the view

The Canvas mounted at the zoom it had and scrolled to the cards' top left corner, so a graph
larger than the view opened on part of it, or on empty air. It now opens (and comes back from
Code or Outline) with every card in view: at the same zoom when they fit, otherwise zoomed out
as far as that takes, the zoom told to the server.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… of an entry does too

A picked entry stayed armed after it was dropped with the pointer, so the next press on a group
added it once more, and nothing but a second press on the same tile disarmed it. Escape now puts
it back (the Library's note says so), and a drop of any entry clears the pick as a press does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s the pipe when it was not

A press on the badge of a pipe not chosen yet only chose it, so the menu needed a second press
and the badge read as dead. It now opens the pipe's menu under the badge at once and lets the
badge's own press choose the pipe; a right press on a badge opens the same menu.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… kept, however fast

A double press on a Layers row put the name field inside the row, and the patch the press's own
selection brought took the field away with what was typed, so the first rename of a row was
lost. The field now sits on the page over the row's name, and Enter or leaving it sends the
name; the canvas menu's Rename keeps the name on a press elsewhere too. Escape still keeps the
old name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ted as the page editor's

A chosen step's row was tinted by the step's own face, which keeps the canvas card's margins: a
pale block that missed the row's left side and was cut off on its right. The row now draws the
choice itself, full width with the page editor's Layers border and tint, and the face is drawn
unchosen and without its margins.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…to in Layers

Choosing a step on the canvas marked its Layers row but left a folded group folded and the list
where it was. Choosing now unfolds the groups the part sits in and pushes
`pb:graph-tree-reveal`, and the hook scrolls the row to the middle of the list when it is out of
view, as the page editor's Layers do; a row pressed already scrolls the canvas to its card.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e view

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ss always chooses its row

A press on a Layers row leaves the focus on the row's own button, and the keys only answered
the row itself, so an arrow scrolled the list instead. The keys now answer from anywhere in the
row. And a press whose row a patch redrew before the release (the Find box's last change,
flushed as it lost the focus) brought no click, so the row was not chosen until a second press:
such a press now chooses the row it started on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…chooses nothing

The arrows only moved the focus ring, so the row in focus and the row chosen parted. Up and Down
now choose the row they move to (its card and the Inspector follow), Enter chooses the row in
focus, and Escape clears the choice. Delete still removes the part as one undo step, as the page
editor's Layers do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n Layers at once

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nd on the chosen row that removes its part

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…the pipe's tone, lined up with the steps' names

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ws it matched; the tab count badge sits inside the tab

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…can leave out its own run dot

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… resolving, so its second read is the one awaited

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nder it and a join under its branches, and Start goes first

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…below, share a grey trunk where two meet a port, and keep the sides and bend set by hand

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…icked library entry puts it back, Escape in Layers lets go of the row's focus

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…set the route forgets it, a group's grip always drags, a new part comes into view with the least scroll

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r own small function

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@shahryarjb
shahryarjb merged commit 4955ffd into master Dec 5, 2026
17 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant