@yuneta/gobj-ui 7.27.26 → 7.27.28

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
@@ -3387,27 +3387,54 @@ gobj_send_event(priv.view.tree, "EV_LOAD_TREE", {tree: answer.data}, gobj);
3387
3387
  close_gobj_tree_view(priv.view);
3388
3388
  ```
3389
3389
 
3390
- **The TRACES block.** In a remote tree the popover of a card carries a table:
3391
- one row per level the gobj can trace (its gclass' own, then the global ones),
3392
- a box for **this gobj** and one for **all of the gclass**. A level that is on
3393
- for the gclass or globally shows on and **locked** in the gobj column, with
3394
- where it comes from (`gclass` / `global`): one gobj cannot turn it off. A box
3395
- is an action: the block locks until the host has loaded what the backend says
3396
- next, so a box shows the backend, never the click. **Remove the traces** of the
3397
- gobj, or of the gclass, turns off what that scope holds on its own. The card
3398
- of a gobj that traces anything wears a `traces` badge.
3399
-
3400
- Note what the C runtime does with them: a gclass level is saved by the yuno
3401
- (`trace_levels`) and **survives a restart**; a gobj level is saved too but only
3402
- the gclass and global scopes are re-applied at start up, so it **ends with the
3403
- yuno**. The block says so. The traces go to the yuno's log, not to the
3404
- Developer window.
3405
-
3406
- Consumer i18n keys (every app that mounts the tree): `global`, `this gobj`,
3407
- `all of the gclass`, `remove the traces of this gobj`,
3408
- `remove the traces of the gclass`,
3409
- `gclass traces survive a restart, gobj traces end with the yuno` (plus
3410
- `traces`, `level`, `loading` and `gclass`, which every app has).
3390
+ **TRACES: three scopes, each where it belongs** (7.27.27). The C kernel has
3391
+ two families of levels and three scopes, and the first version of this view
3392
+ mixed them: its popover grouped the kernel's levels under *Global* -- the name
3393
+ of their table in `gobj.c` -- while *global* also marked a level on for the
3394
+ whole yuno, and it offered an *all of the gclass* column on every card while
3395
+ the yuno's own scope could be set nowhere. The kernel's levels (`machine`,
3396
+ `create_delete`, `ev_kw`...) are valid in every scope -- `set-gclass-trace
3397
+ gclass=C_TCP level=machine` is the way to trace one gclass' machine -- and a
3398
+ gclass' own levels in the first two:
3399
+
3400
+ | Scope | Command | Set from |
3401
+ |---|---|---|
3402
+ | this gobj | `set-gobj-trace` | the popover of its card: one box per level |
3403
+ | every gobj of the gclass | `set-gclass-trace` | the gclass viewer the card's GClass button opens: its *trace levels* zone |
3404
+ | the whole yuno | `set-global-trace` | the toolbar's **traces of the yuno**, in the popover |
3405
+
3406
+ A level a wider scope holds is shown on and **locked** in a narrower one,
3407
+ saying which (`C_TCP` / `yuno`): unticking the narrower bit would not stop it.
3408
+ A box is an action: the block locks until the host has loaded what the backend
3409
+ says next, so a box shows the backend, never the click. **Remove the traces**
3410
+ turns off what that scope holds on its own. The card of a gobj that traces
3411
+ anything wears a `traces` badge.
3412
+
3413
+ For the host, it is still one event: `EV_SET_TRACE_LEVEL` with `scope` `"gobj"`,
3414
+ `"gclass"` or `"global"`, after which it reads the tree and the trace info of
3415
+ `gclass` again. The yuno's levels are read with `EV_TRACE_INFO_WANTED` of the
3416
+ ROOT's gclass, whose answer carries them like every other one; for a set of the
3417
+ yuno's scope `gclass` is that root's gclass. The gclass viewer is this view's
3418
+ child and publishes `EV_SET_GCLASS_TRACE {gclass, levels, set}` to it, which
3419
+ goes out as `EV_SET_TRACE_LEVEL {scope: "gclass"}`.
3420
+
3421
+ Note what the C runtime does with them: a gclass or yuno level is saved by the
3422
+ yuno (`trace_levels`) and **survives a restart**. A gobj level survives too
3423
+ when the gobj is a named **service** (SDK 7.27.3+: it is saved under its service
3424
+ name, the only name `set_user_gobj_traces()` can find at start up); any other
3425
+ gobj's level **ends with the yuno**. The card says which of the two its gobj
3426
+ is, and the gclass viewer that the gclass' levels survive. The traces go to the
3427
+ yuno's log, not to the Developer window.
3428
+
3429
+ Consumer i18n keys (every app that mounts the tree): `traces of this gobj`,
3430
+ `kernel levels`, `this gobj`, `the whole yuno`, `all of the gclass`,
3431
+ `on for the whole yuno`, `on for all of the gclass`, `traces of the yuno`,
3432
+ `remove the traces of this gobj`, `remove the traces of the gclass`,
3433
+ `remove the traces of the yuno`, `the yuno's traces survive a restart`,
3434
+ `the traces of a service survive a restart`,
3435
+ `the traces of a gobj that is not a service end with the yuno`,
3436
+ `the traces of a gclass survive a restart` (plus `yuno`, `level`, `loading`
3437
+ and `gclass`, which every app has).
3411
3438
 
