@yuneta/gobj-ui 7.25.8 → 7.25.10

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/README.md CHANGED
@@ -2077,9 +2077,13 @@ that makes the schema file win over the literal), once, and puts it in use with
2077
2077
  `apply-schema` and a restart of the owning yuno. Until 7.23.195 every write
2078
2078
  here raised both numbers, so an edit half made was already the schema of the
2079
2079
  next start. The topic list marks what this session wrote and has not saved,
2080
- and the column screen says so in a banner; the host sends `EV_REFRESH` after a
2081
- save, and the reload forgets the drafts. The export (C literal and JSON) warns
2082
- while there are drafts: the literal carries the versions a save publishes.
2080
+ and the column screen says so in a banner; an `EV_REFRESH` -- the view's own
2081
+ Refresh button, or a host that sends one after a save -- forgets the drafts this
2082
+ session wrote, and the host's `EV_DRAFTS` replaces what it said before. The
2083
+ export (C literal and JSON) warns while there are drafts: the literal carries
2084
+ the versions a save publishes. Its two views are two named buttons (`schema as
2085
+ c source`, `schema as json`, i18n keys the consumer's locales carry), the one
2086
+ shown pressed.
2083
2087
 
2084
2088
  **A draft survives a reload** (7.25.3). The mark of a write lived in the
2085
2089
  session's memory only, so a reload of the page, a reconnect or a refresh of
@@ -2182,18 +2186,69 @@ else.
2182
2186
  `ST_LOADING` declares none of a screen's actions. A **dialog** left open is
2183
2187
  the one thing still reachable: its Save (`EV_SAVE_COLUMN`, `EV_SAVE_TOPIC`),
2184
2188
  a confirmation (`EV_CONFIRMED`), an orphan delete or an import is refused
2185
- with `the schemas are loading: try again when they are in` (an i18n key the
2186
- consumer's locales carry) and the dialog stays open with what was typed, so
2187
- the same Save works once the load is in. A write that ends with an error --
2188
- a drop included -- still applies a position that waited, as a load does.
2189
- Out of session a load is not asked at all (no *"not in session"* errors);
2190
- the reconnect loads.
2189
+ with `the schemas are loading: wait for them` (7.25.9; an i18n key the
2190
+ consumer's locales carry). A write that ends with an error -- a drop
2191
+ included -- still applies a position that waited, as a load does. Out of
2192
+ session a load is not asked at all (no *"not in session"* errors); the
2193
+ reconnect loads.
2194
+ - **A dialog is built on ONE model, and a load that replaces it closes it**
2195
+ (7.25.9). Every load that lands bumps `model_gen`; a dialog records the one
2196
+ it was opened on, and its Save, its import Preview/Run, an orphan delete and
2197
+ a confirmation carry it in their kw. When a load lands under a dialog of an
2198
+ older model, the dialog is closed and the operator told
2199
+ `the schemas were read again: open the dialog again`; anything stamped with
2200
+ a replaced model that arrives anyway is refused with the same words. A
2201
+ column form sends every field it shows, so its Save after a reload wrote
2202
+ the OLD record over the newer one -- 7.25.8 told the operator to "try
2203
+ again", which did exactly that. The import plan is forgotten when a load
2204
+ LEAVES (7.25.10: one that could not be sent keeps it), and a Yes that finds
2205
+ it gone is said (`the import plan is gone: preview it again`). A load that
2206
+ failed or never left replaced nothing, and the dialog stays with what was
2207
+ typed. A confirmation is a shell modal and outlives a load: its Yes in
2208
+ `ST_EMPTY` or `ST_IDLE` is refused with the same words, not *"NOT
2209
+ DEFINED"* (7.25.10).
2210
+
2211
+ ```js
2212
+ gobj_send_event(editor, "EV_EDIT_COLUMN", {col: "id"}, host); // form, model_gen N
2213
+ gobj_send_event(editor, "EV_REFRESH", {}, host); // Save -> "wait for them"
2214
+ // ... the load lands (model_gen N+1): the form closes, the operator reopens it
2215
+ ```
2216
+ - **A load refused IN session keeps the model it was replacing** (7.25.9): a
2217
+ routing adapter's deadline on a slow `nodes` answers -1 while the session
2218
+ is up. The records are put back, the screen and any open dialog stay, and
2219
+ the operator is told
2220
+ `cannot read the schemas again: the ones shown may be out of date, your next change reads them first`.
2221
+ **The owed reload runs on the operator's next action** (7.25.10; before, it
2222
+ waited for a reconnect that never came while the session stayed up, and a
2223
+ form opened on the old model wrote over the newer record): an edit -- a
2224
+ form, a Save, a delete, a drag, a confirmation, Check, Export, Import, the
2225
+ orphans -- is refused with
2226
+ `the schemas shown may be out of date: they are read again, try again when they are in`
2227
+ and the model is read again (keeping the draft chips); a move goes where it
2228
+ was going and reads there. Not at once and not on a timer: a load refused
2229
+ on a deadline asked again at once is refused the same way, and one asked
2230
+ on a clock is polling. A Refresh asked while a load is in flight keeps the
2231
+ records of the model shown (7.25.10), not the half the first load got.
2232
+ Only a first load, with no model before it, ends on the empty screen.
2233
+
2234
+ ```js
2235
+ // the load failed in session: model kept, reload owed
2236
+ gobj_send_event(editor, "EV_EDIT_COLUMN", {col: "id"}, host); // refused, said; ST_LOADING
2237
+ // ... the load lands: the same click now opens the form
2238
+ ``` A write answered with no record reloads the model and
2239
+ says what it did not send after it
2240
+ (`the treedb did not describe a write back: the writes after it were not sent`).
2241
+ - The toolbar offers Diagram, Check, Export, Import, New topic and New column
2242
+ only when the treedb (or topic) the position names is IN the model; after a
2243
+ reload that no longer has it, Back and Refresh remain.
2191
2244
  - A write this view gave up on (a drop, a deadline) whose answer still says it
2192
2245
  was DONE makes the editor read the model again (at once, after the write in
2193
2246
  flight, or on the reconnect), and it is a write for the host too: it
2194
2247
  publishes `EV_RECORD_WRITTEN` and marks the topic of the record answered.
2195
- Only the host's `EV_REFRESH` (a Save sends it) forgets what this session
2196
- wrote; the reloads the editor asks itself (the reconnect's, a late write's)
2248
+ Only `EV_REFRESH` forgets what this session wrote -- the view's own Refresh
2249
+ button sends it, and a host may after a Save (the agent console does not:
2250
+ there the chips of this session stay until Refresh); the reloads the editor
2251
+ asks itself (the reconnect's, a late write's, the one a refused load owed)
2197
2252
  keep the draft chips. Through a routing adapter that settled the
2198
2253
  write on its OWN deadline the late answer does not reach the view -- the
2199
2254
  adapter echoes a node event instead, which this view does not hear -- and
@@ -3142,7 +3197,12 @@ a modal
3142
3197
  `MODAL` / `MODAL_BACKDROP` / `MODAL_CONTENT` / `MODAL_HEADER` / `MODAL_BACK` /
3143
3198
  `MODAL_TITLE` (+ `MODAL_TITLE_PREFIX` / `MODAL_TITLE_KIND`) / `MODAL_CLOSE` /
3144
3199
  `MODAL_BODY`, a confirm `CONFIRM*` and a toast
3145
- `TOAST*`.
3200
+ `TOAST*`. Every button of that chrome -- each ✕, a dialog's back arrow, a
3201
+ confirmation's answers (`CONFIRM_BTN`) -- carries a translatable `title` and
3202
+ `aria-label` (7.25.10). An answer is named by its own label, so pass i18n
3203
+ KEYS as `yes_label` / `confirm_label` / … (`{yes_label: "install"}`): the
3204
+ defaults (`"Yes"`, `"Delete"`) are not lower-case and no validated locale
3205
+ can hold them.
3146
3206
 
3147
3207
  Those names identify the *kind* of block, not the *instance*: every window in
3148
3208
  the app is a `C_YUI_WINDOW`, every popup is a `MODAL`. To target **one**