@yuneta/gobj-ui 7.23.66 → 7.23.68

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
@@ -1248,12 +1248,15 @@ a level or two, with a count on every cut.
1248
1248
  `antv-dagre` keeps the top-down reading, so the layout picker is also the
1249
1249
  direction picker. A layout change turns the ports of every card in place.
1250
1250
  - **The find and the topic focus search the RECORDS**, not the cards, and open
1251
- the path down to what they find — at most one **page** of hidden matches
1252
- each, because a single letter matches half the treedb and the graph's
1253
- per-topic route (`.../graph/devices`) is a focus on `devices` that lands on
1254
- every load: revealing a whole topic there opened 563 groups of a 6400-record
1255
- treedb before anybody had touched anything. The count reported is of all the
1256
- matches.
1251
+ the path down to what they find. The find reveals at most one **page** of
1252
+ hidden matches (a single letter matches half the treedb); the count reported
1253
+ is of all of them. The topic focus depends on who asks: a click on the
1254
+ **legend** reveals the **whole topic** (`reveal: "all"` on
1255
+ `EV_SET_FOCUS_TOPIC`) — *show me these* means all of them — while the graph's
1256
+ per-topic **route** (`.../graph/devices` is a focus on `devices`) gets one
1257
+ page, because it lands on every load, and revealing a whole topic there
1258
+ opened 563 groups of a 6400-record treedb before anybody had touched
1259
+ anything.
1257
1260
  - **Edition and the saved geometry are untouched by folding.** Only the cards
1258
1261
  on screen are read when the graph is saved; a folded card keeps the entry it
1259
1262
  had in `__graphs__`. A card on its default size grows by the pill row when it
@@ -1263,6 +1266,63 @@ a level or two, with a count on every cut.
1263
1266
 
1264
1267
  One consumer key came with it: `show more`, the chip's tooltip.
1265
1268
 
1269
+ ### The legend is the graph's layer control
1270
+
1271
+ The legend strip under the toolbar is **always there** now (the *Legend*
1272
+ button is gone), and it is not a colour key: it is where the reader decides
1273
+ **what the tree is made of**. One chip per topic — swatch, name, `visible/total`
1274
+ — with a small target for each thing it can do, so a finger lands on one of
1275
+ them:
1276
+
1277
+ | control | what it does |
1278
+ |---|---|
1279
+ | the chip body | **show / hide** the topic. A hidden topic leaves the MODEL, not just the drawing: no card, no pill counts it, no edge reaches it, and whatever hung from it alone has no parent any more. The name is struck through and the count is the total. |
1280
+ | `★` / `☆` | the **main topic**: the trunk the tree hangs from. Filled on the main one (a mark, not a button — the main topic cannot be hidden, because hiding the trunk turns everything into roots, which is the pile); hollow on the others, where it moves the star. |
1281
+ | `+N` | the topic's **loose records**: the ones that should hang from the main tree and do not (a device with no place). Counted here, shown only on request. |
1282
+ | `⌖` | **highlight** the topic — the focus, with `reveal: "all"`. |
1283
+
1284
+ The **main topic is deduced** when none is chosen: the topic whose hooks reach
1285
+ the most OTHER topics, a self-referent hook breaking a tie (a tree of places
1286
+ over a flat list of groups). On the yunovatios central that is `places` (it
1287
+ reaches places, devices, users and controllers); `device_types` reaches one.
1288
+ An `extended` topic (hooks, no fkeys) never wins: the engine draws no edge
1289
+ from one, so its records hang nothing. A treedb where no topic reaches
1290
+ another has no trunk, and every topic is a tree of its own — the behaviour
1291
+ before this existed.
1292
+
1293
+ What the main topic governs, in `treedb_fold_model.js`:
1294
+
1295
+ - its parentless records are the **roots**;
1296
+ - a parentless record of a topic the schema hangs from it (`linked`: reached
1297
+ from the main topic by following hooks) is **loose**, not a root — it is
1298
+ counted per topic and drawn only when its `+N` is on;
1299
+ - a topic the schema does not tie to the main one is its own tree, with its
1300
+ own roots, as before.
1301
+
1302
+ So *places with their users and nothing else* is hiding `devices`,
1303
+ `controllers` and `device_types`; *places with their devices* is hiding
1304
+ `users` and `controllers`. Each combination is a user preference **per
1305
+ treedb**: `hidden_topics`, `main_topic` and `loose_topics` are `SDF_PERSIST`
1306
+ attrs of `C_YUI_TREEDB_GRAPH`, saved under the view's name, and both hosts
1307
+ name the view after the treedb.
1308
+
1309
+ Three edges of it: the URL wins over the strip (a route that lands on a hidden
1310
+ topic shows it first, or it would highlight nothing and say nothing about
1311
+ why); the find searches hidden topics too and counts them apart (`3 matches
1312
+ (+2 in hidden topics)`), because `0` alone reads as *does not exist* when it
1313
+ means *is hidden*; and moving the star reopens the tree at `expand_depth`,
1314
+ since other roots are another tree.
1315
+
1316
+ Wiring: the engine publishes `EV_LEGEND_STATE` after every reconcile — one
1317
+ entry per topic (hidden ones included) with colour, total, visible, loose and
1318
+ flags, plus the main topic — and the view paints the strip from that and
1319
+ nothing else. The strip's clicks are `EV_LEGEND_TOPIC {topic, action}` with
1320
+ `action` one of `toggle`, `main`, `loose`, `focus`; the view persists and
1321
+ forwards them as `EV_SET_HIDDEN_TOPICS`, `EV_SET_MAIN_TOPIC`,
1322
+ `EV_SET_LOOSE_TOPICS`. Consumer i18n keys: `show topic`, `hide topic`,
1323
+ `main topic`, `highlight topic`, `loose records`, `hidden topics`; `legend`
1324
+ is no longer used.
1325
+
1266
1326
  ### C_YUI_TREEDB_SCHEMA — the treedb drawn the way its `.c` draws it
1267
1327
 
1268
1328
  A landing view that draws a treedb the way its schema literal draws it in ASCII