@jsenv/navi 0.29.176 → 0.29.178

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -560,28 +560,25 @@ from the app. Two reasons:
560
560
  that knob, so a popup that genuinely needs its own `maxWidth` can still say so
561
561
  without any of them escaping the app's screen.
562
562
 
563
- ##### Current limitations
563
+ ##### Placement follows the same rectangle
564
564
 
565
- `--navi-app-max-width` caps how big a popup may get; it does not move where one
566
- is placed. Placement is still computed against the real viewport
567
- (`pickPositionRelativeTo`, in `@jsenv/dom`). That is invisible for anything
565
+ `--navi-app-max-width` moves where a popup is placed, not only how big it may
566
+ get. Placement is computed against the visual viewport narrowed to the app's
567
+ own rectangle: navi hands the centered bands to `@jsenv/dom` once
568
+ (`setPlacementViewportInsets`, wired in `navi_css_vars.js`), and
569
+ `pickPositionRelativeTo` reads them on every placement. Invisible for anything
568
570
  centered on its cross axis — `center`, `bottom`, `top`, which is what a dialog
569
- does nearly always — but shows for anything anchored to an edge: a
570
- `positionArea` like `bottom-start`, a `SidePanel`. Those sit against the
571
- window's edge rather than the app column's, so they stay on the real viewport
572
- for now (`side_panel.jsx` restates `--dialog-maxmax-width` as the full viewport
573
- on purpose).
574
-
575
- `FixedBar` is the exception, and shows the shape of the fix: it is pinned to
576
- `--navi-app-inset-*` (see `docs/safe_area.md`), which describes where the app's
577
- rectangle is in the window rather than how wide it may be. Making the rest
578
- follow means narrowing the container rect placement is computed against, inside
579
- `pickPositionRelativeTo`, to that same rectangle.
580
-
581
- Note that an app can already get all of it, placement included, by rendering
582
- itself in an iframe of the target width: the viewport then genuinely _is_ the
583
- app's screen and no token is needed at all. `--navi-app-max-width` is the answer
584
- for an app that does not want to pay that price.
571
+ does nearly always — but it is what puts anything anchored to an edge (a
572
+ `positionArea` like `bottom-start`, a `SidePanel`) flush against the app
573
+ column's edge rather than the window's. `FixedBar` reads the same description
574
+ through CSS instead: it is pinned to `--navi-app-inset-*` (see
575
+ `docs/safe_area.md`), which says where the app's rectangle is in the window
576
+ rather than how wide it may be.
577
+
578
+ Note that an app can also get all of it by rendering itself in an iframe of
579
+ the target width: the viewport then genuinely _is_ the app's screen and no
580
+ token is needed at all. `--navi-app-max-width` is the answer for an app that
581
+ does not want to pay that price.
585
582
 
586
583
  ### 3. Direct rule override (avoid unless necessary)
587
584
 
@@ -147,26 +147,25 @@ to get wrong from there:
147
147
  which: once it has faded into a recognized tail, growing **twice in a row**
148
148
  is a hand (`WHEEL_REGROW_RUN`) — decay jitter bumps up in isolated events and
149
149
  never twice consecutively.
