Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Various minor improvements #401

wants to merge 1 commit into from

Conversation

tortmayr
Copy link
Contributor

What it does

  • 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)

How to test

Follow-ups

Changelog

  • This PR should be mentioned in the changelog
  • This PR introduces a breaking change (if yes, provide more details below for the changelog and the migration guide)

- 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)
Copy link
Contributor

@martin-fleck-at martin-fleck-at left a 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;
Copy link
Contributor

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;
Copy link
Contributor

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.

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.

2 participants