Skip to content

layout: flows that move to another stock face lose their order #446

Closed

Description

@bpowers

When incremental layout moves a stock's flows to a different face, it loses their left-to-right (or top-to-bottom) order and reorders them alphabetically.

Example

A stock has three flows on its bottom face at x=100, 200, 300.
After a chain is removed, layout moves them to the right face and sorts them by y, the natural axis of the right face.
All three still have the bottom face's y coordinate, so the keys tie and the order falls back to the flow names.

Why it matters

Flows jump to positions the modeler did not arrange.
Found in code review of the layout change that routes side flows perpendicular to aging chains, not in a real model.

Fix

Sort by the old face's axis when the face changes, or by whichever axis the old attachment points actually vary along.

Pointers

  • The reordering function this describes (reorder_attachments_by_position) was removed in diagram: one flow geometry owner, gesture planner and executor #1066; in incremental layout a preserved flow now keeps its face and slot.
  • classify_flow_sides in src/simlin-engine/src/layout/mod.rs and its caller in src/simlin-engine/src/layout/incremental.rs

Activity

  1. added
    engine
    layout
    on Jun 8, 2026
  2. changed the title [-]layout: reorder_attachments_by_position loses visual ordering when flows change faces[/-] [+]layout: flows that move to another stock face lose their order[/+] on Oct 12, 2026
  3. added
    bug
    on Oct 12, 2026
  4. bpowers commented on Oct 12, 2026

    @bpowers
    OwnerAuthor

    Closing: already fixed on main.

    reorder_attachments_by_position no longer exists (removed in 1da80fc, #1066). In incremental layout only newly created flows read classify_flow_sides (src/simlin-engine/src/layout/incremental.rs:2553-2567); every drawn flow keeps its face and slot byte for byte, pinned by a_flow_whose_sibling_changes_is_preserved and a_flow_the_patch_does_not_touch_is_preserved in layout_flow_tests.rs.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugenginelayout

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions