@jsenv/navi 0.29.88 → 0.29.90
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 +309 -57
- package/dist/jsenv_navi.js.map +21 -8
- package/docs/AI_INSTRUCTIONS.md +15 -0
- package/docs/control_object.md +38 -1
- package/package.json +1 -1
package/docs/AI_INSTRUCTIONS.md
CHANGED
|
@@ -149,6 +149,21 @@ consistency across the app, not from any single call site.
|
|
|
149
149
|
and what a nameless one merges, and what a `<Picker type="object">` needs in
|
|
150
150
|
its popup (one group, not two controls). Read it before making one value out
|
|
151
151
|
of several controls, and before putting anything in a picker popup.
|
|
152
|
+
- A time of day, and a span between two of them, come as a pair of components
|
|
153
|
+
and the choice between them is about the GESTURE:
|
|
154
|
+
`TimeSpin`/`TimeRangeSpin` (`src/control/picker/preset/spin_time.jsx`) are
|
|
155
|
+
fields one types in, and `TimeWheel`/`TimeRangeWheel`
|
|
156
|
+
(`src/control/wheel/wheel_time.jsx`) are wheels one turns. Both carry a single
|
|
157
|
+
`"HH:MM"` (or `{ start, end }` for a span), so a form holds one field either
|
|
158
|
+
way. Prefer the wheels whenever a half-written value would be nonsense — a
|
|
159
|
+
time typed digit by digit goes through states that are not times ("1" on its
|
|
160
|
+
way to "18"), each of them bounded and corrected under the fingers, while a
|
|
161
|
+
wheel only ever shows values that exist. Two things only the wheels have:
|
|
162
|
+
the bounds of a span PUSH each other while they turn (`minDuration`) instead
|
|
163
|
+
of being refused at send, and `placeholder` is a position shown without being
|
|
164
|
+
an answer — for a span that is optional ("any time of day") on wheels that
|
|
165
|
+
have no blank row to land on. Read this before writing a time input, and
|
|
166
|
+
before making a pair of wheels say "nothing set" by hand.
|
|
152
167
|
- `docs/control_group.md` — `<Group>`: several controls reading as one framed
|
|
153
168
|
object (one border per seam, radius on the outer corners only). Read it
|
|
154
169
|
before placing bordered controls against each other, and before writing
|
package/docs/control_object.md
CHANGED
|
@@ -11,6 +11,7 @@ whose value is an object needs in its popup.
|
|
|
11
11
|
- [`<Form>`: the shape, plus a send](#form-the-shape-plus-a-send)
|
|
12
12
|
- [Naming, and what a nameless group does](#naming-and-what-a-nameless-group-does)
|
|
13
13
|
- [A picker whose value is an object](#a-picker-whose-value-is-an-object)
|
|
14
|
+
- [A group holds what it was given](#a-group-holds-what-it-was-given)
|
|
14
15
|
- [One line, one key](#one-line-one-key)
|
|
15
16
|
- [A settings sheet](#a-settings-sheet)
|
|
16
17
|
- [`Group` is not `ControlGroup`](#group-is-not-controlgroup)
|
|
@@ -117,7 +118,9 @@ Two things to get right:
|
|
|
117
118
|
- **A control that helps FIND the answer is not the answer.** A search box above
|
|
118
119
|
a long list, a "select all" beside it: they are tools, and a tool says so with
|
|
119
120
|
`allowNameless`. The picker then walks past it and talks to the list, which is
|
|
120
|
-
what a popup made of one choice and the means to reach it needs.
|
|
121
|
+
what a popup made of one choice and the means to reach it needs. Never put it
|
|
122
|
+
on the control that IS the value — the picker would have nobody left to fill,
|
|
123
|
+
and the popup would open blank on a value it holds (navi says so in dev).
|
|
121
124
|
|
|
122
125
|
```jsx
|
|
123
126
|
<Picker name="place_ids" type="array">
|
|
@@ -128,6 +131,40 @@ Two things to get right:
|
|
|
128
131
|
</Picker>
|
|
129
132
|
```
|
|
130
133
|
|
|
134
|
+
## A group holds what it was given
|
|
135
|
+
|
|
136
|
+
A group's value looks like it is made of its children, and mostly it is — but
|
|
137
|
+
the two are not the same thing, and the difference shows the moment the children
|
|
138
|
+
are not all there yet:
|
|
139
|
+
|
|
140
|
+
- a group **told** a value holds it whole, before any child has registered to
|
|
141
|
+
show it. A list whose items are still loading, a popup built at open, a row
|
|
142
|
+
scrolled out of a virtualized list — none of them make the value smaller;
|
|
143
|
+
- **a child mounting or unmounting is not somebody answering.** While children
|
|
144
|
+
are arriving, their aggregate is a partial reading; a group takes it for its
|
|
145
|
+
own value only once it has derived that value itself (nobody handed it one),
|
|
146
|
+
or once a child really acts;
|
|
147
|
+
- a child arriving **after** the value did is placed from what the group holds,
|
|
148
|
+
so it shows its part of it. A child arriving with something of its own to show
|
|
149
|
+
is answering, and keeps it. A child bound to a `signal` is placed like any
|
|
150
|
+
other — bound is not frozen — and the placement writes the signal, so an
|
|
151
|
+
`<Input type="hidden" signal>` carrying a piece of the answer shows what the
|
|
152
|
+
group holds. Only a child controlled by a `value`/`checked` prop is left
|
|
153
|
+
alone: its owner decides.
|
|
154
|
+
|
|
155
|
+
A group with an `aggregateChildStates` of its own is outside all of this: what
|
|
156
|
+
it returns is taken as the truth, `undefined` included. That is the one way such
|
|
157
|
+
a group says **"I have nothing to say yet"** — return `undefined` while the
|
|
158
|
+
children it needs are missing, and navi leaves the value alone instead of
|
|
159
|
+
publishing an empty shape upward. A group written to always return its keys
|
|
160
|
+
(`{ mode: undefined, levels: [] }`) is claiming an answer nobody gave, and that
|
|
161
|
+
claim overwrites the row above it the moment the popup opens.
|
|
162
|
+
|
|
163
|
+
Together they are what makes the two-hop case work — the form fills the row, the
|
|
164
|
+
row fills the control in its popup — whatever order the pieces turn up in. Get
|
|
165
|
+
one of them wrong and the symptom is always the same: a value that was there
|
|
166
|
+
before the popup opened, and empty after.
|
|
167
|
+
|
|
131
168
|
## One line, one key
|
|
132
169
|
|
|
133
170
|
A row that opens a popup is one control, so what it answers arrives under its
|