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 (Whiteboards): History issues #8788
Conversation
await page.click('#tl-zoom-out') | ||
await page.waitForTimeout(1500) // wait for the zoom animation to finish | ||
await page.keyboard.press(`${modKey}+-`) | ||
await page.waitForTimeout(1500) // wait for the zoom animation to finish |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated to this PR, but this test was sporadically failing.
26bb36f
to
19e4174
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works as described! 👍
It'll be great if we can remove both replace and pause/resume.
Outliner pages share this problem too, we need a way to prevent the undo/redo if the history is not related to the current operating pages.
Can you create an issue on it? |
@tiensonqin Working on a fix here #8816
Will do, once I figure out how to reproduce this consistently. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sprocketc Thanks for the fixes with tests! 🐛 🔥 Confirmed tests behave as desired
Is some cases we had to persist a new state by replacing the last history entry, instead of pushing a new one.
The related block was removed here https://github.com/logseq/logseq/pull/7786/files#diff-f8d520c32e2ccdf12b14a130b819d3ecbc21284ceabab9ac1ed48d2cab65f272L68-L70
As a result, calling
app.persist(true)
, disregards the boolean and always pushes a new entry. For example, if you drag and drop a block into the canvas and then undo the action, you will notice that there are intermediate history entries that shouldn't exist. There is a similar problem with tweet shapes and iframes.I think we can achieve a similar result by setting
:whiteboard/transact?
to false and by using the existing:compute-new-refs?
that seems to swap the data of the last undo entry.Fixed another bug (d3cd17e) that didn't allow us to undo a block/page creation by using the portal tool or by double clicking. The issue was accidentally fixed by #7786, because replace stopped working. The problem was that the first persist was called with replace true (so not undoable). The next one was called with replace false, but the portal element was already part of the state.
Also fixed persisting the collapsed state of portals and added tests for the mentioned cases.
Some notes about history