Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

Added Time Travel Functionality#55

Merged
dvdsgl merged 7 commits intomicrosoft:masterfrom
georgewritescode:time-travel
Jul 24, 2018
Merged

Added Time Travel Functionality#55
dvdsgl merged 7 commits intomicrosoft:masterfrom
georgewritescode:time-travel

Conversation

@georgewritescode
Copy link
Copy Markdown
Contributor

@georgewritescode georgewritescode commented Jul 20, 2018

This commits adds a 'Time Travel Back' link at the bottom of the page.
It looks at the past commits and gets the index.html at that time and inserts it at the bottom of the page.

It's pretty cool to keep scrolling down and see how the change has changed over time. It keeps going down the commit trail until a change to index.html was made in the commit.

Could have a few improvements but perhaps something we can build upon?

Copy link
Copy Markdown
Contributor

@ctrlaltvikas ctrlaltvikas left a comment

Choose a reason for hiding this comment

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

On line 48 in docs/index.html, the text can be modified.

@runofthemillgeek
Copy link
Copy Markdown
Contributor

The CSS could be different in the previous commits so it doesn't really make sense to show just the HTML content.

@georgewritescode
Copy link
Copy Markdown
Contributor Author

Added functionality to keep going down the commit trail until a change was made to index.html.

@georgewritescode
Copy link
Copy Markdown
Contributor Author

@sangeeth96 Agree with you. Have made a start on fixing that.
The html page received now loads the relevant style.css from the commit.
More testing is needed to ensure this is applied.

If anyone wants to join me on this you're welcome.

@georgewritescode
Copy link
Copy Markdown
Contributor Author

Thanks @vikaskyadav , I've updated the text to make it cleaner. If someone would like to find an icon and place it perhaps at the bottom right of the screen that could work too.

@reimertz
Copy link
Copy Markdown
Contributor

I love this! :D

@dvdsgl
Copy link
Copy Markdown
Contributor

dvdsgl commented Jul 20, 2018

This is incredible. I was hoping someone would attempt this!

If you can think of a more durable way to implement, I'd love to merge. Right now the interaction is a bit confusing and I don't have a lot of confidence in the approach to loading the content. The file handling is too fragile, for example.

We could add a build script to create a static directory for each commit under /docs? Or maybe there is a way to serve the data from GitHub's raw files?

@d4rekanguok
Copy link
Copy Markdown
Contributor

This is awesome! Something like a slide UI to travel thru time would be amazing.

@dvdsgl dvdsgl added the fancy Oh la la label Jul 20, 2018
@georgewritescode
Copy link
Copy Markdown
Contributor Author

georgewritescode commented Jul 21, 2018

@dvdsgl Agree with your suggestions. I've added a build functionality which downloads the html and css files for every change to index.html and stores them in docs/history. We could eliminate all Github API calls completely but that would require some sort of static site generator functionality, a build step for index.html, which I'm not sure we want to include into this project.

Going back in time now displays the name of the commit maker and their commit message.

More changes still to go, currently, the page keeps getting larger as you 'go back in time'. Also the theme button stops working. Whether the styles getting applied is also unclear.

If anyone would like to join in and perhaps make a sidebar with the commits or replace the current page (with the correct CSS applied) rather than adding to the page I think it would work quite well.

@d4rekanguok
Copy link
Copy Markdown
Contributor

@georgewritescode Love the idea, I'll give the sidebar a shot

@dvdsgl
Copy link
Copy Markdown
Contributor

dvdsgl commented Jul 21, 2018

Why not a single directory per commit and keep the historical filenames? Then use an iframe to display the contents of each commit directory.

@d4rekanguok
Copy link
Copy Markdown
Contributor

@georgewritescode @dvdsgl That's what I'm doing as well, except that I'm pulling PRs instead of commits, since that seems to be a bit more meaningful.

Quick update:
time-travel-demo

@dvdsgl
Copy link
Copy Markdown
Contributor

dvdsgl commented Jul 21, 2018

That's fantastic.