150
- - **the other axis, over a faded stream, is not ours to swallow.** Within a
151
- push, cross-axis events are the push's own wobble and are eaten with the
152
- rest — a hand is never perfectly straight. But once our axis is momentum
153
- only, a hand pushing the other way is a NEW gesture, and on an axis the box
154
- does not travel it is not ours at all: it is handed back to whatever scrolls
155
- under the pointer, untouched, and it does not renew the claim either. Renewed
156
- by what it swallows, the gesture would be kept alive by the very scroll it
157
- ignores — every attempt extending the silence it was waiting for. Handed
158
- back, though, only when it IS a scroll: at the end of a fade the deltas are a
159
- pixel or two on each axis, and read alone such an event says "the other
160
- axis" as easily as it says nothing — passed along, those crumbs scroll the
161
- slide's own content a few pixels under the travel, a header creeping off the
162
- edge of the box. Three things separate a scroll from the crumbs, and all
163
- three are asked for: the other axis clearly dominates the event (the same
164
- bar a drag uses to give up its press); the event is the size of a hand, or
165
- the run is growing event over event — a scroll ramping up from rest, which
166
- decay never looks like; and it is a RUN — wobble is isolated, a scroll
167
- insists (`WHEEL_CROSS_RUN`, `WHEEL_CROSS_CONFIRM_DELTA`). The run costs a
168
- real scroll its first event or two — a few pixels, one notch of a stepped
169
- wheel — which is the cheap side of the trade.
150
+ - **cross-axis events are swallowed absolutely, and they renew nothing.** A
151
+ hand is never perfectly straight, so events leaning the other way are the
152
+ gesture's own wobble and are eaten with the rest — and there the swallowing
153
+ has to be total, because no per-event reading tells a scroll's onset from
154
+ that wobble. It was tried, and every filter leaks: end-of-fade crumbs are a
155
+ pixel or two landing on either axis (a `(0,1)` event is "clearly the other
156
+ axis" by any dominance test), a slightly diagonal swipe's tail carries
157
+ hand-sized deltas on both axes, and one crumb let through scrolls the
158
+ slide's own content under the travel — a header creeping off the edge of the
159
+ box, one pixel per leak. Do not re-attempt a "hand it back when it is really
160
+ a scroll" heuristic; the honest boundary is elsewhere: a swallowed
161
+ cross-axis event does NOT renew the claim. Silence is the only end a wheel
162
+ gesture has, and it is silence ON ITS AXIS — renewed by what it eats, the
163
+ gesture would outlive its own stream, and a hand starting a scroll over the
164
+ tail would extend, event by event, the very deadness it was waiting out.
165
+ Left to lapse, the claim dies shortly after the travel axis goes quiet (on a
166
+ system where touching the surface kills the old momentum, that is moments
167
+ after the new scroll begins), and the browser answers the rest of the scroll
168
+ itself.
170
169
 
171
170
  Taking it is also the only way to stop the browser from answering it: on a
172
171
  laptop a horizontal two-finger swipe IS the back-navigation gesture, and a
package/docs/safe_area.md CHANGED
@@ -151,11 +151,14 @@ _sizes_ must fit what is actually visible.
151
151
  and turns the bottom bar's number red when it goes under the keyboard. On a
152
152
  phone; a desktop has no keyboard to open.
153
153
 
154
- ## Current limitation
155
-
156
- Popup **placement** does not follow level 1 yet: `pickPositionRelativeTo` (in
157
- `@jsenv/dom`) still computes against the real viewport. Invisible for anything
158
- centered on its cross axis — which is what a dialog does nearly always — but a
159
- `positionArea` like `bottom-start` or a `SidePanel` sits against the window's
160
- edge rather than the app column's. See "Current limitations" in
154
+ ## Placement follows level 1
155
+
156
+ Popup **placement** answers to the level-1 rectangle too: `getAppInsets`
157
+ (`src/layout/responsive.js`) is the JS reading of the level-1 bands, and
158
+ `pickPositionRelativeTo` (in `@jsenv/dom`) computes against the visual
159
+ viewport narrowed by them (`setPlacementViewportInsets`, wired in
160
+ `navi_css_vars.js`). Invisible for anything centered on its cross axis —
161
+ which is what a dialog does nearly always — but it is what puts a
162
+ `positionArea` like `bottom-start` or a `SidePanel` against the app column's
163
+ edge rather than the window's. See "Placement follows the same rectangle" in
161
164
  `css_architecture.md`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/navi",
3
- "version": "0.29.176",
3
+ "version": "0.29.178",
4
4
  "type": "module",
5
5
  "description": "Library of components including navigation to create frontend applications",
6
6
  "repository": {
@@ -29,7 +29,7 @@
29
29
  "prepublishOnly": "npm run build"
30
30
  },
31
31
  "dependencies": {
32
- "@jsenv/dom": "0.17.42",
32
+ "@jsenv/dom": "0.17.44",
33
33
  "@jsenv/humanize": "1.7.8",
34
34
  "@jsenv/validity": "0.4.3"
35
35
  },