BookStack icon indicating copy to clipboard operation
BookStack copied to clipboard

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

Open WyattBest opened this issue 1 year ago • 4 comments

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

WyattBest avatar May 23 '24 19:05 WyattBest

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.

ssddanbrown avatar May 23 '24 19:05 ssddanbrown

@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?

WyattBest avatar May 23 '24 20:05 WyattBest

@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 avatar May 24 '24 10:05 ssddanbrown

There's no draft management, therefore it's very scary when this message pops up. I'm afraid to discard or delete the draft, even after several saves! I have no clue what state the page is in. This should really be clarified in any message but may also need an additional action in the menu like:

  • Save the current draft as the current final page.

patlecat avatar Jun 02 '25 13:06 patlecat