Commit Graph
3 Commits
Author SHA1 Message Date
yetone 4696d14726 gui: Add provider unrolls its sheet under the list again, and closing it leaves no blank (the owner: 点击「添加供应商」为啥是弹出 modal 而不是像以前一样的交互(展开滚动)· 在添加供应商时会有两层弹窗,很丑,不符合设计原则)
#433 made the add sheet a dialog over the list, to get rid of a blank left under the list once the sheet was closed; but a vendor picked in it opens its editor, a dialog of its own, over that dialog: two layers. The sheet is back under the list, unrolling as the view goes down to it, the button at the view's foot stepping aside while its head is in sight. The blank was the page holding on to the Close clicked: with the sheet gone it held the sheet's neighbours where they were and kept its height as empty room at the view's foot. Closing the sheet (Close or Escape) now lets that hold go and takes the room away, so the list ends at the view's foot as before the sheet opened, and the focus goes back to Add provider, which comes back at once rather than at the end of its fade (it couldn't take the focus while still hidden). Kept from #433: Duplicate and Add another open the new editor without the sheet, an editor opened from the sheet gives the focus back to its option on close, a reload keeps the search's focus and caret, and the search's Escape empties it, then closes the sheet, and never hides the tray.

add-button is pre-#433's again (one click at the end of a long list unrolls the sheet and takes the view to it; scrolled back up, the button takes it there again; logos kept across a dialog) and now closes the sheet by Close twice and by Escape, checking no room is left, the height and scroll are those before it opened, and the focus is on Add provider; with the hold left in place it fails "Close left a blank under the list" in Chromium and WebKit, English and Chinese. add-sheet drops #433's focus trap and checks the sheet, not a backdrop. The 25 tests touching the sheet, Add provider, Duplicate or Add another pass, as does old-webkit; click-scroll passes in WebKit, and in Chromium fails the same four routing/usage cases as unchanged main on this loaded machine. go vet, go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build and go test -tags nogui ./internal/gui/ pass.
2026-10-02 11:03:29 +08:00
Fanbuzandfanpeng 1eb2640d7e fix: 添加供应商改用遮罩并保持列表位置 (#433)
* fix: 添加供应商改用遮罩并保持列表位置

* fix: 统一供应商浮层键盘导航并拦截搜索框退出

* fix: 保留供应商浮层滚动位置并恢复刷新焦点

---------

Co-authored-by: fanpeng <fanpeng@xintukj.com>
2026-10-02 10:15:35 +08:00
yetone 2364f8b5ff providers: the add sheet's rows carry no region tag, the logos stay put when a dialog opens or closes, and "Add provider" sits at the view's foot and reaches the sheet on the first click (Image #27: 国际中国还是有点像狗皮膏药; 每次打开或者关闭弹窗的时候,Provider的logo都会重新刷新一遍; Image #28: 添加供应商要固定在底栏底部…第一次点击的时候没有任何事情发生) — a vendor's merged global/China row lost its "Global · China" tag (design B1): the region is picked in the editor's Region switch and the row's title still lists each region's host. Every redraw of the Providers page made each logo anew, so each one faded in again whenever a dialog opened or closed; renderProviders now hands the logos it drew to icon() to reuse (the editor drawing its own), so they are moved, not remade. "Add provider" is sticky at the view's foot over a long list and steps aside while the sheet's head is in sight; the first click opened the sheet but WebKit clamped the scroll before it grew, and unrollSheet took that for the reader scrolling and gave up — it now starts from where the view really is, and a click with the sheet open eases the view to it. Tested with add-button.test.cjs (new: the bar at the foot at the top and the end, one click reaching the sheet, the bar away and back, a dialog opened and closed keeping every logo; fails on main) and add-sheet.test.cjs (no tag, the hosts in the title), Chromium and WebKit, en and zh; click-scroll passes; the full GUI suite passes but login-import, which fails on main under load. go vet, go build -tags nogui (and GOOS=linux, GOOS=windows) and go test -tags nogui ./... pass. 2026-09-30 02:26:28 +08:00