Commit Graph
3 Commits
Author SHA1 Message Date
yetone 0f6defe78b gui: on a Mac a region or agent strip scrolls with no bar, so a click right after a scroll picks the option under it (#1620)
tencent-cloud.test.cjs was red in WebKit now and then: a region clicked
was not picked. The cause, found by scrolling the strip from the test and
clicking 30ms later: on a Mac page (body.mac) WebKit shows its overlay
scrollbar over the lower half of a scrolled strip for a moment, and
elementsFromPoint at an option's centre returned the strip, not the
option. A press there goes to the bar's track, which pages the strip
sideways (smoothly, 198 -> 44) and picks nothing. A reader on a Mac who
scrolls the regions and clicks at once meets the same miss.

On a Mac these strips (.segs.regions, Connect's segs, #sessAgent) now
scroll with no bar, as a Mac's own tab strips do (scrollbar-width: none,
::-webkit-scrollbar display none). Other systems keep their thin bar.
z-index, isolation and position on the options didn't help; only hiding
the bar did.

Tests:
- tencent-cloud.test.cjs: new "a region clicked right after the strip
  scrolled is the one picked", 480x1200 (the strip in the window; it
  checks so), 10 rounds over 5 scroll positions. Without the CSS WebKit
  missed 39 of 50 clicks (40 of 50 on origin/main 5dfcf4346); with it 0.
- strip-scrollbar.test.cjs now says the Mac strip has no bar (width none,
  bar 0), and goes red without the CSS.

Run: tencent-cloud 20/20 green in WebKit and 20/20 in Chromium;
strip-scrollbar, sess-agent-strip, usage-sessions-agents-fit,
tencent-access-key, system-one, click-scroll, segs-press-redraw in both
engines (segs-press-redraw's Chromium 440px case is red now and then
under load in other trees too: it is one of the Settings tests #1659 is
moving onto the page's last settings read; green 8/8 in each engine
with this change).
2026-10-12 01:55:05 +08:00
yetone c05dd8b6fb provider: Tencent Cloud has Token Plan 企业版 as a region, Enterprise plan · China and · Global (#1574, undirectlookable)
#1574 asks for Tencent Cloud Token Plan's usage through TokenHub's
DescribeTokenPlan API (api/1823/132270). That API covers Token Plan
企业版, the team plan, only. magpie's Tencent Cloud preset knew the
personal plan (api.lkeap.cloud.tencent.com/plan) and TokenHub's pay as
you go, not the enterprise plan, so a provider at it had nowhere to sit.

The preset gains two regions, after the old three so imports and links
are unchanged:

- enterprise: https://tokenhub.tencentmaas.com/plan/v3 (chat completions
  and Responses) and /plan/anthropic, Guangzhou.
- enterprise-intl: the same paths on tokenhub-intl.tencentmaas.com,
  Singapore.

Both use the plan's docs (product/1823/130659, 131173 for the 轻享套餐,
same endpoints) and the Token Plan console as the key page. Their model
lists are the doc's tables for each site, with the three GLM models it
says went away on 2026-10-09 left out, and without the deepseek/… ids.

An entry imported at those endpoints, a magpie://import link with
region=enterprise(-intl) and a provider moved there in the editor land
on the region; TokenHub's pay as you go at the same hosts stays at its
own. The site's import pages (en, zh, ja) list the two regions, and the
region names are translated in zh, zh-TW, ja and de.

Run: go test ./internal/provider (TestTencentCloud,
TestTencentCloudEnterprisePlan, red before the regions), gofmt; GUI
tencent-cloud.test.cjs in Chromium and WebKit, en and zh, 8/8.
Not tried with a real enterprise plan key: we have no Tencent Cloud
account.
2026-10-11 13:06:28 +08:00
yetone 209dc69b59 providers: Tencent Cloud is one preset, its regions Plan · China, Pay as you go · China and Pay as you go · Global (Discord, Jorben: Tencent Cloud's Token Plan, TokenHub and TokenHub China were three tiles of one vendor) — tencent-token-plan, tencent-tokenhub-cn and tencent-tokenhub become tencent-cloud's regions plan, cn and intl, as Xiaomi MiMo's are, each made as its own preset made it: the plan's /plan endpoints with no Responses, its own models and no catalog; TokenHub's hosts with Responses, models.dev's tencent-tokenhub and its own keys page and docs. A region now carries its Website, Catalog and Models, and a saved provider's region is found by its endpoints (regionOf, by exact URL before path, since TokenHub China and global share their paths): normalize gives it that region's keys page, docs and catalog (a catalog the user picked is kept), and planModels its models. The old ids are aliases, as qianfan-token-plan is of baidu-qianfan: Preset and FromPreset take them, FromPreset builds at their region, normalize rewrites a saved provider's preset to tencent-cloud, and a provider's own id never changes, so its key, models, routing groups, usage and prices stay where they were; magpie://import links by an old id land at its region, and region= now also gives a region's docs and catalog. Imports from other apps match a region's endpoints. The editor's docs link follows the region picked with the segmented control, en and zh ("按量 · 中国", "按量 · 国际"); the add sheet has one Tencent Cloud tile; the site's import docs list tencent-cloud with its regions and import.html still names the old ids. TestTencentCloud (each region, old ids, FromPreset, imports, import links) and TestTencentCloudOldPresetsKeepWorking (a providers.json saved by an older magpie under all three old presets, with a routing group over them, read, re-saved as the editor saves and switched between regions) fail on the old code; TestTencentTokenHubRoutes routes through old ids and tencent-cloud alike. tencent-cloud.test.cjs (WebKit en and zh: one tile, the three regions, no select, the docs and Get a key links following the region, an old id's provider opening at its region and saved under its id) fails on the old app.js; add-sheet, zhipu-team, system-one, strip-scrollbar and click-scroll pass (Chromium doesn't launch in this sandbox). Not tried with a Tencent account. go vet, builds (darwin, GOOS=linux, GOOS=windows) and go test -tags nogui -count=1 ./... under a temp HOME pass. 2026-10-04 19:38:14 +08:00