@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 +90 -30
- package/dist/gobj-ui.cjs.js +1662 -971
- package/dist/gobj-ui.es.js +1662 -971
- package/package.json +1 -1
- package/src/c_yui_gclass.css +104 -22
- package/src/c_yui_gclass.js +413 -94
- package/src/c_yui_gobj_tree_js.js +470 -148
- package/src/gclass_traces.wiring.test.js +241 -0
- package/src/gobj_tree_model.js +51 -10
- package/src/gobj_tree_model.test.js +14 -3
- package/src/gobj_tree_remote.wiring.test.js +98 -7
- package/src/yui_gclass_view.js +11 -0
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
|
-
**
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
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`, `
|
|
3457
|
-
`$container`. Events in:
|
|
3458
|
-
`
|
|
3459
|
-
`
|
|
3460
|
-
|
|
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
|
|
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
|
|
3507
|
-
|
|
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
|