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

initial social network #496

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

initial social network #496

wants to merge 1 commit into from

Conversation

jwass91
Copy link
Contributor

@jwass91 jwass91 commented Sep 24, 2017

@stevekrouse

This is a big one...

Here is the start of the social network - with the homepage redesigned to show the most recently updated projects. I also included the code for the screenshot cloud function in this PR.

I think this is a good start and hopefully, we can get this into production within the next couple of weeks.

Then we can work on adding more features.
Such as:

  • A user profile page (with all their projects)
  • A project page (with the likes and comments)
  • More categories of projects on the homepage
  • The ability to follow users (and then add a section to the homepage for recent projects from people you follow)
  • The ability to remix a project (along with storing remix data)
  • And much more

@stevekrouse
Copy link
Owner

[This is an automated integration to preview this pull request's changes to the website.]

https://cdn.rawgit.com/stevekrouse/WoofJS/9100f80720f7ae921cf859c22808d6987a4e1034/index.html

@nicolekelner
Copy link
Contributor

Wow! Jared this is incredible! I honestly don't have any design feedback, I think it looks amazing. I love the rounded edges and flat drop shadow behind each icon, very clean.

My only comment is the initial load time takes a few seconds to pull up the previews. This is probably a very difficult problem to solve since you are sorting through a ton of data.

Down the line it would be great to have the ability to comment, sinceI know that is a huge feature for Scratch's community as well.

Copy link
Owner

@stevekrouse stevekrouse left a comment

Choose a reason for hiding this comment

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

I've only just started this review, so I have more things to look at... stay posted...

However one issue I'm seeing is all the code duplication between /create.html and this page.

In the past, I took the same approach you took here (basically copying /create.html and changing a few things) as you can see at /team.html`. While quick, easy and simple in the short term, this does make things harder to maintain in the long term.

So what are our options?

  1. Keep it roughly as is, potentially removing some code that clearly only belongs on the /create.html page and not here.

  2. Pull sections of code from the /create.html page into their own scripts and link to them externally via <script> tags in both pages, such as woof-authentication.js.

I don't want to make this pull request even bigger, so I'm leaning towards doing (1) now and leaving (2) as an issue for the future. How does that sound?

@@ -881,6 +881,9 @@ <h4 class="modal-body text-danger" :style="{display: !getID() ? 'block' : 'none'
messagingSenderId: "397293370524"
};
firebase.initializeApp(config);

Copy link
Owner

Choose a reason for hiding this comment

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

Please remove these three lines

@@ -1,249 +1,1095 @@
<script>
Copy link
Owner

Choose a reason for hiding this comment

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

Please move the old /index.html page to /demo.html so we can still link to it (as opposed to overwriting it entirely)

@@ -1,249 +1,1095 @@
<script>
var getID = function() {
return window.location.hash.substring(1, window.location.hash.length);
Copy link
Owner

Choose a reason for hiding this comment

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

Don't forget to include to include these snipets of javascript in the new /index.html page so that if a user types woofjs.com#name-of-game it will redirect them to woofjs.com/create#name-of-game


<head>
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:url" content="http://woofjs.com/create">
Copy link
Owner

Choose a reason for hiding this comment

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

Fix the URL here

<title>WoofJS</title>
<link rel="shortcut icon" type="image/png" href="./favicon.png" />

<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
Copy link
Owner

Choose a reason for hiding this comment

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

Seems like you copied and pasted this from /create.html. Please go through and delete the ones you don't need on /index.html

projects: [],
temprecentlysavedprojects: [],
recentlysaved: [{
url: "https://s26.postimg.org/7135l6qeh/placeholder.jpg",
Copy link
Owner

Choose a reason for hiding this comment

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

We don't use postimage. If we need this image, add to our repo

tempuser: '',
projects: [],
temprecentlysavedprojects: [],
recentlysaved: [{
Copy link
Owner

Choose a reason for hiding this comment

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

  1. There's a lot of duplication in this array. Could you create this object once and then add it to the list a number of times?

  2. Why do you need to add fake data to this array at all? Can we handle the data-loading state in VueJS by detecting that this array is empty?


var config = {
action: 'read',
expires: '01-01-2050'
Copy link
Owner

Choose a reason for hiding this comment

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

nice 😉


file.getSignedUrl(config, function(err, url) {
if (err) {
console.error(err);
Copy link
Owner

Choose a reason for hiding this comment

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

Are these logs saved somewhere? If not, can you delete this (and the console.log on line 16 above)?

})

// // this puts the user's most recent project under their name
firebase.database().ref('/code/').orderByChild("--uid").equalTo(user.uid).once('value').then(function(snapshot) {
Copy link
Owner

Choose a reason for hiding this comment

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

This code doesn't belong on this page

@stevekrouse
Copy link
Owner

Social Network Homepage Feedback

This is a big pull request and there are lot of moving parts. Below I walk through my thoughts on how to move forward here, both by 1) simplifying the code and 2) by focusing on the design of the new homepage. There's a lot here, so after you've read through this (a few times) ping me on slack to set up a time to chat about it all and create a plan of attack :)

0) You're doing great!

To be clear, I think you've done a great job here. If you are wondering how it could be possible that you both did a great job and I'm also basically asking you to start over from scratch, I don't blame you -- that does seem contradictory. The reason this is not contradictory is threefold:

  1. The state of the codebase doesn't lend itself well to being extended. This is 100% my fault. I've known this day would come when I'd have to reckon with this. I apologize for not noticing sooner that we should solve this issue before creating this page.

  2. You've done a lot of amazing work here and everything is functioning! All I'm really asking you to do is delete code (but not forever, just for the short term) so that we can focus on getting things right.

  3. If you were a solo developer on this project, it would make sense to do things as you did them. Given that this is a collaborative open source project, I am trying to keep the code standards quite high. The only way I can do that is if we keep pull requests focused and simple. I should've been more insistent the last time we talked, asking you then to remove hearting projects from your code.

1) Simplification

As mentioned above, this pull request is made significantly more complicated by allowing users to sign up and login on the homepage. This is not your fault. The monolithic /create.html page has led us directly into this trap. The only way out of it is to start refactoring sections of it into their own files that we can then import into /create.html and index.html.

However, that refactoring is it's own large project. Adding it on here would make this pull request -- which I would argue is already overly complex -- even more complex. At the same time, I don't feel comfortable adding so much new code into our codebase in this messy way -- even with the intention of refactoring it later. It's just too complex. So what's the way around this? Simplification.

  1. Leave this pull request as is for reference but do not continue working on it.

  2. Create a new pull request. Treat the new homage as setting the bare bones for the social homepage we'll have eventually, but make it complete enough that we can ship it. Keep it very basic. More specifically, don't allow users to login or sign up on the home page on this pull request. All this pull request would do is: 1) link to the /create page, 2) show a few recent projects, 3) link to a few other places (like /demo, /teach and the announcement post). In this way, we will be able to focus much more the the design of the homepage and the screenshot saving code and get to put off the complexities of sharing authentication and signup code between /create and /index. Yes, this would mean that we won't allow users to heart projects on the homepage on this pull request.

  3. Copy the /index.html file. Rename one of the copies /demo.html. Use the remaining old version of /index.html as the basis for the new /index.html (as opposed to /create.html).

  4. Delete the code in /index.html irrelevant with the new homepage, like the Ace editor stuff.

  5. Create the new simplified social network homepage as articulated in this post and to your taste, copying and pasting code from this pull request as needed.

2) Homepage design

Call to action

When designing a homepage, it's important to think about the key action you want users to take. In our case, while viewing the projects of others students is indeed fun and important, I think that is probably less important than getting students to "start coding".

However as things currently stand, the "Start Coding" button is quite small and the projects are quite large. I would suggest decreasing the size of projects (closer to the size they are in Scratch's homepage) and increasing the size of the start coding button

Codepen's homepage below, which on the whole is an example of poor design, does show more what I'm thinking in terms of a big "Sign Up" button (which in our case I think should be "Start Coding") and smaller "Picked Pens" (in our case "Recently Updated Projects").

screenshot 2017-09-28 at 1 11 25 pm

Jumbotron

The top section of a website is really important. When using Boostrap, people often use the Jumbotron component.

Usually there's 1) some big text, 2) some smaller text, 3) a button.

1) Some big text

Some options:

a) WoofJS is a Scratch-inspired JavaScript library for making games.
b) Transition from Scratch to JavaScript
c) Make and share JavaScript games

2) Some smaller text

Some options:

i) WoofJS is a learnable JavaScript framework for creating games by The Coding Space.
ii) WoofJS was created to be the next step after block-based coding in Scratch. For more details, you can read our announcement post.

3) A button

"Start coding" seems to make sense to me here.

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.

3 participants