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

UI Onboarding Wizards #5196

Merged
merged 136 commits into from
Aug 28, 2018
Merged

UI Onboarding Wizards #5196

merged 136 commits into from
Aug 28, 2018

Conversation

madalynrose
Copy link
Contributor

No description provided.

meirish and others added 30 commits August 17, 2018 14:48
Copy link

@DingoEatingFuzz DingoEatingFuzz left a comment

Choose a reason for hiding this comment

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

Review Pt 1: The JavaScript

I read and reviewed everything up to the templates. I skimmed through the CSS assuming it had already been reviewed and merged into this branch.

This looks like mondo excellent work. I saw some places for developer experience improvements, but probably nothing that hasn't already been thought of and passed over for the sake of time.

Can't wait to see how this evolves! I imagine something like this will end up in all products, so this is likely to be the beginning of something that we all share.

size: computed(function() {
return 12;
size: computed('glyph', function() {
return this.get('glyph').startsWith('enable/') ? 48 : 12;

Choose a reason for hiding this comment

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

This strikes me as surprising. I wouldn't expect certain icons to get special treatment implicitly.

this.get('wizard.featureState'),
'CONTINUE',
this.get('mountModel').get('type')
);

Choose a reason for hiding this comment

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

Does it make sense to make a special method for this pattern? Something like...

// wizard.js
next(extendedState) {
  return this.transitionFeatureMachine(this.get('featureState'), 'CONTINUE', extendedState);
}

// this-file.js
try {
  if (config && Object.keys(config.changedAttributes()).length) {
    yield config.save()
    this.get('wizard').next(this.get('mountModel').get('type'));
  }
} catch (err) {
  // ...
}

this.get('wizard').transitionFeatureMachine(
this.get('wizard.featureState'),
'RESET',
this.get('mountModel').get('type')

Choose a reason for hiding this comment

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

Another one! Maybe it also makes sense to "curry" this for two arguments as well as three and one?

// wizard.js

// Total control
transitionFeatureMachine(currentState, event, extendedState) {},

// Assume internally tracked state
transition(event, extendedState) {
  this.transitionFeatureMachine(this.get('wizard.featureState'), event, extendedState);
},

// Convenience methods for common event types 
next(extendedState) { this.transition('CONTINUE', extendedState); },
reset(extendedState) { this.transition('RESET', extendedState); },

Just looking for ways to reduce boilerplate and abstract away some internals.

@@ -0,0 +1,11 @@
// THIS COMPONENT IS ONLY FOR EXTENDING
// You should use this component if you want to use outerHTML symantics

Choose a reason for hiding this comment

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

s/symantics/semantics

});

// yep! that's it, it's more of a way to keep track of what components
// use tagless semantics to make the upgrade to glimmer components easier

Choose a reason for hiding this comment

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

👍 helpful comment!

saveFeatures() {
let wizard = this.get('wizard');
wizard.saveFeatures(this.get('selectedFeatures'));
wizard.transitionTutorialMachine('active.select', 'CONTINUE');

Choose a reason for hiding this comment

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

Super vague thinking here... would it make sense to split wizard into two services, one for each FSM?


export function engines() {
return MOUNTABLE_SECRET_ENGINES;
}

Choose a reason for hiding this comment

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

Since this function is just returning a a reference to the MOUNTABLE_SECRET_ENGINES set, you might as well just export the const instead of a function. Either that or use copy(MOUNTABLE_SECRET_ENGINES, true) to make sure no consumer of the export mutates it.

onEntry: ['completeFeature'],
},
},
};

Choose a reason for hiding this comment

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

I still love how declarative these machines end up. In my head it goes

  1. This PR
  2. ???
  3. Hook it up to a CMS
  4. ???
  5. Profit

],
on: {
CONTINUE: {
details: { cond: type => supportedBackends.includes(type) },

Choose a reason for hiding this comment

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

These cond predicates are cool even though they step on my CMS dream.

storage() {
return getStorage();
},
});

Choose a reason for hiding this comment

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

Some of these methods are rather dense, but I'm not sure if they need more comments or if I just need to know more about xstate.

* initial try at pause

* save resume url when pausing and replay machines when resuming

* don't save resumeURL if it's not set

* don't need currentURL in execute actions

* re-set the state on resume

* fix tools not triggering pause

* small fixes for pausing

* fix policies machine
@meirish meirish changed the title UI Wizards UI Onboarding Wizards Aug 28, 2018
@meirish meirish merged commit f913d4c into master Aug 28, 2018
@meirish meirish deleted the ui-wizards branch August 28, 2018 05:03
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.

4 participants