Skip to content

Conversation

@mejo-
Copy link
Member

@mejo- mejo- commented May 30, 2023

📝 Summary

This PR depends on #700.

🖼️ Screenshots and screencasts

Delete from page list Restore from page trash Mobile
grafik grafik grafik

Screencast
recording2.webm

🚧 TODO

  • Feedback from design team
  • In mobile view, delete button is not sticky to the buttom. why?

🏁 Checklist

  • Code is properly formatted (npm run lint / npm run stylelint / composer run cs:check)
  • Sign-off message is added to all commits
  • Tests (unit, integration and/or end-to-end) passing and the changes are covered with tests
  • Documentation (README or documentation) has been updated or is not required

@mejo- mejo- added enhancement New feature or request 2. developing labels May 30, 2023
@mejo- mejo- force-pushed the enh/pages_trash_frontend branch from c681193 to 9ca6abc Compare May 30, 2023 15:01
@cypress
Copy link

cypress bot commented May 30, 2023

15 failed tests on run #825 ↗︎

15 57 0 0 Flakiness 0

Details:

Add page trash frontend
Project: Collectives Commit: d7c6cb8f0d
Status: Failed Duration: 23:00 💡
Started: Jun 27, 2023 1:00 PM Ended: Jun 27, 2023 1:23 PM
Failed  pages-links.spec.js • 14 failed tests

View Output Video

Test Artifacts
Page Link Handling > Link handling to collectives > Opens link with URL to page in this collective in same/new tab depending on view/edit mode Output Screenshots
Page Link Handling > Link handling to collectives > Opens link with absolute path to page in this collective in same/new tab depending on view/edit mode Output Screenshots
Page Link Handling > Link handling to collectives > Opens link with relative path to page in this collective with fileId in same/new tab depending on view/edit mode Output Screenshots
Page Link Handling > Link handling to collectives > Opens link with relative path to page in this collective with fileId and outdated path in same/new tab depending on view/edit mode Output Screenshots
Page Link Handling > Link handling to collectives > Opens link with relative path to page in this collective without fileId in same/new tab depending on view/edit mode Output Screenshots
Page Link Handling > Link handling to collectives > Opens link with relative path to markdown file in this collective without fileId in same/new tab depending on view/edit mode Output Screenshots
Page Link Handling > Link handling to collectives > Opens link with URL to page in other collective with fileId in same/new tab depending on view/edit mode Output Screenshots
Page Link Handling > Link handling to collectives > Opens link with absolute path to page in other collective without fileId in same/new tab depending on view/edit mode Output Screenshots
Page Link Handling > Link handling to Nextcloud > Opens link with URL to another Nextcloud app in new tab Output Screenshots
Page Link Handling > Link handling to Nextcloud > Opens link with absolute path to another Nextcloud app in new tab Output Screenshots
The first 10 failed tests are shown, see all 14 tests in Cypress Cloud.
Failed  pages.spec.js • 1 failed test

View Output Video

Test Artifacts
Page > Creating a page from template > New page has template content Output Screenshots

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings.

Copy link
Member

@nimishavijay nimishavijay left a comment

Choose a reason for hiding this comment

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

Very cool! General idea looks great! :) Some points from my end:

  • It would be useful to show the path to the pages as well, as I can see a use case where 2 pages with the same name have been deleted and then it's difficult to tell which one to restore. I also have concerns about the height of the list when there are more pages. How about a modal like this (adapted from the calendar trash bin)? There is a subline with the page "location" shown
    image
  • Agreed that we can highlight the deleted pages when the page is deleted! Opening the trash is a bit much indeed
  • Similarly when a page it restored it can also be highlighted for a couple of seconds
  • if the page being restored is a subpage of a page that is collapsed in the list then it could automatically be expanded upon restoring

What do you think? :) also ccing @jancborchardt and @szaimen for more design feedback

Copy link
Member

@jancborchardt jancborchardt left a comment

Choose a reason for hiding this comment

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

Totally agree with @nimishavijay's proposal, modal is more proper here. :)

@mejo- mejo- force-pushed the enh/pages_trash_frontend branch from 0f54482 to cffedb9 Compare May 31, 2023 13:32
@mejo-
Copy link
Member Author

