@yuneta/gobj-ui 7.25.7 → 7.25.9

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
@@ -2177,9 +2177,52 @@ else.
2177
2177
  gobj_send_event(editor, "EV_SHOW", {subpath: "db"}, host); // waits
2178
2178
  // ... the three `nodes` answers land -> ST_TOPICS of `db`
2179
2179
  ```
2180
+ - **The loading screen is drawn** (7.25.8): the body is cleared, the drawing
2181
+ destroyed and every toolbar button disabled, as in `ST_SAVING`, because
2182
+ `ST_LOADING` declares none of a screen's actions. A **dialog** left open is
2183
+ the one thing still reachable: its Save (`EV_SAVE_COLUMN`, `EV_SAVE_TOPIC`),
2184
+ a confirmation (`EV_CONFIRMED`), an orphan delete or an import is refused
2185
+ with `the schemas are loading: wait for them` (7.25.9; an i18n key the
2186
+ consumer's locales carry). A write that ends with an error -- a drop
2187
+ included -- still applies a position that waited, as a load does. Out of
2188
+ session a load is not asked at all (no *"not in session"* errors); the
2189
+ reconnect loads.
2190
+ - **A dialog is built on ONE model, and a load that replaces it closes it**
2191
+ (7.25.9). Every load that lands bumps `model_gen`; a dialog records the one
2192
+ it was opened on, and its Save, its import Preview/Run, an orphan delete and
2193
+ a confirmation carry it in their kw. When a load lands under a dialog of an
2194
+ older model, the dialog is closed and the operator told
2195
+ `the schemas were read again: open the dialog again`; anything stamped with
2196
+ a replaced model that arrives anyway is refused with the same words. A
2197
+ column form sends every field it shows, so its Save after a reload wrote
2198
+ the OLD record over the newer one -- 7.25.8 told the operator to "try
2199
+ again", which did exactly that. The import plan is forgotten when a load
2200
+ starts. A load that failed or never left replaced nothing, and the dialog
2201
+ stays with what was typed.
2202
+
2203
+ ```js
2204
+ gobj_send_event(editor, "EV_EDIT_COLUMN", {col: "id"}, host); // form, model_gen N
2205
+ gobj_send_event(editor, "EV_REFRESH", {}, host); // Save -> "wait for them"
2206
+ // ... the load lands (model_gen N+1): the form closes, the operator reopens it
2207
+ ```
2208
+ - **A load refused IN session keeps the model it was replacing** (7.25.9): a
2209
+ routing adapter's deadline on a slow `nodes` answers -1 while the session
2210
+ is up. The records are put back, the screen and any open dialog stay, the
2211
+ operator is told `cannot read the schemas again: the previous ones stay`,
2212
+ and the reload is owed. Only a first load, with no model before it, ends
2213
+ on the empty screen. A write answered with no record reloads the model and
2214
+ says what it did not send after it
2215
+ (`the treedb did not describe a write back: the writes after it were not sent`).
2216
+ - The toolbar offers Diagram, Check, Export, Import, New topic and New column
2217
+ only when the treedb (or topic) the position names is IN the model; after a
2218
+ reload that no longer has it, Back and Refresh remain.
2180
2219
  - A write this view gave up on (a drop, a deadline) whose answer still says it
2181
2220
  was DONE makes the editor read the model again (at once, after the write in
2182
- flight, or on the reconnect). Through a routing adapter that settled the
2221
+ flight, or on the reconnect), and it is a write for the host too: it
2222
+ publishes `EV_RECORD_WRITTEN` and marks the topic of the record answered.
2223
+ Only the host's `EV_REFRESH` (a Save sends it) forgets what this session
2224
+ wrote; the reloads the editor asks itself (the reconnect's, a late write's)
2225
+ keep the draft chips. Through a routing adapter that settled the
2183
2226
  write on its OWN deadline the late answer does not reach the view -- the
2184
2227
  adapter echoes a node event instead, which this view does not hear -- and
2185
2228
  Refresh is what reads the store.
@@ -2614,6 +2657,22 @@ live region it is both read and announced when it changes.
2614
2657
  > long time and nothing ever rendered it; the claim is gone. Implement it there
2615
2658
  > the day a menu entry needs one.
2616
2659
 
2660
+ ### Toasts — `yui_shell_show_info` / `_warning` / `_error`
2661
+
2662
+ `yui_shell_show_error(shell, "key", {t, timeout})` shows a non-blocking toast
2663
+ (5000 ms by default, `timeout: 0` = until closed) and returns `{close()}`. A
2664
+ string message of the same kind as a toast still on screen is not stacked
2665
+ under it -- there is ONE toast per message -- but each call is a caller of its
2666
+ own: it gets its own handle and its own time, and the toast goes when every
2667
+ caller has closed its handle or timed out (7.25.8). The ✕ closes it for all.
2668
+
2669
+ ```js
2670
+ const a = yui_shell_show_error(shell, "the connection dropped", {t}); // 5 s
2671
+ const b = yui_shell_show_error(shell, "the connection dropped", {t, timeout: 0}); // same toast
2672
+ a.close(); // still shown: b holds it
2673
+ b.close(); // gone
2674
+ ```
2675
+
2617
2676
  ### Modals — `yui_shell_show_modal` and the `before_close` veto
2618
2677
 
2619
2678
  `yui_shell_show_modal(shell, $box, opts)` is the standard popup: pass