From bb23d12fec165fd4011e93cd6e8f3c5cc0371ff5 Mon Sep 17 00:00:00 2001 From: neu-rah Date: Mon, 5 Oct 2026 03:04:55 +0000 Subject: [PATCH 1/3] OnChange is oneData::OnChange; a using keeps oneMenu::OnChange Needs OneData >= 0.1.20. Co-Authored-By: Claude Sonnet 5.5 --- include/oneMenu/menu/item.h | 14 +------------- library.json | 2 +- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/include/oneMenu/menu/item.h b/include/oneMenu/menu/item.h index 381d124..952095f 100644 --- a/include/oneMenu/menu/item.h +++ b/include/oneMenu/menu/item.h @@ -519,19 +519,7 @@ namespace oneMenu { }; }; - /// @brief Fires fn(v) on every value mutation while editing; v is re-read via get() after Base::set() (may be clamped/transformed). - /// Compose inside NumField<...>'s range/storage chain, e.g. NumField, OnChange, AsField>>. - template - struct OnChange { - template - struct Part:I { - using Base=I; - using Base::Base; - using Base::get; - using Type=typename Base::Type; - void set(Type v) {Base::set(v); fn(Base::get());} - }; - }; + using oneData::OnChange; /// @brief Fires fn(v) once when edit mode is left (Enter-to-commit or Esc-while-editing; Esc is treated as a commit, not a cancel). /// Compose outside (wrapping) EditField, e.g. ItemDef<..., OnUpdate, EditField, NumField<...>>. diff --git a/library.json b/library.json index 78ec984..cb60882 100644 --- a/library.json +++ b/library.json @@ -25,7 +25,7 @@ "dependencies": { "HAPI":">=0.7.0", "OneChip":"https://github.com/InternetOfPins/OneChip.git", - "OneData":">=0.1.13", + "OneData":">=0.1.20", "OneInput":"https://github.com/InternetOfPins/OneInput.git", "OneItem":">=0.1.3", "OneOutput":">=0.0.5", From 60483e372f7b19c48bda3fee652780cf9487bebc Mon Sep 17 00:00:00 2001 From: neu-rah Date: Mon, 5 Oct 2026 04:04:01 +0000 Subject: [PATCH 2/3] ItemRef forwards get() A component over an ItemRef (OnSync) reads the referred node's value. Co-Authored-By: Claude Sonnet 5.5 --- include/oneMenu/menu/item.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/oneMenu/menu/item.h b/include/oneMenu/menu/item.h index 952095f..553f714 100644 --- a/include/oneMenu/menu/item.h +++ b/include/oneMenu/menu/item.h @@ -900,6 +900,7 @@ namespace oneMenu { static constexpr void enable(bool o=true) {ref.enable(o);} [[nodiscard]] static constexpr bool changed() {return ref.changed();} static constexpr void sync() {ref.sync();} + static decltype(auto) get() {return ref.get();} // the referred value, for a component over this node (OnSync) static constexpr bool up() {return ref.up();} static constexpr bool down() {return ref.down();} From 15e4c6cfa79cb2018b522412eee968ca9c546060 Mon Sep 17 00:00:00 2001 From: neu-rah Date: Mon, 5 Oct 2026 05:09:55 +0000 Subject: [PATCH 3/3] Depends on OneData >= 0.1.22 OnChange lives in OneData (0.1.20), a component over an ItemRef needs no Type (0.1.21), and a ReadOnly composes into an item (0.1.22). Co-Authored-By: Claude Sonnet 5.5 --- library.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library.json b/library.json index cb60882..8041f98 100644 --- a/library.json +++ b/library.json @@ -25,7 +25,7 @@ "dependencies": { "HAPI":">=0.7.0", "OneChip":"https://github.com/InternetOfPins/OneChip.git", - "OneData":">=0.1.20", + "OneData":">=0.1.22", "OneInput":"https://github.com/InternetOfPins/OneInput.git", "OneItem":">=0.1.3", "OneOutput":">=0.0.5",