3412
3439
  ### The gclass viewer — `yui_gclass_view.js`
3413
3440
 
@@ -3434,7 +3461,12 @@ gclass of a **backend** yuno the host passes the answer of `view-gclass` as
3434
3461
  `opts.current_state` is the state the INSTANCE the reader came from is in. The
3435
3462
  description describes the CLASS and cannot carry it, so the host supplies it —
3436
3463
  the gobj tree passes `node_data.state` — and the machine lights that column.
3437
- Omitted, nothing is lit.
3464
+ Omitted, nothing is lit. `opts.instance_name` names that instance beside its
3465
+ state in the head (`tranger_tracks: ST_IDLE`): a gclass has several, and a
3466
+ state with no name said whose it was to nobody.
3467
+
3468
+ `opts.traces` (`{info, pending}`) says the host can SET this gclass' traces for
3469
+ every gobj of it; see C_YUI_GCLASS below.
3438
3470
 
3439
3471
  `close_gclass_view(handle)` is the host-driven teardown, and the ✕ runs it too:
3440
3472
  the window destroys itself, but the viewer hangs from the HOST, so nothing else
@@ -3453,11 +3485,35 @@ import {register_c_yui_gclass} from "@yuneta/gobj-ui/src/c_yui_gclass.js";
3453
3485
  ```
3454
3486
 
3455
3487
  Attrs: `description` (the document), `gclass_name` (heads the view when the
3456
- document carries no `id`), `current_state`, `view_mode` (`"zones"` | `"raw"`),
3457
- `$container`. Events in: `EV_SET_DESCRIPTION {description, current_state}`,
3458
- `EV_SET_VIEW_MODE {mode}`, `EV_TOGGLE_ZONE {zone}`, `EV_SEARCH {text}`,
3459
- `EV_COPY_ALL`, `EV_LANGUAGE_CHANGED`, `EV_REFRESH`, `EV_SHOW`, `EV_HIDE`. It
3460
- publishes nothing, so hosting it adds no declaration to a host's FSM.
3488
+ document carries no `id`), `current_state`, `instance_name`, `traces`,
3489
+ `view_mode` (`"zones"` | `"raw"`), `$container`. Events in:
3490
+ `EV_SET_DESCRIPTION {description, current_state}`, `EV_SET_VIEW_MODE {mode}`,
3491
+ `EV_TOGGLE_ZONE {zone}`, `EV_SEARCH {text}`, `EV_SHOW_ALL {zone}`,
3492
+ `EV_SET_TRACES {info, pending}`, `EV_COPY_ALL`, `EV_LANGUAGE_CHANGED`,
3493
+ `EV_REFRESH`, `EV_SHOW`, `EV_HIDE`. It publishes `EV_SET_GCLASS_TRACE {gclass,
3494
+ levels, set}` -- only when the host handed it `traces`, which is the host that
3495
+ can set them and declares it (the gobj tree, 7.27.27).
3496
+
3497
+ **The layout** (7.27.27): the head says what the gclass is called, how many
3498
+ gobjs of it there are (`1 instance`, `4 instances`), the instance the reader
3499
+ came from with its state, and the methods it implements as chips. Then the
3500
+ SHORT zones, the machine and the trace levels, side by side when the VIEWER is
3501
+ at least `70rem` wide; then the long tables, attributes and commands, across
3502
+ the whole width with their descriptions visible, each showing 20 entries and a
3503
+ **show all N** button (a search shows every match, capped or not). The width
3504
+ is the VIEWER's, a container query: up to 7.27.26 it was a media query on the
3505
+ screen, so a 720px window on a wide screen got two columns of 330px, and the
3506
+ attributes table scrolled its defaults and descriptions out of sight. The
3507
+ order is new too: C_YUNO's 64 attributes and hundred commands came first and
3508
+ pushed its methods and trace levels 7000px down, beside a machine of two
3509
+ events.
3510
+
3511
+ **Its traces, when `traces` is given** (`{info, pending}`, `info` the four
3512
+ answers `{gclass_levels, global_levels, gclass_on, global_on, error}`): the
3513
+ trace levels zone has one box per level for **every gobj of the gclass**, its
3514
+ own levels and the kernel's; a level the whole yuno traces is locked. A box
3515
+ publishes `EV_SET_GCLASS_TRACE` and locks the zone until `EV_SET_TRACES` hands
3516
+ back what the backend says. Without `traces` the levels are only listed.
3461
3517
 
3462
3518
  `gclass_view_model.js` is where the document becomes the view, and it reads
3463
3519
  **both dialects of it**. The C kernel and the browser registry answer the same
@@ -3494,7 +3550,11 @@ well as 86 commands against one. Two things it says that a JSON dump cannot:
3494
3550
 
3495
3551
  Events declared but handled in no state are OUTPUT events: they leave the
3496
3552
  matrix (one empty row per column says nothing) and are listed under
3497
- *publishes*. The `raw` view keeps the description verbatim — it is the
3553
+ *publishes*, one a row with its flags after it in their own quiet type (as a
3554
+ line of chips, `OUTPUT_EVENT` and `PUBLIC_EVENT` read as two more events). The
3555
+ count of the zone says what it counts, `1 state · 2 events`, and the legend
3556
+ draws only what is on screen: the hatch when an empty cell is drawn, and the
3557
+ mark of an action the backend does not name when there is one. The `raw` view keeps the description verbatim — it is the
3498
3558
  authoritative answer of the backend and is never thrown away.
3499
3559
 
3500
3560
  ### C_YUI_FSM_GRAPH — the machine, drawn
@@ -3503,8 +3563,8 @@ The machine zone's second view, switched from a pair of buttons inside the
3503
3563
  zone (the zone heading is itself a button, and a button inside a button is not
3504
3564
  a control). The matrix stays the default; the graph earns its place where the
3505
3565
  matrix is worst — many states, few events each — and in graph mode the machine
3506
- takes the whole width and the other zones stack under it, because 600px of a
3507
- 1200px viewer is where six states stop fitting.
3566
+ takes the whole width and its pair, the trace levels, goes under it, because
3567
+ half of a viewer is where six states stop fitting.
3508
3568
 
3509
3569
  Attrs: `fsm` (the `fsm` block of the view model), `current_state`,
3510
3570
  `$container`, `canvas_id`, `wide`, `layout` (`dagre-lr` | `dagre-tb`). Events