magpie icon indicating copy to clipboard operation
magpie copied to clipboard

routing: a provider row's account list tooltip shows over its Routing and Stays buttons

Open yetone opened this issue 1 month ago • 4 comments

Found by MYCF711 in their #3749 patch (pr/small-seats). In the "Several accounts or keys" list on the Routing page, each provider row sets row.title = p.who.join(", ") on the whole .rt-pool row (internal/gui/assets/plugins/routing/client.js, at row.title = p.who.join). Segment buttons without a title of their own inherit it, so hovering Routing or Stays shows the account names instead of anything about the button.

Fix: put the tooltip on the name cell (nm.title), as their patch does, plus a GUI test that hovering a Routing segment doesn't show the account list. Not part of #3749's fix, so it gets its own commit.

yetone avatar Oct 26 '26 17:10 yetone

Branch, rebased on 508911e4:

git fetch https://github.com/MYCF711/magpie.git pr/pool-tooltip

One line: the account list moves from the row (row.title) to the name cell (nm.title), and the row carries none of its own — so a control with no title of its own no longer inherits the accounts. Plus internal/gui/tests/routing-pool-tooltip.test.cjs, which asserts what hover resolves to up from each button rather than the row's attribute.

Checked by hand in Chromium against these assets, one provider over four accounts:

                       before                             after
.rt-pool      title = "…, …, …, …"                 null
.rt-pool .nm  title = null                         "…, …, …, …"
Routing/Stays nearest title = the account list      null (each button shows only its own)

All 14 controls in the row, Routing and Stays included, resolve to no title; the "Rate limited" segment keeps the hint it sets itself.

Not run: the new test — no Playwright on this Windows machine. Its 5 languages x 2 widths x 2 engines are unrun here.

MYCF711 avatar Oct 27 '26 05:10 MYCF711

Fixed on a fork branch: fix/3785-pool-tooltip (head a5f315a3, on upstream 6eb510f7) — a pool's account-list tooltip no longer covers its Routing and Stays buttons.

Root cause. internal/gui/assets/plugins/routing/client.js's renderPools attached the account-list tooltip to the whole row, so anywhere on that row the list covered the Routing and Stays buttons.

Change. the tooltip moved to the element that actually lists the accounts behind it (the name element), so the buttons stay reachable; the tip's text is unchanged.

Verified. Red: the new routing-pool-tooltip.test.cjs (playwright in a container) against base assets → routing-pool-tooltip.test.cjs:54: the row itself carries no tooltip ('acct-a, acct-b' !== null) Green: same command → 4/4 (chromium + webkit × en/zh); the neighbours (stays-strict, rate-limited-sink, routing-mode-goes) still pass; TestCoreScriptBudget unchanged → ℹ pass 4, fail 0

Full go test -tags nogui ./... over round 27's branches: 70 packages ok, 5 red (edit TestWriteAtomicReadOnlyHardLink, gateway's five, plugin TestPluginSOCKSProxy, provider's synctest fatal in TestUnreadLoginsWriteErrorsKeepCredentials, testenv TestProgram) — every one of them reproduces identically at base 6eb510f7 in this environment (umask 0027), so none is from this change.

Branch: https://github.com/skygunner/magpie/tree/fix/3785-pool-tooltip — no PR opened, this repo takes no external PRs; say the word if you'd rather have the patch inline here.

skygunner avatar Oct 27 '26 09:10 skygunner

Shipped in v0.1.1771 (f2b4b9894): skygunner's patch, picked as is apart from the code comment (credited in the commit body). The account list is now the name cell's tooltip, so Routing and Stays no longer inherit it. routing-pool-tooltip.test.cjs is red on the old code and green in Chromium and WebKit, en and zh. Leaving this open for @MYCF711 to confirm.

yetone avatar Oct 27 '26 19:10 yetone

Confirmed — the shipped fix is the intended one: the account list is now the name cell's tooltip, and Routing / Stays keep only their own hints (the "Rate limited" segment keeps its own). It also closes the gap in my pr/pool-tooltip branch, whose test matrix I couldn't run here (no Playwright on this Windows box) — f2b4b9894 covers chromium + webkit x en/zh.

Nothing further from me. Fixed as far as I'm concerned — the close is yours, GitHub won't let me set it on someone else's issue. Thanks skygunner for the patch, yetone for picking it up.

MYCF711 avatar Oct 27 '26 19:10 MYCF711