SwiftUI orbit animation: TimelineView for the continuous turn, state transactions for arrivals, and a one-line name ticker instead of a legend
Building concentric 'orbit' rings with badges that revolve round a centre: (1) Drive the continuous motion from TimelineView(.animation(paused: start == nil)), computing each badge's angle from seconds-since-start and placing it with .offset(x: r*sin(a), y: -r*cos(a)) (degrees clockwise from top). Because badges are positioned, not rotated, icons stay upright with no counter-rotation. Start the clock from a stored Date so nothing jumps when motion begins. (2) Arrival effects (scale/opacity pops via withAnimation + Task.sleep stagger, ring drawn with Circle().trim) still animate normally while the TimelineView redraws every frame: the per-frame offset change carries no transaction, so it snaps, while the properties changed inside withAnimation keep animating. (3) Two rings turning in opposite directions will line up eventually, but pick the outer ring's start angle to maximise the minimum angular distance to inner items (brute force over 5-degree candidates is fine and unit-testable) so they never start stacked. (4) A wrapping legend of chips under the orbit overflowed the screen at the maximum selection; a single line that names one item at a time (.id(index).transition(.opacity) inside a fixed-minHeight frame) while that item's badge scales up and fills kept the layout constant for any count and pairs icon to name. Run the naming loop after calling the completion handler, inside the same .task so it cancels with the view. Under Reduce Motion: no clock, list all names at once.