Go to file
2026-08-28 01:53:48 +08:00
design Replace console demo with SQLite Research Shelf 2026-08-22 08:21:26 +08:00
examples perf: gate resize and post-resize interactions 2026-08-27 12:14:51 +08:00
postmortem Ship operations-console ETAF playground pair 2026-08-22 06:19:10 +08:00
scripts test: record Research Shelf operations through public observers 2026-08-28 01:53:48 +08:00
tests test: record Research Shelf operations through public observers 2026-08-28 01:53:48 +08:00
.gitignore refactor: remove app artifact workflow 2026-08-25 20:03:07 +08:00
DESIGN.md Simplify Research Shelf authoring workflow 2026-08-24 02:08:54 +08:00
DESIGN.zh-CN.md Simplify Research Shelf authoring workflow 2026-08-24 02:08:54 +08:00
etaf-playground.el perf: isolate latency gate from regression load 2026-08-26 00:10:17 +08:00
Makefile test: record Research Shelf operations through public observers 2026-08-28 01:53:48 +08:00
README.md test: record Research Shelf operations through public observers 2026-08-28 01:53:48 +08:00
README.zh-CN.md fix: use display-buffer for playground previews 2026-08-25 20:23:42 +08:00

ETAF Playground

ETAF Playground is a generic authoring workspace: the left side edits one same-basename application's sources and the right side mounts its live ETAF preview. The framework discovers examples from files; it does not contain a business catalog or require a concrete application.

Each example follows this contract:

  • examples/NAME.etaf — one inert structural form;
  • examples/NAME.el — the companion Components, state, effects, and root factory (etaf-NAME-root by convention);
  • examples/NAME.ecss — optional inert (styles ...) presentation rules.

Run M-x etaf-playground-open to open the default example. The source header has clickable ETAF, EL, and ECSS buttons. C-c 1/2/3 (or C-c C-1/C-2/C-3) switches the source; C-c C-c renders the current source into the right-hand preview. Saving a source file also refreshes by default. etaf-playground-register-example is available when a companion needs a non-conventional root or feature name.

Preview placement uses the standard Emacs display-buffer action stored in etaf-playground-display-action. The default is a right side window using half the frame:

;; Right preview using 40% of the frame.
(setq etaf-playground-display-action
      '((display-buffer-in-side-window)
        (side . right)
        (window-width . 0.4)))

;; Right preview fixed at 100 columns.
(setq etaf-playground-display-action
      '((display-buffer-in-side-window)
        (side . right)
        (window-width . 100)))

;; Preview in its own frame.
(setq etaf-playground-display-action
      '((display-buffer-pop-up-frame)
        (pop-up-frame-parameters . ((width . 120) (height . 45)))))

The low-level etaf-playground-mount-example API remains available for batch tests and consumers that only need a preview buffer. Business Components, database schemas, palettes, refs, and handlers stay in the example companion.

Research Shelf is small enough to keep its complete executable companion in one .el file. Its sections are separated by comments while the Playground entry files remain easy to discover:

examples/research-shelf.etaf  # inert structure source
examples/research-shelf.ecss  # inert style source
examples/research-shelf.el    # DATA / THEME / STATE / VIEW / ROOT sections

The companion registers :reload-on-refresh t, so saving the .el, .etaf, or .ecss source and refreshing reloads the complete consumer before the next mount.

Run make check EMACS=/Applications/Emacs.app/Contents/MacOS/Emacs. Run make perf for the fixed 1413×62 latency gate. Every scenario performs five unmeasured warmups followed by 30 measured samples; both p95 and max must remain at or below 50ms, including Theme and post-resize interactions. For repeated absolute-latency runs, use make perf-prepare once after source changes, let compilation activity settle, then run make perf-evaluator without rebuilding the dependency graph.

The bundled Research Shelf example installs a deterministic 256-record SQLite fixture with 12 records per page. Bind etaf-research-shelf-fixture-size and etaf-research-shelf-page-size for smaller tests or larger pressure runs. Its application UI is only a consumer of the generic workspace; activate Rows N ✎ to enter any value from 1 through 100.