mejo- commented May 31, 2023

Thanks a lot for your feedback @nimishavijay and @jancborchardt. I implemented most of your suggestions. See the updated sceenshots/casts.

Only remaining is how to represent the path of the page in trashbin. In the files trashbin, original path is not displayed either. And it can become quite long and cluttered soon if we display it. That's why I went without first, but would be curious about your ideas.

Copy link
Member

@jancborchardt jancborchardt left a comment

Choose a reason for hiding this comment

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

Nice! Some further feedback:

  • It is a bit strange that "Delete page" is not the last entry of the action menu. The "last modified" info entry could be moved to first position instead?
  • Pages with subpages also seems to remove all subpages. Maybe in that case it is ok to have a confirmation modal?
  • The feedback with highlighting the "Deleted pages" is not super obvious. Generally we should always also use showNotification, in this case it could say "[Pagename] deleted", ideally even with an " Undo" button.
  • In the modal:
    • The table headings don't need to be bold
    • "Restore" button could be outside of the menu so it's quick to access, in secondary button style.
    • The last horizontal line below the last list item is not necessary

@mejo-
Copy link
Member Author

mejo- commented May 31, 2023

Thanks @jancborchardt! Some quick follow-ups:

Pages with subpages also seems to remove all subpages. Maybe in that case it is ok to have a confirmation modal?

Well, it was forbidden before, but now that it's easy to restore I thought it would be ok to just allow it. But if you prefer, we can add a confirmation modal for sure.

It is a bit strange that "Delete page" is not the last entry of the action menu. The "last modified" info entry could be moved to first position instead?

I'm not sure whether I like that. I will give it a try, but in general the "last modified" info is really more something like an info and not something we should emphasize by putting it as the first entry, no?

@jancborchardt
Copy link
Member

Thanks @jancborchardt! Some quick follow-ups:

Pages with subpages also seems to remove all subpages. Maybe in that case it is ok to have a confirmation modal?

Well, it was forbidden before, but now that it's easy to restore I thought it would be ok to just allow it. But if you prefer, we can add a confirmation modal for sure.

Yeah, it's just that it's not super clear that this is what happens, at least before you do it. So yes I would say a confirmation is in order here.

It is a bit strange that "Delete page" is not the last entry of the action menu. The "last modified" info entry could be moved to first position instead?

I'm not sure whether I like that. I will give it a try, but in general the "last modified" info is really more something like an info and not something we should emphasize by putting it as the first entry, no?

Right, yeah and actually the "Convert with pandoc" is also a bit of a nerdy option (at least wording-wise)? What do you think about this order:

  • Select emoji
  • Move page
  • Convert with pandoc
  • Add template for subpages
  • (edited by info entry)
  • Delete page

@mejo-
Copy link
Member Author

mejo- commented May 31, 2023

Right, yeah and actually the "Convert with pandoc" is also a bit of a nerdy option

Haha, yeah sorry this is from a custom extension (https://github.com/mejo-/pandoc) and not part of Collectives.

@jancborchardt
Copy link
Member

Haha, yeah sorry this is from a custom extension (https://github.com/mejo-/pandoc) and not part of Collectives.

Nice! :) May I suggest "Convert or export" (or "Convert & export")?

@mejo- mejo- force-pushed the enh/pages_trash branch 3 times, most recently from b03b9fb to 34b080a Compare June 5, 2023 14:17
@delete-merged-branch delete-merged-branch bot deleted the branch main June 5, 2023 14:28
@mejo- mejo- force-pushed the enh/pages_trash_frontend branch from cffedb9 to 3be9342 Compare June 6, 2023 10:45
@mejo- mejo- changed the base branch from enh/pages_trash to main June 6, 2023 10:49
@mejo- mejo- requested a review from jancborchardt June 6, 2023 10:50
@mejo- mejo- marked this pull request as ready for review June 6, 2023 10:56
Copy link
Member

@jancborchardt jancborchardt left a comment

Choose a reason for hiding this comment

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

Very nice! I would still say the "modified" info line should move one up in the menu so delete is the last entry, but that can also be a follow-up. :)

Copy link
Member

@juliusknorr juliusknorr left a comment

Choose a reason for hiding this comment

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

