Skip to content

v0.13.0

Choose a tag to compare

@github-actions github-actions released this 07 Nov 03:46
· 41 commits to main since this release

.gtui format 10 (reads v1..v10). Crate 0.13.0.

Changed

  • In neighbour view (E) the selected edge pulses again: the overlay that lifts the highlighted
    path above boxes and text used to repaint it in the plain edge colour, which wiped the pulse.

  • In neighbour view (E) the cursor only picks edges of the highlighted node: pointing at an edge
    that merely passes through the same cell (or belongs to a neighbour) no longer selects it, so when
    several edges share a cell the ones from the centre win. Clicking such an edge says "E: only edges
    of the centre" instead of silently selecting it.

  • Neighbour view (E) now keeps the highlighted path visible: the lit edges are drawn once more
    above boxes, text and labels, so a highlighted edge is not cut by the boxes it passes. Ports on a
    highlighted neighbour keep the colour of their own edge and the neighbour's other ports (arrows
    and Ts of edges that are not lit) are dimmed, so dbus.socket's 16 red arrowheads no longer
    compete with the one blue one.

  • A T junction on a box border now uses the colour of the edge it belongs to, the same as the
    arrowhead, instead of the box's border colour. The glyph is unchanged.

  • An edge that is short relative to its boxes (its length is no larger than the biggest box side,
    both ends on auto) now picks its two sides from all 16 pairs, preferring ones that can run
    straight. This only touches small boxes standing next to big ones (systemd.gtui moves one edge);
    everything else keeps the ordinary rule, and explicit from_side / to_side opts out.

  • Ports are allocated by the border's capacity again, not by the text size: an 18-row box with a
    one-line label has 16 cells down each side, so a side no longer collapses to a single anchor when
    its label happens to be one line. A side with fewer than two cells that cannot hold its group
    moves the whole group to a side that has room and also faces the other box; the surplus endpoints
    otherwise move individually, choosing the side closest to the target instead of the next one
    clockwise. This fixes systemd.gtui at 1:1: basic.target keeps 16 arrowheads down its full
    right edge (instead of one plus four v on top, eight ^ on the bottom and a wrap around the
    left) and dbus.socket the same on its left.

  • layered only forces a vertical side for adjacent ranks when the two boxes do not overlap
    vertically; two boxes side by side that merely start at a different row keep their left/right
    edges.

  • The last-resort route no longer draws a line that stops halfway: when the straight fallback is
    blocked the edge draws nothing instead of leaving a dangling stroke.

  • When a side runs out of cells the endpoint that moves is now chosen by gain instead of by edge
    order: plain lines move before arrowheads, and only the surplus count moves (a side with 16 cells
    and 17 ends moves exactly one). A one-row none node keeps its single-cell sides and shares them
    between plain lines rather than being pushed to the top or bottom.

