Skip to content

Action analytics #2233

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

Merged
merged 10 commits into from
May 16, 2018
Merged

Action analytics #2233

merged 10 commits into from
May 16, 2018

Conversation

pq
Copy link
Contributor

@pq pq commented May 9, 2018

An approach to getting unique analytics for the 2 flavors of "open in..." native editor actions.

I'm not married to the analytics keys ("openInXcodeFromBanner", etc. are long-winded but not inconsistent with what we have already). Needless to say, very open to suggestions.

/cc @devoncarew @stevemessick

@pq
Copy link
Contributor Author

pq commented May 9, 2018

Oh I see a build break... I'll fix that in a sec.

@pq
Copy link
Contributor Author

pq commented May 9, 2018

Ok, weird, I pulled in a conflicting FlutterView during a rebase. Should be fixed now.

@pq
Copy link
Contributor Author

pq commented May 9, 2018

Sorry for the noise. This is green now.

@devoncarew @stevemessick

* Template method. Implement @performAction.
*/
@Override
public final void actionPerformed(AnActionEvent e) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Final methods often end up causing unexpected problems. It would be better to omit that modifier.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 In general I hear you. In this case though it's a template method and I don't want it accidentally overridden since the analytics call won't happen unless they think to call super.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@OverridingMethodsMustInvokeSuper will do what you want and won't do what I don't want.

screen shot 2018-05-10 at 12 43 02 pm

You'll need to add a library dependency on jsr305 to enable that annotation, but I think it's worth doing. (Remember to add it to all relevant module definitions. I think there are two.)

In its current form, this method appears to contradict the instructions from JetBrains:
https://www.jetbrains.org/intellij/sdk/docs/tutorials/action_system/working_with_custom_actions.html

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have an opinion here, but we may want to move discussion out of a PR; perhaps when you're in the office Monday Steve?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. We can discuss and rejigger.

pq added 2 commits May 10, 2018 08:49
# Conflicts:
#	flutter-studio/src/io/flutter/actions/OpenAndroidModule.java
@pq
Copy link
Contributor Author

pq commented May 10, 2018

Ok, I've rebased and this PR is clean again.

What do you guys think?

cc @stevemessick @devoncarew

@pq pq requested a review from devoncarew May 10, 2018 16:02
@NotNull
@Override
public String getAnalyticsId() {
return "openModuleInAndroidStudio";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

openModuleInAndroidStudio ==> OpenModuleInAndroidStudio (TitleCamelCase)

@Override
public void actionPerformed(AnActionEvent e) {
public String getAnalyticsId() {
return "openInAndroidStudio";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OpenInAndroidStudio

@Override
public void actionPerformed(AnActionEvent e) {
public String getAnalyticsId() {
return "openInXcode";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OpenInXcode

@NotNull
@Override
public String getAnalyticsId() {
return "openInXcodeFromBanner";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't have an existing pattern for this; perhaps OpenInXcode.banner?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@NotNull
@Override
public String getAnalyticsId() {
return "openInAndroidStudioFromBanner";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OpenInAndroidStudio.banner?

* Template method. Implement @performAction.
*/
@Override
public final void actionPerformed(AnActionEvent e) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have an opinion here, but we may want to move discussion out of a PR; perhaps when you're in the office Monday Steve?

pq added 2 commits May 16, 2018 10:20
# Conflicts:
#	src/io/flutter/editor/NativeEditorNotificationProvider.java
Copy link
Contributor Author

@pq pq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@NotNull
@Override
public String getAnalyticsId() {
return "openInXcodeFromBanner";
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

* Template method. Implement @performAction.
*/
@Override
public final void actionPerformed(AnActionEvent e) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. We can discuss and rejigger.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants