routing: the head's line keeps its height live, so a pick doesn't pull the list up

c5cdb043e (v0.1.1926) gave a finished request nothing took its own line
under the head ("Nothing took this request: …") where it had the
one-account hint. That line sits over the list, so in English picking
the WorkBuddy 400 of routing-failed-open (mythfish's case) shrank it
from three lines to one and pulled the list up under the click:
"picking the request moved the page", chromium and webkit en live.

holdMode keeps the line, live, as tall as the last three requests told
it, as holdStory does the story, keyed by width and language. A layout
is read only when the line's words or the width change (#3164), and the
head is told again once the steps' width is first known, so a pick
before the next second's telling is held too.

Run (mote):
- routing-failed-open at c5cdb043e: 2 of 8 red (en live, both
  engines); at 602ad84ad (before it) green; with this change green
  alone, beside held-request and mode-goes (108 pass, 0 fail), and
  under load beside rule-remove, rules-line, rule-drag and affinity
  (all failed-open and held-request cases ok).
- Every routing-* and click-scroll* file at the first version of this
  change (before the header retell): 1666 pass, 30 fail. All but two
  of the reds are in files red at 602ad84ad too (rule-drag,
  rule-remove, rules-line, rule-models, row-swap, steady,
  story-shrinks). routing-failed-open webkit en live was still red
  under that load, which the header retell fixes (green in the runs
  above); routing-many-keys' two reds passed in the next run
  (failed-open, held-request, mode-goes, many-keys, story-shrinks,
  steady: only steady's 2 and story-shrinks' webkit red, both red at
  602ad84ad).

Not run: the whole GUI suite; the Go suite (no Go change).
This commit is contained in:
yetone
2026-10-29 01:50:14 +08:00
parent 425a613224
commit 2fc2d53583
+31 -1
View File
@@ -2355,6 +2355,34 @@ function routingPage(part) {
if (what.childElementCount !== 2 || what.firstChild.textContent !== name || what.lastChild.textContent !== tail) what.replaceChildren(el("b", "", name), el("span", "", tail));
// keys that read their own windows are weighed as accounts are
setText(mode, none ? noneWhy(r) : lone ? t(LONE) : g && routing === "order" ? t(GROUP_ORDER) : g && routing === "weight" ? t(GROUP_WEIGHT) : t(!routing && f?.kind === "key" && !r.order.some((x) => x.known) && !g ? KEYS_SMART : m[1]));
holdMode(r);
}
// holdMode keeps the line under the head, live, as tall as the last
// few requests told it, as holdStory does the story: it sits over the
// list, so a request picked whose line is shorter (one nothing took
// says so in a line, where one account on gave three) pulled the list
// up under the reader's click. A layout is read only when the line's
// words or the width change, not on each second's telling (#3164)
let modeHold = { key: "", told: new Map() };
function holdMode(r) {
const w = storyW;
if (rp || day || !w) {
if (mode.style.minHeight) mode.style.minHeight = "";
modeHold = { key: "", told: new Map() };
return;
}
const key = JSON.stringify([w, document.documentElement.lang]);
if (key !== modeHold.key) modeHold = { key, told: new Map() };
if (modeHold.told.get(r.id)?.[0] !== mode.textContent) {
mode.style.minHeight = "";
modeHold.told.set(r.id, [mode.textContent, mode.getBoundingClientRect().height]);
const ids = [...modeHold.told.keys()].sort((x, y) => y - x);
for (const id of ids.slice(3)) if (id !== r.id) modeHold.told.delete(id);
}
const own = modeHold.told.get(r.id)[1];
const held = Math.max(...[...modeHold.told.values()].map((h) => h[1]));
const min = held > own ? held + "px" : "";
if (mode.style.minHeight !== min) mode.style.minHeight = min;
}
// goTo makes what names a routing a way to where it is set: a provider's
// own under Several accounts or keys, a group's its card
@@ -2699,7 +2727,9 @@ function routingPage(part) {
});
}
// grown since it was measured (a font come in): measured again as it is
new ResizeObserver(() => { storyW = steps.clientWidth; storyDrawn = ""; holdStory(); }).observe(steps);
// and the head's line told again, so it is held from the first width
// on, not from the second's next telling (a pick before it isn't held)
new ResizeObserver(() => { storyW = steps.clientWidth; storyDrawn = ""; holdStory(); if (headOf) header(...headOf); }).observe(steps);
// renderCtx draws the request's context window under its story, with
// its session's prompts request by request; drawn again only when what
// it shows changes. Live, the next request is patched into the card