gui: a narrow weighted key list keeps the key's name on hover (00e0fd11b)

00e0fd11b put Switch off beside Remove on a key's row, shown on hover.
In a weighted list about 480px wide (the editor beside the list at a
900px window), the weight pill, Make first, Remove and now Switch off
left the name nothing: key-weight-fit's "hovering squeezes the name to
nothing" went red, en 900px, Chromium and WebKit. That red came from
this change, found in the full GUI suite run after the push.

There, under 520px of list, Switch off isn't shown on an on key's
hover; the tick dot still switches it, and an off key's Switch on is
always shown. Elsewhere nothing changes. The key list is an inline-size
container for it.

key-weight-fit measured "Remove" as the row's first .text.quiet, which
is now Switch off; it names Remove itself.

Run (mote):
- key-weight-fit, key-switch: 36/36 ok, Chromium + WebKit.
- key-weight-fit at 00e0fd11b: chromium/webkit en 900px red, as in the
  full run; ok with this.
- With key-replace, key-weight, provider-many-keys, routing-keys-fold,
  key-copy: the only reds are key-replace 420px (#4126 scroll hold,
  #3476 under load), the same on 00e0fd11b~1's assets.
- Full GUI suite on Linux (wsl-run magpie-desktop) at 00e0fd11b: 379
  of 15055 red in 80 files. The key-adjacent ones were rerun on mote
  at 00e0fd11b and at its parent: the same tests red on both (under
  load, #4304 on mote, #4120/#4121 on Linux), except key-weight-fit,
  fixed here.
Not tried: the real desktop app.
This commit is contained in:
yetone
2026-10-30 01:07:14 +08:00
parent 35cf8e083d
commit 81bdca1fe9
2 changed files with 6 additions and 1 deletions
+5
View File
@@ -2750,6 +2750,11 @@ body.window .ag-sk-icon { width: 22px; height: 22px; border-radius: 6px; }
.accts.keys .acc:not(:hover) > .alane:not(.set):not(.open):not(:focus) { margin-left: -9px; }
}
.accts.keys .acc .using, .accts.keys .acc > .text:not(.quiet) { flex: none; white-space: nowrap; }
/* Switch off on hover, beside Remove (wei_VC on X): in a narrow weighted
list the weight pill and Make first leave no room for it, and the name
went to nothing; there the tick dot alone switches an on key off */
.accts.keys { container-type: inline-size; }
@container (max-width: 520px) { .accts.keys.weighted .acc > .key-switch.quiet { display: none; } }
#gatewayKeys .acc { min-width: 0; }
#gatewayKeys .acc .plan { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* a gateway key's own limit (#585): the badge, what it used under the
+1 -1
View File
@@ -91,7 +91,7 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
const hov = await page.evaluate(() => {
const row = document.querySelector('.editor .acc[data-account-id="bbbbbbbbbb"]');
const box = row.closest(".accts").getBoundingClientRect();
const rm = row.querySelector(".text.quiet"), n = row.querySelector(".n");
const rm = row.querySelector(".text.quiet:not(.key-switch)"), n = row.querySelector(".n");
const b = rm.getBoundingClientRect();
return { opacity: getComputedStyle(rm).opacity, cw: rm.clientWidth, sw: rm.scrollWidth, right: b.right, boxRight: box.right, name: n.clientWidth };
});