I wonder if a bar across the bottom could be a better design? The design is centered horizontally so it would be less disruptive to the composition. Also, we need a way to toggle time travel view–maybe an icon in a corner?

@d4rekanguok
Copy link
Copy Markdown
Contributor

For the sidebar, I think If we do horizontal, it's possible that the page inside the iframe won't be displayed in full (have to scroll to see full page). Since the website is already well optimized for small width, I think it works well with a vertical sidebar. I would love to revisit & give horizontal a try though.

Corner icon probably works — I'm thinking bottom right fixed, what do you folks think?

@dvdsgl
Copy link
Copy Markdown
Contributor

dvdsgl commented Jul 21, 2018

Maybe a toggle inline with the theme switcher, so we begin to develop a localized control strip.

@d4rekanguok
Copy link
Copy Markdown
Contributor

Sounds great. I'll make a new PR after fixing up some stuff so we can talk more about implementation.

@georgewritescode
Copy link
Copy Markdown
Contributor Author

@d4rekanguok Great job! This looks fantastic. I love the idea of using Pull Requests rather than commits too. I've merged your PR and given you collaborative access to the repo. Let's make this a reality!

@dvdsgl
Copy link
Copy Markdown
Contributor

dvdsgl commented Jul 22, 2018

Is npm run build-timetravel still relevant? It's still in the README but references a missing script.

@dvdsgl
Copy link
Copy Markdown
Contributor

dvdsgl commented Jul 22, 2018

Also, how should people discover this? Perhaps we can change the Contributed by 34 contributors on GitHub element to link to this?

@d4rekanguok
Copy link
Copy Markdown
Contributor

@georgewritescode thanks George!! I saw the invite.

@dvdsgl Ah sorry my PR was meant to be a work in progress, I haven't updated the build script & readme yet, will update in a sec. For discovery, perhaps we can rework the Contributed... line to include time travel link? i.e See contributions made by 34 contributors.?

@d4rekanguok
Copy link
Copy Markdown
Contributor

d4rekanguok commented Jul 23, 2018

btw my build.js is running a bit faulty, a few of the PR is missing files 😓

If we decide to merge this, this is a list of stuff I think would be good to have before then:

  • fix build.js
  • mobile layout (maybe move the side bar to bottom)
    • sidebar is moved to the bottom, but need better design
  • link back to original page
  • add hash to url so we can link to a specific version

Tried to put in a few commits before the getting back to work. Have a good week folks!

@dvdsgl
Copy link
Copy Markdown
Contributor

dvdsgl commented Jul 24, 2018

I'm eager to merge once conflicts are resolved!

@d4rekanguok
Copy link
Copy Markdown
Contributor

@dvdsgl I've just cleaned it up!

@dvdsgl dvdsgl merged commit 91d5633 into microsoft:master Jul 24, 2018
@dvdsgl
Copy link
Copy Markdown
Contributor

dvdsgl commented Jul 24, 2018

Brilliant work, everyone!

@d4rekanguok
Copy link
Copy Markdown
Contributor

d4rekanguok commented Jul 24, 2018

Oh shit I didn’t realize ignoring a conflict while rebasing will just take out that commit altogether, so George’s commits are not in the history. Will do it again from a local branch, sorry @georgewrstescode !!

Oh shit it’s merged. I’m so sorry +___+

@dvdsgl
Copy link
Copy Markdown
Contributor

dvdsgl commented Jul 24, 2018

Oops! Please just prepare another branch with the fix and I will force-push over master real quick.

@dvdsgl
Copy link
Copy Markdown
Contributor

dvdsgl commented Jul 24, 2018

Guys, this is probably the coolest thing I've ever seen happen on GitHub.

@dvdsgl
Copy link
Copy Markdown
Contributor

dvdsgl commented Jul 24, 2018

Or, if there is a way to do this without a rewrite, that would be ideal.

@d4rekanguok
Copy link
Copy Markdown
Contributor

Awesome! It’ll be hard for me to work on this now but I’ll try to work in a rebase in a few hours

@pmarquees
Copy link
Copy Markdown

I know this is old, but I found this just now so...

THIS IS SO NICE!

Open Source <3

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants