@yuneta/gobj-ui 7.0.1 → 7.2.0

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
@@ -491,6 +491,37 @@ The buttons of that toolbar never shrink. When the row runs out of room, the
491
491
  url is what gives way, cut with an ellipsis, and the whole value stays in the
492
492
  `title` and the `aria-label`.
493
493
 
494
+ ### Reading a topic table: filters, columns, CSV
495
+
496
+ `C_YUI_TREEDB_TOPIC_WITH_FORM` had one global search box over the loaded rows.
497
+ Three tools join it, each behind its own flag, all **on** by default:
498
+
499
+ | attr | what it adds |
500
+ |---|---|
501
+ | `with_header_filters` | a filter box in the header of each column a match means something on |
502
+ | `with_columns_button` | a dialog that ticks which columns the table shows |
503
+ | `with_export_button` | downloads what the table holds as CSV |
504
+
505
+ **Not every column gets a filter box, on purpose.** A hook holds children, a
506
+ dict holds a subtree, and a date cell shows a formatted string over an epoch
507
+ number — a text match against the raw value there answers a question nobody
508
+ asked, so those columns get no box rather than a box that lies. A `boolean`
509
+ gets a tristate tick, an `enum` gets a list of its own values, and an `fkey`
510
+ gets a box whose match stringifies the value first, because *which rows point
511
+ at X* is the question fkey columns exist to answer and a fkey arrives as a ref
512
+ string, a list of them or a dict.
513
+
514
+ The search box and the header filters are **separate layers**: clearing the
515
+ search does not silently drop the column filters. The CSV carries what the
516
+ table HOLDS — the loaded rows, the visible columns, both filters applied, which
517
+ is what the reader is looking at. It is not the topic: a server-side dump of
518
+ every node is not something this view can stream, and the button's title says
519
+ so.
520
+
521
+ Searching is a user action, so it crosses the FSM (`EV_SEARCH`) like the rest;
522
+ it used to call `tabulator.setFilter` straight from the DOM handler, where the
523
+ `machine` trace could not see it.
524
+
494
525
  ### Read-only treedbs: `readonly`
495
526
 
496
527
  `C_YUI_TREEDB_TOPICS` and `C_YUI_TREEDB_GRAPH` take a **`readonly`** attr; the
@@ -530,6 +561,31 @@ Two implementation notes worth keeping:
530
561
  still arrive from a keyboard path or a form that outlived the flag, and an
531
562
  ignored write is exactly the behaviour this whole change exists to stop.
532
563
 
564
+ ### Finding a node in the graph
565
+
566
+ `C_YUI_TREEDB_GRAPH` carries a find box in the middle of its toolbar. It
567
+ matches the term against the node's **label**, its id and its topic name, puts
568
+ every match in the same amber `active` state the topic focus uses, and centres
569
+ the viewport on them.
570
+
571
+ Two details that are not decoration:
572
+
573
+ - it matches the **label**, not only the id. On a topic keyed by `rowid`,
574
+ `uuid` or `qualified` the id is a counter or a path and the name a human
575
+ knows the record by lives in a secondary key — the same reason `node_label()`
576
+ exists.
577
+ - it **says how many** it found. A graph that did not move looks identical
578
+ whether nothing matched or the only match was already on screen, so the count
579
+ is shown next to the box (hidden while the box is empty; a typed term that
580
+ matches nothing shows `0`, which is an answer).
581
+
582
+ The find and the topic focus **share the highlight**: starting one clears the
583
+ other. Two amber sets at once would say nothing about either.
584
+
585
+ Wiring: the box sends `EV_FIND_NODES {text}` to the view, which forwards it to
586
+ `C_G6_NODES_TREE`; the graph answers `EV_FIND_RESULT {term, matches}`, which the
587
+ view declares like every other event its child publishes.
588
+
533
589
  ### C_YUI_TREEDB_SCHEMA — the treedb drawn the way its `.c` draws it
534
590
 
535
591
  A landing view that draws a treedb the way its schema literal draws it in ASCII