@jsenv/navi 0.29.115 → 0.29.117
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/dist/jsenv_navi.js +115 -35
- package/dist/jsenv_navi.js.map +15 -6
- package/docs/AI_INSTRUCTIONS.md +3 -3
- package/docs/control_value.md +43 -0
- package/package.json +1 -1
package/docs/AI_INSTRUCTIONS.md
CHANGED
|
@@ -149,9 +149,9 @@ consistency across the app, not from any single call site.
|
|
|
149
149
|
and why `value` and `signal` cannot both be passed. It also holds the answer
|
|
150
150
|
to "a shortcut button beside a control" — `--navi-update`, gated like every
|
|
151
151
|
interaction, against an `onClick` writing the signal, which is not and fires
|
|
152
|
-
on a read-only control
|
|
153
|
-
|
|
154
|
-
that proposes a value.
|
|
152
|
+
on a read-only control — and `--navi-update:smooth`, the control seen moving
|
|
153
|
+
to the value it was given. Read it before wiring a control's value by hand
|
|
154
|
+
with `value` + `uiAction`, and before writing a button that proposes a value.
|
|
155
155
|
- `docs/create_and_edit.md` — the loop almost every app has: a screen that
|
|
156
156
|
creates a resource, the page of what was created, a screen that edits it. The
|
|
157
157
|
routes and why several match at once, one form for two modes, filling the edit
|
package/docs/control_value.md
CHANGED
|
@@ -7,6 +7,7 @@ somewhere else in the app.
|
|
|
7
7
|
- [The three answers](#the-three-answers)
|
|
8
8
|
- [A bound signal works in both directions](#a-bound-signal-works-in-both-directions)
|
|
9
9
|
- [A button that proposes a value is `--navi-update`](#a-button-that-proposes-a-value-is---navi-update)
|
|
10
|
+
- [`--navi-update:smooth`: the control is seen answering](#--navi-updatesmooth-the-control-is-seen-answering)
|
|
10
11
|
- [`signal` + `defaultValue`: the answer and where it starts](#signal--defaultvalue-the-answer-and-where-it-starts)
|
|
11
12
|
- [What a signal holds, control by control](#what-a-signal-holds-control-by-control)
|
|
12
13
|
- [Empty keeps the shape of the question](#empty-keeps-the-shape-of-the-question)
|
|
@@ -127,6 +128,48 @@ the command finds an element that holds no value; navi says so in dev rather
|
|
|
127
128
|
than letting the press do nothing at all. An id that matches nothing is a dev
|
|
128
129
|
warning too, naming the id it looked for.
|
|
129
130
|
|
|
131
|
+
### `--navi-update:smooth`: the control is seen answering
|
|
132
|
+
|
|
133
|
+
A shortcut sets the value at once, and on a phone the thumb covers the button
|
|
134
|
+
while the eye is on the control: with two wheels above four shortcuts, « soir »
|
|
135
|
+
swaps the digits and nothing shows which wheel changed, or by how much. The
|
|
136
|
+
control should be the thing that answers — seen moving to the value the way it
|
|
137
|
+
moves under a finger.
|
|
138
|
+
|
|
139
|
+
That is what the `:smooth` argument asks for:
|
|
140
|
+
|
|
141
|
+
```jsx
|
|
142
|
+
<Button command="--navi-update:smooth" commandFor={hoursId} value={evening}>
|
|
143
|
+
soir
|
|
144
|
+
</Button>
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
- **The value is set immediately, whatever moves on screen.** Whoever reads
|
|
148
|
+
the control right after the press (a form, `--navi-send`, a signal) gets the
|
|
149
|
+
new value; only the drawing takes its time. A control never lies about its
|
|
150
|
+
state to look like it is still travelling.
|
|
151
|
+
- **The control decides how it moves.** The argument says nothing about
|
|
152
|
+
pixels or duration: a wheel scrolls to the row the way it glides after an
|
|
153
|
+
arrow key, the short way round when it loops; a slider would slide its
|
|
154
|
+
thumb; a control with nothing to move sets its value and that is all. A
|
|
155
|
+
control that does not know the argument is not broken — it answers like a
|
|
156
|
+
plain `--navi-update`.
|
|
157
|
+
- **A gesture on the control itself is never fought.** A wheel being dragged
|
|
158
|
+
or flung keeps reporting its own rows; the requested value is where it goes
|
|
159
|
+
once the finger's movement is over. And a value the control did not choose
|
|
160
|
+
is not a choice: arriving on it fires no settle, no `action` — those belong
|
|
161
|
+
to the user's own inputs.
|
|
162
|
+
- **`prefers-reduced-motion` keeps the instant swap.** The option describes
|
|
163
|
+
how the change is shown, and whoever asked to see less motion is answered
|
|
164
|
+
first.
|
|
165
|
+
|
|
166
|
+
The same request is available from JS, for what is not a button —
|
|
167
|
+
`dispatchRequestSetUIState(el, value, { behavior: "smooth" })` — and it
|
|
168
|
+
survives a group: sent to a `TimeRangeWheel`, it reaches each of its wheels.
|
|
169
|
+
|
|
170
|
+
_Reference: the wheel (`wheel.jsx`, `pendingBehaviorRef`) is the control
|
|
171
|
+
honouring it today._
|
|
172
|
+
|
|
130
173
|
## `signal` + `defaultValue`: the answer and where it starts
|
|
131
174
|
|
|
132
175
|
They are not competing, they answer two different questions:
|