Only a minor comment, non blocking, otherwise the code looks good to me. Haven't tested yet though.

@juliusknorr
Copy link
Member

juliusknorr commented Jun 20, 2023

Tested and found a few issues that might be worth to look into before merging:

  • Page not removed from trashbin UI list after deleting it permanently
  • Delete permanently breaks collective, steps to reproduce:
    • Create a collective
    • Add 1 subpage
    • Delete the sub page
    • Permanently delete the subpage
    • Reload the collective -> See Page not found: {page}
  • When having a page open while deleting the main view should navigate to the parent page, otherwise you may end up with a broken text editor as the file is no longer present or can continue edit a deleted page
  • Deleting a page does not immediately remove it from the list
  • Restoring a page failes if the page has been reloaded (might also happen if the previous would be the case):
    Screenshot 2023-06-20 at 21 13 24

@mejo- mejo- force-pushed the enh/pages_trash_frontend branch from f0e7de2 to 3abce81 Compare June 26, 2023 16:09
@mejo-
Copy link
Member Author

mejo- commented Jun 26, 2023

Thanks for testing @juliushaertl. I was unable to reproduce most of the issues you face. The problem with broken collective was a severe bug though that I fixed in 3abce81 now. Maybe you can test again?

Page not removed from trashbin UI list after deleting it permanently

For me, pages always get removed from the trashbin UI after deleting permanently

When having a page open while deleting the main view should navigate to the parent page, otherwise you may end up with a broken text editor as the file is no longer present or can continue edit a deleted page

That's what happens in my tests.

Deleting a page does not immediately remove it from the list
Restoring a page failes if the page has been reloaded (might also happen if the previous would be the case):

Mh, unable to reproduce these two as well.

@mejo- mejo- force-pushed the enh/pages_trash_frontend branch from 3abce81 to 090f263 Compare June 26, 2023 16:12
@mejo- mejo- requested a review from juliusknorr June 26, 2023 16:46
@mejo- mejo- force-pushed the enh/pages_trash_frontend branch 2 times, most recently from 499a015 to 33390fb Compare June 26, 2023 17:23
@juliusknorr
Copy link
Member

Strange, now it works all fine. I'm wondering if I just have been on an outdated branch, though I'm quite sure I pulled before testing.

Anyways, works like a charm now ❤️

@mejo- mejo- force-pushed the enh/pages_trash_frontend branch 4 times, most recently from f3315e2 to d7c6cb8 Compare June 27, 2023 12:55
mejo- added 11 commits June 27, 2023 17:56
We want the subpage order to stay consistent after restore

Signed-off-by: Jonas <[email protected]>
* Highlight trash button when trashing a page
* Expand path to restored page in page list
* Highlight and scroll into view restored page in page list
* Don't remove subpage order of parent when trashing a page

Signed-off-by: Jonas <[email protected]>
* Distinguish 'Delete page' and 'Delete page and subpages'
* Fix stickyness of page trash button on mobile
* Show notification toast when trashing a page
* Remove trailing horizontal line in page trash modal
* Don't use bold font for table headings in trash modal

Signed-off-by: Jonas <[email protected]>
* Define thead and tbody areas in page trash table
* Always show restore button inline in page trash table

Signed-off-by: Jonas <[email protected]>
If the folder has an index page, we want to use its fileId in the
collectives page database. But if it doesn't, we don't want to fail
hard.

Signed-off-by: Jonas <[email protected]>
@mejo- mejo- force-pushed the enh/pages_trash_frontend branch from d7c6cb8 to 2cfa45e Compare June 27, 2023 15:58
* Clear timeout before setting a new one
* Remove highlight class and add it again for re-highlighting
* Clear timeout on component unmount to prevent memory leaks

Signed-off-by: Jonas <[email protected]>
@mejo- mejo- force-pushed the enh/pages_trash_frontend branch from 2cfa45e to 43d1d13 Compare June 27, 2023 16:07
@mejo- mejo- merged commit 50ca324 into main Jun 27, 2023
@delete-merged-branch delete-merged-branch bot deleted the enh/pages_trash_frontend branch June 27, 2023 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review enhancement New feature or request

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Allow restoring a deleted page

5 participants