Skip to content
This repository has been archived by the owner on Jun 17, 2021. It is now read-only.

Gatsby starter #335

Merged
merged 24 commits into from
Jan 21, 2019
Merged

Gatsby starter #335

merged 24 commits into from
Jan 21, 2019

Conversation

AWolf81
Copy link
Collaborator

@AWolf81 AWolf81 commented Nov 20, 2018

Related Issue:
#47

Summary:
Add a Gatsby Starter selection to CreateNewProjectWizard & add the business logic to pass the starter url to the create command.
I've enlarged the TwoPanelModal height so the new component will fit into it.

The thing with selecting more stuff is something we're handling with Guppy plugins. So we can add Flow, Storybook, Docz,... after project creation to keep the setup small.

Screenshots/GIFs:
Gatsby with starter
grafik

Starter selection list (Removed and added as requested)
grafik

Todos:

  • Improve UI
    • Create a TextComponent with a button on the right to open the selection menu - similar to DirectroyPicker
    • Use Card component to render Starter selection list - manual styling with styled-components.
    • Add more details from the yaml. (Maybe we need to get more data from Gatsby as there is no title in the starter.yml)
    • Improve styling of the selected starter (just a red border at the moment)
    • Add basic navigation (show more) to starter list (just if we're not using Algolia)
    • Check positioning of selection modal (slightly moved down)
  • Refactor new step into ProjectStarterSelector component and use it in projectSpecificSteps method
  • Selection list
    • Fix selection updates in SelectStarterDialog - Not working at the moment.
    • Sort by Github stars - requires an additional query. Not added. Maybe we need to use Graphql to get all the data. Like in this code.
  • Add test for config-variables.service
  • Refactor build steps - I'd like to improve the conditons for button disable & submit button.
  • Add a better copy to the Gatsby Starter summary pane. We'll need more details for the why and what it will do.
  • Show a message if starter couldn't be used. Fails silently at the moment.
  • Check if we need a loading spinner for the selection list.
  • Should we display a preview screenshot? I think there is no image in the starter.yml not sure where to get the image - I'll check the Gatsby starter selection page. Right now not possible as the yml doesn't contain a screenshot.
  • Fix index issue in MainPane. Button disabling & Form submitting not working as expected.

Discussion

  • What features are required in the starter selection dialog? I think we're not needing every feature from Gatsby starter list - maybe we could add a link to it. But the Algolia search would be nice and maybe a sorting by the most popluar starters.
  • Should we use Algolia for searching? I think it's OK to use a typeahead component as there are just arount 70 items in the list. We could change to Algolia later.
  • Should we also add the Deploy to Netlify button? Or is this confusing for beginners? I think it's easy to add but I'm not sure if we should add it. (Just opening a link like https://app.netlify.com/start/deploy?repository=https://github.com/gatsbyjs/gatsby-starter-blog will deploy to netlify).
  • Should we allow the user to enter a URL manually into the starter input? Do we need some prefixes in the input field? For now I'm adding https://github.com/gatsbyjs/ if no url is entered - so entering gatsby-starter-blog will use the starter https://github.com/gatsbyjs/gatsby-starter-blog. We could also add a replacement for username/repo so it would be https://github.com/username/repo.

Note
There is a visual issue (double border at the bottom) at the HoverableOutlineButton in combination with TextInput. It's also on master as you can see in the screenshot below.
So it's not introduced here. I've tried to fix it but I couldn't find the cause of it. If I remove the border-bottom from wrapper in TextInput there is no border anymore so I think the icon will somehow inherit the border from that wrapper.
The border is more visible on narrow screen width.
grafik

@codecov
Copy link

codecov bot commented Nov 20, 2018

Codecov Report

Merging #335 into master will increase coverage by 1.22%.
The diff coverage is 48.78%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #335      +/-   ##
==========================================
+ Coverage   25.82%   27.05%   +1.22%     
==========================================
  Files         152      160       +8     
  Lines        3729     3800      +71     
  Branches      397      414      +17     
==========================================
+ Hits          963     1028      +65     
+ Misses       2489     2483       -6     
- Partials      277      289      +12
Impacted Files Coverage Δ
src/config/project-types.js 100% <ø> (+25%) ⬆️
src/reducers/modal.reducer.js 100% <ø> (ø) ⬆️
...c/components/CreateNewProjectWizard/ProjectName.js 0% <ø> (ø) ⬆️
src/components/CreateNewProjectWizard/BuildPane.js 0% <0%> (ø) ⬆️
...s/CreateNewProjectWizard/CreateNewProjectWizard.js 0% <0%> (ø) ⬆️
src/services/check-if-url-exists.service.js 0% <0%> (ø)
...ependencySearchResult/AddDependencySearchResult.js 0% <0%> (ø) ⬆️
src/components/CreateNewProjectWizard/MainPane.js 0% <0%> (ø) ⬆️
...c/components/CreateNewProjectWizard/SummaryPane.js 0% <0%> (ø) ⬆️
src/components/FormField/FormField.js 0% <0%> (ø) ⬆️
... and 23 more


componentDidMount() {
fetch(
'https://raw.githubusercontent.com/gatsbyjs/gatsby/master/docs/starters.yml'
Copy link
Collaborator

Choose a reason for hiding this comment

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

to put this in Algolia, we will have to push to Algolia somewhere https://github.com/gatsbyjs/gatsby/blob/master/www/gatsby-node.js here I think, but I'm not too sure yet what the most efficient way will be.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks, for pointing to the Graphql query in the Gatsby starter. It would be great if we could use a similar query but I'm not sure how to query the same data.
I think for now we can just use the starter.yml and I think the selection is OK now. I'll update the screenshots above in a minute.

Also the search can be easily done by filtering through the yml data. So Algolia is not really needed here at the moment.

@AWolf81 AWolf81 changed the title [WIP] Gatsby starter Gatsby starter Nov 23, 2018
Copy link
Owner

@joshwcomeau joshwcomeau left a comment

Choose a reason for hiding this comment

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

Overall this looks pretty good.

I did have one high-level concern, which is that I had a bit of a different flow in mind. I imagined that we'd restructure it into the following sequence:

Step 1. Enter name, type, icon
Step 2. Project-specific settings. For Vanilla React it would skip this step. For gatsby, it'd show a list of the most popular starters, or let the user enter their own

The benefits to this flow are the following:

  • There's no modal-in-modal for the project-specific settings. I'm always a bit bothered when one modal prompts another modal to open, and the Redux setup really only expects 1 modal to be active at a time, so it's probably not the best user-experience.
  • The initial screen, for name/type/icon, doesn't get too crowded, and doesn't change depending on which option is selected (well except the button text would change from "Let's do this" to "next").
  • More flexible for other project-specific settings, without having to worry about running out of space.

Sorry I didn't make that potential flow known! I think it'd be a better experience, and I also think it'd simplify the code quite a bit... but I know you've invested a lot of time in this current approach and I'd understand if you want to ship it as-is now. We can always revisit later.

Other than that, I had some questions inline


static getDerivedStateFromProps(nextProps: Props, prevState: State) {
return {
gatsbyStarter: nextProps.projectStarter,
Copy link
Owner

Choose a reason for hiding this comment

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

Hm, so I think in general this is a not-ideal pattern. I feel like either this component should own the state entirely, so it doesn't receive projectStarter from props, or it should always delegate to the parent's projectStarter.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think you're right but with-out this it would require me to modify modal state as I need to have the info about the entered starter before opening the modal.
So the user can dismiss the changes made in the modal. Anyway I'm not changing this as I'll check if I can remove the second modal - so this won't be needed anymore.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's acutally an anti-pattern to override local state unconditionally with every prop change.
There is a nice post you-probably-dont-need-derived-state about this in the React.js blog.

We don't need it here anymore as I'm rewriting this. But I wanted to note this as I've learned this and I wasn't aware of it.

gatsbyStarter: selectedStarter,
},
() => {
console.log('updated', this.state);
Copy link
Owner

Choose a reason for hiding this comment

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

I feel like we don't need this callback?

Also, there's another console.log above it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, that's right. Sorry, I've missed that debug stuff. I'll remove it.

starters library{' '}
<ExternalLink href="https://www.gatsbyjs.org/starters/">
here.
</ExternalLink>
Copy link
Owner

Choose a reason for hiding this comment

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

I think it's slightly more conventional to make the link inline:

For a better overview you can also have a look at the{' '}
<ExternalLink href="https://www.gatsbyjs.org/starters/">
  Gatsby starters library
</ExternalLink>.

Copy link
Collaborator Author

@AWolf81 AWolf81 Nov 26, 2018

Choose a reason for hiding this comment

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

OK, modified.
What I've noticed with the external links in the summary pane is that the link is not fully clickable. I think that's also happening on master so this is not introduced here.
Also the link visiblity is pretty bad as it's not visible that it's clickable. What do you think would it be OK to add a thin light rounded box around these links?
Or maybe underlining would also work similar to the import project button.

For the hover I need to check what's causing it - looks like the width of the container is not wide enough. I haven't found the cause yet.

Here is how this looks:
screenrecording_externallink_hover

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hover issue fixed with PR #337. It was an issue with the backface pointer events.
We could improve styling later - thin outline not added.

class MainPane extends PureComponent<Props> {
type State = {
gatsbyStarter: string, // Temporary value during selection in selection toast
};
Copy link
Owner

Choose a reason for hiding this comment

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

hm it feels like this state lives in so many places... Couldn't this invoke updateFieldValue instead of being set locally?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, that's right - it lives in many places. But I'm not sure if I can simplify this. As the user can open the starter selection component and select a starter but then decides to cancel that selection so the previously entered starter is still available.

If I would use updateFieldValue that flow wouldn't work.

const renderedSteps: Array<?React$Node> = buildSteps.slice(
0,
currentStepIndex
);
Copy link
Owner

Choose a reason for hiding this comment

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

I feel like this might be a bit over-engineered... I think I'd opt for a "dumber" approach:

const steps = [];

if (currentStepIndex > 0) {
  steps.push(/* first step */);
}

if (currentStep > 1 && projectType === 'gatsby') {
  steps.push(/* project-specific step for Gatsby */);
}

if (currentStep > 2) {
  steps.push(/* third step */);
}

In addition to being a bit easier to follow, it doesn't create a bunch of elements that might not be used.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think you're right. That's a bit over-engineered. :-) Your code is probably easier to follow. I'll have a look at it and maybe I re-write this but I have to think about how I'll implement your proposed flow with-out the additional modal.
So if I'm changing the step order I have to modify this part.

return (
(currentStepIndex > 0 && !projectType) ||
(currentStepIndex >= lastIndex && !projectIcon)
);
Copy link
Owner

Choose a reason for hiding this comment

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

I'd love for this to be broken into a couple steps, so that the steps can be given variable names to convey meaning.

const needsProjectType = !projectType && currentStepIndex > 0;
const needsProjectIcon = !projectIcon && currentStepIndex >= lastIndex;

return needsProjectType || needsProjectIcon;

Also, I was initially confused because I assumed validateField would return true if the field was invalid... how about isSubmitDisabled as the name?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good idea. Renaming to isSubmitDisabled makes it easier to understand. Splitting is also OK as it improves readability.
I first though that it's clear what these checks are doing but for new devs it's better to have that additional naming.

@@ -185,6 +185,29 @@ class SummaryPane extends PureComponent<Props> {
</Fragment>
);
}
case 'projectStarter': {
// todo: why is a key needed on FadeIn? Was s3t.
// todo: should we rename projectStarter to be mores specific as this is Gatbsy only.
Copy link
Owner

Choose a reason for hiding this comment

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

Typo, Gatsby.

Also I don't understand the first todo, what's s3t?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh, OK, I'll fix that typo.
The key="s3t" is in line 178 of SummaryPane. I haven't added it to the Gatsby part. Is the key needed or do I miss why it's there?

>
<HoverableOutlineButton
noPadding
onMouseDown={() => window.requestAnimationFrame(handleFocus)}
Copy link
Owner

Choose a reason for hiding this comment

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

Why requestAnimationFrame?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not sure if it's needed. It's copied it from ProjectName#line202.
I haven't tested it with-out it. We could refactor ProjectName component later to use the TextInputWithButton component.

There is just a visiual issue with the line below the icon (double line) as menitoned in the PR. Do you have an idea why the line appears below the icon?


// We're using "template" variables inside the project type configuration file (config/project-types.js)
// so with the following function we can replace the string $port with the real port number e.g. 3000
// (see type VariableMap for used mapping strings)
Copy link
Owner

Choose a reason for hiding this comment

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

Hm, what's the advantage to doing it this way? We used to just pass the variables along to the function instead of needing to do substitution. Did adding starters increase the complexity here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No, starters don't add complexity here. I just wanted to clean this so it looks like at the devServer.

I think with this it's easier to add new project types as there is no callback in the project type configuration file. The substitution was added in PR #292.

@AWolf81
Copy link
Collaborator Author

AWolf81 commented Nov 25, 2018

I've tried to modify the steps as you mentioned (I'll push it in a minute) but I think there isn't enough space to add the starter behaviour as the last step (see screenshot below). I'd like to keep the notice to the Gatbsy starters, a input for searching (we can use the input we're already having) and a list with the search results + the Codesandbox preview buttons (maybe with a smaller icon).

Maybe we could reduce the spacing between the steps. I'll have a look at it later today.

grafik

@AWolf81
Copy link
Collaborator Author

AWolf81 commented Nov 26, 2018

@joshwcomeau Please have a look at my updated code. I've addressed your review comments.

I've added everything to the same modal & changed the order of the steps.
Spacing between the steps is reduced but I think it's still OK.
Starter section looks OK (see updated screenshot). It would be better to have more than two starters visible in the list but I think there isn't more space available. Fontsize of the starter selection list is pretty small but similar to the other fonts used.
Typeahead and highlighting is also improved and I like how it's working now.

Just the height jumps between the project types but I think that's OK or should we do equal heights? So CRA/Nextjs pane has the same height as Gatsby.

Please let me know if I missed anything from your comments.

const WrapperLabel = styled.label`
const WrapperLabel = styled.label.attrs({
// default to 30px spacing between FormFields
spacing: props => props.spacing || 30,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'll move this to FormField component static defaultProps as it's only one location to add the default of 30 instead of every styled-component.

@AWolf81
Copy link
Collaborator Author

AWolf81 commented Jan 4, 2019

@joshwcomeau could you please have a look if this is working as expected?
If anything is open, please let me know.

I think just the panel height could be improved but maybe we could change this in a following PR as this is already pretty large.

@AWolf81
Copy link
Collaborator Author

AWolf81 commented Jan 17, 2019

@melanieseltzer could you please have a look at this? I think this is ready.
I've change the height of the modal so it's the same for all project types now. I think that's better.

@melanieseltzer
Copy link
Collaborator

This is looking pretty great 👍 I only took a surface level look so far to play around with it, haven't dug into the code yet. Seems like the select starter functionality is working, and the preview in Codesandbox functionality. Since this is quite a large PR I'm going to have to dedicate some more time to take a deeper look, but for now I have some preliminary notes:

  • The background is scrolling when you are scrolling inside the starter section and it's a little jarring:

I wonder if we could leverage the isVisible prop in CreateNewProjectWizard to disable background scrolling when the modal is open? Maybe with a conditional createGlobalStyle once styled-components v4 lands in #269? I'm imagining something like the following, but let me know if you have another idea:

<BackgroundScroll disabled={isVisible}  />

...

const BackgroundScroll = createGlobalStyle`
  html, body {
    overflow: ${props => (props.disabled ? 'hidden' : 'auto')};
  }
`
  • I'm getting a weird lint error in the dev console from one of the dependencies, do you get this?
webpackHotDevClient.js:138 ./node_modules/encoding/lib/iconv-loader.js
9:10-32 Critical dependency: the request of a dependency is an expression
  • I have some UX concerns with the way a starter is selected:

screen shot 2019-01-17 at 10 35 56 pm

So once the starter gets selected it gets pulled up to the top of the list, and out of the flow. This is somewhat confusing to me and I feel like it should stay in place and just be highlighted to indicate it's selected. Otherwise the user loses their place and has to scroll back down to get back to where they were, in case they want to make another selection.

Actually I think there's an ordering bug when you make a selection 🤔 Unless I'm misinterpreting this flow, but it doesn't feel intentional. You can see what I mean in this GIF:

As you can see in the screen cap, I scroll to the bottom of the current list of items, and you can see the last two items are gatsby-starter-mate and gatsby-minimal-portfolio-blog. So when I choose gatsby-minimal-portfolio-blog it gets pulled to the top, but when I scroll back down I'm expecting gatsby-starter-mate to be the last in the list. But it's not, it's nowhere to be found in that positioning.

It seems like maybe the pagination is off?

@AWolf81
Copy link
Collaborator Author

AWolf81 commented Jan 18, 2019

@melanieseltzer Thanks for your review.

  • Background scrolling with open modal: Maybe we could disable pointer-events on app wrapper if the modal is active to avoid scrolling. I'll have a look at this later today.

  • Linting message: No I haven't seen that. I'll check if I'm getting that message too.

  • UX issue: The problem here is that we're reusing the input field because of the limited space. Before you click the text entered will be used to filter the list "best match" first item. Once you selected a starter that's the best match and the other result are having a similar url like the picked starter.

    Maybe we can use a different property to filter the typeahead list or do you have an idea how we could improve this? I like to show the picked starter url in the input field but maybe we could just leave the entered typeahead string in the field and mark the selected with the border - but it could be a problem as the selected starter could disappear if the typeahead is changed.
    (Probably forcing the selected item to be in the list would be a work-around e.g. manually at as first item if not in list)

@melanieseltzer
Copy link
Collaborator

Maybe we could disable pointer-events on app wrapper if the modal is active to avoid scrolling.

👍

UX issue: Once you selected a starter that's the best match and the other result are having a similar url like the picked starter.

Ah, gotcha. That's the thing I wasn't understanding about the functionality. As someone just jumping into the flow, I didn't associate selecting a starter (clicking on its name) as setting a best match... I just thought I was making a selection choice, and not expecting the results to change based on that. That's why it's appearing jumbled to me.

Is there a reason to have a 'best match' functionality? As a user I'm expecting search results to be pretty static:

  • If I type the word 'blog', all blog related items appear (and I can paginate through them sequentially)
  • If I click on one to make it the selected item, I'm not expecting the order of the items to change, or for different results to appear. I'm just making a selection.
  • If I change my mind and want to choose a starter before or after the current one, I should be able to go back to the position in the original list and do that. But with 'best match' the items may have completely re-ordered themselves, or an item previously there isn't even visible anymore, if it's not related to the current 'best match'. E.g. say I click on a starter with 'TypeScript' but I previously saw a starter with 'Redux' that I think would work better. I scroll down to try find the Redux starter again but it's gone because the results are now best match for 'TypeScript' keyword. Sure I could type Redux in search but feels a little clunky to do this...

I like to show the picked starter url in the input field

It is somewhat problematic for the input text to change to the URL when a selection is made. Somewhat annoying to have typed 'blog' and then after the selection is made, the text is wiped. Cause if you make a selection prematurely but change your mind, you'll have to type 'blog' in again and it's an extra step.

tl;dr

Keeping in mind I'm not a UX expert or anything, just going by how I interact with things. So @joshwcomeau and others please feel free to jump in here 🙂

I think I would suggest:

  • No 'best match' functionality. Clicking on a starter simply selects it in place (purple outline) but doesn't move it to the top of the list, and doesn't cause a re-order of results.
  • Keep search text in the input, don't put the selected url in there.
  • If there needs to be more highlight calling attention to the selected starter, perhaps a tick icon or something? Bad photoshop...

@AWolf81
Copy link
Collaborator Author

AWolf81 commented Jan 20, 2019

@melanieseltzer you're right, the re-ordering things is a bit weird. I like your proposed UX flow just one thing I'd like to have - moving the selected starter to the top of the list.

So I've changed it as you proposed except modifiy list (not pushed yet):

  • static typeahead input field with-out setting the starter url there
  • move selected starter to top of list - I think that's needed as there are cases you won't see that you have selected a starter (e.g. new typeahead and selected starter on other pagination page or not in the results). Maybe we also need to add an info sign to the input field so it's clear that there is a starter selected (see details below Indication of selected starter)

Indication of selected starter
If the user selects a starter and then clears the typeahead input it's not clear that there is a starter selected.
OK, I have another solution to this. We won't hide the starters if typeahead is empty & toggling starter list to hidden is disabled if there is a selected starter.

Loading of starters
How should we handle a missing internet connection? I first thought that it would be good to have something like in the screenshot below.
But a missing internet connection is a general problem for project creation and we should display that earlier (see console log below unhandled promise after clicking build with-out internet). I think disable build button & show a message like Can't create a new project with-out internet connection and/or a popover / heading on the modal with that info.
I think I'll remove the info from my working directory and we have to add this in a separate issue (issue not created yet). I think it's OK to fail silently for now. I'll create the issue in a minute.
grafik
grafik

Removing selected starter
Because of the change of not adding the selected starter to the input box we need to have a way to remove the selected starter. Before it was handled by clearing the input field - which was also not perfect.

I've added it by clicking on the selected starter a second time - this will deselect the starter. Is this OK or do we need a separate button to deselect the starter?

@AWolf81
Copy link
Collaborator Author

AWolf81 commented Jan 20, 2019

@melanieseltzer Please have a look if this is OK and I have addressed everything. I think we can revisit and optimize this later.

I think the reordering of selected starter to the top is not perfect but OK for now. It would be better to keep the order and have a separate display of the selected starter. (Needs to be in a separate location because the typeahead could change the list and won't display the selected starter.)

Also list size is a bit small with just two items but I don't have an idea at the moment how we could easily optimize this. An idea would be to have icons for each build step and only display the active step or we could make the project icon selector collapsilble (we would probably get just one more item in the starter list with this as we could collapse to one icon).

Scrolling of background with active modal disabled with overflow: hidden as mentioned here. That's working just the disapearing of the scrolls with active modal is not perfect but I think that's acceptable.

<StarterItemHeading
selected={selectedStarter === starter.repo}
onClick={() =>
this.handleUpdateStarter(
Copy link
Collaborator

Choose a reason for hiding this comment

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

There's a lot of passing down/abstraction of the updateFieldValue function (from CreateNewProjectWizard) to ultimately end up here.

The chain right now seems to be:

  1. CreateNewProjectWizard passes it to MainPane as updateFieldValue prop
  2. MainPane passes it to ProjectStarter as onSelect prop
  3. ProjectStarter passes it to SelectStarterList as updateStarter prop
  4. SelectStarterList abstracts it into function handleUpdateStarter

This was a bit hard to follow when I was in ProjectStarter and wanted to see where handleOnSelect was getting its parameters set.

I wonder if there's a way to simplify this or at least keep the naming consistent when passing it around?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, you're right. This is pretty complex. A quick-fix after merging this would be to name it consistently.
But we could also open an issue to check if we can simplify this with Context-API or a Reducer - so we don't have to pass it through each component.
I think the ProjectStarter uses one more child component compared to the other build steps.

Copy link
Collaborator

@melanieseltzer melanieseltzer left a comment

Choose a reason for hiding this comment

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

This flows much better 👍 I've just a concern about passing functions down but it's something we could optimize later.

move selected starter to top of list - I think that's needed as there are cases you won't see that you have selected a starter

Good point, I hadn't thought of that. I think it works well now that there's no re-ordering of the results. I'm no longer confused.

We won't hide the starters if typeahead is empty

That's a good idea, I like it.

I've added it by clicking on the selected starter a second time - this will deselect the starter. Is this OK or do we need a separate button to deselect the starter?

Yeah I think this is okay!

The disabling of background scroll when modal is looking good 👍

@AWolf81 AWolf81 merged commit db0f006 into master Jan 21, 2019
@AWolf81 AWolf81 deleted the gatsby-starter branch January 21, 2019 00:23
@AWolf81
Copy link
Collaborator Author

AWolf81 commented Jan 21, 2019

@melanieseltzer
Oh, one point I've missed is that we have to update the SummaryPane for the starter as the user have to pick a starter from the list as entering the starter url into the input won't select the starter.

Or should we add that feature back in? E.g. if the user enteres a matching starter by name or url it will automatically pick the starter?
If the user enters a url that's not in the starters list it will be picked & used on build click - e.g. user wants to use an unlisted starter.
I'll add this and create a new PR for it.

@melanieseltzer
Copy link
Collaborator

@AWolf81 Oh good point! I'll wait for the new PR because I've also identified an issue with search results that I'd like to iterate over.

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

Successfully merging this pull request may close these issues.

None yet

4 participants