iterlab 2.0.1__tar.gz → 2.1.0__tar.gz

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.
Files changed (133) hide show
  1. {iterlab-2.0.1 → iterlab-2.1.0}/CHANGELOG.md +1703 -1552
  2. {iterlab-2.0.1 → iterlab-2.1.0}/GUIDE.md +800 -754
  3. {iterlab-2.0.1 → iterlab-2.1.0}/PKG-INFO +1 -1
  4. {iterlab-2.0.1 → iterlab-2.1.0}/VERIFICATION.md +253 -212
  5. {iterlab-2.0.1 → iterlab-2.1.0}/examples/showcase_layout.py +94 -94
  6. {iterlab-2.0.1 → iterlab-2.1.0}/src/iterlab/__init__.py +25 -25
  7. {iterlab-2.0.1 → iterlab-2.1.0}/src/iterlab/app.py +113 -101
  8. {iterlab-2.0.1 → iterlab-2.1.0}/src/iterlab/codegen/inject.py +169 -165
  9. {iterlab-2.0.1 → iterlab-2.1.0}/src/iterlab/codegen/templates.py +43 -0
  10. {iterlab-2.0.1 → iterlab-2.1.0}/src/iterlab/layout/schema.py +557 -534
  11. iterlab-2.1.0/src/iterlab/runtime/editors.py +423 -0
  12. iterlab-2.1.0/src/iterlab/runtime/loader.py +262 -0
  13. {iterlab-2.0.1 → iterlab-2.1.0}/src/iterlab/runtime/remembered.py +48 -22
  14. {iterlab-2.0.1 → iterlab-2.1.0}/src/iterlab/ui/app.py +468 -462
  15. {iterlab-2.0.1 → iterlab-2.1.0}/src/iterlab/ui/designer.py +738 -711
  16. {iterlab-2.0.1 → iterlab-2.1.0}/src/iterlab/ui/elements.py +941 -873
  17. iterlab-2.1.0/src/iterlab/ui/handler_menu.py +154 -0
  18. {iterlab-2.0.1 → iterlab-2.1.0}/src/iterlab/ui/icon.py +20 -0
  19. {iterlab-2.0.1 → iterlab-2.1.0}/src/iterlab/ui/modetoggle.py +1 -1
  20. {iterlab-2.0.1 → iterlab-2.1.0}/src/iterlab/ui/runner.py +2 -1
  21. {iterlab-2.0.1 → iterlab-2.1.0}/src/iterlab/versionguard.py +8 -8
  22. {iterlab-2.0.1 → iterlab-2.1.0}/tests/conftest.py +45 -71
  23. {iterlab-2.0.1 → iterlab-2.1.0}/tests/integration/test_layout_file.py +165 -210
  24. {iterlab-2.0.1 → iterlab-2.1.0}/tests/ui/test_box_stubs.py +222 -251
  25. {iterlab-2.0.1 → iterlab-2.1.0}/tests/ui/test_default_window_size.py +0 -15
  26. iterlab-2.1.0/tests/ui/test_handler_menu.py +306 -0
  27. {iterlab-2.0.1 → iterlab-2.1.0}/tests/ui/test_icon.py +241 -138
  28. {iterlab-2.0.1 → iterlab-2.1.0}/tests/ui/test_look.py +248 -267
  29. {iterlab-2.0.1 → iterlab-2.1.0}/tests/ui/test_properties_panel.py +131 -156
  30. iterlab-2.1.0/tests/ui/test_real_launch.py +372 -0
  31. {iterlab-2.0.1 → iterlab-2.1.0}/tests/ui/test_restart_app.py +55 -12
  32. iterlab-2.1.0/tests/ui/test_screenshot.py +239 -0
  33. {iterlab-2.0.1 → iterlab-2.1.0}/tests/ui/test_toolbar.py +129 -0
  34. {iterlab-2.0.1 → iterlab-2.1.0}/tests/ui/test_toolbar_collapse.py +200 -204
  35. iterlab-2.1.0/tests/unit/test_editors.py +215 -0
  36. iterlab-2.1.0/tests/unit/test_element_colours.py +71 -0
  37. iterlab-2.1.0/tests/unit/test_fresh_compile.py +151 -0
  38. iterlab-2.1.0/tests/unit/test_handler_stubs.py +101 -0
  39. iterlab-2.1.0/tests/unit/test_project_imports.py +186 -0
  40. {iterlab-2.0.1 → iterlab-2.1.0}/tests/unit/test_remembered.py +6 -6
  41. {iterlab-2.0.1 → iterlab-2.1.0}/tests/unit/test_runnable_file.py +222 -226
  42. {iterlab-2.0.1 → iterlab-2.1.0}/tests/unit/test_style.py +197 -185
  43. {iterlab-2.0.1 → iterlab-2.1.0}/tests/unit/test_versionguard.py +229 -228
  44. iterlab-2.1.0/tools/check_downgrade.py +95 -0
  45. iterlab-2.0.1/src/iterlab/runtime/loader.py +0 -147
  46. iterlab-2.0.1/tests/ui/test_screenshot.py +0 -133
  47. {iterlab-2.0.1 → iterlab-2.1.0}/.gitignore +0 -0
  48. {iterlab-2.0.1 → iterlab-2.1.0}/LICENSE +0 -0
  49. {iterlab-2.0.1 → iterlab-2.1.0}/NOTICE +0 -0
  50. {iterlab-2.0.1 → iterlab-2.1.0}/README.md +0 -0
  51. {iterlab-2.0.1 → iterlab-2.1.0}/docs/intro.gif +0 -0
  52. {iterlab-2.0.1 → iterlab-2.1.0}/docs/iterlab.jpg +0 -0
  53. {iterlab-2.0.1 → iterlab-2.1.0}/docs/logo.png +0 -0
  54. {iterlab-2.0.1 → iterlab-2.1.0}/examples/showcase.py +0 -0
  55. {iterlab-2.0.1 → iterlab-2.1.0}/pyproject.toml +0 -0
  56. {iterlab-2.0.1 → iterlab-2.1.0}/src/iterlab/assets/iterlab.ico +0 -0
  57. {iterlab-2.0.1 → iterlab-2.1.0}/src/iterlab/assets/iterlab.png +0 -0
  58. {iterlab-2.0.1 → iterlab-2.1.0}/src/iterlab/cli.py +0 -0
  59. {iterlab-2.0.1 → iterlab-2.1.0}/src/iterlab/codegen/__init__.py +0 -0
  60. {iterlab-2.0.1 → iterlab-2.1.0}/src/iterlab/codegen/rename.py +0 -0
  61. {iterlab-2.0.1 → iterlab-2.1.0}/src/iterlab/errors.py +0 -0
  62. {iterlab-2.0.1 → iterlab-2.1.0}/src/iterlab/interface.py +0 -0
  63. {iterlab-2.0.1 → iterlab-2.1.0}/src/iterlab/layout/__init__.py +0 -0
  64. {iterlab-2.0.1 → iterlab-2.1.0}/src/iterlab/layout/store.py +0 -0
  65. {iterlab-2.0.1 → iterlab-2.1.0}/src/iterlab/py.typed +0 -0
  66. {iterlab-2.0.1 → iterlab-2.1.0}/src/iterlab/runtime/__init__.py +0 -0
  67. {iterlab-2.0.1 → iterlab-2.1.0}/src/iterlab/runtime/dispatch.py +0 -0
  68. {iterlab-2.0.1 → iterlab-2.1.0}/src/iterlab/runtime/environment.py +0 -0
  69. {iterlab-2.0.1 → iterlab-2.1.0}/src/iterlab/runtime/faults.py +0 -0
  70. {iterlab-2.0.1 → iterlab-2.1.0}/src/iterlab/runtime/startupcheck.py +0 -0
  71. {iterlab-2.0.1 → iterlab-2.1.0}/src/iterlab/types.py +0 -0
  72. {iterlab-2.0.1 → iterlab-2.1.0}/src/iterlab/ui/__init__.py +0 -0
  73. {iterlab-2.0.1 → iterlab-2.1.0}/src/iterlab/ui/dialogs.py +0 -0
  74. {iterlab-2.0.1 → iterlab-2.1.0}/src/iterlab/ui/faultbanner.py +0 -0
  75. {iterlab-2.0.1 → iterlab-2.1.0}/src/iterlab/ui/palette.py +0 -0
  76. {iterlab-2.0.1 → iterlab-2.1.0}/src/iterlab/ui/properties.py +0 -0
  77. {iterlab-2.0.1 → iterlab-2.1.0}/src/iterlab/ui/screenshot.py +0 -0
  78. {iterlab-2.0.1 → iterlab-2.1.0}/src/iterlab/ui/scroll.py +0 -0
  79. {iterlab-2.0.1 → iterlab-2.1.0}/src/iterlab/ui/session.py +0 -0
  80. {iterlab-2.0.1 → iterlab-2.1.0}/src/iterlab/ui/startupnotice.py +0 -0
  81. {iterlab-2.0.1 → iterlab-2.1.0}/src/iterlab/ui/theme.py +0 -0
  82. {iterlab-2.0.1 → iterlab-2.1.0}/src/iterlab/ui/tooltip.py +0 -0
  83. {iterlab-2.0.1 → iterlab-2.1.0}/tests/contract/test_layout_schema.py +0 -0
  84. {iterlab-2.0.1 → iterlab-2.1.0}/tests/contract/test_public_api.py +0 -0
  85. {iterlab-2.0.1 → iterlab-2.1.0}/tests/integration/test_additive.py +0 -0
  86. {iterlab-2.0.1 → iterlab-2.1.0}/tests/integration/test_create_and_run.py +0 -0
  87. {iterlab-2.0.1 → iterlab-2.1.0}/tests/integration/test_never_dies.py +0 -0
  88. {iterlab-2.0.1 → iterlab-2.1.0}/tests/integration/test_reload.py +0 -0
  89. {iterlab-2.0.1 → iterlab-2.1.0}/tests/integration/test_rename.py +0 -0
  90. {iterlab-2.0.1 → iterlab-2.1.0}/tests/integration/test_stub_annotations.py +0 -0
  91. {iterlab-2.0.1 → iterlab-2.1.0}/tests/ui/_helpers.py +0 -0
  92. {iterlab-2.0.1 → iterlab-2.1.0}/tests/ui/conftest.py +0 -0
  93. {iterlab-2.0.1 → iterlab-2.1.0}/tests/ui/test_arming.py +0 -0
  94. {iterlab-2.0.1 → iterlab-2.1.0}/tests/ui/test_axes_is_a_real_axes.py +0 -0
  95. {iterlab-2.0.1 → iterlab-2.1.0}/tests/ui/test_direct_manipulation.py +0 -0
  96. {iterlab-2.0.1 → iterlab-2.1.0}/tests/ui/test_empty_text.py +0 -0
  97. {iterlab-2.0.1 → iterlab-2.1.0}/tests/ui/test_fault_banner.py +0 -0
  98. {iterlab-2.0.1 → iterlab-2.1.0}/tests/ui/test_input_elements.py +0 -0
  99. {iterlab-2.0.1 → iterlab-2.1.0}/tests/ui/test_label_appearance.py +0 -0
  100. {iterlab-2.0.1 → iterlab-2.1.0}/tests/ui/test_mode_toggle.py +0 -0
  101. {iterlab-2.0.1 → iterlab-2.1.0}/tests/ui/test_mouse_buttons.py +0 -0
  102. {iterlab-2.0.1 → iterlab-2.1.0}/tests/ui/test_perf.py +0 -0
  103. {iterlab-2.0.1 → iterlab-2.1.0}/tests/ui/test_plot_events.py +0 -0
  104. {iterlab-2.0.1 → iterlab-2.1.0}/tests/ui/test_presentation_survives.py +0 -0
  105. {iterlab-2.0.1 → iterlab-2.1.0}/tests/ui/test_properties_drawer.py +0 -0
  106. {iterlab-2.0.1 → iterlab-2.1.0}/tests/ui/test_properties_editing.py +0 -0
  107. {iterlab-2.0.1 → iterlab-2.1.0}/tests/ui/test_property_commit.py +0 -0
  108. {iterlab-2.0.1 → iterlab-2.1.0}/tests/ui/test_resize.py +0 -0
  109. {iterlab-2.0.1 → iterlab-2.1.0}/tests/ui/test_selectors.py +0 -0
  110. {iterlab-2.0.1 → iterlab-2.1.0}/tests/ui/test_showcase_example.py +0 -0
  111. {iterlab-2.0.1 → iterlab-2.1.0}/tests/ui/test_startup_notice.py +0 -0
  112. {iterlab-2.0.1 → iterlab-2.1.0}/tests/ui/test_style_editing.py +0 -0
  113. {iterlab-2.0.1 → iterlab-2.1.0}/tests/ui/test_switch_cost.py +0 -0
  114. {iterlab-2.0.1 → iterlab-2.1.0}/tests/ui/test_tag_tooltip.py +0 -0
  115. {iterlab-2.0.1 → iterlab-2.1.0}/tests/ui/test_verify_tool.py +0 -0
  116. {iterlab-2.0.1 → iterlab-2.1.0}/tests/ui/test_window_launch.py +0 -0
  117. {iterlab-2.0.1 → iterlab-2.1.0}/tests/ui/test_window_size_memory.py +0 -0
  118. {iterlab-2.0.1 → iterlab-2.1.0}/tests/unit/test_atomic_write.py +0 -0
  119. {iterlab-2.0.1 → iterlab-2.1.0}/tests/unit/test_cli.py +0 -0
  120. {iterlab-2.0.1 → iterlab-2.1.0}/tests/unit/test_environment.py +0 -0
  121. {iterlab-2.0.1 → iterlab-2.1.0}/tests/unit/test_faults.py +0 -0
  122. {iterlab-2.0.1 → iterlab-2.1.0}/tests/unit/test_import_boundary.py +0 -0
  123. {iterlab-2.0.1 → iterlab-2.1.0}/tests/unit/test_label_type.py +0 -0
  124. {iterlab-2.0.1 → iterlab-2.1.0}/tests/unit/test_preflight_gate.py +0 -0
  125. {iterlab-2.0.1 → iterlab-2.1.0}/tests/unit/test_schema.py +0 -0
  126. {iterlab-2.0.1 → iterlab-2.1.0}/tests/unit/test_start_mode.py +0 -0
  127. {iterlab-2.0.1 → iterlab-2.1.0}/tests/unit/test_startupcheck.py +0 -0
  128. {iterlab-2.0.1 → iterlab-2.1.0}/tests/unit/test_templates.py +0 -0
  129. {iterlab-2.0.1 → iterlab-2.1.0}/tests/unit/test_typing_surface.py +0 -0
  130. {iterlab-2.0.1 → iterlab-2.1.0}/tools/check_readme_links.py +0 -0
  131. {iterlab-2.0.1 → iterlab-2.1.0}/tools/make_icon.py +0 -0
  132. {iterlab-2.0.1 → iterlab-2.1.0}/tools/preflight.py +0 -0
  133. {iterlab-2.0.1 → iterlab-2.1.0}/tools/verify.py +0 -0
