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

fix: equation input undo regession #3923

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

wststone
Copy link
Collaborator

Fix regression of #3852, I basically just deleted the handle check of the meta+z keydown event and let the native event handles the undo behavior.
Also added equation and inline-equation elements to the www editor and slashmenu, so there's more showcasing and also i can test locally.

Checklist

  • yarn typecheck
  • yarn lint:fix
  • yarn test
  • yarn brl
  • yarn changeset
  • ui changelog

2. feat: add equation and inline-equation elements in editor and slashmenu
Copy link

codesandbox bot commented Dec 26, 2024

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

Copy link

vercel bot commented Dec 26, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
plate ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 27, 2024 3:56am

@zbeyens
Copy link
Member

zbeyens commented Dec 26, 2024

Thanks for adding the UI!

@@ -79,9 +78,6 @@ export const useEquationInput = ({
} else if (isHotkey('escape')(e)) {
e.preventDefault();
onDismiss();
} else if (isHotkey('meta+z')(e)) {
e.preventDefault();
editor.undo();
} else if (isHotkey('meta+y')(e) || isHotkey('meta+shift+z')(e)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

seems not work in macos cmd + shift + z

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

hmm, what's the expected behavior for cmd shift z in macos?

Copy link
Collaborator

Choose a reason for hiding this comment

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

If you really need to do this, you can use Hotkeys.isUndo and Hotkeys.isRedo from packages/core/src/lib/utils/hotkeys.ts.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I was careless yesterday and did not see the redo logic below 😥, i think simply deleting it makes the most sense?

Copy link
Collaborator

Choose a reason for hiding this comment

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

The effect looks great. @wststone

Copy link
Collaborator

@felixfeng33 felixfeng33 Dec 27, 2024

Choose a reason for hiding this comment

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

but I found an another history issue.
history issue is really tricky.

focus.mp4

Copy link
Collaborator

Choose a reason for hiding this comment

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

Referring to Notion, I think what we need to do is to avoid opening the popover during an undo action.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I will take a look

Copy link

changeset-bot bot commented Dec 27, 2024

⚠️ No Changeset found

Latest commit: d324b3b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

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.

4 participants