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

Save and preview #1024

Closed
wants to merge 3 commits into from
Closed

Save and preview #1024

wants to merge 3 commits into from

Conversation

yagebu
Copy link
Contributor

@yagebu yagebu commented Apr 2, 2022

Issue(s) Resolved

Supercedes #701

Description of Changes

The current behaviour is to jump to the preview page after saving. This PR adds a new button ("Save Changes and Preview") which behaves like the current one and changes the main "Save Changes" button to only save the changes (and show a notification in the top right corner that saving succeeded). That behaviour seems to be more in line with how most "editors" behave on save.

For keyboard users, this adds a shortcut (Ctrl/Meta+p) which allows one to quickly jump between the edit (or any other) and the preview page. This was currently only possible with the Ctrl/Meta+s shortcut, which only worked on the edit page if one had actually changed something. Saving and previewing now takes one additional click (but I think having distinct shortcuts is more explicit and avoids saving unwanted changes if one just wants to jump to the preview page).

@dairiki
Copy link
Contributor

dairiki commented Apr 2, 2022

What happens when you hit the preview hot-key after making some changes but before saving?

From a brief look at the code, it looks like it does the same thing as hitting the preview button does now which is to display a "You have unsaved information. Are you sure you want to leave this page?" dialog.

Since a very common operation is to make some edits and then want to see the result, I think it might be better to have the hotkey do a save-and-preview.

Or maybe (if there are changes) put up a dialog with three choices:

You have unsaved changes:
 - Cancel (return to edit view)
 - Discard Changes (and preview)
 - Save (and preview) [default focussed - so `<ctl/alt>-P` `<return>` will do a save and preview.]

@dairiki dairiki mentioned this pull request Aug 3, 2022
4 tasks
Make the save button the default and show a notification on save.

Also, add a keyboard shortcut for the preview page (Ctrl/Meta+p), so
that the preview page can still quickly be reached (now from any page
:))
@yagebu
Copy link
Contributor Author

yagebu commented Dec 18, 2022

Since a very common operation is to make some edits and then want to see the result, I think it might be better to have the hotkey do a save-and-preview.
Or maybe (if there are changes) put up a dialog with three choices:

I like the dialog idea. I think it's good if the hotkey is for the preview button (which is present on more than just the edit page) and if the hotkey behaves somewhat consistently (always "open preview page"). The dialog with pre-selected button seems like the right solution to still have the very common save-and-preview easily accessible (either Ctrl+s Ctrl+p or Ctrl+p Enter)

@dairiki dairiki added this to the 3.4 milestone Feb 28, 2023
@yagebu
Copy link
Contributor Author

yagebu commented Apr 15, 2023

Closing, let's do #1052 instead

@yagebu yagebu closed this Apr 15, 2023
@yagebu yagebu deleted the save-and-preview branch April 15, 2023 11:17
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.

None yet

2 participants