Commit a1df02f
Replace a NaN in an input element's buffer with its default
Maintainer's decision of 2026-09-02, recorded as input-default-does-not-
replace-nan: a control cannot show NaN and the user could never enter it, so
the buffer must not hold a value the control does not. The default of an
edit, toggle, dropdown or slider replaces a NaN at the end of its buffer the
same way it fills an empty one - written as it stands, not clamped to the
element's range, and without counting as user input, because it came from an
analysis write and an analysis with onUserInput must not re-run on its own
output. Android has had it since 2026-09-02 (ExpView.expViewElement.
applyDefault); this is the iOS half, and the entry leaves phyphox-docs with
it.
Experiment.seedInputDefaults treats a trailing NaN like an empty buffer, at
every moment it already runs: when the experiment is built, on a clear, and
before each analysis pass, for every page whether or not it is on screen.
replaceValues reports no user input, so the rule's third part holds by
construction. The slider joins the collected defaults - the reason it was
kept out, that Android never seeded one, is gone, Android seeds it on every
write pass like the rest - with min and max for the two buffers of a range
slider, the values the handles show. The slider module's own catch-up between
two cycles takes the NaN case too: Float(nan) is nothing to hand a UISlider.
Tests: InputDefaultSeedingTests over the shared fixtures nan-vs-default and
init-vs-default (the rule at its source, before any view exists, plus that a
NaN written later is replaced again and never reads as user input), the
former testTheSliderIsLeftAsItIs turned into testTheSliderIsSeededLikeTheRest,
and ViewBehaviorTests.testANaNIsReplacedByTheDefault mirroring the Android
test through the remote API, asserting the experiment is still stopped.
Verified on the iPhone 17 simulator: the whole phyphoxTests target and all
five ViewBehaviorTests pass. GraphSnapshotTests and ViewSnapshotTests fail
identically on the unmodified tree on this machine (517 golden mismatches
both times) and are unrelated.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>1 parent f1fa7ff commit a1df02f
4 files changed
Lines changed: 128 additions & 17 deletions
File tree
- phyphox-iOS
- phyphoxTests
- phyphoxUITests
- phyphox
- Experiments
- UI/MainView/ExperimentView/ViewModules/Dynamic
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
693 | 693 | | |
694 | 694 | | |
695 | 695 | | |
696 | | - | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
697 | 704 | | |
698 | | - | |
| 705 | + | |
699 | 706 | | |
700 | 707 | | |
701 | 708 | | |
| |||
720 | 727 | | |
721 | 728 | | |
722 | 729 | | |
723 | | - | |
724 | | - | |
725 | | - | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
726 | 734 | | |
727 | 735 | | |
728 | 736 | | |
| |||
734 | 742 | | |
735 | 743 | | |
736 | 744 | | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
737 | 756 | | |
738 | 757 | | |
739 | 758 | | |
| |||
Lines changed: 7 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
244 | 244 | | |
245 | 245 | | |
246 | 246 | | |
247 | | - | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
248 | 251 | | |
249 | | - | |
| 252 | + | |
250 | 253 | | |
251 | 254 | | |
252 | 255 | | |
| |||
255 | 258 | | |
256 | 259 | | |
257 | 260 | | |
258 | | - | |
| 261 | + | |
259 | 262 | | |
260 | 263 | | |
261 | | - | |
| 264 | + | |
262 | 265 | | |
263 | 266 | | |
264 | 267 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1694 | 1694 | | |
1695 | 1695 | | |
1696 | 1696 | | |
1697 | | - | |
1698 | | - | |
1699 | | - | |
1700 | | - | |
1701 | | - | |
| 1697 | + | |
| 1698 | + | |
| 1699 | + | |
| 1700 | + | |
| 1701 | + | |
1702 | 1702 | | |
1703 | 1703 | | |
1704 | 1704 | | |
1705 | | - | |
| 1705 | + | |
| 1706 | + | |
| 1707 | + | |
| 1708 | + | |
| 1709 | + | |
1706 | 1710 | | |
1707 | 1711 | | |
1708 | 1712 | | |
1709 | 1713 | | |
1710 | 1714 | | |
| 1715 | + | |
| 1716 | + | |
| 1717 | + | |
| 1718 | + | |
1711 | 1719 | | |
1712 | 1720 | | |
1713 | 1721 | | |
1714 | 1722 | | |
1715 | 1723 | | |
1716 | 1724 | | |
1717 | 1725 | | |
| 1726 | + | |
| 1727 | + | |
1718 | 1728 | | |
1719 | | - | |
1720 | | - | |
| 1729 | + | |
| 1730 | + | |
| 1731 | + | |
1721 | 1732 | | |
1722 | 1733 | | |
1723 | 1734 | | |
| |||
5168 | 5179 | | |
5169 | 5180 | | |
5170 | 5181 | | |
| 5182 | + | |
| 5183 | + | |
| 5184 | + | |
| 5185 | + | |
| 5186 | + | |
| 5187 | + | |
| 5188 | + | |
| 5189 | + | |
| 5190 | + | |
| 5191 | + | |
| 5192 | + | |
| 5193 | + | |
| 5194 | + | |
| 5195 | + | |
| 5196 | + | |
| 5197 | + | |
| 5198 | + | |
| 5199 | + | |
| 5200 | + | |
| 5201 | + | |
| 5202 | + | |
| 5203 | + | |
| 5204 | + | |
| 5205 | + | |
| 5206 | + | |
| 5207 | + | |
| 5208 | + | |
| 5209 | + | |
| 5210 | + | |
| 5211 | + | |
| 5212 | + | |
| 5213 | + | |
| 5214 | + | |
| 5215 | + | |
| 5216 | + | |
| 5217 | + | |
| 5218 | + | |
| 5219 | + | |
| 5220 | + | |
| 5221 | + | |
| 5222 | + | |
| 5223 | + | |
| 5224 | + | |
| 5225 | + | |
| 5226 | + | |
| 5227 | + | |
| 5228 | + | |
| 5229 | + | |
| 5230 | + | |
| 5231 | + | |
| 5232 | + | |
| 5233 | + | |
| 5234 | + | |
| 5235 | + | |
| 5236 | + | |
| 5237 | + | |
| 5238 | + | |
| 5239 | + | |
| 5240 | + | |
5171 | 5241 | | |
5172 | 5242 | | |
5173 | 5243 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
262 | 262 | | |
263 | 263 | | |
264 | 264 | | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
265 | 284 | | |
266 | 285 | | |
267 | 286 | | |
| |||
0 commit comments