Code Monkey home page Code Monkey logo

Comments (16)

billhowe avatar billhowe commented on August 10, 2024

Two parts to the solution:

  1. Derive a unique url for every state you can reach by manipulating the
    interface, and make sure each can be resolved correctly server-side (this
    is the harder part)

  2. Use the HTML5 pushState interface to manipulate the browser history so
    that a) the url changes without a refresh, and b) the back/forward buttons
    work as expected.

This is how you get the "endless scroll" effect on most news sites
nowadays. You just keep scrolling down to see new articles, and the url
changes, and you can hit "back" to pop back up through them. Yet it's all
AJAX/javascript.

http://spoiledmilk.com/blog/html5-changing-the-browser-url-without-refreshing-page/
https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Manipulating_the_browser_history

On Wed, Apr 2, 2014 at 10:20 AM, Daniel Halperin
[email protected]:

Right now we do a lot of automatic AJAX stuff on page load. One side
effect of this is that if you accidentally hit the back button while
writing a query, you lose all state. Yikes! This just bit us twice in a row.

The website should pick up where you left off if you hit backwards &
forwards. A good model is GitHub, which somehow does this magically.

Reply to this email directly or view it on GitHubhttps://github.com//issues/55
.

from myria-web.

dhalperi avatar dhalperi commented on August 10, 2024

Thanks for tips

from myria-web.

domoritz avatar domoritz commented on August 10, 2024

Another solution is just have separate pages for different languages and not use ajax for switching languages. The last query written should be stored though and we could use push state for that.

In general, I am not a friend of Ajax for things that can easily be done as separate pages.

from myria-web.

stechu avatar stechu commented on August 10, 2024

Before we have this great state aware feature. Can we set the default language to MyriaL?

I use MyriaL most of the time, so have to switch from Datalog to MyriaL each time. How about others and our users other developers?

from myria-web.

dhalperi avatar dhalperi commented on August 10, 2024

This seems like something you can easily submit a PR for, @stechu :)


Daniel Halperin
Director of Research for Scalable Analytics
eScience Institute
University of Washington

On Wed, Apr 16, 2014 at 4:30 PM, Shumo Chu [email protected] wrote:

Before we have this great state aware feature. Can we make the default
language to MyriaL?

I use MyriaL most of the time, so have to switch from Datalog to MyriaL
each time. How about others and our users other developers?


Reply to this email directly or view it on GitHubhttps://github.com//issues/55#issuecomment-40664963
.

from myria-web.

stechu avatar stechu commented on August 10, 2024

@dhalperi I want to make sure most people is happy about that :) Do most people primarily using MyriaL?

from myria-web.

domoritz avatar domoritz commented on August 10, 2024

👍

from myria-web.

dhalperi avatar dhalperi commented on August 10, 2024

Just another input: @mbalazin has expressed a strong 👍 vote for saving state in the editor if we go back to it.

from myria-web.

domoritz avatar domoritz commented on August 10, 2024

It it enough to just save the latest state? That would be much easier since we don't have to mess with the history.

from myria-web.

dhalperi avatar dhalperi commented on August 10, 2024

I don't have an excellent understanding of the low-level implementation
issues here, just the high-level application behavior.

The key constraint is that if I'm writing a query, hit 'Queries', and hit
the back button, I want to be where I was.


Daniel Halperin
Director of Research for Scalable Analytics
eScience Institute
University of Washington

On Tue, May 6, 2014 at 11:48 AM, Dominik Moritz [email protected]:

It it enough to just save the latest state? That would be much easier
since we don't have to mess with the history.


Reply to this email directly or view it on GitHubhttps://github.com//issues/55#issuecomment-42342866
.

from myria-web.

dhalperi avatar dhalperi commented on August 10, 2024

#92 implemented much of this; let's refine the list of tasks?

  • clicking an example can be undone
  • changing language can be undone

from myria-web.

domoritz avatar domoritz commented on August 10, 2024
  • changing tabs can be undone (or at least is stored in state)

from myria-web.

mbalazin avatar mbalazin commented on August 10, 2024

Thanks! Here's the detailed scenario:

A user is editing a query so he/she writes a simplified version, executes
it, and then goes to see the results.
It's important for that user to then be able to go back to the query editor
and continue editing the query.

The most recent query is enough for this scenario (no need to keep the
entire history).

thanks
magda

On Tue, May 6, 2014 at 1:10 PM, Dominik Moritz [email protected]:

  • changing tabs can be undone (or at least is stored in state)


Reply to this email directly or view it on GitHubhttps://github.com//issues/55#issuecomment-42352394
.

from myria-web.

domoritz avatar domoritz commented on August 10, 2024

@mbalazin Exactly this scenario works on https://demo.myria.cs.washington.edu now. As long as the page is not reloaded, a user can also use CMD+Z and CMD+Y to undo/redo changes. I think it would be nice to keep this history as well at least for a few steps. We can probably get this information out of http://codemirror.net/doc/manual.html#api_history

from myria-web.

domoritz avatar domoritz commented on August 10, 2024

Done in #93

from myria-web.

mbalazin avatar mbalazin commented on August 10, 2024

Thanks Dominik!!!!
magda

On Tue, May 6, 2014 at 2:30 PM, Dominik Moritz [email protected]:

Done in #93 #93


Reply to this email directly or view it on GitHubhttps://github.com//issues/55#issuecomment-42361666
.

from myria-web.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.