Commit Graph
2 Commits
Author SHA1 Message Date
yetone b3d1334458 providers: the Add sheet's search shows its hint whole
WJaunita45604 on X: 输入框里面的提示的字显示不全. Since a44da380b
(v0.1.4044) the Add sheet's search hint has been "Find a vendor, or paste a
URL and key…" (查找供应商,或粘贴地址和密钥…), in a box 160px wide, so it
was cut off in every language.

wholeHint (addfloat.js, which the sheet already imports) measures the hint in
the box's own font and sets
--hint-w, which the CSS now sizes the box by: in the sheet's row and when
the tools float into the title bar. Where even that has no room it shows
the shorter "Find a provider" (already in every language) instead. At 760px
and narrower the box keeps room for that short hint (--hint-s), and Import…
wraps to the next line rather than cut it; Custom provider stays on the
search's line (add-sheet-custom). Nothing changes in the observer's own turn,
the hint included: the next frame measures, sizes the box and then picks,
as WebKit calls a change while sizes are being told a loop.

The core grows 84 bytes, the import that calls wholeHint, within its
budget's room.

provider-env-paste asked for the long hint at 440px too. It now waits for
the box to be sized and takes either hint below 900px.

New add-sheet-hint.test.cjs: every language, both engines, at 1300, 1024,
900, 420 and 360px. It checks the hint's drawn width against the room in
the row, floated in the title bar, and after narrowing and widening the
window, and asks for the long hint at 1300 and 900px.

Run (on mote, Playwright 1.62.0, chromium + webkit):
- add-sheet-hint, add-sheet-float, add-sheet, add-sheet-custom,
  provider-env-paste: 140 of 140 (the add-sheet runs with the #6216 fix).
- Broken by hand: the test on origin/main 005178104 (no wholeHint, its
  wait for --hint-w swapped for 300ms) is 26 of 26 red, e.g. "the hint
  fits: 222.125 > 140".
- An earlier version that put the search on a line of its own at 520px and
  narrower broke add-sheet-custom's "on the search's line" at 420px. That
  is why Import… wraps instead.

On mote, both engines: at base 077421733, go test -tags nogui
./internal/gui ok and add-sheet*, provider-env-paste, plugin*.test.cjs,
old-webkit, i18n-keys and i18n-en-no-cjk green but the reds below and
the two the scroll buttons' commit fixes. Rebased on origin/main
6e03b746b with that commit: TestCoreScriptBudget ok with no raise;
add-sheet*, provider-env-paste, plugin-installed-filter,
plugin-api-prompt-key, plugin-password-prompt, the eight plugin files
red before, old-webkit, i18n-keys and the scroll files that commit
names: green but the reds below.
Reds that fail the same on origin/main 6e03b746b, run alone there:
old-webkit (#6467 appearance.js, #5919 .side-foot:has), plugin-move-unserved
(#4392), plugin-signed-out-account (#5998), plugin-signin-no-url (#5938),
plugin-page-foreign-error (#6117), plugin-option-placement (#6559),
rollup-short (#6560), text-size in WebKit (#6561), phone-no-sideways de
375 (#5869). The whole GUI suite was not run: mote's and mica's loads
were over their cores all evening (mote 27-53 on 18, mica 66-104 on 12).

Rebased on origin/main 1730c75b9, the pushed head (mote): go test -tags
nogui ./internal/gui ok; add-sheet*, provider-env-paste,
plugin-installed-filter, plugin-api-prompt-key, plugin-password-prompt,
i18n-keys, i18n-en-no-cjk and view-ends, both engines: 252 of 252.
a82bae2bd, landed on top since, changes the routing plugin, the
gateway and i18n.js keys of its own, none of these files; the core
measure at the pushed head is 1,267,635 of 1,268,961.
2026-11-14 00:16:51 +08:00
yetone 66f98d9d65 gui: the add sheet's tools show in the title bar once scrolled out of sight
The owner, 11-12, on the Providers page's Add sheet: 向上滑动,然后这些区域
不在可视区域的时候,这些区域应该自动浮现在Header处. Beside the sidebar
(side-nav, a window 1024px wide or more), the sheet's search, Custom
provider and Import… now show in the title bar's empty right, left of its
buttons, once the sheet's head row has scrolled out of sight. They are put
there the way Library's, Plugins' and Settings' tools are: position: fixed
inside --tools-l/--tools-r/--top-h, which app.js tools() keeps out of the
crumb's way (its head query now includes #addSheet .add-tools.afloat).
Scrolled back up, they are in their row again. Close stays in the sheet;
the screenshot's box didn't cover it.

The group is pinned, never copied, so there is one search: the words typed
and the focus stay with it both ways. Each change is a 180ms fade in going
into the bar and 140ms coming back, cubic-bezier(.23, 1, .32, 1), opacity
only, so reduced motion keeps it. Nothing moves in the sheet: the head row
keeps its height while its tools are up.

Narrow (no sidebar, which covers 420px and the panel): the bar has no free
room, so the sheet's whole head (label, tools, Close) is held at the top of
the page while the sheet is under it, the way Settings' head is in a narrow
window. It has the same blur strip and a hairline once stuck. At 760px and
under, the tools take a line of their own under the label.

The code is in a new addfloat.js, which renderAdd imports the first time the
sheet opens. In app.js it took TestCoreScriptBudget 487 bytes over
(1266031 > 1265544); with the move the budget passes and isn't raised.
old-webkit's list of scripts loaded on demand names it.

Run at 39ac4fafe (on origin/main 2d2333cfa), then again after rebasing on be8e352a2:
- New add-sheet-float.test.cjs: 22/22 (chromium and webkit; en, zh, zh-TW,
  ja, de; 1100px and 420px). It scrolls with the real wheel. In the bar,
  it checks the search is in the title bar left of its buttons and right
  of the crumb, with Custom provider and Import… there too; narrow, that
  the head is held at the top. Then: the search is clear to press, a click
  scrolls nothing and takes the focus, typing "Relay 2" filters the tiles
  with one search kept, and scrolling back puts it in its row with the
  words and focus.
- Red on the old code (git archive of the base's internal/gui): 0/22, on
  "in the bar once out of sight" (wide) and "the head held at the page's
  top" (narrow).
- go test ./internal/gui -run Budget: ok (mica).
- Related GUI files on mote, both engines, 380 tests, 376 pass: add-sheet,
  add-sheet-custom, add-button, add-partners-shine, add-sponsor-me, the six
  providers-*, i18n-keys, provider-detect-draft, provider-env-paste,
  provider-add-gemini, provider-retrieval-only, provider-url-each-api,
  modal-title-drag, model-id-space, builtins, old-webkit. The four reds are
  filed and come from other changes:
  - add-sheet "quiet rows" chromium en: tlscerts.js reads a null draft's
    serverPin (#6216). It was red in en, and in zh after the rebase, both times
    beside other files. Alone, chromium, 2/2 green on origin/main and 2/2 here;
  - old-webkit: headerpresets.js isn't in its list (#6030);
  - old-webkit: .side-foot:has() in app.css (#5919).
- After rebasing on be8e352a2: Budget ok; add-sheet-float, add-sheet,
  old-webkit and i18n-keys 34/38, the same three filed reds.
- i18n-keys first ran out of memory under mote-run -C internal/gui: it
  walks ../../.., which there is all of ~/runs. Run from the tree's root:
  4/4.

Not tried: the real app (Wails on macOS, WebKitGTK on Linux, WebView2 on
Windows). Only Playwright's engines were run, so the title bar's dragging
around the pinned tools (--wails-draggable) wasn't checked in a real
window.
2026-11-13 05:08:10 +08:00