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

Editor draft actions should dismiss existing notifications so success notifications are clear #5032

Open
WyattBest opened this issue May 23, 2024 · 3 comments

Comments

@WyattBest
Copy link

WyattBest commented May 23, 2024

Dan Edit: This issue was re-purposed to focus on making the notifications clearer, as discussed further on in this issue. The original bug report details below may not be so relevant, but remain for context.

Describe the Bug

Editing a draft that is older than the current version of the page produces this warning:

This page has been updated since this draft was created. It is recommended that you discard this draft or take care not to overwrite any page changes.

It seems that this should say "recommended that you delete this draft." Or perhaps something is wrong with the discard draft action.

Steps to Reproduce

  1. Go to a page and start a draft but do not publish.
  2. Have someone else edit the page and publish the edit.
  3. Resume editing your draft. The warning appears.
  4. Click Discard Draft. The page reloads but the warning does not go away.
  5. Click Delete Draft. The page reloads and the warning goes away.

Expected Behaviour

I would expect that clicking Discard Draft would resolve the warning about needing to discard the draft.

Screenshots or Additional Context

image

Browser Details

Firefox 126.0 on Windows 10

Exact BookStack Version

v24.05.1

@ssddanbrown
Copy link
Member

Hi @WyattBest,

Click Discard Draft. The page reloads but the warning does not go away.

This indicates there may be another issue in your environment. The page should not reload when you click to discard or delete a draft. Do you mean this as a browser page reload, or by "reload" are you referencing the bookstack editor just loading in new content?

It seems that this should say "recommended that you delete this draft."

Although this could be delete, I would prefer to keep this discard as a safer option since the old draft content will exist until a new draft is saved (or auto-saved) which provides a little safety in the event that this was a mistake. This does mean that the old content and warning may re-appear if the user re-edits without having saved a draft since, but that should be infrequent and a reasonable tradeoff IMO.

@WyattBest
Copy link
Author

WyattBest commented May 23, 2024

@ssddanbrown Thank you for responding! You're right; the page does not actually reload. Everything works as you described.

My last remaining confusion stems from the z-index of the notification bubbles. Discarding the draft gives a green success message that it's OK to edit, but it's hidden behind the orange warning. Perhaps notifications should have the newest on top?

@ssddanbrown
Copy link
Member

@WyattBest Yeah, we should probably dismiss existing warnings when that action is taken to avoid the overlap.
I'll go ahead and re-purpose this issue to focus on that as an improvement.

@ssddanbrown ssddanbrown changed the title Discard draft warning really means delete draft Editor draft actions should dismiss existing notifications so success notifications are clear May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants