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

Undo/Redo #17

Closed
arvind opened this issue Jan 26, 2014 · 1 comment
Closed

Undo/Redo #17

arvind opened this issue Jan 26, 2014 · 1 comment

Comments

@arvind
Copy link
Member

arvind commented Jan 26, 2014

No description provided.

@arvind
Copy link
Member Author

arvind commented Jan 27, 2014

We can use Vis.export() to help here. Likely a lot of code sharing between the representations for this and #7.

@arvind arvind closed this as completed in 26aade4 Jan 28, 2014
kadamwhite added a commit that referenced this issue Mar 22, 2016
For #17, we need a history queue. Redux provides a [standard convention for tracking history](https://github.com/reactjs/redux/blob/master/docs/recipes/ImplementingUndoHistory.md), which we leverage via the [redux-undo](https://github.com/omnidan/redux-undo) library. Changes to `getIn` make the history state invisible to components if all they need to do is get the present value of a given property.

To test, apply this diff or replicate these lines in the `store/index.js` file:
```diff
diff --git a/src/js/store/index.js b/src/js/store/index.js
index d2458e2..ae356cd 100644
--- a/src/js/store/index.js
+++ b/src/js/store/index.js
@@ -8,3 +8,7 @@ var configureStore = require('./configureStore');
  * @type {Store}
  */
 module.exports = configureStore(require('./defaultState'));
+
+window.undo = require('redux-undo').ActionCreators.undo;
+window.redo = require('redux-undo').ActionCreators.redo;
+window.store = module.exports;
```

You can then make a change (such as toggling open several layers), then run `store.dispatch(undo())` in the console several times to step backwards through time.

**Remaining Issue:**