@@ -1,1552 +1,1703 @@
1
- # Changelog
2
-
3
- All notable changes to iterlab are recorded here. The project follows semantic
4
- versioning as defined in the project constitution's *Release And Versioning*
5
- section, where the public surface is larger than the Python API: the layout
6
- schema, the handler naming convention, the `ev` contract, the generated stub
7
- shape, and the command are all consumed directly by researcher-written code.
8
-
9
- ## [2.0.1] — 2026-09-14
10
-
11
- ### Changed
12
-
13
- - **A new code file separates what you never edit from what you do.** The
14
- `TYPE_CHECKING` import that lets your editor complete `ev.` now sits at the
15
- very top, inside a frame of `#` characters that says it is boilerplate you
16
- do not need to touch, followed by what it is for. Your own imports start
17
- below the frame, so the section you will add to is no longer interleaved
18
- with the one you can ignore.
19
-
20
- The docstring also loses its line about the top-left toggle: it describes
21
- the window, not the code.
22
-
23
- Checked with pycodestyle, which PyCharm's PEP 8 inspection uses, and with
24
- ruff: neither flags the imports below the frame as not being at the top of
25
- the file. Only new files are affected; iterlab never rewrites a file you
26
- already have.
27
-
28
- ## [2.0.0] — 2026-09-14
29
-
30
- ### Changed
31
-
32
- - **An interface is two files again: `demo.py` and `demo_layout.py`.** The
33
- layout moved out of YAML and into a Python module, where it sits beside the
34
- `Ev` class your editor reads. One write produces both, so what you drew and
35
- what your editor offers cannot drift apart.
36
-
37
- ```python
38
- LAYOUT = {
39
- 'schema_version': 8,
40
- 'window': {'width': 960, 'height': 540},
41
- 'elements': {
42
- 'spectrum': {'type': 'axes', 'position': [0.05, 0.5, 0.9, 0.4]},
43
- },
44
- }
45
-
46
-
47
- class Ev:
48
- spectrum: "Axes"
49
- ```
50
-
51
- **iterlab never imports it.** The layout is lifted out of the parse tree and
52
- evaluated as literals only, so opening somebody else's interface is as safe
53
- as opening a data file — an `import` here would have made every shared
54
- project arbitrary code execution. A computed value in `LAYOUT` is refused
55
- rather than evaluated, which is the price of that guarantee and worth it.
56
-
57
- PyYAML is no longer a dependency.
58
-
59
- - **Files written by 1.x do not open, and there is no migration.** Deliberate:
60
- the library is new enough to have no users, so nobody has a layout to lose,
61
- and a migration written for files that do not exist is a cost with no payer.
62
- A `demo.yaml` left in the folder is not read, not deleted, and not ignored
63
- either — iterlab says what happened and opens a new interface beside it.
64
-
65
- Schema 8 is the first version of this format. The migration machinery stays
66
- for the next real change.
67
-
68
- ## [1.7.1] — never published
69
-
70
- Prepared and gated, then overtaken by 2.0.0 before it was uploaded. Everything
71
- below ships in 2.0.0; the section stays because the work and its reasoning did
72
- not change, only the number it went out under.
73
-
74
- ### Added
75
-
76
- - **Your editor can see what an element offers.** `ev.lbl_0.background` used to
77
- complete to nothing and read as an unknown attribute to anything strict
78
- enough to look: style properties are reached through `__setattr__` against a
79
- tuple of names, which works perfectly at run time and is invisible to a type
80
- checker. They are now declared as annotations without values, so an editor
81
- can offer them while the runtime path is untouched.
82
-
83
- `.text`, `.value`, `.path` and `.visible` gained return types, which turns
84
- them from `Any` into `str`, `float`, `str` and `bool`.
85
-
86
- The package also carries a `py.typed` marker now (PEP 561). Without it a
87
- checker ignores everything above.
88
-
89
- Checked with a real type checker against the built wheel rather than by
90
- reasoning about it:
91
-
92
- | expression | before | now |
93
- |---|---|---|
94
- | `label.background` | unknown attribute | `str \| None` |
95
- | `label.text` | `Any` | `str` |
96
- | `box.value` | `Any` | `float` |
97
- | `plot.plot` | matplotlib's signature | unchanged |
98
-
99
- This is the half that touches nothing you wrote. Completions on `ev.<tag>`
100
- itself need a type for `ev`, which is a separate change.
101
-
102
- - **Your editor can complete `ev.`** iterlab writes `demo_ev.py` beside your
103
- pair, declaring each element and what it is, and rewrites it whenever you
104
- draw, rename or delete one. Generated handlers say `ev: "Ev"`, so inside one
105
- your editor offers the elements you drew — and `ev.ax_0.` offers matplotlib's
106
- own methods and signatures, because an axes *is* an `Axes`.
107
-
108
- Ordinary typing rather than an editor plugin, so it works wherever you work.
109
- Verified by running a type checker over a project iterlab generated:
110
- `ev.spectrum.plot` resolves to matplotlib's signature, `.value` to `float`,
111
- `.text` to `str`, `.background` to `str | None`, and your own `ev.my_cache`
112
- to `Any` with no error.
113
-
114
- The generated module is read by type checkers and never at run time. Delete
115
- it and everything still works.
116
-
117
- **iterlab will not add the import to a file it did not write.** Everything it
118
- puts in your file is appended, leaving what you wrote as an exact prefix, and
119
- an import goes at the top - that guarantee is worth more than a completion.
120
- So a file without the import gets plain stubs, as before, and the guide has
121
- the two lines that opt in.
122
-
123
- ### Fixed
124
-
125
- - **The pan and zoom toolbar was missing under most plots.** It existed under
126
- every one of them and was visible under almost none: Tk hands out a frame's
127
- space in the order things are packed, and the canvas was packed first with
128
- `expand=True`, so it took the lot and the toolbar was never mapped. Whether
129
- one showed came down to whether that particular plot happened to be tall
130
- enough, which is why it looked like the *second* axes was special.
131
-
132
- Packed before the canvas now, which is the whole fix.
133
-
134
- The tests that covered this asked whether the toolbar widget existed. It did.
135
- They now ask whether it is on screen, for plots of three different heights and
136
- across a mode switch, and the old order fails all four.
137
-
138
- ## [1.7.0] — 2026-09-13
139
-
140
- ### Changed
141
-
142
- - **Renaming an element now follows it through your code.** It used to rename
143
- the element's handlers and nothing else, which left every `ev.old_tag` in the
144
- file pointing at an element that no longer existed — working code turned into
145
- a runtime error the next time that line ran.
146
-
147
- A rename now moves the handlers, attribute access (`ev.old`, and anything
148
- else on the left of the dot), whole-word mentions in comments, and whole-word
149
- mentions in strings. The last of those is how `ev.old` written inside an
150
- f-string is reached, which matters because the generated stub is exactly that
151
- shape. The properties panel reports what it rewrote, because editing someone
152
- else's file quietly is not a thing to do twice.
153
-
154
- **A name matches whole or not at all.** With `cmdRun` and `cmdRunAlgorithm`
155
- both on the canvas, renaming the first to `cmdRunData` leaves the second
156
- untouched everywhere — handler, attribute and prose — and leaves your own
157
- `ev.cmdRun_cache` alone as well. A text substitution rewrites all three and
158
- silently unwires an element you never touched; that is why the work is driven
159
- by the tokenizer rather than by `str.replace`, and why swapping in the naive
160
- version fails eight tests.
161
-
162
- Deliberately untouched: a bare local that happens to share the name. Nothing
163
- can distinguish it from a coincidence, so the dot is what a reference is
164
- recognized by.
165
-
166
- Unchanged: a file that will not parse is still refused outright, and line
167
- endings are still preserved to the byte.
168
-
169
- ## [1.6.0] — 2026-09-13
170
-
171
- ### Changed
172
-
173
- - **One window, and switching modes no longer moves it.** The editor and the
174
- running interface are now exactly the same size at all times. The toolbar
175
- takes its room from inside the window instead of being added beside it.
176
-
177
- That leaves the canvas a different *shape* from the interface, and positions
178
- are fractions — an element drawn on a canvas of the wrong shape comes out
179
- stretched when it runs. So the canvas keeps the interface's proportions and
180
- gives up size: the largest rectangle of that shape which fits beside the
181
- toolbar, centred, with the backdrop showing around it. The white rectangle is
182
- the window you will run in; the grey is the room the toolbar borrowed.
183
-
184
- What this replaces: the editor window was the interface *plus* the toolbar,
185
- which meant every mode switch resized the window — and every plot on screen
186
- re-rendered for it. Switching now resizes nothing, so that cost is gone for
187
- good rather than merely reduced.
188
-
189
- The editor's height floor is gone with it. A short window makes for a short
190
- toolbar, and the toolbar scrolls; it has been a scrolling column since 0.13.0
191
- for exactly this reason.
192
-
193
- - **Folding the toolbar grows the canvas** instead of narrowing the window. The
194
- window cannot move — it is the interface's size — so the room the toolbar
195
- gives up goes to the canvas, at the same proportions. Folding is now a way to
196
- see your layout bigger.
197
-
198
- - **A new project opens at half your screen**, rather than a fixed 800x450.
199
- That size is a dialog on an ordinary monitor and a postage stamp on a large
200
- one, and no fixed number can be right for both a laptop and a 4K display.
201
-
202
- Only at creation. An existing project opens at the size it was left at, and
203
- nothing re-decides that for you.
204
-
205
- - **The editor backdrop is a shade darker than the sidebar.** The canvas is a
206
- picture of the run window and its edge has to be findable; against the
207
- sidebar's own colour, a white canvas had almost no edge at all.
208
-
209
- ### Fixed
210
-
211
- - **Toggling modes filled the Tcl interpreter with images.** Each plot's
212
- pan/zoom toolbar holds fifteen Tk images, and destroying the widgets released
213
- none of them: the objects owning them sit in reference cycles, so they stayed
214
- until a full garbage collection happened to run. Ten round trips over three
215
- plots left 135 behind. Enough of them and Tk dies with an access violation
216
- while building something unrelated — which is how this was found, in a test
217
- suite that kept falling over in a file that had nothing to do with it.
218
-
219
- Released on teardown now, where the canvas's event connections were already
220
- being released for the same reason. Growth over ten round trips: 135 images
221
- before, 6 after.
222
-
223
- - **A property field below the fold could not be typed into.** Tk unmaps a
224
- canvas window that is scrolled out of view, and an unmapped widget takes no
225
- focus — so in a toolbar too short to show everything, the keys went nowhere
226
- and the value was silently never committed. Fields are now scrolled into view
227
- when they take focus, and opening the **More** drawer brings the drawer with
228
- it rather than opening it somewhere you cannot see.
229
-
230
- ## [1.5.1] — 2026-09-12
231
-
232
- ### Fixed
233
-
234
- - **Switching back to the interface got slower, and it was the plots redrawing
235
- twice.** Both modes come from one remembered size, so every switch now
236
- resizes the window by the toolbar's width. `geometry` only *asks* for a size —
237
- Tk applies it on a later pass — so the new mode was built at the old width and
238
- every plot on screen rendered again when the resize finally landed.
239
-
240
- Measured on three plots, per switch:
241
-
242
- | | canvas renders | in rendering | switch |
243
- |---|---|---|---|
244
- | before the toolbar change | 6 | 78 ms | 133 ms |
245
- | after it | 9 | 115 ms | 161 ms |
246
- | now | 6 | 70 ms | 114 ms |
247
-
248
- It is one extra render of every plot, so it costs whatever your plots cost:
249
- barely visible on two small ones, a wait on a screenful.
250
-
251
- The window is now sized and the resize allowed to land *before* the new mode
252
- is built. That means running the event loop mid-switch, so a click on the top
253
- bar can arrive between teardown and the new interface existing — `App.busy`
254
- refuses one while a switch is part-built, rather than letting a rebuild start
255
- inside a rebuild and tear down what the outer one is holding.
256
-
257
- Held by a test that counts renders rather than timing them, because a timing
258
- budget on a shared runner is a flake and the count is what changed.
259
-
260
- - **The shipped example announced a version crossing to everyone who opened
261
- it.** `examples/showcase.yaml` was stamped 1.4.0 and shipped in 1.5.0, so
262
- iterlab correctly decided the file came from another version, said so, and
263
- left two `.bak` files beside it. It now records the current version, and a
264
- test keeps it there — it goes stale on every release by nature.
265
-
266
- ## [1.5.0] — 2026-09-12
267
-
268
- ### Added
269
-
270
- - **A showcase project, in `examples/`.** Three plots — sines at several
271
- frequencies, a scatter cloud, a bar chart with error bars — plus two boxes,
272
- three buttons and the labels around them:
273
-
274
- ```console
275
- iterlab examples/showcase
276
- ```
277
-
278
- It is a sanity harness first: one command, and every element type that draws
279
- is on screen doing something. Its `on_startup` builds the data and every
280
- handler under it only draws, so editing the file and clicking **Redraw** shows
281
- the loop the project exists for.
282
-
283
- The suite opens it, runs its startup and uses its controls, because a curated
284
- project is code nobody runs until someone does — which is exactly how
285
- `tools/verify.py` came to spend several releases unable to start.
286
-
287
- `examples/` now ships in the source distribution alongside `docs/`.
288
-
289
- ### Changed
290
-
291
- - **The README shows the loop rather than describing it.** A screenshot of the
292
- showcase project in both modes, with the code between them, under the opening
293
- paragraph. It lives in `docs/` beside the logo, so it ships in the source
294
- distribution and not in every wheel.
295
-
296
- The description on PyPI is frozen into each release at upload time and is
297
- never re-read from the repository, so a README edit reaches that page only
298
- when a version is published. This is the release that carries it.
299
-
300
- ## [1.4.0] — 2026-09-11
301
-
302
- ### Changed
303
-
304
- - **One size describes both modes, and the canvas is the run window.** The
305
- editor canvas is now exactly the interface's pixels, and the editor window is
306
- that plus the toolbar beside it. Resize either and the other follows.
307
-
308
- The old model added the toolbar *and* applied a floor of its own (1080x760) to
309
- the editor, so the two modes were different **shapes**. Positions are
310
- fractions, so an element drawn square came out stretched when run. That, not
311
- the forgetting, was the confusing part — the sizes were never comparable in
312
- the first place.
313
-
314
- The editor keeps a floor, but it no longer reaches the interface. The window
315
- stays tall enough for the toolbar's own controls; below that height the canvas
316
- holds its own size and the leftover shows as blank space under it. Tk does not
317
- clip a column that does not fit - it silently leaves the bottom controls
318
- unmapped - so without the floor the properties panel loses its lower half and
319
- still looks complete. The interface itself now has the only floor that
320
- constrains it (320x240).
321
-
322
- - **Editor resizes are now saved**, reversing 1.4.0's earlier rule. That rule
323
- existed because the editor window was not the interface's size; now it is,
324
- minus a known allowance, so it can be read straight back out.
325
-
326
- ### Added
327
-
328
- - **The toolbar folds to a strip.** Click **Toolbar** to fold it away and again
329
- to bring it back. The window narrows by the difference, so the canvas keeps
330
- exactly the pixels it had — folding tidies the desk without resizing the
331
- interface. Called "Toolbar" rather than left as a bare chevron, because a
332
- chevron on an empty strip does not say what expanding would get you.
333
-
334
- Kept in the layout, so it travels with the project. Selecting an element while
335
- folded does not open it: nothing moves unless the researcher moves it.
336
-
337
- - **Layout schema 6 → 7** for the folded state, no-op migration; absent means
338
- expanded, which is what every older file means.
339
-
340
- - A test holds the two window allowances in step with the two panel widths they
341
- stand for. They live in different modules, and if they drift the canvas
342
- silently stops being the run window — which would go unnoticed, because
343
- nothing would look broken.
344
-
345
- - **A project records which iterlab last edited it, and is backed up when that
346
- changes.** The layout carries an `iterlab_version` stamp; opening it with a
347
- different version — newer *or* older — copies both files aside first, as
348
- `demo.yaml.v1.3.0.bak` and `demo.py.v1.3.0.bak`. The version in the name is
349
- the one that wrote them, since that is what the copy preserves.
350
-
351
- Either direction, deliberately. The downgrade is the dangerous one: an older
352
- build meets a key or an element type it has never heard of. An upgrade is
353
- safer, because migrations run forward and are tested, but a migration is still
354
- a rewrite of the researcher's layout.
355
-
356
- The `.py` is copied and never otherwise touched. If a version change ever went
357
- wrong across stub injection or a rename, that is the copy that would matter
358
- most — a layout can be redrawn, an algorithm cannot.
359
-
360
- An existing backup is not overwritten: the one already on disk is the older
361
- and more original of the two. A folder that cannot be written to does not stop
362
- the interface opening, since a folder iterlab cannot write is one it cannot
363
- damage either — but it says so rather than failing silently.
364
-
365
- A project made before this has no stamp, and that is the commonest crossing of
366
- all, so its copies are named `.vunknown.bak` and it is announced like any
367
- other. An early return on "no recorded version" made exactly that case silent,
368
- which a test now prevents.
369
-
370
- - **Layout schema 5 → 6** for the new key, with a no-op migration. An older file
371
- simply has no stamp, which already means what it needs to mean.
372
-
373
- ### Fixed
374
-
375
- - **The Gate 2 setup tool could not be started.** `tools/verify.py` called
376
- `create_element(..., name=...)` several releases after that argument became
377
- `tag`, so the manual pass raised `TypeError` before it drew anything. Both its
378
- buttons also read "Click here!" once buttons gained a default label, while the
379
- checklist says to click **Redraw** and **Break it**. Nothing noticed either,
380
- because the only thing that runs this tool is a person about to do a pass —
381
- and the results table records that none happened. The tool is now exercised by
382
- the suite, including that its button labels are words the checklist actually
383
- names.
384
-
385
- - **The release gate could be satisfied by prose.** Gate 2 is the recorded
386
- manual pass, and the check that asks whether it happened looked for the
387
- version string anywhere in `VERIFICATION.md`. 1.4.0 passed it on the strength
388
- of a checklist item reading "open a project made before 1.4.0" — so the one
389
- automated question standing between an unverified build and an upload that
390
- cannot be withdrawn was answered by a sentence about something else. It now
391
- reads the *Recorded results* table, and a near miss such as `1.3.10` does not
392
- answer for `1.3.1`.
393
-
394
- - **An interface reopened at the default size instead of the size it was left
395
- at.** The layout has always carried a `window` size and nothing ever wrote to
396
- it, so it stayed at 800x450 forever and every launch opened there.
397
-
398
- The editor appeared to remember, which is what made this easy to miss for so
399
- long. It does not: it is forced up to a minimum that makes the palette and
400
- properties panel fit, and that minimum happened to resemble the size people
401
- were working at. Nothing was being remembered anywhere.
402
-
403
- A resize in GUI mode is now written to the layout, debounced by 400 ms —
404
- dragging a window edge fires `<Configure>` continuously, and saving per pixel
405
- would rewrite the file hundreds of times for one drag. An unchanged size
406
- writes nothing, and a minimised window (Tk reports 1x1) is not a size anyone
407
- chose.
408
-
409
- **Editor resizes are deliberately not saved.** That window holds the sidebar
410
- and has a floor, so it is not the interface's size — saving it would enlarge a
411
- deliberately small interface the first time somebody opened the editor on it.
412
- There is a test for exactly that.
413
-
414
- Closing also cancels any pending save. One firing into a destroyed root is
415
- what printed `invalid command name` on the way out, which I found while
416
- testing this rather than after shipping it.
417
-
418
- ### Changed
419
-
420
- - **A label looks like text rather than a card.** On the editor canvas it is
421
- drawn in the canvas's own colour with a black edge; in the running interface
422
- it takes the background behind it and has no edge.
423
-
424
- Its editor tint used to be `#e7f2e9` against the file selector's `#e6f0ea` —
425
- near enough that a glance could not tell them apart, which is what prompted
426
- this. And in the interface a caption sat in a white box, which is exactly what
427
- a caption should not look like.
428
-
429
- Drawn in the canvas colour rather than with `fill=""`. Truly unfilled would
430
- have been the obvious way to say "transparent", and it would have stopped the
431
- label being selectable: an unfilled canvas rectangle is only hit on its
432
- outline, so it would have been clickable on the border and dead in the middle.
433
- Same colour as the canvas is indistinguishable and stays clickable, and two
434
- tests hold that line.
435
-
436
- Tk has no real transparency, so "transparent" in the interface means painting
437
- the parent's own colour. A background or edge set by researcher code still
438
- wins — this is only the default.
439
-
440
- - **Buttons and both selectors now default to the label's height.** All four are
441
- one line of text, so a row of them lines up without anyone resizing anything.
442
- Widths still differ, because caption length is what actually varies:
443
- "Select a Folder" needs more room than "Click here!". Named `LINE_HEIGHT` and
444
- shared, with a test pinning it so the four cannot drift apart again.
445
-
446
- The text boxes are deliberately left taller: a field someone types into wants
447
- more room than a caption they only read.
448
-
449
- **One consequence, measured rather than assumed.** At the default 800x450
450
- window a caption needs 16 px and 0.03 of the content area gives 12, so a
451
- button's text clips there. From roughly 800x720 upward it fits comfortably
452
- (20 px and rising). The old 0.04 gave exactly 16 px at the default size, which
453
- is why this did not show before. A label has always been 0.03 and has always
454
- clipped at that size; this makes buttons match it in both respects.
455
-
456
- - **Adding an element is now a deliberate two-step act: pick a type, then place
457
- it.** The palette starts with nothing armed and returns to that after each
458
- placement, so one pick puts down one element and the highlight clears.
459
-
460
- A type used to be armed permanently, defaulting to the first in the list, so
461
- *any* click on the canvas background produced an element — including the click
462
- a researcher meant as "get out of what I was doing". They then had to find the
463
- stray element and delete it, and the most likely place for it to land was
464
- underneath something else.
465
-
466
- With nothing armed, a background click does what a background click normally
467
- does: commits whatever was being typed, drops the selection, and takes the
468
- focus. Existing elements are still selectable, movable and deletable — the
469
- canvas is not inert, it just does not manufacture things.
470
-
471
- ### Added
472
-
473
- - **Hovering an element in the editor names its tag.** A button reading "Click
474
- here!" gives no clue whether it is `cmd_0` or `run_fit`, and that name is what
475
- the researcher's code uses — so the tooltip answers where the question is
476
- asked, rather than making them select the element and read the properties
477
- panel.
478
-
479
- Shown for everything that displays text, including the two selectors. An axes
480
- is left out on purpose: it already has its tag drawn on it, so a tooltip would
481
- only repeat what is there.
482
-
483
- Faster than the top-bar tooltips (200 ms against 450 ms), because the pointer
484
- is already on the thing being asked about and the answer is one word. Not
485
- instant: zero delay would flicker across the canvas on any movement. It holds
486
- still once shown rather than following the pointer, and gets out of the way on
487
- a press or a drag.
488
-
489
- Canvas items cannot carry `<Enter>` and `<Leave>` the way widgets can, so this
490
- is driven from the motion handler that already reports what a press would do.
491
-
492
- ### Fixed
493
-
494
- - **An element with no text showed its tag instead of nothing.** Clearing a
495
- label's text gave a label reading `lbl_0`; the same applied to a button and to
496
- the two selectors.
497
-
498
- It was deliberate once. In the first implementation a newly drawn element had
499
- no text at all, so without the fallback it was an invisible rectangle. Every
500
- type has carried a real default since 1.1.0 — "Information:", "Click here!" —
501
- which means the fallback could only fire when somebody had *deliberately*
502
- cleared the text, and that is the one moment it is certainly not what they
503
- meant. A blank status line that fills in later is an ordinary thing to want.
504
-
505
- **The editor still shows the tag** on an element with no text, and that is not
506
- an oversight: there you are working on the elements themselves, and one with
507
- nothing in it still has to be findable and clickable on the canvas. The editor
508
- labels what you are editing; the interface shows what you wrote.
509
-
510
- Nothing changes about what a new element says.
511
-
512
- ## [1.3.1] — 2026-09-09
513
-
514
- Repository only. Nothing here changes the installed package, so 1.3.0 on PyPI is
515
- not defective and needs no replacement.
516
-
517
- ### Fixed
518
-
519
- - **CI had been red on Linux since 1.2.0, and 1.3.0 was published anyway.**
520
-
521
- The failure was in a test, not in iterlab: it typed a filename by generating
522
- key events with the raw character as the keysym, and X11 wants keysym *names*
523
- — `.` is `period` there. Windows Tk accepts the character, so the local suite
524
- passed on Windows every time while the Linux job failed. Characters now map to
525
- the names Tk knows on every platform.
526
-
527
- This is the second defect of exactly this shape. The first was `size_nw_se`,
528
- a cursor name Windows accepts and X11 does not, which CI also caught and which
529
- is guarded by a test asserting every cursor name is valid on the running
530
- platform. There is now a matching test for keysyms, next to it.
531
-
532
- The 1.2.0 run failed for an unrelated reason — `apt-get update` could not
533
- fetch its indexes on the runner. Infrastructure, not code, but it meant the
534
- first red run was easy to wave away, and the next two were not looked at.
535
-
536
- ### Added
537
-
538
- - **`tools/preflight.py`**, which asks every question that must be answered
539
- before publishing: clean tree, commit pushed, **CI green for this exact
540
- commit**, artifacts present and matching the declared version with no stale
541
- ones beside them, `twine check`, README links resolving anonymously, and a
542
- recorded Gate 2 pass. Non-zero exit means do not upload.
543
-
544
- The constitution already said this gate is "absolute rather than advisory".
545
- It was advisory in practice because nothing enforced it — the local suite was
546
- green each time, and nobody opened the run that tests the platform the
547
- developer is not using. A check that depends on someone remembering to look is
548
- not a gate.
549
-
550
- Gate 2 is warned about rather than enforced: only a person can perform it, so
551
- a tool can ask whether it happened but cannot honestly refuse on its behalf.
552
-
553
- ## [1.3.0] — 2026-09-09
554
-
555
- ### Changed
556
-
557
- - **Text and number boxes fire on a committed value, not on every keystroke.**
558
- Enter always runs the handler; leaving the box runs it only if the value
559
- actually changed, so clicking past a box on the way somewhere else does
560
- nothing. The generated stub is now `on_changed_<tag>`.
561
-
562
- Per keystroke redraws once for `1`, again for `10`, again for `100` — two of
563
- those plots are of a number nobody meant, and each one costs whatever the
564
- researcher's handler costs.
565
-
566
- **This was already decided, and I missed it.** The spec has carried a note
567
- since before boxes existed: a text box "commits its value on Enter or on
568
- leaving the field, never on every keystroke ... recorded here so the
569
- convention is not re-litigated when text boxes are built". 1.2.0 re-litigated
570
- it by accident, because nobody re-read the note when the element was finally
571
- built. The note now records that too — a written-down decision only helps if
572
- it is consulted at the moment the thing it describes gets made.
573
-
574
- ### Added
575
-
576
- - **A `changed` interaction**, joining click, hover, move and key. Universal in
577
- the same sense as the others: any element may have a handler written for it,
578
- and one whose value never changes simply never fires — indistinguishable from
579
- an element nobody wrote a handler for. It exists because "the researcher
580
- finished entering a value" is not the same question as "a key went down", and
581
- cannot be built out of `key` without every researcher reimplementing the same
582
- debounce. FR-017a is amended accordingly.
583
-
584
- Renaming an element carries its `on_changed_` handler, like every other.
585
-
586
- - `on_key_<tag>` is untouched and still fires per keystroke for anyone who wants
587
- it, so nothing written against 1.2.0 stops working.
588
-
589
- ## [1.2.0] — 2026-09-09
590
-
591
- *Reached GitHub but not PyPI; superseded by 1.3.0.*
592
-
593
- ### Added
594
-
595
- - **Text and number boxes now generate an `on_key_<tag>` handler**, firing on
596
- every keystroke, and the generated one prints what was typed — `.text` for a
597
- text box, `.value` for a number box.
598
-
599
- This reverses the call made in 1.1.0, where boxes got no stub on the reasoning
600
- that a box is read when something *else* happens. That covers one use and
601
- misses the better one: a plot that follows a value as it is typed, with no
602
- button to press. A researcher who wants the click-then-read pattern deletes
603
- the handler; one who wants live updating would otherwise have had to know that
604
- `on_key_<tag>` exists at all.
605
-
606
- A half-typed number is safe to read: `""`, `"-"` and `"0."` all report `0`
607
- rather than raising, so a handler firing mid-keystroke cannot fault the
608
- session.
609
-
610
- - **The generated file is runnable.** Every new `demo.py` ends with:
611
-
612
- ```python
613
- if __name__ == "__main__":
614
- import iterlab
615
-
616
- iterlab.run(__file__)
617
- ```
618
-
619
- so an IDE's run button opens the interface, with no terminal and nothing to
620
- remember. It passes `__file__` rather than a name, so it works from any
621
- working directory and survives renaming the pair. It cannot loop: iterlab
622
- executes the researcher's module under a name of its own, so `__name__` is
623
- only `"__main__"` for the copy they launched — proven by a test that loads the
624
- file the way the loader does.
625
-
626
- Interfaces created before this do not get it retrofitted. iterlab adds
627
- handlers to a researcher's file and nothing else, and that rule is worth more
628
- than the convenience.
629
-
630
- ### Fixed
631
-
632
- - **A typed property could still be silently discarded**, and 1.1.1's fix for
633
- that is what made it reachable.
634
-
635
- Rebuilding the properties panel destroys its fields, and Tk fires `<FocusOut>`
636
- at a focused widget as it goes. That event is *queued*: it arrives after the
637
- rebuild has finished and the panel's busy flag is clear, so the handler
638
- commits into whichever element is now selected. 1.1.1 added commit points on
639
- selection and on canvas press, which multiplied the rebuilds and turned a
640
- latent race into one that fired often. The old fields are now unbound before
641
- they are destroyed, so a stale event has nothing to run.
642
-
643
- Found by a test that failed roughly one run in five and could not be
644
- reproduced by running its own file — it needed another file to have run first.
645
- Confirmed as mine by running the same loop against 1.1.0 in a worktree: twenty
646
- clean runs there, three failures in fifteen on the current tree.
647
-
648
- ### Changed
649
-
650
- - **New handler stubs are inserted above the `if __name__` block** rather than
651
- appended after it. That block reads as the end of the file, and appending
652
- below it would push it further from the bottom with every element drawn. The
653
- guard is matched structurally, so `'__main__'`, extra spaces or a reversed
654
- comparison all count; only a *trailing* guard qualifies, since one mid-file is
655
- not a launcher and inserting above it would drop a stub into the middle of the
656
- researcher's code. Any comment directly above it travels with it. A file
657
- without a guard is appended to exactly as before.
658
-
659
- ## [1.1.1] — 2026-09-09
660
-
661
- ### Fixed
662
-
663
- - **A typed property was lost unless focus went to another property field.**
664
- Editing a value and then clicking an element, the canvas, or a palette card
665
- silently discarded it. Tabbing to the next field worked, which is what made it
666
- look intermittent rather than broken.
667
-
668
- `<FocusOut>` cannot carry this on its own. Tk fires it when another *widget*
669
- takes keyboard focus, and most of what a researcher clicks next does not take
670
- it — a Canvas, an element drawn on it and a palette card are all unfocusable.
671
- Even when focus does move, Tk delivers the event on the next pass through the
672
- event loop, by which time the panel has been rebuilt for the new selection and
673
- the entry holding the edit no longer exists. The canvas already called
674
- `focus_set()` first thing on a press, which looked like it should have covered
675
- this and could not.
676
-
677
- Committing is now explicit and synchronous on the events where focus really
678
- leaves: a press on the canvas, a palette choice, opening the **More** drawer.
679
-
680
- - **The reported extension filter was this same bug.** Typing `pdf` into
681
- **Types** and clicking away never saved it, so the chooser had nothing to
682
- filter by and offered everything. It works once the value is committed.
683
-
684
- - **An editor change to `extensions` lost to a value set from code.** Found
685
- while checking the above. Session state is deliberately preserved across a
686
- mode switch, and an explicit edit in the editor is supposed to beat it — the
687
- rule already covered `label` and `style`, and `extensions` was simply missed
688
- when it was added a version ago.
689
-
690
- ### Notes
691
-
692
- - The first attempt at the commit fix also committed inside `select`, which is
693
- the refresh path that a drag, a resize and an apply all end on. That wrote the
694
- panel's now-stale position back over the change that had just happened, and a
695
- dragged element snapped home — 15 tests caught it, and the suite time went from
696
- 63s to 161s from the churn. There is now a test for that specific regression,
697
- and one asserting that clicking about without typing does not rewrite the
698
- layout file at all.
699
-
700
- ## [1.1.0] — 2026-09-09
701
-
702
- *Reached GitHub but not PyPI; published as part of 1.1.1.*
703
-
704
- ### Added
705
-
706
- - **Two new element types: `file_select` and `folder_select`.** Each is a button
707
- that opens the operating system's own chooser — the one a researcher already
708
- knows, with their places and network drives in it.
709
-
710
- The first of each takes the bare tag, `fileselect` and `folderselect`, with no
711
- `_0`: an interface almost always has exactly one, and a number on the only one
712
- of something is noise that then appears in every handler mentioning it. A
713
- second becomes `fileselect_1`.
714
-
715
- `.path` is the choice. It is `""` before anything is picked **and** when what
716
- was picked has since been deleted or moved — a path that no longer resolves is
717
- worse than none, because `if ev.fileselect.path:` would pass and the open
718
- would fail on something that looks perfectly valid. The chooser still reopens
719
- where the file used to be, since a renamed file is usually still beside it.
720
-
721
- The handler fires **after** a choice, so `.path` is set when researcher code
722
- runs. Cancelling does nothing at all: no handler, no change.
723
-
724
- The caption stays "Select a File"; showing the selection is one line in the
725
- researcher's handler, and the generated stub shows it. How the interface looks
726
- stays theirs to decide.
727
-
728
- - **`extensions` on the file selector**, in the editor as **Types** and in code
729
- as `ev.fileselect.extensions`. Comma-separated, forgiving about `.TXT`,
730
- `*.csv` and stray spaces, blank meaning every file. "All files" is always
731
- offered alongside, because a filter nobody can escape is a trap the moment one
732
- file was saved with the wrong suffix.
733
-
734
- - **Selections persist across a hard reset and across the process.** Stored in
735
- the user's own state directory keyed by the interface's path, never in the
736
- layout file: `demo.yaml` describes the interface, and writing a runtime choice
737
- into it would make it a log of what happened and a spurious diff in everyone's
738
- repository. The project folder stays the two files it has always been. The
739
- accepted cost is that moving or copying a project starts fresh, which behaves
740
- exactly like a first run.
741
-
742
- Nothing there can raise on the researcher's account: a missing file, unreadable
743
- JSON, a read-only profile all mean "nothing remembered", which is a state every
744
- caller already handles because it is what a first run looks like.
745
-
746
- - `ui/dialogs.py`, one seam for the only modal dialogs iterlab opens. The test
747
- suite's ban on `tkinter.filedialog` stays exactly as it was, so a path that
748
- reaches a real chooser without being replaced fails loudly instead of hanging.
749
- It also normalises Tk's mix of `""`, `()` and `None` for a cancelled dialog
750
- into one shape.
751
-
752
- - `Event.path`, carrying what was just chosen.
753
-
754
- ### Changed
755
-
756
- - **Layout schema 4 → 5**, no-op migration. Nothing in an existing file changes;
757
- the version moves so a version-4 build refuses a file containing a type it has
758
- never heard of rather than reporting it as a defect in the layout.
759
-
760
- ## [1.0.0] — 2026-09-08
761
-
762
- **First public release.** `pip install iterlab`.
763
-
764
- Numbered 1.0.0 rather than continuing the 0.x line because this is the first
765
- version anyone else can install: a 0.21 would read as accumulated churn, where
766
- what it actually marks is the point the tool became available.
767
-
768
- Everything in the entries below shipped in this one release. They were written
769
- as the work happened and are kept as the development record; nothing before this
770
- had ever been published.
771
-
772
- ### What this version commits to
773
-
774
- 1.0.0 is a promise under semantic versioning, so the following are the public
775
- surface and will not change without a major bump:
776
-
777
- - the `on_<interaction>_<tag>` handler naming convention, and `ev` as the first
778
- argument to every handler
779
- - `ev.<tag>` reaching an element, and `.text` on every element that shows text
780
- - an axes element being a real `matplotlib.axes.Axes`
781
- - the `iterlab <name>` command and `iterlab.run(name)`
782
- - the layout schema, which carries its own version and migrates forward
783
-
784
- The layout schema is versioned separately and independently: a file written by
785
- an older build is migrated on open, and one written by a newer build is refused
786
- rather than half-understood.
787
-
788
- ### Changed
789
-
790
- - **Ordinary semantic versioning resumes.** Below 1.0.0 the constitution
791
- suspended the MINOR/PATCH distinction and bumped MINOR on *every* change, so
792
- that the version answered "is the thing in front of me the thing I just
793
- changed?" during hand testing. From here PATCH means a fix, MINOR means an
794
- addition, MAJOR means a break — which is what a version has to mean once other
795
- people depend on it.
796
- - `Development Status` classifier moves from `3 - Alpha` to `4 - Beta`. Claiming
797
- 1.0.0 while advertising alpha would contradict itself. The README's "early,
798
- and honest about it" stands: this is a first public release, not a mature one.
799
-
800
- ## [0.21.1] — not published
801
-
802
- Renumbered to 1.0.0 before publishing.
803
-
804
- Everything in the entries below shipped in this one release; they were written as
805
- the work happened and are kept as the development record. Nothing before this had
806
- ever been published.
807
-
808
- ### Fixed
809
-
810
- - **The README logo was a broken image.** The repository is private, and
811
- `raw.githubusercontent.com` returns 404 for a private repository without a
812
- token — so the image failed for every viewer, including on GitHub. The file
813
- was present and pushed the whole time; the URL simply could not be fetched.
814
-
815
- This is invisible to whoever owns the repository if they only ever check while
816
- signed in, and it is the same failure the README's `GUIDE.md`, `LICENSE` and
817
- `NOTICE` links have. All four resolve once the repository is public, which is
818
- also what the PyPI page needs, since PyPI renders the README anonymously.
819
-
820
- ### Added
821
-
822
- - `tools/check_readme_links.py`, which fetches every external README link with
823
- no credentials at all — the way a stranger's browser does. It reports 4 of 4
824
- dead against a private repository and should report all clear before
825
- publishing. A broken logo on the page people arrive at first is not worth
826
- discovering after an upload that cannot be undone.
827
-
828
- ## [0.21.0] — 2026-09-08
829
-
830
- *Published to PyPI, then superseded fourteen minutes later by 1.0.0.
831
- It is the earliest version installable from PyPI; 1.0.0 is the one to use.*
832
-
833
- Everything in the entries below shipped in this one release; they were written
834
- as the work happened and are kept as the development record. Their "unreleased"
835
- labels are accurate for what they were at the time — nothing before this had
836
- ever been published.
837
-
838
- ### Changed
839
-
840
- - Install instructions in `README.md` and `GUIDE.md` now say `pip install
841
- iterlab`, since that is true from this release onward. The guide keeps the
842
- source install for anyone who wants to change iterlab itself.
843
- - `README.md` links and the logo are absolute URLs. PyPI renders this README on
844
- its own page, where a repository-relative path resolves to nothing — the logo
845
- would have been a broken image and every link a 404, visible to everyone
846
- arriving at the project for the first time.
847
- - Added `Documentation`, `Repository`, `Changelog` and `Issues` project URLs, a
848
- 3.13 classifier, and operating-system and environment classifiers.
849
-
850
- ## [0.20.2] — unreleased
851
-
852
- ### Documentation
853
-
854
- - **The logo now heads `README.md` and `GUIDE.md`**, from `docs/logo.png`.
855
-
856
- - **Both documents brought back in line with the code.** Everything below was
857
- wrong, not merely dated:
858
-
859
- - `README.md` said `pip install iterlab`. It is not on PyPI, and the guide
860
- said so two paragraphs later in a different file. Now both give the
861
- repository install.
862
- - `README.md` claimed "two element types" with "text boxes, labels ... next".
863
- There are five, and text boxes and labels are two of them.
864
- - `GUIDE.md` told the reader to draw `ax_0` and `cmd_0` and then showed an
865
- example using `ev.spectrum` and `on_clicked_run_fit` — tags it had never
866
- asked anyone to create. The worked example now uses the tags it just named,
867
- and says renaming is available.
868
- - Two leftovers from a careless find-and-replace: "use **Restart reset**" and
869
- "press **Restart app**", for a button now called **Hard reset**.
870
- - "Buttons and labels carry these" under Styling, written before boxes
871
- existed and never revisited.
872
- - Stubs were described as generated for "buttons and plot areas", with
873
- "plot areas" long since renamed and boxes never mentioned.
874
- - The styling note said code-set style is lost when you "close and reopen".
875
- True, but it now survives a mode switch, which is the case a researcher
876
- actually meets.
877
-
878
- - Every code example in the guide was executed against this build — startup,
879
- the click handler, all eleven style properties, `.text` on each type, and
880
- `.value` on a number box — rather than read over. No fault was raised by any
881
- of them.
882
-
883
- ## [0.20.1] — unreleased
884
-
885
- ### Fixed
886
-
887
- - **A mode switch reset every element to its layout value.** Text typed into a
888
- box, and a caption, colour or enabled-state set from code, all reverted on the
889
- way back from the editor. Reported as "gui objects get reset when going to
890
- editor".
891
-
892
- The session introduced in 0.12.0 kept `ev` and the contents of each plot, but
893
- not the widgets' own state — and a switch destroys every widget and builds new
894
- ones from the layout file, so anything the *running* interface had done was
895
- lost. The layout is where an element starts, not where it currently is.
896
-
897
- Each handle can now report its presentation and have it restored; the session
898
- holds it across the switch. Programmatic style was reverting too, which was
899
- not in the report but is the same defect.
900
-
901
- **An edit in the editor still wins.** The remembered value is recorded
902
- alongside the layout value it was based on, so if the researcher has since
903
- changed the caption or the colour themselves, the remembered one is dropped —
904
- editing a button's caption and having the old one come straight back would be
905
- its own bug report. Position is not presentation, so moving an element does
906
- not discard what it was showing.
907
-
908
- A **hard reset** still clears everything, which is the difference between
909
- restarting and toggling.
910
-
911
- 14 tests; 10 of them fail against the unfixed code.
912
-
913
- ## [0.20.0] — unreleased
914
-
915
- ### Added
916
-
917
- - **Two new element types: `text_box` and `number_box`.** A text box holds a
918
- line someone types; a number box refuses anything that is not a number.
919
-
920
- The number box validates the *proposed* contents on each keystroke rather than
921
- correcting afterwards, so a rejected character never appears at all — no
922
- flicker, and the box is never momentarily holding something that is not a
923
- number. It deliberately accepts the half-written states a person passes
924
- through: `""`, `"-"`, `"."` and `"-."` are all on the way to a number, and
925
- refusing them would make a negative or a decimal impossible to type.
926
-
927
- `.value` gives the number — `int` when it is a whole one, so
928
- `range(ev.val_0.value)` works without casting — and an empty box reads as `0`
929
- rather than raising, since someone who cleared it to retype is mid-edit, not
930
- mistaken. `.text` gives the same thing as a string.
931
-
932
- Neither gets a generated stub, for the reason a label does not: a box is
933
- normally read when something *else* happens rather than reacted to keystroke
934
- by keystroke. Every interaction remains available to a hand-written handler.
935
-
936
- - **`.text` on every element that shows text**, whatever kind it is. A button
937
- and a label keep their string in Tk's `-text` option and a box keeps it in a
938
- variable; `.text` hides that, so `ev.<tag>.text` works without first
939
- remembering what `<tag>` is.
940
-
941
- ### Changed
942
-
943
- - **Default tags are now short and typed**: `cmd_0` for a button, `lbl_0` for a
944
- label, `edt_0` for a text box, `val_0` for a number box (`ax_0` unchanged).
945
- These are the shorthands a person would use themselves, so `ev.cmd_0` reads
946
- the way the code around it already does.
947
-
948
- - **New elements come with working text**: a button says "Click here!" and a
949
- label says "Information:", rather than repeating their own tag. A button
950
- reading `cmd_0` is a placeholder the researcher has to fix before showing
951
- anyone; one reading "Click here!" is a control. The default button is slightly
952
- wider to fit its caption — a default that clips its own text is worse than one
953
- that is a little roomy.
954
-
955
- - **Layout schema 3 → 4.** Nothing in an existing file changes and the migration
956
- is a no-op, but the version has to move: a file written now may contain a type
957
- a version-3 build has never heard of, and the version gate is what makes that
958
- build refuse the file cleanly rather than report an unknown element type as a
959
- defect in the researcher's layout.
960
-
961
- ## [0.19.1] — unreleased
962
-
963
- ### Fixed
964
-
965
- - **The window icon did not appear.** Tk offers two mechanisms — `iconbitmap`
966
- with an `.ico` and `iconphoto` with a `PhotoImage` — and 0.18.0 applied both
967
- "for coverage". They do not layer: applied together to one window the title
968
- bar shows a blank grey square, which is worse than either alone and worse than
969
- doing nothing. Each works perfectly on its own.
970
-
971
- Exactly one is applied now, chosen by platform: `iconbitmap` on Windows, so
972
- each size gets the frame drawn for it and the title bar shows the 16 px
973
- artwork rather than Tk squeezing down the 256; `iconphoto` elsewhere, which is
974
- what X11 and macOS honour. The other is tried only when the first *fails*, as
975
- a fallback rather than a supplement.
976
-
977
- The test that existed asserted `apply()` returned True — which it happily did
978
- while producing an empty box. It is the same shape of defect as every wiring
979
- bug in this project: the mechanism was tested and the outcome was not. The
980
- test now counts which Tk calls are actually made and fails if both are, and
981
- Gate 2 gained an item to look at the title bar, since only a person can tell a
982
- drawn icon from a blank one.
983
-
984
- ## [0.19.0] — unreleased
985
-
986
- ### Changed
987
-
988
- - **The icon is redrawn from a supplied logo**: a waveform ringed by two arcs
989
- chasing each other. The wave is the researcher's data, the ring is the loop
990
- they work inside, which is a better statement of the tool than the previous
991
- drawing managed.
992
-
993
- Two things carry it. The ring takes an **angular** gradient whose colour run
994
- is mapped onto each arc's own sweep, so a tail is fully dark and an arrow head
995
- fully bright — spread over a half-turn instead, both ends land mid-blue and
996
- the heads lose their punch. The wave takes a **linear** gradient, because it
997
- travels where the ring turns.
998
-
999
- The detail thresholds moved after looking at the frames magnified rather than
1000
- guessing: at 64 px the dotted arcs had already collapsed into a grey fuzz that
1001
- made the whole mark look dirty, so the full drawing now starts at 128.
1002
-
1003
- **The 16 and 24 px frames invert** — a white wave on solid brand blue. A dark
1004
- line on a near-white tile has almost no ink left to work with at that size and
1005
- goes faint in a taskbar, where the light tile's own edge is lost too. It
1006
- trades a little consistency between sizes for a mark that can be seen, and
1007
- nobody views the 16 and the 256 side by side.
1008
-
1009
- ## [0.18.0] — unreleased
1010
-
1011
- ### Added
1012
-
1013
- - **An application icon**, replacing Tk's default feather — which tells a
1014
- researcher nothing and makes the window look like a stray interpreter in a
1015
- taskbar full of real applications.
1016
-
1017
- A plot with a loop: the rising curve is every plotting library's icon, and the
1018
- circular arrow is what makes it this one, since iterating inside the interface
1019
- rather than re-running a script is the whole product.
1020
-
1021
- - `tools/make_icon.py`, which *is* the icon — checked in as the source rather
1022
- than a binary somebody would have to open an image editor to change.
1023
-
1024
- It draws at 8x and downsamples, and brushes strokes as overlapping discs
1025
- rather than using `draw.line`, which leaves notches exactly where this curve
1026
- turns. The `.ico` carries **three detail levels across seven sizes**: below
1027
- 48 px the axes are dropped and the brush fattens, and at 16 px only the curve
1028
- survives. An icon is not one drawing scaled — the thin marks close into mud —
1029
- and a test asserts the 16 px frame is not merely the 256 resampled.
1030
-
1031
- Applied through both `iconphoto` (portable, honoured by X11 and macOS) and
1032
- `iconbitmap` (what Windows uses for the title bar and taskbar, and crisper
1033
- there). Neither can raise: an icon is decoration, and decoration must not be
1034
- able to end a session. The `PhotoImage` is held for the life of the process,
1035
- since Tk silently reverts to the feather when one is collected.
1036
-
1037
- ## [0.17.0] — unreleased
1038
-
1039
- ### Added
1040
-
1041
- - **Hover text on the top-bar buttons.** Two of them differ only in how much
1042
- they throw away, and a two-word label cannot carry that. `Tooltip` is drawn as
1043
- a borderless toplevel that never takes focus.
1044
- - **A "Screenshot" button**, writing a PNG beside the interface's own files as
1045
- `demo-<date>-<time>.png`. It captures the **content area only** — the top bar
1046
- is iterlab's furniture and has no business in a figure someone pastes into a
1047
- report. No file dialog: a modal blocks the test suite outright, the same
1048
- reason element creation does not ask for a name. Pillow already ships with
1049
- matplotlib, so this adds no dependency. A machine that cannot grab the screen
1050
- (headless Linux) reports it through the fault banner rather than taking the
1051
- window down.
1052
- - **A "More" drawer in the properties panel.** Only the tag, and the text for a
1053
- button or label, are shown by default; position, size, colour, font and state
1054
- are behind it. The set is declared per element type in
1055
- `schema.BASIC_PROPERTIES`, so a future slider declares its range and starting
1056
- position the same way a button declares its caption.
1057
-
1058
- The advanced widgets are *built* either way and only packed or not, so
1059
- committing an edit never depends on which fields the researcher happened to
1060
- reveal. The drawer stays open across selections — someone adjusting colours
1061
- across several elements should not have to reopen it each time.
1062
-
1063
- ### Changed
1064
-
1065
- - **"Restart app" is now "Hard reset"**, in the top bar and in the startup
1066
- notice.
1067
- - **Positions and sizes are rounded to two decimals on construction**, not only
1068
- when saved. Hundredths of the window is finer than anyone can place by hand or
1069
- see, and finer than that turns the layout file into digits whose diffs mean
1070
- nothing. Rounding at construction means what is in memory is what is on disk,
1071
- so a value never changes under a researcher between drawing it and reopening
1072
- it.
1073
-
1074
- Validation still runs first, so a genuinely invalid rectangle is rejected
1075
- rather than quietly rounded into an acceptable one. Only rounding's own
1076
- artefacts are corrected: a sliver that would round away to nothing becomes the
1077
- smallest real element, and an edge rounded past the window is given its
1078
- position back rather than being shrunk.
1079
-
1080
- `DEFAULT_SIZE["button"]` moves from `0.035` to `0.04` high, since a default
1081
- ought to be expressible on the grid it will be snapped to.
1082
-
1083
- ## [0.16.0] — unreleased
1084
-
1085
- ### Fixed
1086
-
1087
- - **An edited `on_startup` was often not noticed at all.** Reported as "nothing
1088
- happens", and there were two independent reasons, either of which was enough
1089
- on its own:
1090
-
1091
- 1. The check hung off the dispatcher's after-invoke hook, which fires only
1092
- when a handler actually ran. Clicking an element you have not written code
1093
- for — normal, and silent by design — never looked at the file. So the
1094
- notice appeared only if you happened to click something that already had a
1095
- handler.
1096
- 2. Nothing checked without an interaction at all. Saving the file and looking
1097
- at the window did nothing, which is exactly when a researcher expects
1098
- something to happen.
1099
-
1100
- The check now runs before *every* interaction whatever it goes on to do, and
1101
- a 700 ms poll notices a save on its own. It reads the file rather than the
1102
- loaded module — deliberately, since reloading on a timer would re-run
1103
- module-level code uninvited, and since the module is only reloaded when an
1104
- interaction reaches a handler that exists.
1105
-
1106
- ### Added
1107
-
1108
- - **A "Re-run startup" button in the top bar**, as requested. Enabled only when
1109
- startup has actually been edited, so the button is its own indicator: save the
1110
- file, look up, and it has come alive. It runs the new startup over the session
1111
- already in memory, so the data survives.
1112
-
1113
- ### Changed
1114
-
1115
- - The notice's second action is now **Restart app**, the same restart the top
1116
- bar offers, rather than a separate session-only restart. One restart concept
1117
- in the interface rather than two whose difference is invisible.
1118
- - `ModuleLoader.generation`, added in 0.13.0, is gone. The staleness check is
1119
- keyed to the file's own (mtime, size) instead, which is what let it work
1120
- without loading anything — and an API with one caller that no longer needs it
1121
- is better deleted than kept.
1122
-
1123
- ## [0.15.0] — unreleased
1124
-
1125
- ### Changed
1126
-
1127
- - **`ev.<tag>` for a plot is now a real matplotlib `Axes`**, not an object that
1128
- forwards to one. `AxesHandle` subclasses `Axes` and is registered as a
1129
- matplotlib projection, which is the supported way to have a figure build a
1130
- particular Axes subclass.
1131
-
1132
- The difference is invisible for `ev.ax_0.plot(...)`, which worked either way,
1133
- and decisive everywhere else. `isinstance(ev.ax_0, Axes)` is now true, so any
1134
- library that takes an `ax=` argument accepts it, and matplotlib's own
1135
- machinery does too. A forwarding wrapper fails all of that — and fails it
1136
- inside whatever library the researcher passed it to, a long way from anything
1137
- iterlab wrote.
1138
-
1139
- - **The element type `plot_area` is renamed `axes`**, and new ones are tagged
1140
- `ax_0`, `ax_1`, … rather than `plot_0`. `ax` is what the variable is called in
1141
- everyone's matplotlib code, so `ev.ax_0` reads the way a researcher's own code
1142
- already does. What the layout calls the thing is now what the thing is.
1143
-
1144
- - **Layout schema 2 → 3**, with a migration that rewrites `type: plot_area` to
1145
- `type: axes`. Tags, positions and styles are untouched, so an interface drawn
1146
- before this keeps working and keeps its names.
1147
-
1148
- ### Notes
1149
-
1150
- - Everything iterlab adds to the Axes subclass is prefixed `_iterlab_`, except
1151
- the deliberate public surface (`tag`, `visible`, `canvas`, `widget`,
1152
- `element`, `disconnect`). A test asserts that nothing added shadows a
1153
- matplotlib attribute, so a future matplotlib release cannot quietly collide
1154
- with us.
1155
- - `visible` keeps its element-level meaning — is this on screen — uniform with
1156
- buttons and labels, and hides the toolbar with it. matplotlib's own
1157
- `set_visible` is left alone and still does matplotlib's thing.
1158
-
1159
- ## [0.14.0] — unreleased
1160
-
1161
- ### Added
1162
-
1163
- - **A "Restart app" button in the top bar**, beside the mode toggle. A cold
1164
- restart: the layout is re-read from disk, the researcher's module is dropped
1165
- from the import cache, and a new session begins. It is the answer to anything
1166
- a warm reload deliberately does not cover — an edited helper module, a
1167
- hand-edited layout file, or simply wanting a clean slate.
1168
-
1169
- It stays in the mode it was pressed in. Restarting is not a request to be
1170
- moved to a different screen, and the window is not resized either: that would
1171
- rearrange the researcher's desktop, which is not what was asked for.
1172
-
1173
- Replaces the narrower "Restart session" button in the top bar. That behaviour
1174
- still exists and is still offered by the startup notice, where re-running
1175
- startup over a live session is the point; as a top-bar control, one button
1176
- with one meaning beats two whose difference is invisible until it bites.
1177
-
1178
- ### Fixed
1179
-
1180
- - A layout file edited by hand into something unparsable took the window down on
1181
- restart, which is precisely what Principle III forbids. The last good layout
1182
- is kept, the interface carries on, and the error is reported through the
1183
- banner rather than swallowed. Found by a test written to check something else,
1184
- which crashed instead of failing.
1185
-
1186
- ## [0.13.0] — unreleased
1187
-
1188
- ### Added
1189
-
1190
- - **An edited `on_startup` is now noticed and offered back.** Every other
1191
- handler takes effect on the next click because the next click runs it;
1192
- startup already ran, so editing it did nothing at all and nothing said so.
1193
- Nothing raises, so no fault appeared — the code simply never ran, which is
1194
- the most expensive silence this tool can produce.
1195
-
1196
- A strip now appears offering **Re-run startup** (keeps `ev` and everything on
1197
- it) and **Restart session** (discards it). Both are offered rather than one
1198
- chosen, because whether re-running is safe depends on the researcher's code:
1199
- `ev.x = load(...)` rebinds and is safe, `ev.log.append(...)` is not. Dismissing
1200
- hides the strip without marking the edit accepted, so a further edit raises it
1201
- again — ignoring one edit must not make the next one silent.
1202
-
1203
- - `runtime/startupcheck.py`. What counts as "startup changed" is narrower than
1204
- "the file changed" — otherwise every handler edit would cry wolf — and wider
1205
- than "the text of `on_startup` changed", because startup's behaviour lives
1206
- partly in the module-level helpers it calls. The fingerprint covers
1207
- `on_startup` plus every module-level function transitively reachable from it,
1208
- compared as parsed structure so reformatting and comments cost nothing. A
1209
- file mid-edit that will not parse fingerprints as `None` and raises no alarm.
1210
-
1211
- - `ModuleLoader.generation`, so a caller can ask "has this reloaded since I last
1212
- looked?" without re-reading the file. The staleness check is therefore
1213
- proportional to edits, not to clicks.
1214
-
1215
- ### Notes
1216
-
1217
- - **New imports already worked** and needed no change: the loader executes the
1218
- module fresh rather than calling `importlib.reload`, so an `import` line added
1219
- to a live file runs on the next reload. Verified rather than assumed.
1220
- - **Imported modules are assumed not to change during a session.** If `demo.py`
1221
- does `import fitting` and `fitting.py` is then edited, the change is not
1222
- picked up: `fitting` is already in `sys.modules`, so the import statement
1223
- binds the cached module. This is a deliberate scope boundary, not an
1224
- oversight - cascading reloads through a module graph brings the stale-instance
1225
- problem with it (objects already built keep their old class), and the cost of
1226
- getting that subtly wrong is higher than the cost of restarting. **Restart
1227
- app** covers it when it matters.
1228
-
1229
- ## [0.12.0] — unreleased
1230
-
1231
- ### Changed
1232
-
1233
- - **A session now survives a mode switch.** It belongs to the interface, not to
1234
- GUI mode. Toggling into the editor to nudge a button and back no longer
1235
- discards `ev`, no longer blanks a plot, and no longer re-runs `on_startup`.
1236
-
1237
- This reverses FR-015d, which said a switch ends the session. That behaviour
1238
- did not remove the cost of reloading data so much as move it: from "every
1239
- code edit", which the reload loop already solved, to "every layout edit",
1240
- which is the other half of the same loop. A researcher with a slow load was
1241
- still paying it, just for a different reason.
1242
-
1243
- ### Added
1244
-
1245
- - **A "Restart session" control** beside the mode toggle. Because toggling now
1246
- preserves everything deliberately, there has to be one explicit way to say
1247
- start over — and it is how a change to `on_startup` takes effect. Chrome
1248
- under FR-015c, and disabled in editor mode, where there is no live session to
1249
- discard (FR-015e).
1250
- - `Session`, owning what outlives a mode: `ev`, one matplotlib `Figure` per plot
1251
- area, and whether startup has run. A `Figure` can be attached to a new canvas,
1252
- which is what makes a drawn plot survive at all.
1253
- - `Session.reconcile` and `Session.retag`, so state belonging to an element
1254
- deleted in the editor is dropped and state belonging to a renamed one follows
1255
- the new tag (FR-015f).
1256
-
1257
- ### Fixed
1258
-
1259
- - A figure's callback registry is shared with **every canvas it is ever attached
1260
- to**. Reusing the figure across a switch therefore left the dead canvas's
1261
- connections live, so a single click fired the handler once per switch ever
1262
- made — three toggles, four handler calls. `PlotHandle.disconnect()` releases
1263
- them on teardown. Found by prototyping before designing, and now covered by a
1264
- test that fails with `assert 4 == 1` without the fix.
1265
-
1266
- ### Tests
1267
-
1268
- - Three tests driving real matplotlib events through the canvas: a drawn curve
1269
- survives a switch, a click fires exactly once after three switches, and a
1270
- renamed plot keeps its curve. Each was confirmed to fail against the
1271
- unfixed code.
1272
-
1273
- ## [0.11.1] — unreleased
1274
-
1275
- ### Fixed
1276
-
1277
- - A UI test asserted real OS focus, which the window manager can withhold and
1278
- which other tests disturb by mapping and unmapping the shared Tk root. It
1279
- passed alone and failed in the full suite. Now asks Tk which widget is last
1280
- focused *for that toplevel*, which is the same question without depending on
1281
- the desktop.
1282
-
1283
- ## [0.11.0] — unreleased
1284
-
1285
- ### Added
1286
-
1287
- - **`GUIDE.md`** — a user guide: install, first interface, the handler and `ev`
1288
- model, every element type with its code API, the full styling table, tagging,
1289
- deleting, and the known limits. It will grow as element types are added.
1290
-
1291
- ### Fixed
1292
-
1293
- - A plot area's `visible` could be set but not read. `PlotHandle` delegates
1294
- unknown attributes to its matplotlib `Axes`, which knows nothing about
1295
- `visible`, so reading it raised `AttributeError` while writing it worked. Any
1296
- style property a handle can set is now also readable — found while checking
1297
- the guide's claims rather than by writing them down and hoping.
1298
-
1299
- ## [0.10.0] — unreleased
1300
-
1301
- ### Fixed
1302
-
1303
- - Clicking, hovering or typing on a **plot area** raised `NameError: name
1304
- 'name' is not defined`. The v0.8.0 tag rename missed the closure inside
1305
- `build_plot_area`, which still referred to `name` and still passed
1306
- `element=` to an `Event` whose field had become `tag`. Plot areas were the
1307
- only element type affected.
1308
-
1309
- ### Added
1310
-
1311
- - `tests/ui/test_plot_events.py` drives matplotlib's own callback machinery —
1312
- the closures in `build_plot_area` — rather than calling the dispatcher
1313
- directly. Every other plot test went straight to the dispatcher, so the
1314
- closures were never executed and a NameError in them survived a 291-test
1315
- suite. Seven of the eight new tests fail against the bug.
1316
-
1317
- ## [0.9.0] — unreleased
1318
-
1319
- ### Added
1320
-
1321
- - **Style properties on buttons and labels**: fill colour, text colour, border
1322
- colour and width, font family, font size, bold, italic, alignment, enabled
1323
- and visible. A plot area takes only `visible` — matplotlib owns the rest of
1324
- how it looks, and offering a fill colour that did nothing would be a lie.
1325
- - **Every style property is settable from code**, and doing so changes the live
1326
- widget without ever writing back to the layout file. The layout holds the
1327
- *starting* appearance; research code overrides it for the session:
1328
-
1329
- ev.title.background = "#ffe0e0"
1330
- ev.title.font_size = 20
1331
- ev.run_fit.enabled = False
1332
-
1333
- - Editors for all of it in the properties panel: hex fields with a swatch that
1334
- opens the system colour picker, a font dropdown listing only families
1335
- actually installed, and checkboxes and radio buttons for the rest.
1336
- - The editor canvas now previews an element's real colours, font and weight, so
1337
- a styling choice can be judged without toggling to GUI mode.
1338
-
1339
- ### Changed
1340
-
1341
- - **Layout schema version 2.** The `style` block is new, and an older build
1342
- would reject it as an unrecognized key, so the version had to move — and with
1343
- it comes the first real migration (FR-036c said to write one when it was
1344
- actually needed rather than in advance). A version 1 layout opens unchanged,
1345
- is migrated in memory, and is only rewritten when something is saved.
1346
- - Only non-default style values are written, so an unstyled element is still a
1347
- three-line entry.
1348
-
1349
- ## [0.8.0] — unreleased
1350
-
1351
- ### Changed
1352
-
1353
- - An element's unique identifier is now called its **tag**, everywhere. It was
1354
- "name", which collided with the interface's own name and with the handler
1355
- *function* names it appears in. The legacy 2024 spike called it a tag too.
1356
-
1357
- Researcher-facing: `event.element` becomes `event.tag`; the properties panel
1358
- field is "Tag". Unchanged: `ev.<tag>`, `on_clicked_<tag>` and the layout file
1359
- format — the tag has always been the mapping key there, so **no existing
1360
- layout or research code needs editing**.
1361
-
1362
- Internally `Element.name` becomes `Element.tag`, `Layout.names()` becomes
1363
- `Layout.tags()`, `Layout.rename()` becomes `Layout.retag()`, and
1364
- `validate_name` becomes `validate_tag`. Deliberately *not* renamed:
1365
- `Interface.name`, which is the interface's own name, and `handler_name`,
1366
- which really is a function's name.
1367
-
1368
- ## [0.7.0] — unreleased
1369
-
1370
- ### Fixed
1371
-
1372
- - Resize cursors did nothing on Linux. `size_nw_se` and `size_ne_sw` are Tk's
1373
- Windows-only names; X11 has no such cursors, so every diagonal handle showed
1374
- no pointer change at all. The guard in `_set_cursor` caught the error and
1375
- said nothing. Replaced with X11 corner names, which all three platforms
1376
- accept — and which give each corner its own cursor rather than sharing one
1377
- across a diagonal. Found by CI on Linux.
1378
-
1379
- ### Added
1380
-
1381
- - `tools/verify.py` builds a throwaway interface for the manual verification
1382
- pass: a plot, a label and two buttons, with research code that loads slowly,
1383
- plots, and fails on demand. It removes the setup from Gate 2, which was the
1384
- real reason the pass had never been done.
1385
- - A test asserting every cursor name is valid on the running platform. Tk
1386
- silently ignores an unknown one, so nothing else would report it.
1387
-
1388
- ## [0.6.0] — unreleased
1389
-
1390
- ### Added
1391
-
1392
- - A **label** element: text placed in the layout and set from code with
1393
- `ev.status.text = "..."`. It is the first type with **no generated handler** —
1394
- a label displays text rather than being clicked, and a stub for every one
1395
- would leave a pile of dead functions in the researcher's file. Every
1396
- interaction is still available if the handler is written by hand (FR-017a);
1397
- only the automatic stub is withheld.
1398
-
1399
- ### Changed
1400
-
1401
- - The editor opens at 1080x760 rather than the interface's own size. That size
1402
- describes the *interface*, and is advisory; editor mode adds a sidebar the
1403
- interface knows nothing about. Switching to the editor grows a window that is
1404
- too small but never shrinks one — a size chosen deliberately stays.
1405
- - The default button is smaller: roughly 134x38 px on a maximised 1920x1080
1406
- window, down from 230x65, which read as unusually large.
1407
- - Palette entries are single compact rows of icon and name, about 33 px each,
1408
- rather than cards with descriptions. The vocabulary is going to grow, and a
1409
- card tall enough for a description does not survive a dozen types in a
1410
- sidebar.
1411
- - The text field in the properties panel now serves any text-bearing type, not
1412
- just buttons. `label` holds a button's caption and a label's text — the same
1413
- idea, so it stays one schema field rather than two.
1414
-
1415
- ## [0.5.0] — unreleased
1416
-
1417
- ### Added
1418
-
1419
- - Generated starter files import numpy as np. No research happens without it.
1420
- - A delete control in the properties panel, pinned to the bottom of the sidebar
1421
- so a destructive action is never the thing pushed off the screen. The
1422
- element's handler stays in the code file, as it always has.
1423
- - The editor sidebar scrolls when its contents are taller than the window.
1424
-
1425
- ### Changed
1426
-
1427
- - The editor has a modern look: the `clam` ttk theme restyled with a flat
1428
- palette, the element types shown as icon cards rather than radio buttons, and
1429
- the geometry fields laid out as a 2x2 grid instead of four stacked rows.
1430
- Icons are drawn as vectors rather than loaded from image files or set as text
1431
- glyphs — no assets to ship, and no bet on the platform font having a
1432
- character.
1433
- - Property edits commit on Enter or when the field loses focus. The Apply
1434
- button is gone: a value typed and tabbed away from is a value you meant.
1435
- - Removed the dashed "mode toggle" hint from the canvas. The toggle lives in
1436
- its own chrome bar above the layout, so nothing is ever underneath it and the
1437
- hint was misleading.
1438
-
1439
- ### Fixed
1440
-
1441
- - The sidebar's contents disappeared at small window sizes. Tk stops *mapping*
1442
- children that no longer fit rather than clipping them, so the geometry fields
1443
- were absent rather than scrolled out of view — with no error, no scrollbar,
1444
- and the only symptom being that typing into them did nothing. At the 800x450
1445
- default this affected every position field.
1446
-
1447
- ## [0.4.0] — unreleased
1448
-
1449
- ### Fixed
1450
-
1451
- - A button responded only to the left mouse button. Middle and right clicks did
1452
- not reach the handler at all — Tk's `command` option fires for button 1 only,
1453
- and nothing else was bound. The event also reported `"left"` unconditionally,
1454
- since the value was hardcoded rather than read from the click. All three
1455
- buttons now fire the handler and `event.button` says which one.
1456
- - Removed `_bind_tk_events`, which was written but never called.
1457
-
1458
- ### Changed
1459
-
1460
- - The generated stub for a plot area now prints which mouse button was used
1461
- alongside the coordinates, and its comment lists the possible values. The
1462
- button was always available on the event; nothing advertised it.
1463
-
1464
- ## [0.3.0] — unreleased
1465
-
1466
- ### Changed
1467
-
1468
- - Placing an element no longer opens a modal asking for its name. The element
1469
- is created with its default name, selected, and the properties panel's name
1470
- field is focused with the text selected — so accepting the default needs no
1471
- typing and replacing it needs no extra click. This still satisfies FR-005a,
1472
- and it removes a dialog that stopped the researcher on every placement.
1473
-
1474
- ### Fixed
1475
-
1476
- - The test suite could stop and wait for a human. One code path opened a modal
1477
- that no test stubbed, which made the suite unrunnable unattended and so
1478
- disqualified it as a release gate (Principle VII, Gate 1). The dialog is
1479
- gone, and `tests/conftest.py` now makes any modal — dialog, message box or
1480
- file chooser — raise instead of block, so a future one fails loudly rather
1481
- than appearing to hang.
1482
-
1483
- ## [0.2.0] — unreleased
1484
-
1485
- Everything found by the first hands-on session with the application. Each of the
1486
- four defects below was a component that was fully implemented and never
1487
- connected to anything, and each was invisible to the automated suite because the
1488
- tests exercised the mechanism directly rather than going through the assembled
1489
- app.
1490
-
1491
- ### Fixed
1492
-
1493
- - The mode toggle did nothing. `ModeToggle` was written but never instantiated,
1494
- so the chrome frame held no control at all.
1495
- - `ev.some_plot.plot(...)` drew nothing after the first interaction. An embedded
1496
- figure gets no automatic repaint — pyplot installs that hook and pyplot has no
1497
- place here, since `plt.show()` would start a second event loop against Tk's.
1498
- Handlers now repaint whatever they drew.
1499
- - A launch-time fault in startup was reported twice, because the deferred-startup
1500
- hook re-entered itself.
1501
- - Adding an element to a `.py` written with CRLF line endings rewrote every line
1502
- in the file.
1503
-
1504
- ### Added
1505
-
1506
- - Drag an element to move it; drag an edge to resize one dimension or a corner
1507
- to resize both. Pointer feedback says what a press will do before you commit.
1508
- - Click empty canvas to place an element at a sensible default size for its
1509
- type, centred on the click. Escape deselects, since clicking now creates.
1510
- - `iterlab.run(name)` — the library entry point that contracts/commands.md and
1511
- the README had documented while `__init__.py` was empty.
1512
- - The version has a single source of truth in `__init__.py`, which
1513
- `pyproject.toml` reads.
1514
-
1515
- ## [0.1.0] — unreleased
1516
-
1517
- The initial implementation of feature 001. Never published; superseded by 0.2.0
1518
- before it left the working tree.
1519
-
1520
- ### Added
1521
-
1522
- - `iterlab <name>` opens an interface. One command; editing and using it are two
1523
- modes of one program, switched with the toggle in the top-left corner.
1524
- - **Editor mode**: a canvas, a palette of element types, and a properties panel.
1525
- Draw by dragging; every property is editable, including the name.
1526
- - **GUI mode**: the interface as drawn, with handlers wired and the standard
1527
- matplotlib navigation toolbar on every plot area.
1528
- - Two element types: plot areas and buttons.
1529
- - Handlers bind by naming convention (`on_<interaction>_<element>`), with the
1530
- universal interaction set click / hover / motion / key. Every handler is
1531
- optional; exactly one stub is generated per element.
1532
- - Code changes take effect on the next interaction with no restart, and nothing
1533
- in the session is discarded — loaded data, computed results and drawn plots
1534
- all survive.
1535
- - A fault in researcher code never ends the session. It is reported to stderr
1536
- in full and signalled in the window, and the report clears when corrected code
1537
- runs. An element with no handler is silent, which is a different thing.
1538
- - Renaming an element rewrites its handlers and nothing else in the file.
1539
- - Layout files record `schema_version: 1`. A layout written by a newer iterlab
1540
- is reported and left untouched rather than partially understood.
1541
-
1542
- ### Known limits
1543
-
1544
- - A mode switch ends the session; switching back runs startup again. Applying
1545
- layout edits to a live session is the aim, not a promise.
1546
- - Changing `on_startup` takes effect by starting a fresh session — toggling out
1547
- and back is enough.
1548
- - Handlers run to completion while the interface waits. Long computations block
1549
- the window.
1550
- - Reloading a module re-executes its top level, so data loaded at module level
1551
- rather than in `on_startup` will reload on every edit. The generated starter
1552
- file says so.
1
+ # Changelog
2
+
3
+ All notable changes to iterlab are recorded here. The project follows semantic
4
+ versioning as defined in the project constitution's *Release And Versioning*
5
+ section, where the public surface is larger than the Python API: the layout
6
+ schema, the handler naming convention, the `ev` contract, the generated stub
7
+ shape, and the command are all consumed directly by researcher-written code.
8
+
9
+ ## [2.1.0] — 2026-09-26
10
+
11
+ ### Added
12
+
13
+ - **Right-click an element in the editor to go to its code.** The menu lists
14
+ the element's handlers, its main one first. A handler you have written opens
15
+ in your editor at its line; one you have not is added to the end of your file
16
+ and then opened, so the menu is also where you find out what else an element
17
+ can do. Only the interactions an element can fire are offered: `changed`
18
+ only for the two boxes, `key` only for those and a plot.
19
+
20
+ The heading names the editor. iterlab recognises VS Code and PyCharm when you
21
+ launched it from one, by what they set in the environment or by finding them
22
+ among its parent processes, and says `<select IDE>` when it cannot tell.
23
+ Point at the heading to pick VS Code, PyCharm, Sublime Text, Notepad++ or
24
+ your default text editor. The pick is remembered outside the project, beside
25
+ what the file selectors remember, and wins over detection from then on.
26
+
27
+ No IDE extension is involved. Each of these editors opens a file at a line
28
+ from its own command line, and sends that to the window you have open.
29
+
30
+ ### Changed
31
+
32
+ - **The first switch to your interface no longer pauses.** The editor never
33
+ draws a plot, so matplotlib - about a third of a second to import, and
34
+ seventy-odd modules - used to load the first time you pressed the toggle,
35
+ and read as iterlab being slow to run what you drew. It now loads while the
36
+ window is opening, before anything is on screen. Opening takes that much
37
+ longer; the first switch takes as long as every later one.
38
+
39
+ - **`on_key_` is gone from buttons, selectors and labels.** It could not fire
40
+ from a click: none of them takes the keyboard when clicked, and a label
41
+ cannot take it at all, so a key pressed after clicking one went to whatever
42
+ had focus before - a number box, in the case that found this. It was
43
+ documented as working on every element, and only ever did after a Tab, which
44
+ nobody does in an interface like this. They no longer listen for keys, so a
45
+ hand-written one cannot half-work. `on_key_` stays on plots and the two boxes,
46
+ which do take the keyboard.
47
+
48
+ ### Fixed
49
+
50
+ - **An edit could silently fail to take effect.** The guide's own first example
51
+ is "change `2` to `5`, save, click". Saved within a second of the last load,
52
+ that edit did nothing and reported nothing: the loader noticed the change,
53
+ reloaded, and Python handed back the old compiled code, because it judges its
54
+ `__pycache__` fresh by whole-second modification time and file size, and `2`
55
+ and `5` are the same size. A second, separate gap sat underneath it: Windows
56
+ records file times in ticks of up to about 15 ms, so two same-size saves in
57
+ one tick were not even noticed.
58
+
59
+ People rarely save twice in a second. An editor that formats on save does it
60
+ routinely, and so does an assistant editing the file. Your code is now
61
+ compiled from its source on every load, never from a cache, and a change is
62
+ detected by content as well as by time and size. This is Principle IV - a
63
+ code change takes effect without a restart - holding when it had quietly not.
64
+
65
+ - **A helper module beside your code could not be imported under the `iterlab`
66
+ command.** `import helper` next to `demo.py` worked when launched from an
67
+ IDE, where Python puts the script's folder on the path, and failed with
68
+ `ModuleNotFoundError` under `iterlab demo`, where nothing did. The project
69
+ folder now goes first on the path, exactly as `python demo.py` puts it.
70
+
71
+ - **Hard reset did not pick up an edited helper module**, though the guide said
72
+ it did. It forgot your own module, and the helper stayed cached. It now
73
+ forgets every module loaded from your project folder, and its compiled cache,
74
+ while never touching installed packages - a project's `.venv` usually sits
75
+ inside the folder, and re-importing numpy over its running C extensions would
76
+ crash rather than restart. An upgraded installed library still needs iterlab
77
+ closed and reopened, which the guide now says.
78
+
79
+ - **A plot's toolbar misbehaved after a trip to the editor.** With the zoom or
80
+ pan tool pressed, the old toolbar stayed connected to the plot and went on
81
+ answering drags, raising `invalid command name ...canvas` on each one, while
82
+ the new toolbar showed no tool pressed. And Home and Back did nothing, because
83
+ the history of views was rebuilt empty, so a zoomed plot had no way back to
84
+ the full view. The old toolbar is now disconnected, and the pressed tool and
85
+ the view history both stay with the plot.
86
+
87
+ - **The Screenshot button's hover text mentioned `.yaml` files**, a format 2.0.0
88
+ retired.
89
+
90
+ ### Documentation
91
+
92
+ - **The guide, the manual checklist, the contracts and the constitution now
93
+ match the released product.** The guide's footer claimed it was verified
94
+ against 1.4.0; its cross-version section described migrations 2.0.0 removed;
95
+ its event table missed `"changed"` and `event.path`. Five checklist rows
96
+ tested behaviour 1.6.0 replaced. The layout-schema contract still described
97
+ schema 4 in YAML, and the handler contract said `event.kind` was `"click"`.
98
+
99
+ The constitution is amended to 4.0.0. It had described YAML layouts and
100
+ handler-only renames for four releases after they stopped being true. The
101
+ 2.0.0 break, taken with no migration while iterlab had no users, is recorded
102
+ as a dated exception rather than made legal: the compatibility obligations
103
+ bind every release after it in full.
104
+
105
+ The feature 001 spec, plan, tasks and research are left as written, as the
106
+ design record they are, with a banner pointing to what is current.
107
+
108
+ ### Testing
109
+
110
+ - **The manual checklist shrinks from 59 items to 37**, before one is added for
111
+ the right-click menu. Twenty-two came out:
112
+ seven that the suite already asserted, three merged into items that judge the
113
+ same thing, eleven now automated, and one open question (does a zoom survive
114
+ a trip to the editor?) decided and tested. The rule was always that Gate 2 holds
115
+ only what cannot be automated. Several items claimed that and were wrong.
116
+ Retired numbers are listed in `VERIFICATION.md` with the test that replaced
117
+ each one, and are never reused.
118
+
119
+ - **Real launches.** A new process runs `python demo.py`, the way an IDE's
120
+ run button does, from another directory. It closes, relaunches, and checks
121
+ that the window size and a file selector's memory came back. That covers
122
+ a resize in either mode, a remembered file that was since deleted, and a
123
+ project folder that was moved.
124
+ - **Real screenshots.** The Screenshot button is pressed against a real
125
+ screen and the PNG is read back. The tests check its size, where an element
126
+ is to the pixel, and that a zoomed plot is captured zoomed.
127
+ - **The title bar icon** is grabbed from the screen and searched for the
128
+ mark's colour. Tk reports success for an icon that renders as the feather,
129
+ a grey box, or the 256 px artwork squeezed to a thin outline, and this
130
+ catches each of them.
131
+ - **Telling element types apart** is measured as perceptual colour distance
132
+ between every pair. The threshold is checked against the label and file
133
+ selector colours that once shipped looking identical.
134
+ - **A real downgrade** runs in CI. A project made by this version is opened
135
+ by the previous release, installed from PyPI, and both backups are checked.
136
+
137
+ - **The display suite could crash Windows Tk partway through.** Every interface
138
+ opened set the window icon again, and on Windows each time loads the `.ico`
139
+ afresh and never frees the last one: 21 GDI objects, against a limit of
140
+ 10,000 per process. A launch does it once, so no researcher met it, but the
141
+ suite opens hundreds of interfaces on one shared window, and reached about
142
+ 9,900 by the end. The next few tests added crashed it with an access
143
+ violation. The icon is now set once per window, and a full run peaks at a
144
+ few hundred.
145
+
146
+ - **Seventeen tests removed**: thirteen that repeated another test's check the
147
+ same way, three that could not fail, and one diagnostic left over from a
148
+ debugging session.
149
+
150
+ - **Five tests that could no longer fail now test what they say.** They wrote
151
+ 1.x YAML into what is now a Python layout file, so they passed at parsing and
152
+ never reached the validation they were named for. One passed only because its
153
+ search text happened to match the `Ev` class.
154
+
155
+ - **A layout with no version stamp no longer calls itself "a build older than
156
+ 1.4.0".** Every iterlab since then stamps what it writes, so an unstamped
157
+ file was written by hand. The message now says the file does not record which
158
+ iterlab wrote it. It is still backed up and announced.
159
+
160
+ ## [2.0.1] — 2026-09-14
161
+
162
+ ### Changed
163
+
164
+ - **A new code file separates what you never edit from what you do.** The
165
+ `TYPE_CHECKING` import that lets your editor complete `ev.` now sits at the
166
+ very top, inside a frame of `#` characters that says it is boilerplate you
167
+ do not need to touch, followed by what it is for. Your own imports start
168
+ below the frame, so the section you will add to is no longer interleaved
169
+ with the one you can ignore.
170
+
171
+ The docstring also loses its line about the top-left toggle: it describes
172
+ the window, not the code.
173
+
174
+ Checked with pycodestyle, which PyCharm's PEP 8 inspection uses, and with
175
+ ruff: neither flags the imports below the frame as not being at the top of
176
+ the file. Only new files are affected; iterlab never rewrites a file you
177
+ already have.
178
+
179
+ ## [2.0.0] — 2026-09-14
180
+
181
+ ### Changed
182
+
183
+ - **An interface is two files again: `demo.py` and `demo_layout.py`.** The
184
+ layout moved out of YAML and into a Python module, where it sits beside the
185
+ `Ev` class your editor reads. One write produces both, so what you drew and
186
+ what your editor offers cannot drift apart.
187
+
188
+ ```python
189
+ LAYOUT = {
190
+ 'schema_version': 8,
191
+ 'window': {'width': 960, 'height': 540},
192
+ 'elements': {
193
+ 'spectrum': {'type': 'axes', 'position': [0.05, 0.5, 0.9, 0.4]},
194
+ },
195
+ }
196
+
197
+
198
+ class Ev:
199
+ spectrum: "Axes"
200
+ ```
201
+
202
+ **iterlab never imports it.** The layout is lifted out of the parse tree and
203
+ evaluated as literals only, so opening somebody else's interface is as safe
204
+ as opening a data file — an `import` here would have made every shared
205
+ project arbitrary code execution. A computed value in `LAYOUT` is refused
206
+ rather than evaluated, which is the price of that guarantee and worth it.
207
+
208
+ PyYAML is no longer a dependency.
209
+
210
+ - **Files written by 1.x do not open, and there is no migration.** Deliberate:
211
+ the library is new enough to have no users, so nobody has a layout to lose,
212
+ and a migration written for files that do not exist is a cost with no payer.
213
+ A `demo.yaml` left in the folder is not read, not deleted, and not ignored
214
+ either — iterlab says what happened and opens a new interface beside it.
215
+
216
+ Schema 8 is the first version of this format. The migration machinery stays
217
+ for the next real change.
218
+
219
+ ## [1.7.1] — never published
220
+
221
+ Prepared and gated, then overtaken by 2.0.0 before it was uploaded. Everything
222
+ below ships in 2.0.0; the section stays because the work and its reasoning did
223
+ not change, only the number it went out under.
224
+
225
+ ### Added
226
+
227
+ - **Your editor can see what an element offers.** `ev.lbl_0.background` used to
228
+ complete to nothing and read as an unknown attribute to anything strict
229
+ enough to look: style properties are reached through `__setattr__` against a
230
+ tuple of names, which works perfectly at run time and is invisible to a type
231
+ checker. They are now declared as annotations without values, so an editor
232
+ can offer them while the runtime path is untouched.
233
+
234
+ `.text`, `.value`, `.path` and `.visible` gained return types, which turns
235
+ them from `Any` into `str`, `float`, `str` and `bool`.
236
+
237
+ The package also carries a `py.typed` marker now (PEP 561). Without it a
238
+ checker ignores everything above.
239
+
240
+ Checked with a real type checker against the built wheel rather than by
241
+ reasoning about it:
242
+
243
+ | expression | before | now |
244
+ |---|---|---|
245
+ | `label.background` | unknown attribute | `str \| None` |
246
+ | `label.text` | `Any` | `str` |
247
+ | `box.value` | `Any` | `float` |
248
+ | `plot.plot` | matplotlib's signature | unchanged |
249
+
250
+ This is the half that touches nothing you wrote. Completions on `ev.<tag>`
251
+ itself need a type for `ev`, which is a separate change.
252
+
253
+ - **Your editor can complete `ev.`** iterlab writes `demo_ev.py` beside your
254
+ pair, declaring each element and what it is, and rewrites it whenever you
255
+ draw, rename or delete one. Generated handlers say `ev: "Ev"`, so inside one
256
+ your editor offers the elements you drew — and `ev.ax_0.` offers matplotlib's
257
+ own methods and signatures, because an axes *is* an `Axes`.
258
+
259
+ Ordinary typing rather than an editor plugin, so it works wherever you work.
260
+ Verified by running a type checker over a project iterlab generated:
261
+ `ev.spectrum.plot` resolves to matplotlib's signature, `.value` to `float`,
262
+ `.text` to `str`, `.background` to `str | None`, and your own `ev.my_cache`
263
+ to `Any` with no error.
264
+
265
+ The generated module is read by type checkers and never at run time. Delete
266
+ it and everything still works.
267
+
268
+ **iterlab will not add the import to a file it did not write.** Everything it
269
+ puts in your file is appended, leaving what you wrote as an exact prefix, and
270
+ an import goes at the top - that guarantee is worth more than a completion.
271
+ So a file without the import gets plain stubs, as before, and the guide has
272
+ the two lines that opt in.
273
+
274
+ ### Fixed
275
+
276
+ - **The pan and zoom toolbar was missing under most plots.** It existed under
277
+ every one of them and was visible under almost none: Tk hands out a frame's
278
+ space in the order things are packed, and the canvas was packed first with
279
+ `expand=True`, so it took the lot and the toolbar was never mapped. Whether
280
+ one showed came down to whether that particular plot happened to be tall
281
+ enough, which is why it looked like the *second* axes was special.
282
+
283
+ Packed before the canvas now, which is the whole fix.
284
+
285
+ The tests that covered this asked whether the toolbar widget existed. It did.
286
+ They now ask whether it is on screen, for plots of three different heights and
287
+ across a mode switch, and the old order fails all four.
288
+
289
+ ## [1.7.0] — 2026-09-13
290
+
291
+ ### Changed
292
+
293
+ - **Renaming an element now follows it through your code.** It used to rename
294
+ the element's handlers and nothing else, which left every `ev.old_tag` in the
295
+ file pointing at an element that no longer existed — working code turned into
296
+ a runtime error the next time that line ran.
297
+
298
+ A rename now moves the handlers, attribute access (`ev.old`, and anything
299
+ else on the left of the dot), whole-word mentions in comments, and whole-word
300
+ mentions in strings. The last of those is how `ev.old` written inside an
301
+ f-string is reached, which matters because the generated stub is exactly that
302
+ shape. The properties panel reports what it rewrote, because editing someone
303
+ else's file quietly is not a thing to do twice.
304
+
305
+ **A name matches whole or not at all.** With `cmdRun` and `cmdRunAlgorithm`
306
+ both on the canvas, renaming the first to `cmdRunData` leaves the second
307
+ untouched everywhere — handler, attribute and prose — and leaves your own
308
+ `ev.cmdRun_cache` alone as well. A text substitution rewrites all three and
309
+ silently unwires an element you never touched; that is why the work is driven
310
+ by the tokenizer rather than by `str.replace`, and why swapping in the naive
311
+ version fails eight tests.
312
+
313
+ Deliberately untouched: a bare local that happens to share the name. Nothing
314
+ can distinguish it from a coincidence, so the dot is what a reference is
315
+ recognized by.
316
+
317
+ Unchanged: a file that will not parse is still refused outright, and line
318
+ endings are still preserved to the byte.
319
+
320
+ ## [1.6.0] — 2026-09-13
321
+
322
+ ### Changed
323
+
324
+ - **One window, and switching modes no longer moves it.** The editor and the
325
+ running interface are now exactly the same size at all times. The toolbar
326
+ takes its room from inside the window instead of being added beside it.
327
+
328
+ That leaves the canvas a different *shape* from the interface, and positions
329
+ are fractions — an element drawn on a canvas of the wrong shape comes out
330
+ stretched when it runs. So the canvas keeps the interface's proportions and
331
+ gives up size: the largest rectangle of that shape which fits beside the
332
+ toolbar, centred, with the backdrop showing around it. The white rectangle is
333
+ the window you will run in; the grey is the room the toolbar borrowed.
334
+
335
+ What this replaces: the editor window was the interface *plus* the toolbar,
336
+ which meant every mode switch resized the window — and every plot on screen
337
+ re-rendered for it. Switching now resizes nothing, so that cost is gone for
338
+ good rather than merely reduced.
339
+
340
+ The editor's height floor is gone with it. A short window makes for a short
341
+ toolbar, and the toolbar scrolls; it has been a scrolling column since 0.13.0
342
+ for exactly this reason.
343
+
344
+ - **Folding the toolbar grows the canvas** instead of narrowing the window. The
345
+ window cannot move — it is the interface's size — so the room the toolbar
346
+ gives up goes to the canvas, at the same proportions. Folding is now a way to
347
+ see your layout bigger.
348
+
349
+ - **A new project opens at half your screen**, rather than a fixed 800x450.
350
+ That size is a dialog on an ordinary monitor and a postage stamp on a large
351
+ one, and no fixed number can be right for both a laptop and a 4K display.
352
+
353
+ Only at creation. An existing project opens at the size it was left at, and
354
+ nothing re-decides that for you.
355
+
356
+ - **The editor backdrop is a shade darker than the sidebar.** The canvas is a
357
+ picture of the run window and its edge has to be findable; against the
358
+ sidebar's own colour, a white canvas had almost no edge at all.
359
+
360
+ ### Fixed
361
+
362
+ - **Toggling modes filled the Tcl interpreter with images.** Each plot's
363
+ pan/zoom toolbar holds fifteen Tk images, and destroying the widgets released
364
+ none of them: the objects owning them sit in reference cycles, so they stayed
365
+ until a full garbage collection happened to run. Ten round trips over three
366
+ plots left 135 behind. Enough of them and Tk dies with an access violation
367
+ while building something unrelated — which is how this was found, in a test
368
+ suite that kept falling over in a file that had nothing to do with it.
369
+
370
+ Released on teardown now, where the canvas's event connections were already
371
+ being released for the same reason. Growth over ten round trips: 135 images
372
+ before, 6 after.
373
+
374
+ - **A property field below the fold could not be typed into.** Tk unmaps a
375
+ canvas window that is scrolled out of view, and an unmapped widget takes no
376
+ focus — so in a toolbar too short to show everything, the keys went nowhere
377
+ and the value was silently never committed. Fields are now scrolled into view
378
+ when they take focus, and opening the **More** drawer brings the drawer with
379
+ it rather than opening it somewhere you cannot see.
380
+
381
+ ## [1.5.1] — 2026-09-12
382
+
383
+ ### Fixed
384
+
385
+ - **Switching back to the interface got slower, and it was the plots redrawing
386
+ twice.** Both modes come from one remembered size, so every switch now
387
+ resizes the window by the toolbar's width. `geometry` only *asks* for a size —
388
+ Tk applies it on a later pass — so the new mode was built at the old width and
389
+ every plot on screen rendered again when the resize finally landed.
390
+
391
+ Measured on three plots, per switch:
392
+
393
+ | | canvas renders | in rendering | switch |
394
+ |---|---|---|---|
395
+ | before the toolbar change | 6 | 78 ms | 133 ms |
396
+ | after it | 9 | 115 ms | 161 ms |
397
+ | now | 6 | 70 ms | 114 ms |
398
+
399
+ It is one extra render of every plot, so it costs whatever your plots cost:
400
+ barely visible on two small ones, a wait on a screenful.
401
+
402
+ The window is now sized and the resize allowed to land *before* the new mode
403
+ is built. That means running the event loop mid-switch, so a click on the top
404
+ bar can arrive between teardown and the new interface existing — `App.busy`
405
+ refuses one while a switch is part-built, rather than letting a rebuild start
406
+ inside a rebuild and tear down what the outer one is holding.
407
+
408
+ Held by a test that counts renders rather than timing them, because a timing
409
+ budget on a shared runner is a flake and the count is what changed.
410
+
411
+ - **The shipped example announced a version crossing to everyone who opened
412
+ it.** `examples/showcase.yaml` was stamped 1.4.0 and shipped in 1.5.0, so
413
+ iterlab correctly decided the file came from another version, said so, and
414
+ left two `.bak` files beside it. It now records the current version, and a
415
+ test keeps it there — it goes stale on every release by nature.
416
+
417
+ ## [1.5.0] — 2026-09-12
418
+
419
+ ### Added
420
+
421
+ - **A showcase project, in `examples/`.** Three plots — sines at several
422
+ frequencies, a scatter cloud, a bar chart with error bars — plus two boxes,
423
+ three buttons and the labels around them:
424
+
425
+ ```console
426
+ iterlab examples/showcase
427
+ ```
428
+
429
+ It is a sanity harness first: one command, and every element type that draws
430
+ is on screen doing something. Its `on_startup` builds the data and every
431
+ handler under it only draws, so editing the file and clicking **Redraw** shows
432
+ the loop the project exists for.
433
+
434
+ The suite opens it, runs its startup and uses its controls, because a curated
435
+ project is code nobody runs until someone does — which is exactly how
436
+ `tools/verify.py` came to spend several releases unable to start.
437
+
438
+ `examples/` now ships in the source distribution alongside `docs/`.
439
+
440
+ ### Changed
441
+
442
+ - **The README shows the loop rather than describing it.** A screenshot of the
443
+ showcase project in both modes, with the code between them, under the opening
444
+ paragraph. It lives in `docs/` beside the logo, so it ships in the source
445
+ distribution and not in every wheel.
446
+
447
+ The description on PyPI is frozen into each release at upload time and is
448
+ never re-read from the repository, so a README edit reaches that page only
449
+ when a version is published. This is the release that carries it.
450
+
451
+ ## [1.4.0] — 2026-09-11
452
+
453
+ ### Changed
454
+
455
+ - **One size describes both modes, and the canvas is the run window.** The
456
+ editor canvas is now exactly the interface's pixels, and the editor window is
457
+ that plus the toolbar beside it. Resize either and the other follows.
458
+
459
+ The old model added the toolbar *and* applied a floor of its own (1080x760) to
460
+ the editor, so the two modes were different **shapes**. Positions are
461
+ fractions, so an element drawn square came out stretched when run. That, not
462
+ the forgetting, was the confusing part — the sizes were never comparable in
463
+ the first place.
464
+
465
+ The editor keeps a floor, but it no longer reaches the interface. The window
466
+ stays tall enough for the toolbar's own controls; below that height the canvas
467
+ holds its own size and the leftover shows as blank space under it. Tk does not
468
+ clip a column that does not fit - it silently leaves the bottom controls
469
+ unmapped - so without the floor the properties panel loses its lower half and
470
+ still looks complete. The interface itself now has the only floor that
471
+ constrains it (320x240).
472
+
473
+ - **Editor resizes are now saved**, reversing 1.4.0's earlier rule. That rule
474
+ existed because the editor window was not the interface's size; now it is,
475
+ minus a known allowance, so it can be read straight back out.
476
+
477
+ ### Added
478
+
479
+ - **The toolbar folds to a strip.** Click **Toolbar** to fold it away and again
480
+ to bring it back. The window narrows by the difference, so the canvas keeps
481
+ exactly the pixels it had — folding tidies the desk without resizing the
482
+ interface. Called "Toolbar" rather than left as a bare chevron, because a
483
+ chevron on an empty strip does not say what expanding would get you.
484
+
485
+ Kept in the layout, so it travels with the project. Selecting an element while
486
+ folded does not open it: nothing moves unless the researcher moves it.
487
+
488
+ - **Layout schema 6 → 7** for the folded state, no-op migration; absent means
489
+ expanded, which is what every older file means.
490
+
491
+ - A test holds the two window allowances in step with the two panel widths they
492
+ stand for. They live in different modules, and if they drift the canvas
493
+ silently stops being the run window — which would go unnoticed, because
494
+ nothing would look broken.
495
+
496
+ - **A project records which iterlab last edited it, and is backed up when that
497
+ changes.** The layout carries an `iterlab_version` stamp; opening it with a
498
+ different version — newer *or* older — copies both files aside first, as
499
+ `demo.yaml.v1.3.0.bak` and `demo.py.v1.3.0.bak`. The version in the name is
500
+ the one that wrote them, since that is what the copy preserves.
501
+
502
+ Either direction, deliberately. The downgrade is the dangerous one: an older
503
+ build meets a key or an element type it has never heard of. An upgrade is
504
+ safer, because migrations run forward and are tested, but a migration is still
505
+ a rewrite of the researcher's layout.
506
+
507
+ The `.py` is copied and never otherwise touched. If a version change ever went
508
+ wrong across stub injection or a rename, that is the copy that would matter
509
+ most — a layout can be redrawn, an algorithm cannot.
510
+
511
+ An existing backup is not overwritten: the one already on disk is the older
512
+ and more original of the two. A folder that cannot be written to does not stop
513
+ the interface opening, since a folder iterlab cannot write is one it cannot
514
+ damage either — but it says so rather than failing silently.
515
+
516
+ A project made before this has no stamp, and that is the commonest crossing of
517
+ all, so its copies are named `.vunknown.bak` and it is announced like any
518
+ other. An early return on "no recorded version" made exactly that case silent,
519
+ which a test now prevents.
520
+
521
+ - **Layout schema 5 → 6** for the new key, with a no-op migration. An older file
522
+ simply has no stamp, which already means what it needs to mean.
523
+
524
+ ### Fixed
525
+
526
+ - **The Gate 2 setup tool could not be started.** `tools/verify.py` called
527
+ `create_element(..., name=...)` several releases after that argument became
528
+ `tag`, so the manual pass raised `TypeError` before it drew anything. Both its
529
+ buttons also read "Click here!" once buttons gained a default label, while the
530
+ checklist says to click **Redraw** and **Break it**. Nothing noticed either,
531
+ because the only thing that runs this tool is a person about to do a pass —
532
+ and the results table records that none happened. The tool is now exercised by
533
+ the suite, including that its button labels are words the checklist actually
534
+ names.
535
+
536
+ - **The release gate could be satisfied by prose.** Gate 2 is the recorded
537
+ manual pass, and the check that asks whether it happened looked for the
538
+ version string anywhere in `VERIFICATION.md`. 1.4.0 passed it on the strength
539
+ of a checklist item reading "open a project made before 1.4.0" — so the one
540
+ automated question standing between an unverified build and an upload that
541
+ cannot be withdrawn was answered by a sentence about something else. It now
542
+ reads the *Recorded results* table, and a near miss such as `1.3.10` does not
543
+ answer for `1.3.1`.
544
+
545
+ - **An interface reopened at the default size instead of the size it was left
546
+ at.** The layout has always carried a `window` size and nothing ever wrote to
547
+ it, so it stayed at 800x450 forever and every launch opened there.
548
+
549
+ The editor appeared to remember, which is what made this easy to miss for so
550
+ long. It does not: it is forced up to a minimum that makes the palette and
551
+ properties panel fit, and that minimum happened to resemble the size people
552
+ were working at. Nothing was being remembered anywhere.
553
+
554
+ A resize in GUI mode is now written to the layout, debounced by 400 ms —
555
+ dragging a window edge fires `<Configure>` continuously, and saving per pixel
556
+ would rewrite the file hundreds of times for one drag. An unchanged size
557
+ writes nothing, and a minimised window (Tk reports 1x1) is not a size anyone
558
+ chose.
559
+
560
+ **Editor resizes are deliberately not saved.** That window holds the sidebar
561
+ and has a floor, so it is not the interface's size — saving it would enlarge a
562
+ deliberately small interface the first time somebody opened the editor on it.
563
+ There is a test for exactly that.
564
+
565
+ Closing also cancels any pending save. One firing into a destroyed root is
566
+ what printed `invalid command name` on the way out, which I found while
567
+ testing this rather than after shipping it.
568
+
569
+ ### Changed
570
+
571
+ - **A label looks like text rather than a card.** On the editor canvas it is
572
+ drawn in the canvas's own colour with a black edge; in the running interface
573
+ it takes the background behind it and has no edge.
574
+
575
+ Its editor tint used to be `#e7f2e9` against the file selector's `#e6f0ea` —
576
+ near enough that a glance could not tell them apart, which is what prompted
577
+ this. And in the interface a caption sat in a white box, which is exactly what
578
+ a caption should not look like.
579
+
580
+ Drawn in the canvas colour rather than with `fill=""`. Truly unfilled would
581
+ have been the obvious way to say "transparent", and it would have stopped the
582
+ label being selectable: an unfilled canvas rectangle is only hit on its
583
+ outline, so it would have been clickable on the border and dead in the middle.
584
+ Same colour as the canvas is indistinguishable and stays clickable, and two
585
+ tests hold that line.
586
+
587
+ Tk has no real transparency, so "transparent" in the interface means painting
588
+ the parent's own colour. A background or edge set by researcher code still
589
+ wins — this is only the default.
590
+
591
+ - **Buttons and both selectors now default to the label's height.** All four are
592
+ one line of text, so a row of them lines up without anyone resizing anything.
593
+ Widths still differ, because caption length is what actually varies:
594
+ "Select a Folder" needs more room than "Click here!". Named `LINE_HEIGHT` and
595
+ shared, with a test pinning it so the four cannot drift apart again.
596
+
597
+ The text boxes are deliberately left taller: a field someone types into wants
598
+ more room than a caption they only read.
599
+
600
+ **One consequence, measured rather than assumed.** At the default 800x450
601
+ window a caption needs 16 px and 0.03 of the content area gives 12, so a
602
+ button's text clips there. From roughly 800x720 upward it fits comfortably
603
+ (20 px and rising). The old 0.04 gave exactly 16 px at the default size, which
604
+ is why this did not show before. A label has always been 0.03 and has always
605
+ clipped at that size; this makes buttons match it in both respects.
606
+
607
+ - **Adding an element is now a deliberate two-step act: pick a type, then place
608
+ it.** The palette starts with nothing armed and returns to that after each
609
+ placement, so one pick puts down one element and the highlight clears.
610
+
611
+ A type used to be armed permanently, defaulting to the first in the list, so
612
+ *any* click on the canvas background produced an element — including the click
613
+ a researcher meant as "get out of what I was doing". They then had to find the
614
+ stray element and delete it, and the most likely place for it to land was
615
+ underneath something else.
616
+
617
+ With nothing armed, a background click does what a background click normally
618
+ does: commits whatever was being typed, drops the selection, and takes the
619
+ focus. Existing elements are still selectable, movable and deletable — the
620
+ canvas is not inert, it just does not manufacture things.
621
+
622
+ ### Added
623
+
624
+ - **Hovering an element in the editor names its tag.** A button reading "Click
625
+ here!" gives no clue whether it is `cmd_0` or `run_fit`, and that name is what
626
+ the researcher's code uses — so the tooltip answers where the question is
627
+ asked, rather than making them select the element and read the properties
628
+ panel.
629
+
630
+ Shown for everything that displays text, including the two selectors. An axes
631
+ is left out on purpose: it already has its tag drawn on it, so a tooltip would
632
+ only repeat what is there.
633
+
634
+ Faster than the top-bar tooltips (200 ms against 450 ms), because the pointer
635
+ is already on the thing being asked about and the answer is one word. Not
636
+ instant: zero delay would flicker across the canvas on any movement. It holds
637
+ still once shown rather than following the pointer, and gets out of the way on
638
+ a press or a drag.
639
+
640
+ Canvas items cannot carry `<Enter>` and `<Leave>` the way widgets can, so this
641
+ is driven from the motion handler that already reports what a press would do.
642
+
643
+ ### Fixed
644
+
645
+ - **An element with no text showed its tag instead of nothing.** Clearing a
646
+ label's text gave a label reading `lbl_0`; the same applied to a button and to
647
+ the two selectors.
648
+
649
+ It was deliberate once. In the first implementation a newly drawn element had
650
+ no text at all, so without the fallback it was an invisible rectangle. Every
651
+ type has carried a real default since 1.1.0 — "Information:", "Click here!" —
652
+ which means the fallback could only fire when somebody had *deliberately*
653
+ cleared the text, and that is the one moment it is certainly not what they
654
+ meant. A blank status line that fills in later is an ordinary thing to want.
655
+
656
+ **The editor still shows the tag** on an element with no text, and that is not
657
+ an oversight: there you are working on the elements themselves, and one with
658
+ nothing in it still has to be findable and clickable on the canvas. The editor
659
+ labels what you are editing; the interface shows what you wrote.
660
+
661
+ Nothing changes about what a new element says.
662
+
663
+ ## [1.3.1] — 2026-09-09
664
+
665
+ Repository only. Nothing here changes the installed package, so 1.3.0 on PyPI is
666
+ not defective and needs no replacement.
667
+
668
+ ### Fixed
669
+
670
+ - **CI had been red on Linux since 1.2.0, and 1.3.0 was published anyway.**
671
+
672
+ The failure was in a test, not in iterlab: it typed a filename by generating
673
+ key events with the raw character as the keysym, and X11 wants keysym *names*
674
+ — `.` is `period` there. Windows Tk accepts the character, so the local suite
675
+ passed on Windows every time while the Linux job failed. Characters now map to
676
+ the names Tk knows on every platform.
677
+
678
+ This is the second defect of exactly this shape. The first was `size_nw_se`,
679
+ a cursor name Windows accepts and X11 does not, which CI also caught and which
680
+ is guarded by a test asserting every cursor name is valid on the running
681
+ platform. There is now a matching test for keysyms, next to it.
682
+
683
+ The 1.2.0 run failed for an unrelated reason — `apt-get update` could not
684
+ fetch its indexes on the runner. Infrastructure, not code, but it meant the
685
+ first red run was easy to wave away, and the next two were not looked at.
686
+
687
+ ### Added
688
+
689
+ - **`tools/preflight.py`**, which asks every question that must be answered
690
+ before publishing: clean tree, commit pushed, **CI green for this exact
691
+ commit**, artifacts present and matching the declared version with no stale
692
+ ones beside them, `twine check`, README links resolving anonymously, and a
693
+ recorded Gate 2 pass. Non-zero exit means do not upload.
694
+
695
+ The constitution already said this gate is "absolute rather than advisory".
696
+ It was advisory in practice because nothing enforced it — the local suite was
697
+ green each time, and nobody opened the run that tests the platform the
698
+ developer is not using. A check that depends on someone remembering to look is
699
+ not a gate.
700
+
701
+ Gate 2 is warned about rather than enforced: only a person can perform it, so
702
+ a tool can ask whether it happened but cannot honestly refuse on its behalf.
703
+
704
+ ## [1.3.0] — 2026-09-09
705
+
706
+ ### Changed
707
+
708
+ - **Text and number boxes fire on a committed value, not on every keystroke.**
709
+ Enter always runs the handler; leaving the box runs it only if the value
710
+ actually changed, so clicking past a box on the way somewhere else does
711
+ nothing. The generated stub is now `on_changed_<tag>`.
712
+
713
+ Per keystroke redraws once for `1`, again for `10`, again for `100` — two of
714
+ those plots are of a number nobody meant, and each one costs whatever the
715
+ researcher's handler costs.
716
+
717
+ **This was already decided, and I missed it.** The spec has carried a note
718
+ since before boxes existed: a text box "commits its value on Enter or on
719
+ leaving the field, never on every keystroke ... recorded here so the
720
+ convention is not re-litigated when text boxes are built". 1.2.0 re-litigated
721
+ it by accident, because nobody re-read the note when the element was finally
722
+ built. The note now records that too — a written-down decision only helps if
723
+ it is consulted at the moment the thing it describes gets made.
724
+
725
+ ### Added
726
+
727
+ - **A `changed` interaction**, joining click, hover, move and key. Universal in
728
+ the same sense as the others: any element may have a handler written for it,
729
+ and one whose value never changes simply never fires — indistinguishable from
730
+ an element nobody wrote a handler for. It exists because "the researcher
731
+ finished entering a value" is not the same question as "a key went down", and
732
+ cannot be built out of `key` without every researcher reimplementing the same
733
+ debounce. FR-017a is amended accordingly.
734
+
735
+ Renaming an element carries its `on_changed_` handler, like every other.
736
+
737
+ - `on_key_<tag>` is untouched and still fires per keystroke for anyone who wants
738
+ it, so nothing written against 1.2.0 stops working.
739
+
740
+ ## [1.2.0] — 2026-09-09
741
+
742
+ *Reached GitHub but not PyPI; superseded by 1.3.0.*
743
+
744
+ ### Added
745
+
746
+ - **Text and number boxes now generate an `on_key_<tag>` handler**, firing on
747
+ every keystroke, and the generated one prints what was typed — `.text` for a
748
+ text box, `.value` for a number box.
749
+
750
+ This reverses the call made in 1.1.0, where boxes got no stub on the reasoning
751
+ that a box is read when something *else* happens. That covers one use and
752
+ misses the better one: a plot that follows a value as it is typed, with no
753
+ button to press. A researcher who wants the click-then-read pattern deletes
754
+ the handler; one who wants live updating would otherwise have had to know that
755
+ `on_key_<tag>` exists at all.
756
+
757
+ A half-typed number is safe to read: `""`, `"-"` and `"0."` all report `0`
758
+ rather than raising, so a handler firing mid-keystroke cannot fault the
759
+ session.
760
+
761
+ - **The generated file is runnable.** Every new `demo.py` ends with:
762
+
763
+ ```python
764
+ if __name__ == "__main__":
765
+ import iterlab
766
+
767
+ iterlab.run(__file__)
768
+ ```
769
+
770
+ so an IDE's run button opens the interface, with no terminal and nothing to
771
+ remember. It passes `__file__` rather than a name, so it works from any
772
+ working directory and survives renaming the pair. It cannot loop: iterlab
773
+ executes the researcher's module under a name of its own, so `__name__` is
774
+ only `"__main__"` for the copy they launched — proven by a test that loads the
775
+ file the way the loader does.
776
+
777
+ Interfaces created before this do not get it retrofitted. iterlab adds
778
+ handlers to a researcher's file and nothing else, and that rule is worth more
779
+ than the convenience.
780
+
781
+ ### Fixed
782
+
783
+ - **A typed property could still be silently discarded**, and 1.1.1's fix for
784
+ that is what made it reachable.
785
+
786
+ Rebuilding the properties panel destroys its fields, and Tk fires `<FocusOut>`
787
+ at a focused widget as it goes. That event is *queued*: it arrives after the
788
+ rebuild has finished and the panel's busy flag is clear, so the handler
789
+ commits into whichever element is now selected. 1.1.1 added commit points on
790
+ selection and on canvas press, which multiplied the rebuilds and turned a
791
+ latent race into one that fired often. The old fields are now unbound before
792
+ they are destroyed, so a stale event has nothing to run.
793
+
794
+ Found by a test that failed roughly one run in five and could not be
795
+ reproduced by running its own file — it needed another file to have run first.
796
+ Confirmed as mine by running the same loop against 1.1.0 in a worktree: twenty
797
+ clean runs there, three failures in fifteen on the current tree.
798
+
799
+ ### Changed
800
+
801
+ - **New handler stubs are inserted above the `if __name__` block** rather than
802
+ appended after it. That block reads as the end of the file, and appending
803
+ below it would push it further from the bottom with every element drawn. The
804
+ guard is matched structurally, so `'__main__'`, extra spaces or a reversed
805
+ comparison all count; only a *trailing* guard qualifies, since one mid-file is
806
+ not a launcher and inserting above it would drop a stub into the middle of the
807
+ researcher's code. Any comment directly above it travels with it. A file
808
+ without a guard is appended to exactly as before.
809
+
810
+ ## [1.1.1] — 2026-09-09
811
+
812
+ ### Fixed
813
+
814
+ - **A typed property was lost unless focus went to another property field.**
815
+ Editing a value and then clicking an element, the canvas, or a palette card
816
+ silently discarded it. Tabbing to the next field worked, which is what made it
817
+ look intermittent rather than broken.
818
+
819
+ `<FocusOut>` cannot carry this on its own. Tk fires it when another *widget*
820
+ takes keyboard focus, and most of what a researcher clicks next does not take
821
+ it — a Canvas, an element drawn on it and a palette card are all unfocusable.
822
+ Even when focus does move, Tk delivers the event on the next pass through the
823
+ event loop, by which time the panel has been rebuilt for the new selection and
824
+ the entry holding the edit no longer exists. The canvas already called
825
+ `focus_set()` first thing on a press, which looked like it should have covered
826
+ this and could not.
827
+
828
+ Committing is now explicit and synchronous on the events where focus really
829
+ leaves: a press on the canvas, a palette choice, opening the **More** drawer.
830
+
831
+ - **The reported extension filter was this same bug.** Typing `pdf` into
832
+ **Types** and clicking away never saved it, so the chooser had nothing to
833
+ filter by and offered everything. It works once the value is committed.
834
+
835
+ - **An editor change to `extensions` lost to a value set from code.** Found
836
+ while checking the above. Session state is deliberately preserved across a
837
+ mode switch, and an explicit edit in the editor is supposed to beat it — the
838
+ rule already covered `label` and `style`, and `extensions` was simply missed
839
+ when it was added a version ago.
840
+
841
+ ### Notes
842
+
843
+ - The first attempt at the commit fix also committed inside `select`, which is
844
+ the refresh path that a drag, a resize and an apply all end on. That wrote the
845
+ panel's now-stale position back over the change that had just happened, and a
846
+ dragged element snapped home — 15 tests caught it, and the suite time went from
847
+ 63s to 161s from the churn. There is now a test for that specific regression,
848
+ and one asserting that clicking about without typing does not rewrite the
849
+ layout file at all.
850
+
851
+ ## [1.1.0] — 2026-09-09
852
+
853
+ *Reached GitHub but not PyPI; published as part of 1.1.1.*
854
+
855
+ ### Added
856
+
857
+ - **Two new element types: `file_select` and `folder_select`.** Each is a button
858
+ that opens the operating system's own chooser — the one a researcher already
859
+ knows, with their places and network drives in it.
860
+
861
+ The first of each takes the bare tag, `fileselect` and `folderselect`, with no
862
+ `_0`: an interface almost always has exactly one, and a number on the only one
863
+ of something is noise that then appears in every handler mentioning it. A
864
+ second becomes `fileselect_1`.
865
+
866
+ `.path` is the choice. It is `""` before anything is picked **and** when what
867
+ was picked has since been deleted or moved — a path that no longer resolves is
868
+ worse than none, because `if ev.fileselect.path:` would pass and the open
869
+ would fail on something that looks perfectly valid. The chooser still reopens
870
+ where the file used to be, since a renamed file is usually still beside it.
871
+
872
+ The handler fires **after** a choice, so `.path` is set when researcher code
873
+ runs. Cancelling does nothing at all: no handler, no change.
874
+
875
+ The caption stays "Select a File"; showing the selection is one line in the
876
+ researcher's handler, and the generated stub shows it. How the interface looks
877
+ stays theirs to decide.
878
+
879
+ - **`extensions` on the file selector**, in the editor as **Types** and in code
880
+ as `ev.fileselect.extensions`. Comma-separated, forgiving about `.TXT`,
881
+ `*.csv` and stray spaces, blank meaning every file. "All files" is always
882
+ offered alongside, because a filter nobody can escape is a trap the moment one
883
+ file was saved with the wrong suffix.
884
+
885
+ - **Selections persist across a hard reset and across the process.** Stored in
886
+ the user's own state directory keyed by the interface's path, never in the
887
+ layout file: `demo.yaml` describes the interface, and writing a runtime choice
888
+ into it would make it a log of what happened and a spurious diff in everyone's
889
+ repository. The project folder stays the two files it has always been. The
890
+ accepted cost is that moving or copying a project starts fresh, which behaves
891
+ exactly like a first run.
892
+
893
+ Nothing there can raise on the researcher's account: a missing file, unreadable
894
+ JSON, a read-only profile all mean "nothing remembered", which is a state every
895
+ caller already handles because it is what a first run looks like.
896
+
897
+ - `ui/dialogs.py`, one seam for the only modal dialogs iterlab opens. The test
898
+ suite's ban on `tkinter.filedialog` stays exactly as it was, so a path that
899
+ reaches a real chooser without being replaced fails loudly instead of hanging.
900
+ It also normalises Tk's mix of `""`, `()` and `None` for a cancelled dialog
901
+ into one shape.
902
+
903
+ - `Event.path`, carrying what was just chosen.
904
+
905
+ ### Changed
906
+
907
+ - **Layout schema 4 → 5**, no-op migration. Nothing in an existing file changes;
908
+ the version moves so a version-4 build refuses a file containing a type it has
909
+ never heard of rather than reporting it as a defect in the layout.
910
+
911
+ ## [1.0.0] — 2026-09-08
912
+
913
+ **First public release.** `pip install iterlab`.
914
+
915
+ Numbered 1.0.0 rather than continuing the 0.x line because this is the first
916
+ version anyone else can install: a 0.21 would read as accumulated churn, where
917
+ what it actually marks is the point the tool became available.
918
+
919
+ Everything in the entries below shipped in this one release. They were written
920
+ as the work happened and are kept as the development record; nothing before this
921
+ had ever been published.
922
+
923
+ ### What this version commits to
924
+
925
+ 1.0.0 is a promise under semantic versioning, so the following are the public
926
+ surface and will not change without a major bump:
927
+
928
+ - the `on_<interaction>_<tag>` handler naming convention, and `ev` as the first
929
+ argument to every handler
930
+ - `ev.<tag>` reaching an element, and `.text` on every element that shows text
931
+ - an axes element being a real `matplotlib.axes.Axes`
932
+ - the `iterlab <name>` command and `iterlab.run(name)`
933
+ - the layout schema, which carries its own version and migrates forward
934
+
935
+ The layout schema is versioned separately and independently: a file written by
936
+ an older build is migrated on open, and one written by a newer build is refused
937
+ rather than half-understood.
938
+
939
+ ### Changed
940
+
941
+ - **Ordinary semantic versioning resumes.** Below 1.0.0 the constitution
942
+ suspended the MINOR/PATCH distinction and bumped MINOR on *every* change, so
943
+ that the version answered "is the thing in front of me the thing I just
944
+ changed?" during hand testing. From here PATCH means a fix, MINOR means an
945
+ addition, MAJOR means a break — which is what a version has to mean once other
946
+ people depend on it.
947
+ - `Development Status` classifier moves from `3 - Alpha` to `4 - Beta`. Claiming
948
+ 1.0.0 while advertising alpha would contradict itself. The README's "early,
949
+ and honest about it" stands: this is a first public release, not a mature one.
950
+
951
+ ## [0.21.1] — not published
952
+
953
+ Renumbered to 1.0.0 before publishing.
954
+
955
+ Everything in the entries below shipped in this one release; they were written as
956
+ the work happened and are kept as the development record. Nothing before this had
957
+ ever been published.
958
+
959
+ ### Fixed
960
+
961
+ - **The README logo was a broken image.** The repository is private, and
962
+ `raw.githubusercontent.com` returns 404 for a private repository without a
963
+ token — so the image failed for every viewer, including on GitHub. The file
964
+ was present and pushed the whole time; the URL simply could not be fetched.
965
+
966
+ This is invisible to whoever owns the repository if they only ever check while
967
+ signed in, and it is the same failure the README's `GUIDE.md`, `LICENSE` and
968
+ `NOTICE` links have. All four resolve once the repository is public, which is
969
+ also what the PyPI page needs, since PyPI renders the README anonymously.
970
+
971
+ ### Added
972
+
973
+ - `tools/check_readme_links.py`, which fetches every external README link with
974
+ no credentials at all — the way a stranger's browser does. It reports 4 of 4
975
+ dead against a private repository and should report all clear before
976
+ publishing. A broken logo on the page people arrive at first is not worth
977
+ discovering after an upload that cannot be undone.
978
+
979
+ ## [0.21.0] — 2026-09-08
980
+
981
+ *Published to PyPI, then superseded fourteen minutes later by 1.0.0.
982
+ It is the earliest version installable from PyPI; 1.0.0 is the one to use.*
983
+
984
+ Everything in the entries below shipped in this one release; they were written
985
+ as the work happened and are kept as the development record. Their "unreleased"
986
+ labels are accurate for what they were at the time — nothing before this had
987
+ ever been published.
988
+
989
+ ### Changed
990
+
991
+ - Install instructions in `README.md` and `GUIDE.md` now say `pip install
992
+ iterlab`, since that is true from this release onward. The guide keeps the
993
+ source install for anyone who wants to change iterlab itself.
994
+ - `README.md` links and the logo are absolute URLs. PyPI renders this README on
995
+ its own page, where a repository-relative path resolves to nothing — the logo
996
+ would have been a broken image and every link a 404, visible to everyone
997
+ arriving at the project for the first time.
998
+ - Added `Documentation`, `Repository`, `Changelog` and `Issues` project URLs, a
999
+ 3.13 classifier, and operating-system and environment classifiers.
1000
+
1001
+ ## [0.20.2] — unreleased
1002
+
1003
+ ### Documentation
1004
+
1005
+ - **The logo now heads `README.md` and `GUIDE.md`**, from `docs/logo.png`.
1006
+
1007
+ - **Both documents brought back in line with the code.** Everything below was
1008
+ wrong, not merely dated:
1009
+
1010
+ - `README.md` said `pip install iterlab`. It is not on PyPI, and the guide
1011
+ said so two paragraphs later in a different file. Now both give the
1012
+ repository install.
1013
+ - `README.md` claimed "two element types" with "text boxes, labels ... next".
1014
+ There are five, and text boxes and labels are two of them.
1015
+ - `GUIDE.md` told the reader to draw `ax_0` and `cmd_0` and then showed an
1016
+ example using `ev.spectrum` and `on_clicked_run_fit` — tags it had never
1017
+ asked anyone to create. The worked example now uses the tags it just named,
1018
+ and says renaming is available.
1019
+ - Two leftovers from a careless find-and-replace: "use **Restart reset**" and
1020
+ "press **Restart app**", for a button now called **Hard reset**.
1021
+ - "Buttons and labels carry these" under Styling, written before boxes
1022
+ existed and never revisited.
1023
+ - Stubs were described as generated for "buttons and plot areas", with
1024
+ "plot areas" long since renamed and boxes never mentioned.
1025
+ - The styling note said code-set style is lost when you "close and reopen".
1026
+ True, but it now survives a mode switch, which is the case a researcher
1027
+ actually meets.
1028
+
1029
+ - Every code example in the guide was executed against this build — startup,
1030
+ the click handler, all eleven style properties, `.text` on each type, and
1031
+ `.value` on a number box — rather than read over. No fault was raised by any
1032
+ of them.
1033
+
1034
+ ## [0.20.1] — unreleased
1035
+
1036
+ ### Fixed
1037
+
1038
+ - **A mode switch reset every element to its layout value.** Text typed into a
1039
+ box, and a caption, colour or enabled-state set from code, all reverted on the
1040
+ way back from the editor. Reported as "gui objects get reset when going to
1041
+ editor".
1042
+
1043
+ The session introduced in 0.12.0 kept `ev` and the contents of each plot, but
1044
+ not the widgets' own state — and a switch destroys every widget and builds new
1045
+ ones from the layout file, so anything the *running* interface had done was
1046
+ lost. The layout is where an element starts, not where it currently is.
1047
+
1048
+ Each handle can now report its presentation and have it restored; the session
1049
+ holds it across the switch. Programmatic style was reverting too, which was
1050
+ not in the report but is the same defect.
1051
+
1052
+ **An edit in the editor still wins.** The remembered value is recorded
1053
+ alongside the layout value it was based on, so if the researcher has since
1054
+ changed the caption or the colour themselves, the remembered one is dropped —
1055
+ editing a button's caption and having the old one come straight back would be
1056
+ its own bug report. Position is not presentation, so moving an element does
1057
+ not discard what it was showing.
1058
+
1059
+ A **hard reset** still clears everything, which is the difference between
1060
+ restarting and toggling.
1061
+
1062
+ 14 tests; 10 of them fail against the unfixed code.
1063
+
1064
+ ## [0.20.0] — unreleased
1065
+
1066
+ ### Added
1067
+
1068
+ - **Two new element types: `text_box` and `number_box`.** A text box holds a
1069
+ line someone types; a number box refuses anything that is not a number.
1070
+
1071
+ The number box validates the *proposed* contents on each keystroke rather than
1072
+ correcting afterwards, so a rejected character never appears at all — no
1073
+ flicker, and the box is never momentarily holding something that is not a
1074
+ number. It deliberately accepts the half-written states a person passes
1075
+ through: `""`, `"-"`, `"."` and `"-."` are all on the way to a number, and
1076
+ refusing them would make a negative or a decimal impossible to type.
1077
+
1078
+ `.value` gives the number — `int` when it is a whole one, so
1079
+ `range(ev.val_0.value)` works without casting — and an empty box reads as `0`
1080
+ rather than raising, since someone who cleared it to retype is mid-edit, not
1081
+ mistaken. `.text` gives the same thing as a string.
1082
+
1083
+ Neither gets a generated stub, for the reason a label does not: a box is
1084
+ normally read when something *else* happens rather than reacted to keystroke
1085
+ by keystroke. Every interaction remains available to a hand-written handler.
1086
+
1087
+ - **`.text` on every element that shows text**, whatever kind it is. A button
1088
+ and a label keep their string in Tk's `-text` option and a box keeps it in a
1089
+ variable; `.text` hides that, so `ev.<tag>.text` works without first
1090
+ remembering what `<tag>` is.
1091
+
1092
+ ### Changed
1093
+
1094
+ - **Default tags are now short and typed**: `cmd_0` for a button, `lbl_0` for a
1095
+ label, `edt_0` for a text box, `val_0` for a number box (`ax_0` unchanged).
1096
+ These are the shorthands a person would use themselves, so `ev.cmd_0` reads
1097
+ the way the code around it already does.
1098
+
1099
+ - **New elements come with working text**: a button says "Click here!" and a
1100
+ label says "Information:", rather than repeating their own tag. A button
1101
+ reading `cmd_0` is a placeholder the researcher has to fix before showing
1102
+ anyone; one reading "Click here!" is a control. The default button is slightly
1103
+ wider to fit its caption — a default that clips its own text is worse than one
1104
+ that is a little roomy.
1105
+
1106
+ - **Layout schema 3 → 4.** Nothing in an existing file changes and the migration
1107
+ is a no-op, but the version has to move: a file written now may contain a type
1108
+ a version-3 build has never heard of, and the version gate is what makes that
1109
+ build refuse the file cleanly rather than report an unknown element type as a
1110
+ defect in the researcher's layout.
1111
+
1112
+ ## [0.19.1] — unreleased
1113
+
1114
+ ### Fixed
1115
+
1116
+ - **The window icon did not appear.** Tk offers two mechanisms — `iconbitmap`
1117
+ with an `.ico` and `iconphoto` with a `PhotoImage` — and 0.18.0 applied both
1118
+ "for coverage". They do not layer: applied together to one window the title
1119
+ bar shows a blank grey square, which is worse than either alone and worse than
1120
+ doing nothing. Each works perfectly on its own.
1121
+
1122
+ Exactly one is applied now, chosen by platform: `iconbitmap` on Windows, so
1123
+ each size gets the frame drawn for it and the title bar shows the 16 px
1124
+ artwork rather than Tk squeezing down the 256; `iconphoto` elsewhere, which is
1125
+ what X11 and macOS honour. The other is tried only when the first *fails*, as
1126
+ a fallback rather than a supplement.
1127
+
1128
+ The test that existed asserted `apply()` returned True — which it happily did
1129
+ while producing an empty box. It is the same shape of defect as every wiring
1130
+ bug in this project: the mechanism was tested and the outcome was not. The
1131
+ test now counts which Tk calls are actually made and fails if both are, and
1132
+ Gate 2 gained an item to look at the title bar, since only a person can tell a
1133
+ drawn icon from a blank one.
1134
+
1135
+ ## [0.19.0] — unreleased
1136
+
1137
+ ### Changed
1138
+
1139
+ - **The icon is redrawn from a supplied logo**: a waveform ringed by two arcs
1140
+ chasing each other. The wave is the researcher's data, the ring is the loop
1141
+ they work inside, which is a better statement of the tool than the previous
1142
+ drawing managed.
1143
+
1144
+ Two things carry it. The ring takes an **angular** gradient whose colour run
1145
+ is mapped onto each arc's own sweep, so a tail is fully dark and an arrow head
1146
+ fully bright — spread over a half-turn instead, both ends land mid-blue and
1147
+ the heads lose their punch. The wave takes a **linear** gradient, because it
1148
+ travels where the ring turns.
1149
+
1150
+ The detail thresholds moved after looking at the frames magnified rather than
1151
+ guessing: at 64 px the dotted arcs had already collapsed into a grey fuzz that
1152
+ made the whole mark look dirty, so the full drawing now starts at 128.
1153
+
1154
+ **The 16 and 24 px frames invert** — a white wave on solid brand blue. A dark
1155
+ line on a near-white tile has almost no ink left to work with at that size and
1156
+ goes faint in a taskbar, where the light tile's own edge is lost too. It
1157
+ trades a little consistency between sizes for a mark that can be seen, and
1158
+ nobody views the 16 and the 256 side by side.
1159
+
1160
+ ## [0.18.0] — unreleased
1161
+
1162
+ ### Added
1163
+
1164
+ - **An application icon**, replacing Tk's default feather — which tells a
1165
+ researcher nothing and makes the window look like a stray interpreter in a
1166
+ taskbar full of real applications.
1167
+
1168
+ A plot with a loop: the rising curve is every plotting library's icon, and the
1169
+ circular arrow is what makes it this one, since iterating inside the interface
1170
+ rather than re-running a script is the whole product.
1171
+
1172
+ - `tools/make_icon.py`, which *is* the icon — checked in as the source rather
1173
+ than a binary somebody would have to open an image editor to change.
1174
+
1175
+ It draws at 8x and downsamples, and brushes strokes as overlapping discs
1176
+ rather than using `draw.line`, which leaves notches exactly where this curve
1177
+ turns. The `.ico` carries **three detail levels across seven sizes**: below
1178
+ 48 px the axes are dropped and the brush fattens, and at 16 px only the curve
1179
+ survives. An icon is not one drawing scaled — the thin marks close into mud —
1180
+ and a test asserts the 16 px frame is not merely the 256 resampled.
1181
+
1182
+ Applied through both `iconphoto` (portable, honoured by X11 and macOS) and
1183
+ `iconbitmap` (what Windows uses for the title bar and taskbar, and crisper
1184
+ there). Neither can raise: an icon is decoration, and decoration must not be
1185
+ able to end a session. The `PhotoImage` is held for the life of the process,
1186
+ since Tk silently reverts to the feather when one is collected.
1187
+
1188
+ ## [0.17.0] — unreleased
1189
+
1190
+ ### Added
1191
+
1192
+ - **Hover text on the top-bar buttons.** Two of them differ only in how much
1193
+ they throw away, and a two-word label cannot carry that. `Tooltip` is drawn as
1194
+ a borderless toplevel that never takes focus.
1195
+ - **A "Screenshot" button**, writing a PNG beside the interface's own files as
1196
+ `demo-<date>-<time>.png`. It captures the **content area only** — the top bar
1197
+ is iterlab's furniture and has no business in a figure someone pastes into a
1198
+ report. No file dialog: a modal blocks the test suite outright, the same
1199
+ reason element creation does not ask for a name. Pillow already ships with
1200
+ matplotlib, so this adds no dependency. A machine that cannot grab the screen
1201
+ (headless Linux) reports it through the fault banner rather than taking the
1202
+ window down.
1203
+ - **A "More" drawer in the properties panel.** Only the tag, and the text for a
1204
+ button or label, are shown by default; position, size, colour, font and state
1205
+ are behind it. The set is declared per element type in
1206
+ `schema.BASIC_PROPERTIES`, so a future slider declares its range and starting
1207
+ position the same way a button declares its caption.
1208
+
1209
+ The advanced widgets are *built* either way and only packed or not, so
1210
+ committing an edit never depends on which fields the researcher happened to
1211
+ reveal. The drawer stays open across selections — someone adjusting colours
1212
+ across several elements should not have to reopen it each time.
1213
+
1214
+ ### Changed
1215
+
1216
+ - **"Restart app" is now "Hard reset"**, in the top bar and in the startup
1217
+ notice.
1218
+ - **Positions and sizes are rounded to two decimals on construction**, not only
1219
+ when saved. Hundredths of the window is finer than anyone can place by hand or
1220
+ see, and finer than that turns the layout file into digits whose diffs mean
1221
+ nothing. Rounding at construction means what is in memory is what is on disk,
1222
+ so a value never changes under a researcher between drawing it and reopening
1223
+ it.
1224
+
1225
+ Validation still runs first, so a genuinely invalid rectangle is rejected
1226
+ rather than quietly rounded into an acceptable one. Only rounding's own
1227
+ artefacts are corrected: a sliver that would round away to nothing becomes the
1228
+ smallest real element, and an edge rounded past the window is given its
1229
+ position back rather than being shrunk.
1230
+
1231
+ `DEFAULT_SIZE["button"]` moves from `0.035` to `0.04` high, since a default
1232
+ ought to be expressible on the grid it will be snapped to.
1233
+
1234
+ ## [0.16.0] — unreleased
1235
+
1236
+ ### Fixed
1237
+
1238
+ - **An edited `on_startup` was often not noticed at all.** Reported as "nothing
1239
+ happens", and there were two independent reasons, either of which was enough
1240
+ on its own:
1241
+
1242
+ 1. The check hung off the dispatcher's after-invoke hook, which fires only
1243
+ when a handler actually ran. Clicking an element you have not written code
1244
+ for — normal, and silent by design — never looked at the file. So the
1245
+ notice appeared only if you happened to click something that already had a
1246
+ handler.
1247
+ 2. Nothing checked without an interaction at all. Saving the file and looking
1248
+ at the window did nothing, which is exactly when a researcher expects
1249
+ something to happen.
1250
+
1251
+ The check now runs before *every* interaction whatever it goes on to do, and
1252
+ a 700 ms poll notices a save on its own. It reads the file rather than the
1253
+ loaded module — deliberately, since reloading on a timer would re-run
1254
+ module-level code uninvited, and since the module is only reloaded when an
1255
+ interaction reaches a handler that exists.
1256
+
1257
+ ### Added
1258
+
1259
+ - **A "Re-run startup" button in the top bar**, as requested. Enabled only when
1260
+ startup has actually been edited, so the button is its own indicator: save the
1261
+ file, look up, and it has come alive. It runs the new startup over the session
1262
+ already in memory, so the data survives.
1263
+
1264
+ ### Changed
1265
+
1266
+ - The notice's second action is now **Restart app**, the same restart the top
1267
+ bar offers, rather than a separate session-only restart. One restart concept
1268
+ in the interface rather than two whose difference is invisible.
1269
+ - `ModuleLoader.generation`, added in 0.13.0, is gone. The staleness check is
1270
+ keyed to the file's own (mtime, size) instead, which is what let it work
1271
+ without loading anything — and an API with one caller that no longer needs it
1272
+ is better deleted than kept.
1273
+
1274
+ ## [0.15.0] — unreleased
1275
+
1276
+ ### Changed
1277
+
1278
+ - **`ev.<tag>` for a plot is now a real matplotlib `Axes`**, not an object that
1279
+ forwards to one. `AxesHandle` subclasses `Axes` and is registered as a
1280
+ matplotlib projection, which is the supported way to have a figure build a
1281
+ particular Axes subclass.
1282
+
1283
+ The difference is invisible for `ev.ax_0.plot(...)`, which worked either way,
1284
+ and decisive everywhere else. `isinstance(ev.ax_0, Axes)` is now true, so any
1285
+ library that takes an `ax=` argument accepts it, and matplotlib's own
1286
+ machinery does too. A forwarding wrapper fails all of that — and fails it
1287
+ inside whatever library the researcher passed it to, a long way from anything
1288
+ iterlab wrote.
1289
+
1290
+ - **The element type `plot_area` is renamed `axes`**, and new ones are tagged
1291
+ `ax_0`, `ax_1`, … rather than `plot_0`. `ax` is what the variable is called in
1292
+ everyone's matplotlib code, so `ev.ax_0` reads the way a researcher's own code
1293
+ already does. What the layout calls the thing is now what the thing is.
1294
+
1295
+ - **Layout schema 2 → 3**, with a migration that rewrites `type: plot_area` to
1296
+ `type: axes`. Tags, positions and styles are untouched, so an interface drawn
1297
+ before this keeps working and keeps its names.
1298
+
1299
+ ### Notes
1300
+
1301
+ - Everything iterlab adds to the Axes subclass is prefixed `_iterlab_`, except
1302
+ the deliberate public surface (`tag`, `visible`, `canvas`, `widget`,
1303
+ `element`, `disconnect`). A test asserts that nothing added shadows a
1304
+ matplotlib attribute, so a future matplotlib release cannot quietly collide
1305
+ with us.
1306
+ - `visible` keeps its element-level meaning — is this on screen — uniform with
1307
+ buttons and labels, and hides the toolbar with it. matplotlib's own
1308
+ `set_visible` is left alone and still does matplotlib's thing.
1309
+
1310
+ ## [0.14.0] — unreleased
1311
+
1312
+ ### Added
1313
+
1314
+ - **A "Restart app" button in the top bar**, beside the mode toggle. A cold
1315
+ restart: the layout is re-read from disk, the researcher's module is dropped
1316
+ from the import cache, and a new session begins. It is the answer to anything
1317
+ a warm reload deliberately does not cover — an edited helper module, a
1318
+ hand-edited layout file, or simply wanting a clean slate.
1319
+
1320
+ It stays in the mode it was pressed in. Restarting is not a request to be
1321
+ moved to a different screen, and the window is not resized either: that would
1322
+ rearrange the researcher's desktop, which is not what was asked for.
1323
+
1324
+ Replaces the narrower "Restart session" button in the top bar. That behaviour
1325
+ still exists and is still offered by the startup notice, where re-running
1326
+ startup over a live session is the point; as a top-bar control, one button
1327
+ with one meaning beats two whose difference is invisible until it bites.
1328
+
1329
+ ### Fixed
1330
+
1331
+ - A layout file edited by hand into something unparsable took the window down on
1332
+ restart, which is precisely what Principle III forbids. The last good layout
1333
+ is kept, the interface carries on, and the error is reported through the
1334
+ banner rather than swallowed. Found by a test written to check something else,
1335
+ which crashed instead of failing.
1336
+
1337
+ ## [0.13.0] — unreleased
1338
+
1339
+ ### Added
1340
+
1341
+ - **An edited `on_startup` is now noticed and offered back.** Every other
1342
+ handler takes effect on the next click because the next click runs it;
1343
+ startup already ran, so editing it did nothing at all and nothing said so.
1344
+ Nothing raises, so no fault appeared — the code simply never ran, which is
1345
+ the most expensive silence this tool can produce.
1346
+
1347
+ A strip now appears offering **Re-run startup** (keeps `ev` and everything on
1348
+ it) and **Restart session** (discards it). Both are offered rather than one
1349
+ chosen, because whether re-running is safe depends on the researcher's code:
1350
+ `ev.x = load(...)` rebinds and is safe, `ev.log.append(...)` is not. Dismissing
1351
+ hides the strip without marking the edit accepted, so a further edit raises it
1352
+ again — ignoring one edit must not make the next one silent.
1353
+
1354
+ - `runtime/startupcheck.py`. What counts as "startup changed" is narrower than
1355
+ "the file changed" — otherwise every handler edit would cry wolf — and wider
1356
+ than "the text of `on_startup` changed", because startup's behaviour lives
1357
+ partly in the module-level helpers it calls. The fingerprint covers
1358
+ `on_startup` plus every module-level function transitively reachable from it,
1359
+ compared as parsed structure so reformatting and comments cost nothing. A
1360
+ file mid-edit that will not parse fingerprints as `None` and raises no alarm.
1361
+
1362
+ - `ModuleLoader.generation`, so a caller can ask "has this reloaded since I last
1363
+ looked?" without re-reading the file. The staleness check is therefore
1364
+ proportional to edits, not to clicks.
1365
+
1366
+ ### Notes
1367
+
1368
+ - **New imports already worked** and needed no change: the loader executes the
1369
+ module fresh rather than calling `importlib.reload`, so an `import` line added
1370
+ to a live file runs on the next reload. Verified rather than assumed.
1371
+ - **Imported modules are assumed not to change during a session.** If `demo.py`
1372
+ does `import fitting` and `fitting.py` is then edited, the change is not
1373
+ picked up: `fitting` is already in `sys.modules`, so the import statement
1374
+ binds the cached module. This is a deliberate scope boundary, not an
1375
+ oversight - cascading reloads through a module graph brings the stale-instance
1376
+ problem with it (objects already built keep their old class), and the cost of
1377
+ getting that subtly wrong is higher than the cost of restarting. **Restart
1378
+ app** covers it when it matters.
1379
+
1380
+ ## [0.12.0] — unreleased
1381
+
1382
+ ### Changed
1383
+
1384
+ - **A session now survives a mode switch.** It belongs to the interface, not to
1385
+ GUI mode. Toggling into the editor to nudge a button and back no longer
1386
+ discards `ev`, no longer blanks a plot, and no longer re-runs `on_startup`.
1387
+
1388
+ This reverses FR-015d, which said a switch ends the session. That behaviour
1389
+ did not remove the cost of reloading data so much as move it: from "every
1390
+ code edit", which the reload loop already solved, to "every layout edit",
1391
+ which is the other half of the same loop. A researcher with a slow load was
1392
+ still paying it, just for a different reason.
1393
+
1394
+ ### Added
1395
+
1396
+ - **A "Restart session" control** beside the mode toggle. Because toggling now
1397
+ preserves everything deliberately, there has to be one explicit way to say
1398
+ start over — and it is how a change to `on_startup` takes effect. Chrome
1399
+ under FR-015c, and disabled in editor mode, where there is no live session to
1400
+ discard (FR-015e).
1401
+ - `Session`, owning what outlives a mode: `ev`, one matplotlib `Figure` per plot
1402
+ area, and whether startup has run. A `Figure` can be attached to a new canvas,
1403
+ which is what makes a drawn plot survive at all.
1404
+ - `Session.reconcile` and `Session.retag`, so state belonging to an element
1405
+ deleted in the editor is dropped and state belonging to a renamed one follows
1406
+ the new tag (FR-015f).
1407
+
1408
+ ### Fixed
1409
+
1410
+ - A figure's callback registry is shared with **every canvas it is ever attached
1411
+ to**. Reusing the figure across a switch therefore left the dead canvas's
1412
+ connections live, so a single click fired the handler once per switch ever
1413
+ made — three toggles, four handler calls. `PlotHandle.disconnect()` releases
1414
+ them on teardown. Found by prototyping before designing, and now covered by a
1415
+ test that fails with `assert 4 == 1` without the fix.
1416
+
1417
+ ### Tests
1418
+
1419
+ - Three tests driving real matplotlib events through the canvas: a drawn curve
1420
+ survives a switch, a click fires exactly once after three switches, and a
1421
+ renamed plot keeps its curve. Each was confirmed to fail against the
1422
+ unfixed code.
1423
+
1424
+ ## [0.11.1] — unreleased
1425
+
1426
+ ### Fixed
1427
+
1428
+ - A UI test asserted real OS focus, which the window manager can withhold and
1429
+ which other tests disturb by mapping and unmapping the shared Tk root. It
1430
+ passed alone and failed in the full suite. Now asks Tk which widget is last
1431
+ focused *for that toplevel*, which is the same question without depending on
1432
+ the desktop.
1433
+
1434
+ ## [0.11.0] — unreleased
1435
+
1436
+ ### Added
1437
+
1438
+ - **`GUIDE.md`** — a user guide: install, first interface, the handler and `ev`
1439
+ model, every element type with its code API, the full styling table, tagging,
1440
+ deleting, and the known limits. It will grow as element types are added.
1441
+
1442
+ ### Fixed
1443
+
1444
+ - A plot area's `visible` could be set but not read. `PlotHandle` delegates
1445
+ unknown attributes to its matplotlib `Axes`, which knows nothing about
1446
+ `visible`, so reading it raised `AttributeError` while writing it worked. Any
1447
+ style property a handle can set is now also readable — found while checking
1448
+ the guide's claims rather than by writing them down and hoping.
1449
+
1450
+ ## [0.10.0] — unreleased
1451
+
1452
+ ### Fixed
1453
+
1454
+ - Clicking, hovering or typing on a **plot area** raised `NameError: name
1455
+ 'name' is not defined`. The v0.8.0 tag rename missed the closure inside
1456
+ `build_plot_area`, which still referred to `name` and still passed
1457
+ `element=` to an `Event` whose field had become `tag`. Plot areas were the
1458
+ only element type affected.
1459
+
1460
+ ### Added
1461
+
1462
+ - `tests/ui/test_plot_events.py` drives matplotlib's own callback machinery —
1463
+ the closures in `build_plot_area` — rather than calling the dispatcher
1464
+ directly. Every other plot test went straight to the dispatcher, so the
1465
+ closures were never executed and a NameError in them survived a 291-test
1466
+ suite. Seven of the eight new tests fail against the bug.
1467
+
1468
+ ## [0.9.0] — unreleased
1469
+
1470
+ ### Added
1471
+
1472
+ - **Style properties on buttons and labels**: fill colour, text colour, border
1473
+ colour and width, font family, font size, bold, italic, alignment, enabled
1474
+ and visible. A plot area takes only `visible` — matplotlib owns the rest of
1475
+ how it looks, and offering a fill colour that did nothing would be a lie.
1476
+ - **Every style property is settable from code**, and doing so changes the live
1477
+ widget without ever writing back to the layout file. The layout holds the
1478
+ *starting* appearance; research code overrides it for the session:
1479
+
1480
+ ev.title.background = "#ffe0e0"
1481
+ ev.title.font_size = 20
1482
+ ev.run_fit.enabled = False
1483
+
1484
+ - Editors for all of it in the properties panel: hex fields with a swatch that
1485
+ opens the system colour picker, a font dropdown listing only families
1486
+ actually installed, and checkboxes and radio buttons for the rest.
1487
+ - The editor canvas now previews an element's real colours, font and weight, so
1488
+ a styling choice can be judged without toggling to GUI mode.
1489
+
1490
+ ### Changed
1491
+
1492
+ - **Layout schema version 2.** The `style` block is new, and an older build
1493
+ would reject it as an unrecognized key, so the version had to move — and with
1494
+ it comes the first real migration (FR-036c said to write one when it was
1495
+ actually needed rather than in advance). A version 1 layout opens unchanged,
1496
+ is migrated in memory, and is only rewritten when something is saved.
1497
+ - Only non-default style values are written, so an unstyled element is still a
1498
+ three-line entry.
1499
+
1500
+ ## [0.8.0] — unreleased
1501
+
1502
+ ### Changed
1503
+
1504
+ - An element's unique identifier is now called its **tag**, everywhere. It was
1505
+ "name", which collided with the interface's own name and with the handler
1506
+ *function* names it appears in. The legacy 2024 spike called it a tag too.
1507
+
1508
+ Researcher-facing: `event.element` becomes `event.tag`; the properties panel
1509
+ field is "Tag". Unchanged: `ev.<tag>`, `on_clicked_<tag>` and the layout file
1510
+ format — the tag has always been the mapping key there, so **no existing
1511
+ layout or research code needs editing**.
1512
+
1513
+ Internally `Element.name` becomes `Element.tag`, `Layout.names()` becomes
1514
+ `Layout.tags()`, `Layout.rename()` becomes `Layout.retag()`, and
1515
+ `validate_name` becomes `validate_tag`. Deliberately *not* renamed:
1516
+ `Interface.name`, which is the interface's own name, and `handler_name`,
1517
+ which really is a function's name.
1518
+
1519
+ ## [0.7.0] — unreleased
1520
+
1521
+ ### Fixed
1522
+
1523
+ - Resize cursors did nothing on Linux. `size_nw_se` and `size_ne_sw` are Tk's
1524
+ Windows-only names; X11 has no such cursors, so every diagonal handle showed
1525
+ no pointer change at all. The guard in `_set_cursor` caught the error and
1526
+ said nothing. Replaced with X11 corner names, which all three platforms
1527
+ accept — and which give each corner its own cursor rather than sharing one
1528
+ across a diagonal. Found by CI on Linux.
1529
+
1530
+ ### Added
1531
+
1532
+ - `tools/verify.py` builds a throwaway interface for the manual verification
1533
+ pass: a plot, a label and two buttons, with research code that loads slowly,
1534
+ plots, and fails on demand. It removes the setup from Gate 2, which was the
1535
+ real reason the pass had never been done.
1536
+ - A test asserting every cursor name is valid on the running platform. Tk
1537
+ silently ignores an unknown one, so nothing else would report it.
1538
+
1539
+ ## [0.6.0] — unreleased
1540
+
1541
+ ### Added
1542
+
1543
+ - A **label** element: text placed in the layout and set from code with
1544
+ `ev.status.text = "..."`. It is the first type with **no generated handler** —
1545
+ a label displays text rather than being clicked, and a stub for every one
1546
+ would leave a pile of dead functions in the researcher's file. Every
1547
+ interaction is still available if the handler is written by hand (FR-017a);
1548
+ only the automatic stub is withheld.
1549
+
1550
+ ### Changed
1551
+
1552
+ - The editor opens at 1080x760 rather than the interface's own size. That size
1553
+ describes the *interface*, and is advisory; editor mode adds a sidebar the
1554
+ interface knows nothing about. Switching to the editor grows a window that is
1555
+ too small but never shrinks one — a size chosen deliberately stays.
1556
+ - The default button is smaller: roughly 134x38 px on a maximised 1920x1080
1557
+ window, down from 230x65, which read as unusually large.
1558
+ - Palette entries are single compact rows of icon and name, about 33 px each,
1559
+ rather than cards with descriptions. The vocabulary is going to grow, and a
1560
+ card tall enough for a description does not survive a dozen types in a
1561
+ sidebar.
1562
+ - The text field in the properties panel now serves any text-bearing type, not
1563
+ just buttons. `label` holds a button's caption and a label's text — the same
1564
+ idea, so it stays one schema field rather than two.
1565
+
1566
+ ## [0.5.0] — unreleased
1567
+
1568
+ ### Added
1569
+
1570
+ - Generated starter files import numpy as np. No research happens without it.
1571
+ - A delete control in the properties panel, pinned to the bottom of the sidebar
1572
+ so a destructive action is never the thing pushed off the screen. The
1573
+ element's handler stays in the code file, as it always has.
1574
+ - The editor sidebar scrolls when its contents are taller than the window.
1575
+
1576
+ ### Changed
1577
+
1578
+ - The editor has a modern look: the `clam` ttk theme restyled with a flat
1579
+ palette, the element types shown as icon cards rather than radio buttons, and
1580
+ the geometry fields laid out as a 2x2 grid instead of four stacked rows.
1581
+ Icons are drawn as vectors rather than loaded from image files or set as text
1582
+ glyphs — no assets to ship, and no bet on the platform font having a
1583
+ character.
1584
+ - Property edits commit on Enter or when the field loses focus. The Apply
1585
+ button is gone: a value typed and tabbed away from is a value you meant.
1586
+ - Removed the dashed "mode toggle" hint from the canvas. The toggle lives in
1587
+ its own chrome bar above the layout, so nothing is ever underneath it and the
1588
+ hint was misleading.
1589
+
1590
+ ### Fixed
1591
+
1592
+ - The sidebar's contents disappeared at small window sizes. Tk stops *mapping*
1593
+ children that no longer fit rather than clipping them, so the geometry fields
1594
+ were absent rather than scrolled out of view — with no error, no scrollbar,
1595
+ and the only symptom being that typing into them did nothing. At the 800x450
1596
+ default this affected every position field.
1597
+
1598
+ ## [0.4.0] — unreleased
1599
+
1600
+ ### Fixed
1601
+
1602
+ - A button responded only to the left mouse button. Middle and right clicks did
1603
+ not reach the handler at all — Tk's `command` option fires for button 1 only,
1604
+ and nothing else was bound. The event also reported `"left"` unconditionally,
1605
+ since the value was hardcoded rather than read from the click. All three
1606
+ buttons now fire the handler and `event.button` says which one.
1607
+ - Removed `_bind_tk_events`, which was written but never called.
1608
+
1609
+ ### Changed
1610
+
1611
+ - The generated stub for a plot area now prints which mouse button was used
1612
+ alongside the coordinates, and its comment lists the possible values. The
1613
+ button was always available on the event; nothing advertised it.
1614
+
1615
+ ## [0.3.0] — unreleased
1616
+
1617
+ ### Changed
1618
+
1619
+ - Placing an element no longer opens a modal asking for its name. The element
1620
+ is created with its default name, selected, and the properties panel's name
1621
+ field is focused with the text selected — so accepting the default needs no
1622
+ typing and replacing it needs no extra click. This still satisfies FR-005a,
1623
+ and it removes a dialog that stopped the researcher on every placement.
1624
+
1625
+ ### Fixed
1626
+
1627
+ - The test suite could stop and wait for a human. One code path opened a modal
1628
+ that no test stubbed, which made the suite unrunnable unattended and so
1629
+ disqualified it as a release gate (Principle VII, Gate 1). The dialog is
1630
+ gone, and `tests/conftest.py` now makes any modal — dialog, message box or
1631
+ file chooser — raise instead of block, so a future one fails loudly rather
1632
+ than appearing to hang.
1633
+
1634
+ ## [0.2.0] — unreleased
1635
+
1636
+ Everything found by the first hands-on session with the application. Each of the
1637
+ four defects below was a component that was fully implemented and never
1638
+ connected to anything, and each was invisible to the automated suite because the
1639
+ tests exercised the mechanism directly rather than going through the assembled
1640
+ app.
1641
+
1642
+ ### Fixed
1643
+
1644
+ - The mode toggle did nothing. `ModeToggle` was written but never instantiated,
1645
+ so the chrome frame held no control at all.
1646
+ - `ev.some_plot.plot(...)` drew nothing after the first interaction. An embedded
1647
+ figure gets no automatic repaint — pyplot installs that hook and pyplot has no
1648
+ place here, since `plt.show()` would start a second event loop against Tk's.
1649
+ Handlers now repaint whatever they drew.
1650
+ - A launch-time fault in startup was reported twice, because the deferred-startup
1651
+ hook re-entered itself.
1652
+ - Adding an element to a `.py` written with CRLF line endings rewrote every line
1653
+ in the file.
1654
+
1655
+ ### Added
1656
+
1657
+ - Drag an element to move it; drag an edge to resize one dimension or a corner
1658
+ to resize both. Pointer feedback says what a press will do before you commit.
1659
+ - Click empty canvas to place an element at a sensible default size for its
1660
+ type, centred on the click. Escape deselects, since clicking now creates.
1661
+ - `iterlab.run(name)` — the library entry point that contracts/commands.md and
1662
+ the README had documented while `__init__.py` was empty.
1663
+ - The version has a single source of truth in `__init__.py`, which
1664
+ `pyproject.toml` reads.
1665
+
1666
+ ## [0.1.0] — unreleased
1667
+
1668
+ The initial implementation of feature 001. Never published; superseded by 0.2.0
1669
+ before it left the working tree.
1670
+
1671
+ ### Added
1672
+
1673
+ - `iterlab <name>` opens an interface. One command; editing and using it are two
1674
+ modes of one program, switched with the toggle in the top-left corner.
1675
+ - **Editor mode**: a canvas, a palette of element types, and a properties panel.
1676
+ Draw by dragging; every property is editable, including the name.
1677
+ - **GUI mode**: the interface as drawn, with handlers wired and the standard
1678
+ matplotlib navigation toolbar on every plot area.
1679
+ - Two element types: plot areas and buttons.
1680
+ - Handlers bind by naming convention (`on_<interaction>_<element>`), with the
1681
+ universal interaction set click / hover / motion / key. Every handler is
1682
+ optional; exactly one stub is generated per element.
1683
+ - Code changes take effect on the next interaction with no restart, and nothing
1684
+ in the session is discarded — loaded data, computed results and drawn plots
1685
+ all survive.
1686
+ - A fault in researcher code never ends the session. It is reported to stderr
1687
+ in full and signalled in the window, and the report clears when corrected code
1688
+ runs. An element with no handler is silent, which is a different thing.
1689
+ - Renaming an element rewrites its handlers and nothing else in the file.
1690
+ - Layout files record `schema_version: 1`. A layout written by a newer iterlab
1691
+ is reported and left untouched rather than partially understood.
1692
+
1693
+ ### Known limits
1694
+
1695
+ - A mode switch ends the session; switching back runs startup again. Applying
1696
+ layout edits to a live session is the aim, not a promise.
1697
+ - Changing `on_startup` takes effect by starting a fresh session — toggling out
1698
+ and back is enough.
1699
+ - Handlers run to completion while the interface waits. Long computations block
1700
+ the window.
1701
+ - Reloading a module re-executes its top level, so data loaded at module level
1702
+ rather than in `on_startup` will reload on every edit. The generated starter
1703
+ file says so.