Skip to content

OnChange is oneData::OnChange; ItemRef forwards get(); needs OneData >= 0.1.22 - #2

Merged
neu-rah merged 3 commits into
mainfrom
itemref-get
Oct 5, 2026
Merged

neu-rah merged 3 commits into
mainfrom
itemref-get

Conversation

@neu-rah

@neu-rah neu-rah commented Oct 5, 2026

Copy link
Copy Markdown
Member

Follows OneData #3 (merged, 0.1.22).

What changes

  • OnChange<fn> is oneData::OnChange<fn> now: using oneData::OnChange; replaces the struct in menu/item.h (same behaviour, same call sites; oneMenu::OnChange still names it). It is a data component, not a menu one. Without this, code with both using namespace oneMenu; and using namespace oneData; and an unqualified OnChange<fn> is ambiguous now that OneData has its own.
  • ItemRef::get() forwards the referred node's get(), so a component over an ItemRef (OneData's OnSync<fn>) reads the referred value. Only instantiated when called.
  • Dependency OneData >= 0.1.22 (OnChange lives there; OnSync composes over an ItemRef; ReadOnly composes into an item).

Tests, against OneData main

test/negative/run.sh (5/5, g++ and clang++), the four native tests (test_footer, test_idtext, test_kbd_frames, test_view), and a check with both namespaces open that an unqualified OnChange<fn> resolves to the same entity as oneData::OnChange.

Cost

None by construction: a struct moved to a header OneMenu already includes, and one member function of a class template that is instantiated only when called. I did not measure an example's size before and after.

🤖 Generated with Claude Code

neu-rah and others added 3 commits October 5, 2026 03:04
Needs OneData >= 0.1.20.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A component over an ItemRef (OnSync) reads the referred node's value.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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 <noreply@anthropic.com>
@neu-rah
neu-rah merged commit 2985df7 into main Oct 5, 2026
4 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant