-
Notifications
You must be signed in to change notification settings - Fork 30
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
Various minor improvements #401
base: master
Are you sure you want to change the base?
Conversation
- Merge *-default.ts implementation files of `FeedbackActionDispatcher` and `HelperLineManager` with the the interface definition files. The split is no longer necessary since we resolved potential circular dependency issues - Ensure that we consistently use the `LazyInjector` over dedicated async providers and deprecate existing provider injection - Fix a bug in the `FocusTracker` where we could end up in an invalid state on startup (diagram active but .diagramElement is undefined). This mostly occurred in standalone contexts (Diagram element is root => no focus change => handle gets never invoked)
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.
Change looks good to me overall but I wonder whether the focus tracking needs to be correctly initialized. Also the PR has merge conflicts. Other than that, I like the cleanup and various improvements, thank you Tobias!
@@ -29,7 +30,7 @@ export interface FocusChange { | |||
* Allows querying of the current focus state and the focused root diagram element and the currently focused element within the diagram. | |||
*/ | |||
@injectable() | |||
export class FocusTracker implements IActionHandler { | |||
export class FocusTracker implements IActionHandler, IDiagramStartup { | |||
protected inActiveCssClass = 'inactive'; | |||
protected _hasFocus = true; |
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 wonder if that should really be true now that we actually track the focus change in the beginning?
postModelInitialization(): MaybePromise<void> { | ||
this.handleFocusChange(); | ||
} | ||
|
||
handle(action: Action): void | Action | ICommand { | ||
if (!FocusStateChangedAction.is(action)) { | ||
return; | ||
} | ||
|
||
this._hasFocus = action.hasFocus; |
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.
This should probably be initialized correctly somehow.
What it does
FeedbackActionDispatcher
andHelperLineManager
with the the interface definition files. The split is no longer necessary since we resolved potential circular dependency issuesLazyInjector
over dedicated async providers and deprecate existing provider injectionFocusTracker
where we could end up in an invalid state on startup (diagram active but .diagramElement is undefined). This mostly occurred in standalone contexts (Diagram element is root => no focus change => handle gets never invoked)How to test
Follow-ups
Changelog