@yuneta/gobj-ui 7.27.26 → 7.27.27

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,50 @@ 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
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 is saved too but
3423
+ only the gclass and global scopes are re-applied at start up, so it **ends with
3424
+ the yuno**. The blocks say so. The traces go to the yuno's log, not to the
3404
3425
  Developer window.
3405
3426
 
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`,
3427
+ Consumer i18n keys (every app that mounts the tree): `traces of this gobj`,
3428
+ `kernel levels`, `this gobj`, `the whole yuno`, `all of the gclass`,
3429
+ `on for the whole yuno`, `on for all of the gclass`, `traces of the yuno`,
3430
+ `remove the traces of this gobj`, `remove the traces of the gclass`,
3431
+ `remove the traces of the yuno`, `the yuno's traces survive a restart`,
3409
3432
  `gclass traces survive a restart, gobj traces end with the yuno` (plus
3410
- `traces`, `level`, `loading` and `gclass`, which every app has).
3433
+ `yuno`, `level`, `loading` and `gclass`, which every app has).
3411
3434
 
3412
3435
  ### The gclass viewer — `yui_gclass_view.js`
3413
3436
 
@@ -3434,7 +3457,12 @@ gclass of a **backend** yuno the host passes the answer of `view-gclass` as
3434
3457
  `opts.current_state` is the state the INSTANCE the reader came from is in. The
3435
3458
  description describes the CLASS and cannot carry it, so the host supplies it —
3436
3459
  the gobj tree passes `node_data.state` — and the machine lights that column.
3437
- Omitted, nothing is lit.
3460
+ Omitted, nothing is lit. `opts.instance_name` names that instance beside its
3461
+ state in the head (`tranger_tracks: ST_IDLE`): a gclass has several, and a
3462
+ state with no name said whose it was to nobody.
3463
+
3464
+ `opts.traces` (`{info, pending}`) says the host can SET this gclass' traces for
3465
+ every gobj of it; see C_YUI_GCLASS below.
3438
3466
 
3439
3467
  `close_gclass_view(handle)` is the host-driven teardown, and the ✕ runs it too:
3440
3468
  the window destroys itself, but the viewer hangs from the HOST, so nothing else
@@ -3453,11 +3481,35 @@ import {register_c_yui_gclass} from "@yuneta/gobj-ui/src/c_yui_gclass.js";
3453
3481
  ```
3454
3482
 
3455
3483
  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.
3484
+ document carries no `id`), `current_state`, `instance_name`, `traces`,
3485
+ `view_mode` (`"zones"` | `"raw"`), `$container`. Events in:
3486
+ `EV_SET_DESCRIPTION {description, current_state}`, `EV_SET_VIEW_MODE {mode}`,
3487
+ `EV_TOGGLE_ZONE {zone}`, `EV_SEARCH {text}`, `EV_SHOW_ALL {zone}`,
3488
+ `EV_SET_TRACES {info, pending}`, `EV_COPY_ALL`, `EV_LANGUAGE_CHANGED`,
3489
+ `EV_REFRESH`, `EV_SHOW`, `EV_HIDE`. It publishes `EV_SET_GCLASS_TRACE {gclass,
3490
+ levels, set}` -- only when the host handed it `traces`, which is the host that
3491
+ can set them and declares it (the gobj tree, 7.27.27).
3492
+
3493
+ **The layout** (7.27.27): the head says what the gclass is called, how many
3494
+ gobjs of it there are (`1 instance`, `4 instances`), the instance the reader
3495
+ came from with its state, and the methods it implements as chips. Then the
3496
+ SHORT zones, the machine and the trace levels, side by side when the VIEWER is
3497
+ at least `70rem` wide; then the long tables, attributes and commands, across
3498
+ the whole width with their descriptions visible, each showing 20 entries and a
3499
+ **show all N** button (a search shows every match, capped or not). The width
3500
+ is the VIEWER's, a container query: up to 7.27.26 it was a media query on the
3501
+ screen, so a 720px window on a wide screen got two columns of 330px, and the
3502
+ attributes table scrolled its defaults and descriptions out of sight. The
3503
+ order is new too: C_YUNO's 64 attributes and hundred commands came first and
3504
+ pushed its methods and trace levels 7000px down, beside a machine of two
3505
+ events.
3506
+
3507
+ **Its traces, when `traces` is given** (`{info, pending}`, `info` the four
3508
+ answers `{gclass_levels, global_levels, gclass_on, global_on, error}`): the
3509
+ trace levels zone has one box per level for **every gobj of the gclass**, its
3510
+ own levels and the kernel's; a level the whole yuno traces is locked. A box
3511
+ publishes `EV_SET_GCLASS_TRACE` and locks the zone until `EV_SET_TRACES` hands
3512
+ back what the backend says. Without `traces` the levels are only listed.
3461
3513
 
3462
3514
  `gclass_view_model.js` is where the document becomes the view, and it reads
3463
3515
  **both dialects of it**. The C kernel and the browser registry answer the same
@@ -3494,7 +3546,11 @@ well as 86 commands against one. Two things it says that a JSON dump cannot:
3494
3546
 
3495
3547
  Events declared but handled in no state are OUTPUT events: they leave the
3496
3548
  matrix (one empty row per column says nothing) and are listed under
3497
- *publishes*. The `raw` view keeps the description verbatim — it is the
3549
+ *publishes*, one a row with its flags after it in their own quiet type (as a
3550
+ line of chips, `OUTPUT_EVENT` and `PUBLIC_EVENT` read as two more events). The
3551
+ count of the zone says what it counts, `1 state · 2 events`, and the legend
3552
+ draws only what is on screen: the hatch when an empty cell is drawn, and the
3553
+ mark of an action the backend does not name when there is one. The `raw` view keeps the description verbatim — it is the
3498
3554
  authoritative answer of the backend and is never thrown away.
3499
3555
 
3500
3556
  ### C_YUI_FSM_GRAPH — the machine, drawn
@@ -3503,8 +3559,8 @@ The machine zone's second view, switched from a pair of buttons inside the
3503
3559
  zone (the zone heading is itself a button, and a button inside a button is not
3504
3560
  a control). The matrix stays the default; the graph earns its place where the
3505
3561
  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.
3562
+ takes the whole width and its pair, the trace levels, goes under it, because
3563
+ half of a viewer is where six states stop fitting.
3508
3564
 
3509
3565
  Attrs: `fsm` (the `fsm` block of the view model), `current_state`,
3510
3566
  `$container`, `canvas_id`, `wide`, `layout` (`dagre-lr` | `dagre-tb`). Events