Skip to content

Align container handoffs and center parallel workflow branches - #3034

Merged
alixander merged 4 commits into
masterfrom
feat/tala-handoffs-and-branches
Nov 25, 2026
Merged

alixander merged 4 commits into
masterfrom
feat/tala-handoffs-and-branches

Conversation

@alixander

@alixander alixander commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Human


AI

Two changes to TALA’s default layout for diagrams with identifiable parallel paths.

  • For a leftward or rightward handoff between two containers, find a unique pairing of children and align each pair across the gap. Matched edges use center ports. Additional subscriptions get separate ports on the facing sides.
  • For an automatically laid out workflow, recognize disjoint branches that split and rejoin, including nested forks. Center a shorter branch over the span of the longer one. Explicit hierarchy ranks, cross-branch dependencies and pinned geometry retain their existing layout.
Native D2 example On master With this change
Five events, five subscribers, nine handoffs 0 of 9 left to right, 1 crossing, 2,993 px of wire 9 of 9 left to right, 0 crossings, 1,220 px of wire
Nested release, space above and below Review patch 90 / 402 px, 7 bends 150 / 150 px, 8 bends
Order checks, space above and below Score risk 90 / 246 px, 8 bends 96 / 96 px, 8 bends

The release workflow uses tighter spacing as well as centered branches. Secondary handoffs can be diagonal, and some interfaces grow taller.

Review findings

  • Saved TALA diagrams now retain their top or bottom panel titles while aligning the handoffs. Reopening two diagrams produced by master aligned all five and four primary connections respectively, preserved the title positions across three layouts, and allowed individual edges to be rerouted. Invisible endpoints keep the ordinary layout.
  • One-pixel faces could acquire corner connections after export. The fixes preserve the previous routing for those cases, retain the interior port on two-pixel handoff faces, and preserve valid half-pixel side ports on workflow splits and joins. A native export check covered both handoff directions and all four workflow directions at sizes from 1 to 1,000 pixels.
  • Exhaustive comparison with a brute-force matcher agreed on all 66,064 bipartite graphs with two through four rows. A separate sweep checked 240 shuffled, nested and repeated workflows. The 161 changed drawings retained their nodes and edges and had no crossings, overlapping routes or contact with unrelated shapes.
  • The 65 checked-in fixtures and 200 mixed regression diagrams produced byte-identical SVGs and exported diagrams on master and this branch. Other checks covered 256 mixed-dimension layouts, 40 multi-board variants, theme and sketch rendering, and the rendered arrowhead footprints in all 75 comparison diagrams.
  • TALA package tests, race detection, D2 end-to-end tests, CLI tests and Go vet passed. GitHub CI, TALA fuzzing and release builds and smoke tests passed on b440148b4.
Event subscriptions · D2 source
direction: right
events: Published events {
  placed: Order placed
  stock: Stock changed
  payment: Card captured
  refund: Refund issued
  disputed: Dispute opened
}
workers: Subscribers {
  dispatch: Fulfillment
  stock: Availability
  ledger: Sales ledger
  refund: Reimbursements
  disputes: Risk review
}
events.placed -> workers.dispatch
events.stock -> workers.stock
events.payment -> workers.ledger
events.refund -> workers.refund
events.disputed -> workers.disputes
events.placed -> workers.stock
events.payment -> workers.dispatch
events.refund -> workers.ledger
events.disputed -> workers.refund
Nested release · D2 source
direction: down

submit: Submit change
review: Review patch
build: Build package
linux: Test Linux
mac: Test macOS
verify: Verify package
approve: Approve release

classes: {
  checkpoint: {
    style.fill: "#DCECE8"
    style.stroke: "#36665D"
  }
}
submit.class: checkpoint
approve.class: checkpoint
build.class: checkpoint
verify.class: checkpoint

submit -> review -> approve
submit -> build
build -> linux -> verify
build -> mac -> verify
verify -> approve
  • sent from alixander's Codex

Place uniquely matched endpoints across a shared corridor and center shorter branches within closed fork/join regions. Preserve authored constraints and compare complete candidates with the selected drawing.

- sent from alixander's Codex
@alixander
alixander marked this pull request as ready for review November 25, 2026 09:16
@alixander
alixander merged commit 4f9bb82 into master Nov 25, 2026
16 checks passed
@alixander
alixander deleted the feat/tala-handoffs-and-branches branch November 25, 2026 09:49
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