@yuneta/gobj-ui 7.27.25 → 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
@@ -3292,7 +3292,7 @@ because opening a popover per node to learn it is not reading a tree:
3292
3292
  | On the card | Says |
3293
3293
  |---|---|
3294
3294
  | Colour (border + left bar) | the ROLE: sky = the yuno, emerald = a service, amber = a pure child, pink = a volatil one, violet = a plain child |
3295
- | Status pill | a SYMBOL and, where there is room, the word: `▶` playing, `‖` running but not playing (PAUSED, which is what the popover calls it in full), `■` stopped, `⊘` disabled. The symbol and not only a colour, because a dot has one shape and stopped is the state that has to be seen |
3295
+ | Status pill | a SYMBOL and, where there is room, the word: `▶` playing, `‖` running but not playing (PAUSED, which is what the popover calls it in full), `●` running in green for a gobj whose gclass has neither `mt_play` nor `mt_pause` (nothing to play, so not paused: the descriptor's `play_methods`, which a backend answers from the SDK after 7.27.1 and which reads as unknown, so paused, before it), `■` stopped, `⊘` disabled. The symbol and not only a colour, because a dot has one shape and stopped is the state that has to be seen |
3296
3296
  | Badges | `service`, `pure child`, `volatil child`, `disabled`, `bottom` (it has a bottom gobj), `commands` (its gclass exposes commands) |
3297
3297
  | Its own line | the FSM state |
3298
3298
  | Dashed border, dimmed | disabled — that branch is out of the game |
@@ -3354,7 +3354,15 @@ and it declares the four output events in its FSM:
3354
3354
  | in | `EV_GCLASS_DESCRIPTION` | `{gclass, description}` | — opens the gclass viewer on that description |
3355
3355
 
3356
3356
  The host loads the **first** tree itself (it opened the view); after that the
3357
- view asks only on Refresh. A local tree publishes none of these, so the
3357
+ view asks only on Refresh. Ask `view-gobj-tree` for the fields the view reads,
3358
+ by name (`options=[...]`): its default leaves out `gclass` and `fullname`, and
3359
+ `play_methods` is what keeps a gobj with nothing to play from reading paused.
3360
+
3361
+ **A minimap** appears from `minimap_min_nodes` cards on (default `20`, `0`
3362
+ never), in either source. The tree opens at actual size rather than fitted, so
3363
+ a reader is past its edge sooner than in the treedb graph (`30`). Its frame and
3364
+ anchor are the treedb graph's, shared in `yui_graph_minimap.js`; its blocks
3365
+ wear their card's role colour. A local tree publishes none of these, so the
3358
3366
  Frontend view and every existing host declare nothing new.
3359
3367
 
3360
3368
  `open_gobj_tree_view()` (`yui_gobj_tree_view.js`) opens such a tree in a window
@@ -3379,27 +3387,50 @@ gobj_send_event(priv.view.tree, "EV_LOAD_TREE", {tree: answer.data}, gobj);
3379
3387
  close_gobj_tree_view(priv.view);
3380
3388
  ```
3381
3389
 
3382
- **The TRACES block.** In a remote tree the popover of a card carries a table:
3383
- one row per level the gobj can trace (its gclass' own, then the global ones),
3384
- a box for **this gobj** and one for **all of the gclass**. A level that is on
3385
- for the gclass or globally shows on and **locked** in the gobj column, with
3386
- where it comes from (`gclass` / `global`): one gobj cannot turn it off. A box
3387
- is an action: the block locks until the host has loaded what the backend says
3388
- next, so a box shows the backend, never the click. **Remove the traces** of the
3389
- gobj, or of the gclass, turns off what that scope holds on its own. The card
3390
- of a gobj that traces anything wears a `traces` badge.
3391
-
3392
- Note what the C runtime does with them: a gclass level is saved by the yuno
3393
- (`trace_levels`) and **survives a restart**; a gobj level is saved too but only
3394
- the gclass and global scopes are re-applied at start up, so it **ends with the
3395
- 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
3396
3425
  Developer window.
3397
3426
 
3398
- Consumer i18n keys (every app that mounts the tree): `global`, `this gobj`,
3399
- `all of the gclass`, `remove the traces of this gobj`,
3400
- `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`,
3401
3432
  `gclass traces survive a restart, gobj traces end with the yuno` (plus
3402
- `traces`, `level`, `loading` and `gclass`, which every app has).
3433
+ `yuno`, `level`, `loading` and `gclass`, which every app has).
3403
3434
 
3404
3435
  ### The gclass viewer — `yui_gclass_view.js`
3405
3436
 
@@ -3426,7 +3457,12 @@ gclass of a **backend** yuno the host passes the answer of `view-gclass` as
3426
3457
  `opts.current_state` is the state the INSTANCE the reader came from is in. The
3427
3458
  description describes the CLASS and cannot carry it, so the host supplies it —
3428
3459
  the gobj tree passes `node_data.state` — and the machine lights that column.
3429
- 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.
3430
3466
 
3431
3467
  `close_gclass_view(handle)` is the host-driven teardown, and the ✕ runs it too:
3432
3468
  the window destroys itself, but the viewer hangs from the HOST, so nothing else
@@ -3445,11 +3481,35 @@ import {register_c_yui_gclass} from "@yuneta/gobj-ui/src/c_yui_gclass.js";
3445
3481
  ```
3446
3482
 
3447
3483
  Attrs: `description` (the document), `gclass_name` (heads the view when the
3448
- document carries no `id`), `current_state`, `view_mode` (`"zones"` | `"raw"`),
3449
- `$container`. Events in: `EV_SET_DESCRIPTION {description, current_state}`,
3450
- `EV_SET_VIEW_MODE {mode}`, `EV_TOGGLE_ZONE {zone}`, `EV_SEARCH {text}`,
3451
- `EV_COPY_ALL`, `EV_LANGUAGE_CHANGED`, `EV_REFRESH`, `EV_SHOW`, `EV_HIDE`. It
3452
- 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.
3453
3513
 
3454
3514
  `gclass_view_model.js` is where the document becomes the view, and it reads
3455
3515
  **both dialects of it**. The C kernel and the browser registry answer the same
@@ -3486,7 +3546,11 @@ well as 86 commands against one. Two things it says that a JSON dump cannot:
3486
3546
 
3487
3547
  Events declared but handled in no state are OUTPUT events: they leave the
3488
3548
  matrix (one empty row per column says nothing) and are listed under
3489
- *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
3490
3554
  authoritative answer of the backend and is never thrown away.
3491
3555
 
3492
3556
  ### C_YUI_FSM_GRAPH — the machine, drawn
@@ -3495,8 +3559,8 @@ The machine zone's second view, switched from a pair of buttons inside the
3495
3559
  zone (the zone heading is itself a button, and a button inside a button is not
3496
3560
  a control). The matrix stays the default; the graph earns its place where the
3497
3561
  matrix is worst — many states, few events each — and in graph mode the machine
3498
- takes the whole width and the other zones stack under it, because 600px of a
3499
- 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.
3500
3564
 
3501
3565
  Attrs: `fsm` (the `fsm` block of the view model), `current_state`,
3502
3566
  `$container`, `canvas_id`, `wide`, `layout` (`dagre-lr` | `dagre-tb`). Events