Repository navigation
Fix: code editor handle requests made in a widget tree reach their editor (FR-38) - #174
Merged
Merged
Conversation
…itor (FR-38) The page's flush of code editor requests drops a request for a handle its renderer does not carry, and a WidgetView tree has a renderer of its own that nothing flushed, so edit, select, reveal and fold asked of a handle in a widget tree never left. After the trees are rendered each request now goes to the tree whose renderer carries the handle; a handle no tree carries is still dropped. The request is applied by one method of the renderer, which the page's flush uses too. Tested through a WidgetView with a code editor whose button asks its handle for an edit, a selection and a reveal.
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.
Found while wiring the Ember editor's find and replace:
handle.select,revealandediton aCodeEditorHandlecreated in aWidgetViewtree never reached the editor, so nothing selected, scrolled or replaced, and no error was reported.Cause
The page's flush of code editor requests (
flush_code_edits) takes the whole queue and drops a request whose handle its renderer does not carry. AWidgetViewtree has aComposeRendererof its own (its owneditorstable), and nothing flushed the requests for it.What
After
render_islandshas rendered the trees, each request goes to the tree whose renderer carries the handle (ComposeRenderer::apply_editor_request, which the page's flush uses too); a handle no tree carries is dropped as before.EditorRequest::token().Tests (FR-38)
fr38_a_code_editor_handle_in_a_widget_tree_reaches_its_editor: aWidgetViewwith a code editor and a button that asks its handle for an edit, a selection and a reveal; each goes out addressed to the island's editor. Verified to fail without the fix (the request is dropped).fr34_3_widgets_in_html6,code_editor8,fr34_html_bridge20, lib;cargo fmtclean.Stacked after #173 (merged).