This is what is happening at present when I toggle open the topmost group:
![image](https://cloud.githubusercontent.com/assets/442115/13963380/815299e8-f03b-11e5-80f9-39e6c09d082b.png)
Events are stacking up, and we need to step through to identify why multiple actions are firing at once. This is why you need to undo() many times to see any change in the UI. Once this is resolved, each action should be granularly undoable and we can build a better interface for the history.

LYRA-267
kadamwhite added a commit that referenced this issue Mar 28, 2016
For #17, we need a history queue. Redux provides a [standard convention for tracking history](https://github.com/reactjs/redux/blob/master/docs/recipes/ImplementingUndoHistory.md), which we leverage via the [redux-undo](https://github.com/omnidan/redux-undo) library. Changes to `getIn` make the history state invisible to components if all they need to do is get the present value of a given property.

To test, apply this diff or replicate these lines in the `store/index.js` file:
```diff
diff --git a/src/js/store/index.js b/src/js/store/index.js
index d2458e2..ae356cd 100644
--- a/src/js/store/index.js
+++ b/src/js/store/index.js
@@ -8,3 +8,7 @@ var configureStore = require('./configureStore');
  * @type {Store}
  */
 module.exports = configureStore(require('./defaultState'));
+
+window.undo = require('redux-undo').ActionCreators.undo;
+window.redo = require('redux-undo').ActionCreators.redo;
+window.store = module.exports;
```

You can then make a change (such as toggling open several layers), then run `store.dispatch(undo())` in the console several times to step backwards through time.

**Remaining Issue:**

This is what is happening at present when I toggle open the topmost group:
![image](https://cloud.githubusercontent.com/assets/442115/13963380/815299e8-f03b-11e5-80f9-39e6c09d082b.png)
Events are stacking up, and we need to step through to identify why multiple actions are firing at once. This is why you need to undo() many times to see any change in the UI. Once this is resolved, each action should be granularly undoable and we can build a better interface for the history.

LYRA-267
kadamwhite added a commit that referenced this issue Mar 28, 2016
For #17, we need a history queue. Redux provides a [standard convention for tracking history](https://github.com/reactjs/redux/blob/master/docs/recipes/ImplementingUndoHistory.md), which we leverage via the [redux-undo](https://github.com/omnidan/redux-undo) library. Changes to `getIn` make the history state invisible to components if all they need to do is get the present value of a given property.

To test, apply this diff or replicate these lines in the `store/index.js` file:
```diff
diff --git a/src/js/store/index.js b/src/js/store/index.js
index d2458e2..ae356cd 100644
--- a/src/js/store/index.js
+++ b/src/js/store/index.js
@@ -8,3 +8,7 @@ var configureStore = require('./configureStore');
  * @type {Store}
  */
 module.exports = configureStore(require('./defaultState'));
+
+window.undo = require('redux-undo').ActionCreators.undo;
+window.redo = require('redux-undo').ActionCreators.redo;
+window.store = module.exports;
```

You can then make a change (such as toggling open several layers), then run `store.dispatch(undo())` in the console several times to step backwards through time.

**Remaining Issue:**

This is what is happening at present when I toggle open the topmost group:
![image](https://cloud.githubusercontent.com/assets/442115/13963380/815299e8-f03b-11e5-80f9-39e6c09d082b.png)
Events are stacking up, and we need to step through to identify why multiple actions are firing at once. This is why you need to undo() many times to see any change in the UI. Once this is resolved, each action should be granularly undoable and we can build a better interface for the history.

LYRA-267
kadamwhite added a commit that referenced this issue Mar 31, 2016
For #17, we need a history queue. Redux provides a [standard convention for tracking history](https://github.com/reactjs/redux/blob/master/docs/recipes/ImplementingUndoHistory.md), which we leverage via the [redux-undo](https://github.com/omnidan/redux-undo) library. Changes to `getIn` make the history state invisible to components if all they need to do is get the present value of a given property.

To test, apply this diff or replicate these lines in the `store/index.js` file:
```diff
diff --git a/src/js/store/index.js b/src/js/store/index.js
index d2458e2..ae356cd 100644
--- a/src/js/store/index.js
+++ b/src/js/store/index.js
@@ -8,3 +8,7 @@ var configureStore = require('./configureStore');
  * @type {Store}
  */
 module.exports = configureStore(require('./defaultState'));
+
+window.undo = require('redux-undo').ActionCreators.undo;
+window.redo = require('redux-undo').ActionCreators.redo;
+window.store = module.exports;
```

You can then make a change (such as toggling open several layers), then run `store.dispatch(undo())` in the console several times to step backwards through time.

**Remaining Issue:**

This is what is happening at present when I toggle open the topmost group:
![image](https://cloud.githubusercontent.com/assets/442115/13963380/815299e8-f03b-11e5-80f9-39e6c09d082b.png)
Events are stacking up, and we need to step through to identify why multiple actions are firing at once. This is why you need to undo() many times to see any change in the UI. Once this is resolved, each action should be granularly undoable and we can build a better interface for the history.

LYRA-267
kadamwhite added a commit that referenced this issue Apr 13, 2016
For #17, we need a history queue. Redux provides a [standard convention for tracking history](https://github.com/reactjs/redux/blob/master/docs/recipes/ImplementingUndoHistory.md), which we leverage via the [redux-undo](https://github.com/omnidan/redux-undo) library. Changes to `getIn` make the history state invisible to components if all they need to do is get the present value of a given property.

To test, apply this diff or replicate these lines in the `store/index.js` file:
```diff
diff --git a/src/js/store/index.js b/src/js/store/index.js
index d2458e2..ae356cd 100644
--- a/src/js/store/index.js
+++ b/src/js/store/index.js
@@ -8,3 +8,7 @@ var configureStore = require('./configureStore');
  * @type {Store}
  */
 module.exports = configureStore(require('./defaultState'));
+
+window.undo = require('redux-undo').ActionCreators.undo;
+window.redo = require('redux-undo').ActionCreators.redo;
+window.store = module.exports;
```

You can then make a change (such as toggling open several layers), then run `store.dispatch(undo())` in the console several times to step backwards through time.

**Remaining Issue:**

This is what is happening at present when I toggle open the topmost group:
![image](https://cloud.githubusercontent.com/assets/442115/13963380/815299e8-f03b-11e5-80f9-39e6c09d082b.png)
Events are stacking up, and we need to step through to identify why multiple actions are firing at once. This is why you need to undo() many times to see any change in the UI. Once this is resolved, each action should be granularly undoable and we can build a better interface for the history.

LYRA-267
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant