Files
magpie/internal/gui/assets/plugins/routing
yetone ed71fa774d routing: the last request's story shrinks back on a busy gateway too (shensmart on Discord)
shensmart on Discord (a remote magpie, the page in a local browser): the
room under "How the last request was routed" grew with use and, once
stretched, never shrank back.

Cause (internal/gui/assets/plugins/routing/client.js, holdStory): the
story is held at the tallest of the last STORY_HELD requests so the page
doesn't jump between requests (dumplings' jitter, routing-ctx-still), and
0455b9279 made a long one drop out after three. But only a request drawn
while answered was counted. On a busy gateway a request is answered as
the next starts, both come in one trace, and the newest (the one drawn)
is always under way, so nothing new was ever counted and a long story
held the box at its height for good.

What changed: every request drawn live counts, answered or under way, at
the height it has now (the map is renamed done -> told). The anti-jump
hold is kept: a request under way is still held at the answered one
before it, and a sequential agent behaves as before. Once three newer
requests have been told, a long one stops holding the box. No new UI.

Guarded by a new case in internal/gui/tests/routing-story-shrinks.test.cjs:
a request handed on four times, then traces that each carry one request
answered and the next started. en at 1100px and zh at 420px, Chromium
and WebKit. On the old client.js (f81913994) it is 0/4 red: "the box
shrank back with the newest always under way: 247.5 vs 247.5 (min-height
247.5px)" (en), 356.25 vs 356.25 (zh); the original four cases passed.

Run (macOS, NODE_PATH playwright 1.62.0, log kept whole in a file):
- At f81913994 + this change: every internal/gui/tests/routing-*.test.cjs,
  panel-routing*.test.cjs and i18n-keys.test.cjs, both engines:
  1229/1229 pass. go test -count=1 ./internal/gui: ok (83s).
- Rebased on origin/main c4a5e6153 (one provider-only commit, nothing
  under internal/gui), head tree of this commit: routing-story-shrinks,
  routing-ctx-still and i18n-keys again, 29/29 pass.

Not tried: shensmart's own remote magpie and traffic; their version is
unknown, and if it predates v0.1.1326 (0455b9279) the plain "long story
held for good" case is what they saw, which that release already fixes.
No full Go suite (only JS and the gui package changed). Not tried in the
real Linux WebKitGTK app (no motion or new browser API involved).
2026-10-23 10:02:13 +08:00
..