Repository navigation
Show controlled values unless the user has an unacknowledged edit - #97
Merged
Merged
Conversation
An embedder numbers widget events with NoteWidgetEvent, and a commit may carry "eventsApplied": the last event applied to the state its tree was built from. Elements declare controlled properties (input-text: value). With eventsApplied, a commit stores them as the element's committed values. An element edited after eventsApplied keeps what the user typed; any other patched, created or acknowledged element shows its committed values, even when the commit does not carry them, so a rejected or transformed edit converges. Without eventsApplied nothing changes. InputText reloads ImGui's edit buffer when a controlled value replaces the text while it is being edited, and its value is reported in the diagnostics state. The commit state advertises controlledValues. Five new unit tests; all 414 pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0186WhMU3KjnmjR7Y4r49GrT
|
Caution Review failedThe pull request is closed.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
andreamancuso
temporarily deployed
to
github-pages
November 24, 2026 11:45 — with
GitHub Pages
Inactive
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
xframes-core lets the application model own what an input shows (xframes-core#24). The hard case is a commit and a user's edit crossing: the model applied "a", the user has since typed "ab", and a commit carrying "a" lands. Overwriting the input would lose the keystroke. Only the engine knows, when it applies a commit, whether the input was edited after the state the commit was built from.
What
XFrames::NoteWidgetEvent(id)numbers widget events and records each element's last edit that no commit has acknowledged. The shared C library calls it for every event it queues and stamps the sequence into polled events."eventsApplied": the last event applied to the state its tree was built from (a canonical uint64 decimal string, parsed likebaseRevision).ControlledProps;input-textdeclaresvalue). WitheventsApplied, a commit stores them as the element's committed values instead of patching them. An element edited aftereventsAppliedkeeps what the user typed. Any other patched, created or acknowledged element shows its committed values, even when the commit does not carry them, so a rejected or transformed edit converges.eventsApplied, behavior is unchanged.InputTextreloads ImGui's edit buffer when a controlled value replaces its text while it is being edited, and reports its value in the diagnostics state. The commit state advertisescontrolledValues.Tests
Five new tests: the feature and numbering; a value shown with no unacknowledged edit; an edit after
eventsAppliedkept, then restored by an acknowledging commit without a patch; values ignored withouteventsApplied; destruction forgetting an edit. All 414 engine tests pass locally. Two hand mutations (no staleness check; no re-apply without a patch) were each caught.xframes-core's checks against the shared library built from this commit also pass locally, including hidden-window crossing checks and
check-native.ps1 -SoftwareRendering.🤖 Generated with Claude Code
https://claude.ai/code/session_0186WhMU3KjnmjR7Y4r49GrT