@n-uf/placement 26.11.50 → 26.11.52

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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,162 @@
3
3
  Versions are calendar versions, `YY.M.R` (year, month of the release, counter within the month), shared with
4
4
  `@n-uf/motion`: both packages carry the same version, and a release bumps both.
5
5
 
6
+ ## 26.11.52
7
+
8
+ - `./scene`, **a lane's guide and its mark come from one layout** (behavior change in the marks as seen). An
9
+ empty lane's guide before entry came from `lanes()` as seen and its mark after entry from `lanes(…, { spot })`, two
10
+ layouts: an empty top bar's guide was cut at the panel columns that move down once it opens (its mark is not), and the
11
+ corner it shares with an empty rail flipped owner on entry. Now an edge lane empty as seen with one spot (or one
12
+ sliding spot) takes its marks, as seen, in that spot's after-entry layout, the same marks `lanes(…, { spot })` gives it
13
+ once held and clipped to its rect over that layout, solved once per lift; its hit `rect` stays as seen. Where the
14
+ prediction overlaps another lane's marks, `marks` gives the overlap up (to a lane not predicted; between two predicted
15
+ lanes, to the bar), so no two lanes' `marks` overlap; **`Lane.entry`** keeps the prediction whole, each corner its
16
+ own, and **`Lane.corners`** names the lanes it overlaps, so a landing model gives the corner to the lane the pointer
17
+ picks (`@n-uf/motion` reads them). Lanes that hold items keep their marks; a held spot's regions are unchanged;
18
+ `emptyLanes: "edge"` and lanes with several spots (pitched stretches) predict nothing. Host notes: a host that draws
19
+ `lanes()` marks itself sees an empty bar's box over the columns as seen; one that draws the landing model's guides
20
+ gets the corner rule with no change.
21
+
22
+ - `./scene`, **`SceneItem.pushable`: the gap after a run of fixed cells is a stop** (additive). In a title bar whose end
23
+ zone holds fixed cells (a state cell and a page cell, `align: "end"`), a toolbar homed after them ("state page zoom")
24
+ could not be put back once it had left: the cells are the end zone's anchored fixed run, a drop after them pushes them
25
+ inward, and every such place was refused, so `stops()` and `targets()` offered nothing after them. `solve` itself
26
+ accepts the place (`moveTo` at the index after them lands the toolbar there and moves the cells left by its width).
27
+ A fixed item can now declare **`pushable: true`**: the anchored-run protection skips it, so the gap at the end of a run
28
+ of such items is a stop and a target, and a drop there pushes them inward. They keep their order: no gap between two
29
+ `pushable` items is offered, and a `pushable` item followed by an unflagged fixed one (window controls) is still a
30
+ wedge with no place between them. Left out, nothing changes: window controls and every fixed item at an anchor keep
31
+ their place, and row R7-end-zone-anchored-fixed-stay holds. `pushable` is a declaration of the scene like
32
+ `Edge.zoneAccepts`: `readScene` takes it from `base`, `storeScene` never writes it, and a stored one is dropped
33
+ (`item:<id>:pushable`). Host note: mark the cells that may yield; the stop's id is `gap:<edge>:end:<n>` with `n` the
34
+ count of the zone's other members. In the start zone the rule is the mirror ("a movable item dropped beside it, on its
35
+ anchor's side, may push it inward"): a `pushable` item at the edge's start makes the gap before it a stop
36
+ (`gap:<edge>:start:0`), so flag a title only if a toolbar may go before it. New rows R7-end-zone-pushable-put-back and
37
+ R7-end-zone-fixed-without-the-flag-no-gap-after, a test file, and the lab's kit case `kit-pushable-cells-put-back`.
38
+ - `./scene`, **in a held frame every lane's marks follow its edge** (fix). With `options.spot`, every lane takes its
39
+ marks in the held spot's layout, but only the held lane was clipped to its rect over that layout; the others were
40
+ clipped to their rect as seen, so where the drop moves an edge (a column pushed aside by a rail that opens) their
41
+ marks were cut short or lost (a column's joint lines, a rail's head line). In a held frame every lane is now clipped
42
+ to its rect over the spot's layout (`laneRectOver`); its hit `rect` stays as seen.
43
+ - `./scene`, **a turned float takes the new orient's size** (fix, additive). `orient()` (the grip menu's "lay out
44
+ horizontally / vertically") kept the float's rect, so an upright 36 × 107 toolbar turned to a row drew its 88 × 28
45
+ content in the old frame. A float's size is now kept per orient: **`SceneItem.floatSizes`** (`{ row?, column? }`).
46
+ `floatSizeOf(item, orient?, floatOrient?)` gives `floatSizes[orient]`, else the legacy `floatSize` only where `orient`
47
+ is the orient the float is in, else the item's first form's natural size along `orient` (a form that grows keeps
48
+ `DEFAULT_FLOAT_SIZE`). `floatAt` with a rect and a hand `resize` write `floatSizes` for the orient the float is in;
49
+ `orient()` gives the frame the size the new orient draws it at (`solve` draws a first form that does not grow at
50
+ `floatSizeOf`, so a toolbar float given an explicit size keeps it and only one given none fits its content; one that
51
+ grows, a panel's card, stays the float's rect), at the same place and with the same anchor, and
52
+ keeps a growing form's rect for the orient it leaves, so turning there and back gives the same rect and a hand size
53
+ per orient survives. The drag's float target takes the size for the orient it lands in. `storeScene` / `readScene`
54
+ carry `floatSizes` (an entry that isn't a size is dropped, `item:<id>:floatSizes:<orient>`). **Per-orient sizes
55
+ apply to items that declare `floatSizes`; others keep the stored rect** (`declaresFloatSizes`): an item with no
56
+ `floatSizes` is framed exactly as before, a float at its first form at its stored rect, its legacy `floatSize` read
57
+ in any orient and kept as it is by `readScene` and by `floatAt` with no rect, and `orient()` turns it keeping its
58
+ rect, as before. On an item that declares `floatSizes`, a legacy `floatSize` (stored, a base item's, or in memory at
59
+ `floatAt`) is the size for the orient its float is in, and `orient()` gives the frame the new orient's size.
60
+ `floatAt` with a rect and a hand `resize` write `floatSizes`, so an item becomes declared once its size is set by
61
+ one of them. Host notes: **`SceneItem.floatSize` is deprecated**: still read, written into
62
+ `floatSizes` by the scene's own changes as they run, and removed in the next breaking release; read `floatSizes`
63
+ instead. A host that declares no `floatSizes` sees no change: its floats keep their stored rects. A host that
64
+ declares `floatSizes` for one orient and floats the item in the other sees that orient's natural size, not the
65
+ stored rect: declare both. A scene already stored with a float turned before this fix reads as it was stored.
66
+ - `./scene`, **`SceneItemLayout.axis`** (additive). `solve` reports the axis every item lies along, `"row"` or
67
+ `"column"`: a placed item's is its edge's (a bar's items lie along a row, a column's, a rail's and a rail tab's along
68
+ a column, whatever form they took; a toolbar group's icons form is a `row` in a bar), a float's its orient. Hosts read
69
+ it and stop inferring it from `formKind === "icons"`. It is a required field of the layout, so a host that builds a
70
+ `SceneItemLayout` by hand adds it.
71
+ - `./scene/cases`, **the Near guides' rule, as landing rows and a check** (additive). On every frame that shows a Near
72
+ guide of lane L, L holds the pointer (also on its own refused stretch), or L is pending, or the pointer is in open
73
+ space within `NEAR_REACH` (12 px) of L; none shows over a refused place outside L. `nearGuideIssues(row, frames,
74
+ before?, stretchPositions?)` checks it over a row's frames, and a row asks for it with `moving.nearGuides`;
75
+ `moving.guideSwitches` bounds how often the lane whose guides show changes; `end.pending` and `end.landing` read the
76
+ last frame; `LandingCaseFrame.pending` is the landing model's `pending`, which the reference host now reports. Four
77
+ rows, `landing-near-rail-glide`, `landing-near-rail-pending-release`, `landing-near-corner-steady` and
78
+ `landing-near-pending-corner-steady` (inside two lanes that overlap at a corner the pending lane, and its guides,
79
+ never flicker), need `NEAR_SINCE` (`"26.11.52"`): a Near guide shows a lane only where the pointer can enter it
80
+ (`@n-uf/motion`'s `approach.reach` is now 12 px, see its changelog). Host notes: a host on an older library skips the four rows
81
+ (counted by the ratchet); a host that sets a larger `approach.reach` fails the rows that check `nearGuides`, as it
82
+ shows early guides on purpose.
83
+ - `./scene`, **an empty side rail's lane is the band its drop opens** (pinned, no behavior change). `lanes()` already
84
+ gave an empty edge (not drawn) the rect its edge takes once the held item has landed there, one rail wide (21 and
85
+ 30 px), under `emptyLanes: "real"` and `"edge"` alike (`"edge"` changes only the marks, a thin striped strip); a test
86
+ now pins it over a real window and a library window.
87
+ - `./scene`, **a lane's marks lie inside its lane's rect** (fix). An empty top bar's lane stops where it gives way to a
88
+ drawn column, but its marks were laid over the whole band and cut only around drawn edges, so they still ran out to
89
+ the window's edges, over an empty side rail's marks: two lanes' marks overlapped at the corners. Every lane's marks
90
+ are now clipped to its `rect` (a line is kept only if it lies inside), so `settle`'s corner rules, "a lane not drawn
91
+ gives way to a drawn one, and between two not drawn the bar owns the corner", hold as written. The rule is exact: a
92
+ lane's marks lie inside its lane rect in the layout they are drawn in. With `options.spot`, the held spot's lane is
93
+ drawn in that spot's layout (its edge may have moved, a rail starting higher once a bar is left empty), so its marks
94
+ lie inside its rect computed over that layout; its `rect` for the landing model is unchanged. The corner clip is one
95
+ rule for the two: whether and where an empty lane gives way is read from the layout as seen, so a spot held on an
96
+ empty bar (its drop draws the bar, full width) keeps its marks between the drawn rails, where its `rect` stops.
97
+ - `./scene`, **an empty edge's lane gives way to a drawn edge at a corner** (fix). `lanes()` built an empty bar's lane
98
+ (not drawn) as its full edge width over the band its drop would draw, so an empty top bar's lane ran over a drawn
99
+ side rail's top, and a pointer coming down the rail stayed in the bar's lane. The marks already followed "at a corner
100
+ a lane not drawn gives way to a drawn one"; the lane's rect now does too: it is clipped along its axis to stop at the
101
+ drawn edge's side. Only a drawn edge that takes the held item (has a lane for it) and stands across the band's middle
102
+ line cuts: beside a drawn panel column that refuses a toolbar the corner stays the bar's lane. The clip loses no
103
+ landing: the spots' cuts are made over the band whole and then clipped, so the spot the clip falls in starts at the
104
+ clip, a spot whose whole stretch lies on the drawn edge is left out (the pointer there is in that edge's lane), and the
105
+ corner clip makes no zero-length `along` stretch. Between two edges not drawn the corner is unchanged.
106
+ - `./scene`, **`SceneRefusal["reason"]` gains `"too-thick"`** (a contract change for an exhaustive `switch`: add the
107
+ case; a host that treats any other reason like `"no-room"` needs no change). A bar thinner than every form of the
108
+ held item but the » menu's (each sets no cross size and has a `cross.min` over the bar's thickness: a 30 px toolbar
109
+ on a 28 px bar) used to refuse every zone as `"no-room"`, which says the bar is too short. It now refuses them as
110
+ `"too-thick"`, so a host can say the item is thicker than the bar. `"no-room"` is kept for lack of length. One
111
+ thickness test for every edge: a new column's line (against its template's `cross.max`) and a rail stop (against the
112
+ rail's `width`) refuse as `"too-thick"` too, a slot's refused pieces say what its zone says, and the stretch beside a
113
+ lone item is `"own-place"` whichever the zone's refusal for want of room.
114
+ - `./scene/cases`, **the landing rows check the hand rule** (additive: a row's `moving.hand`; a host's `LandingPlay` may
115
+ report its `stretchPositions`). While a lane holds, the landing is the nearest landing in its lane to the pointer
116
+ and lies within `max(48, g / 2 + 6)` px of it (`max(56, g / 2 + 6)` on the frame before a hop), `g` the gap along
117
+ the lane between the facing edges of the two adjacent landings the pointer lies between. The rows `landing-grip-*`,
118
+ `landing-room-*` and `landing-step-down-room` use it instead of the fixed 48/56 px, so a lane with landings far
119
+ apart (a docked item much longer than the held one) holds its bound there: `g` is about its length less the held
120
+ item's, plus a gutter. New exports: `handBound(g, beforeHop?)`, `HAND_TRAIL`, `HAND_TRAIL_BEFORE_HOP`, `HAND_MARGIN`,
121
+ `HAND_FAST`. Every row that passed still passes. Decision record `docs/decisions/0001-the-hand-rule.md`. For the
122
+ nearest clause, landings that overlap or touch the held one (no more than half a pixel apart) count as its place,
123
+ as the checker does and the record and reference now say. A frame in a lane `lanes()` doesn't give for the row is
124
+ held to the floor (`handBound(0)`), its issue naming the lane, instead of going unchecked.
125
+
126
+ ## 26.11.51
127
+
128
+ A stretch is the room the drop makes. Host notes: additive; a host that draws hatches may read their new `givesWay`.
129
+
130
+ - `./scene`, **a neighbor that steps down to make room gives way** (fix). One rule for marks and stretches: when the
131
+ item lands beside a room, a neighbor gives way if it moves away from the room, leaves the lane (the menu, a float)
132
+ or takes a shorter form than it has now. For the marks, "now" is the layout they are drawn in (as seen) when no
133
+ spot is held; with `spot` held it is the layout as seen with the held item lifted (what the window showed before
134
+ this drop), since in the spot's own layout the neighbor is already drawn stepped down: its striped end and
135
+ `givesWay` stay. Stretches compare with the layout as seen with the held item lifted.
136
+ - A free stretch of a bar or a toolbar rail runs from flush after the neighbor before it to flush before the one
137
+ after it **in the forms the drop leaves them in**, not only as seen. Where the room as seen is shorter than the
138
+ item but a drop there steps a neighbor down, the stretch now has its sliding spot (and its pitched spots under
139
+ `"pitched"`, not only its two ends), so the landing stays at the hand across that room; before, it stayed at a
140
+ dock at one end while the pointer crossed the open room. A dock's push of a neighbor that keeps no room for it
141
+ is no room made: that end stays where it is seen. The forms don't depend on the space a dock keeps, so every start
142
+ in the stretch finds them alike, and every start that lands as aimed (within 1 px) is in the range.
143
+ - **No sliding spot is a point; every landing a room offers has a spot.** A stretch with room for the item at a
144
+ single start (its range under a pixel), or shorter than the item, has no sliding spot: that start (flush after the
145
+ neighbor before it) is a plain dock, as a pitched stretch's end gives it, with the plain dock's id and no `slide`
146
+ (`…@<pitches kept>` where a dock between the same neighbors already has that id), `home` where it is the item's own
147
+ place. A spot already landing within 1 px of it (the item's own place, say) stays instead. So under `"free"` every
148
+ landing `"pitched"` offers is reached, by a spot within 1 px or a slide's range, and its box and striped ends come
149
+ from its landing. (Before this, such a stretch could show as a `…@slide` spot with `from` equal to `to`; or, where
150
+ no plain dock landed there, as nothing: no spot, box or hatch.)
151
+ - **The item's own place wins its landing** (fix, both modes): a dock landing a fraction of a pixel before it (on an
152
+ over-subscribed edge) no longer takes its place, so its home spot is listed.
153
+ - **Marks:** a box gets its striped end (`HATCH_END`) at the side of each neighbor that gives way, whether or not the
154
+ room as seen is shorter than the item; where none moves, leaves or steps down, the box is plain. The hatch mark
155
+ carries **`LaneMark.givesWay`**, the neighbor's id (data for hosts and tests; nothing to show). The old fallback for
156
+ short room where neither neighbor moved (a striped end at the neighbor after) is gone: there the item fits by
157
+ taking another form itself, and its box is plain.
158
+ - `./scene/cases`, **`STEP_SINCE`** (`"26.11.51"`) and the landing row `landing-step-down-room`: a toolbar slid at
159
+ 0.3 px/ms over room a neighbor steps down to make stays within 48 px of the pointer (56 on the frame before a hop).
160
+ A host on an older version skips it.
161
+
6
162
  ## 26.11.50
7
163
 
8
164
  Stretch positions. With `@n-uf/motion`'s sliding spots. Host notes: **a contract change**: `stretchPositions` now