1ccacad63281094de8a3372d5a507d38f9969e5c
3
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
9019ca88d6 |
gui: Scroll to top and Scroll to bottom move when the page under them changes, not only on a scroll (Jiabubu)
Jiabubu on Discord: with the capsule in sight, a click that opened a
Routing group left it over the editor's member rows (Remove beside Up
and Down) and its held Cancel and Add, and it moved off them only once
the page was scrolled.
scrollends.js placed the capsule on a scroll, a resize, focus or the
pointer leaving it, and a hidden attribute set anywhere. Opening a group
in place sets none, unless something else on the page happened to be
hidden again in the same draw (an empty pool list is, on every draw,
which is why the earlier tests saw it move). It now also watches the
open page and each of its own children with a ResizeObserver, and the
page's child list, so any change of size under it (a group opened or
closed, rows added or taken out) places it again on the next frame: it
rises above a held foot, steps aside at the page's foot, or comes back.
One file serves every page with the capsule (Agents, Providers, Routing,
Library, Settings, plugin pages), so they all take it. No core script
changed; scrollends.js loads lazily and has no budget.
view-ends-relayout.test.cjs: with no scroll after the change, the capsule
must be where the reader's next scroll puts it, and over nothing of the
editor's:
- Routing, 16 groups of the reporter's rows ("低-ultra", 922K), a pool in
the list: a screen down, a click on the card lowest in sight opens its
editor; then Cancel closes it.
- Agents, 40 rows: a little above the foot, a block at the list's end
taken out so the foot comes up under the capsule.
Desktop 1100, 700, 560; browser page 1100, 440, 360; Chromium and WebKit,
en/zh/zh-TW/ja/de.
Run on mote (mote-run) at this tree:
- view-ends-relayout, both engines, every language: 10 of 10 ok.
- On
|
||
|
|
2cfeda3d3a |
routing: a group editor's Cancel and Add have the scroll capsule above them, their ground to the window's edge
jiabubu on Discord: in a Routing group editor, its bar of Cancel and Add,
held at the window's foot while the editor runs on below, had the Scroll
to top and Scroll to bottom capsule over Add, and under the bar's ground a
gap above the window's bottom edge.
- The capsule (scrollends.js) rose above Providers' sticky Add bar only.
It now rises above any page foot marked .view-foot that is under it,
and the editor's bar is one. A foot elsewhere on the page, not under
the capsule, leaves it where it was.
- The bar was held at bottom: 0, which stops at the view's own foot
padding (4px, 8px in the window, max(12px, the safe area) on the phone
page, from app.css), so that much of the page showed under it. It is
now held that far down, its ground to the window's edge; on a phone
page its buttons keep the safe area under them.
routing-editor-foot.test.cjs: sixteen groups, then New group, scrolled so
the page is a screen down and the editor runs on below the window: the
bar's foot at the window's edge, the capsule above the bar and over none
of its buttons, and Add's right end taking a click as Add. Desktop 1100,
700, 560; browser page 1100, 700, 440, 360; Chromium and WebKit,
en/zh/zh-TW/ja/de.
Run on mote (mote-run):
- routing-editor-foot, Chromium and WebKit, en/zh/zh-TW/ja/de: 10 of 10
ok.
- At b3cf5641a (this change on
|
||
|
|
d5dc8eeccc |
gui: Scroll to top and Scroll to bottom on a long page (emo172)
#1090 (emo172) asked for back-to-top and back-to-bottom buttons on the main pages. Once a page is scrolled more than one window down, a small capsule with two buttons, Scroll to top and Scroll to bottom, fades in. It sits in the page's right margin when a wide window leaves one, and otherwise over the page's corner, above Providers' sticky Add buttons. It stays hidden near the top of the page, while a dialog is open, and (over the corner) at the page's foot, where the last row can't scroll out from under it, unless it has the pointer or keyboard focus. The page's own height never changes for it, because app.js's scroll guard measures that height. A press goes through scrollOnPurpose, so the window's scroll guard takes it as the reader's own scroll. It scrolls smoothly, or at once under reduced motion, and the button at the end it already reached is aria-disabled. Both buttons are real buttons, reachable by Tab, with a label and tooltip in en, zh, zh-TW, ja and de. They are drawn from the window's tokens in both themes, with no gradient and no coloured edge. scrollends.js is imported on the window's first scroll, so the core scripts carry one line in app.js, paid for by two comments cut from the scroll guard's. No budget was raised. old-webkit lists scrollends.js among the lazy scripts. docs/subsystems/gui-shell.md says where the capsule sits and when it shows. Run on mote at this head (on |