Changed

  • Port and arrow ownership is now an explicit role model instead of "whichever edge
    last wrote the cell": a cell's port role is either Arrow or Line (never both),
    an arrowhead keeps a set of owning edges (arrow_owners) plus, per edge, the
    strokes / ports / arrows it actually owns. Selection, the E-mode overlay and the
    arrow colour no longer consult edge_cells (which stays as the hit-testing union).
  • Consequences:
    • A plain connection end no longer takes a cell that an arrow end owns, so
      selecting a forward edge (dbus.service -> dbus.socket) no longer shows an
      arrowhead at its source (<->).
    • Only arrows the selected edge owns are highlighted; foreign arrowheads along
      the path (and at the picked edge's ports) keep their own colour.
    • An arrowhead shared by several edges is highlighted for every owner.
    • Routing treats other edges' ports/arrowheads as a soft obstacle (+100), so
      lines prefer to route around them instead of crossing them.
  • Routes on examples/real/systemd.gtui shift (same arrow count and directions,
    three more rows of detours); the dump is stable across runs.

Fixed

  • A text node (style=none) endpoint no longer loses the corner where its edge turns: the cell just
    outside the port gets the hidden direction bit pointing back at the port, so the route draws
    ╭ ─ ╮ ╰ ╯ instead of a bare ─/│. The port cell itself (the text) is still never drawn on, and
    a straight run stays straight. On examples/fun/hongloumeng.gtui three junctions gain their
    corner (╭───╯, 贾蓉╮, ╰秦可卿); systemd.gtui is unchanged.

  • The cells a selected edge's ports open onto are now taken from what was actually drawn
    (Canvas::edge_out_cells, recorded in edge_full / path / edge_loop), not from the port plan.
    When a side is full the plan has no entry for that end and the drawing falls back to pick_port,
    so a foreign arrowhead sitting on that cell was not suppressed: selecting
    dbus.service -> basic.target still showed multi-user.target -> dbus.service's > at its
    source. It is hidden now, while the selected edge's own target arrowhead stays. The set is
    assigned once after every layer is drawn instead of being cleared per layer.

  • A shared arrowhead now takes the colour of the edge that is currently active instead of the
    colour of the first edge that claimed the cell: the picked edge wins, then the single lit edge in
    neighbour view, then the first (visible) owner. In neighbour view on fwupd.service, the arrow
    into dbus.service is drawn in the fwupd edge's colour rather than the first owner's red; when
    several owners are lit at once the visible colour is kept (one cell, one colour). Applies to
    arrows between text nodes, to arrows embedded in a box border, and leaves the ordinary picture
    unchanged.

  • A port cell's outside cell now carries the same role as the port (Arrow / Line), so a
    plain connection never starts on a cell an arrowhead is drawn in. Canvas::outside_arrow refuses
    to draw an arrow on a cell that a line end already starts from, and the E-mode overlay no longer
    repaints an arrow that blit hid for the selected edge. Selecting a forward edge
    (dbus.service -> dbus.socket) therefore no longer shows a foreign > at its source, in either
    state; the ordinary (unselected) picture is unchanged.

  • A one-line text target (dbus.service in systemd.gtui) has exactly one arrow cell on each of
    its two usable sides, but four edges point into it. Once a side's arrow cell was taken, the port
    planner had nothing left and returned no port, so the route reached the box without an arrowhead
    (the fwupd and wpa_supplicant arrows were simply absent). Arrow ends now share the cell on
    their side when nothing else is free: the glyph is drawn once, its ink and owner stay with the
    first edge, and every sharing edge counts the cell as its own, so selecting any of them blinks it.

  • The E-mode overlay used to repaint an edge's line glyph over an arrowhead belonging to another lit
    edge of the same centre, hiding the shared arrowhead again. Arrowheads stay on top there too.

  • The selected edge is now painted over every other edge, including the other edges that E mode
    raises for the same centre. Before, in E mode the last drawn lit edge won the shared cells, so a
    selected edge was interrupted exactly where a neighbour edge ran along the same row.

  • A port whose exit cell lied inside another box is no longer used: the edge (and its arrowhead)
    used to be painted under that box, so the arrow simply was not there. The planner now switches
    that endpoint to another side that has a way out (and overflow never lands on a covered cell).
    On systemd.gtui fwupd.service and wpa_supplicant.service now enter dbus.service from the
    right and the left with visible arrowheads (dbus.service< / >dbus.service).

  • An edge could disappear completely: the port chosen on its side had its first step inside
    another box (two boxes overlap on screen), so the route had nowhere to go and the whole edge was
    dropped. pick_port now skips a side whose exit cell is a box cell, and when a planned route
    still fails the edge is re-planned once with both ends scanning the border instead of trusting
    the plan. On systemd.gtui this brings back the two edges into dbus.service that were
    invisible (all six of its neighbours now show their edge). The examples suite goes from ~44 s to
    ~66 s because those edges are now routed instead of being dropped.

  • A cross cell keeps the colour of the shape you can see: the edge drawn first owns both the glyph
    and the colour, and a later edge (even when its group is the one under the cursor) no longer
    repaints that one cell in its own colour, which made a long red run look like it was cut by a
    blue square. Raising an edge (selection / E) still recolours it as a whole.

  • An edge whose route cannot be found is no longer half drawn: the fallback used to return a single
    cell while the caller still painted the port stub, the arrowhead and a one-cell vertical, leaving
    a floating ^ under the box (visible on basic.target in systemd.gtui). A failed route now
    draws nothing at all -- no stroke, no port, no arrowhead.

  • The route cache keyed documents by geometry only, so two documents with the same box rectangles
    but different text could reuse each other's planned strokes (and their ports). Every document now
    carries a process-wide id that is part of the key.