-
Notifications
You must be signed in to change notification settings - Fork 323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Interaction resumption #9621
Interaction resumption #9621
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to see a bit more docs for editHandler, as I don't quite grasp what is the relation between all those classes
app/gui2/src/components/GraphEditor/widgets/WidgetSelection.vue
Outdated
Show resolved
Hide resolved
widgetId: WidgetId, | ||
hooks: WidgetEditHooks, | ||
parent: WidgetEditHandler | undefined, | ||
portEditor: PortEditor, | ||
widgetTree: { | ||
currentEdit: WidgetEditHandler | undefined | ||
} = injectWidgetTree(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw that we use private readonly widgetId: WidgetId
syntax in constructor parameters elsewhere, so it's both declared and set as property.
pointerdown: (event, navigator) => { | ||
if (!hooks.pointerdown) return false | ||
return hooks.pointerdown?.(event, navigator) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where the propagation is done?
readonly active: Ref<boolean> | ||
private readonly interactionHandler | ||
private readonly resumable: PortEditResumeData | ||
private readonly interactions = new Array<PortEditSubinteraction>() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is a difference between PortEditInteraction
and PortEditSubinteraction
?
interface Endable { | ||
end?(origin: WidgetId): void | ||
} | ||
/** A child interaction of a @{link PortEditInteraction} */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is "child interaction"? Is it the same as "child's interaction"? In this page docs, the only parent/child relation is this of Widgets.
* Obtains a top-level interaction to edit a port (see {@link PortEditInteraction}), which may be a pre-existing | ||
* ongoing interaction, or a newly-started interaction. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the name does not quite reflect the usage.
I rearranged the file to introduce concepts in a more logical order, and added docs, especially to |
parent: WidgetEditHandler | undefined, | ||
portEditor: PortEditor, | ||
widgetTree: { | ||
private readonly widgetId: WidgetId, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having this, the initializations (lines 57 onwards) are redundant.
Pull Request Description
Prevent interactions such as an open dropdown from being disrupted by the temporary state of absent type information occurring after an edit.
Screen.Recording.2024-04-02.at.06.44.05.mov
All widget-edit interactions that are active when a component is to be unmounted save state and are suspended. When a new component defining a
WidgetEditHandler
is instantiated, if the component is found to be equivalent to a component that was suspended, and no other interaction has been initiated in the interim, the interaction is restarted using the suspended state.Important Notes
WidgetEditHandler
now provides a reactiveactive
property; using it is simpler and avoids this type of bug in the future.Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.
./run ide build
.