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 Functionality #42

Closed
davidkircos opened this issue Apr 7, 2022 · 1 comment
Closed

Undo / Redo Functionality #42

davidkircos opened this issue Apr 7, 2022 · 1 comment
Labels
type: enhancement new feature or request

Comments

@davidkircos
Copy link
Collaborator

davidkircos commented Apr 7, 2022

Research Command Pattern & Memento Pattern

@davidkircos davidkircos added the type: enhancement new feature or request label Apr 7, 2022
@davidkircos
Copy link
Collaborator Author

For undo and redo, commands should also save the interaction state (cursor position) when they were run. When pressing Command Z in Excel it also reverts to the cursor position of when the previous command was run. This should be relatively easy to do because we store all the GridInteractionState in a single object.

export const gridInteractionStateDefault: GridInteractionState = {
  keyboardMovePosition: { x: 0, y: 0 },
  cursorPosition: { x: 0, y: 0 },
  showMultiCursor: false,
  multiCursorPosition: {
    originPosition: { x: 0, y: 0 },
    terminalPosition: { x: 0, y: 0 },
  },
  showInput: false,
  inputInitialValue: '',
};

https://github.com/quadratichq/quadratic/blob/main/src/atoms/gridInteractionStateAtom.ts

@davidkircos davidkircos linked a pull request Nov 17, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement new feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant