Skip to content

Better trash - #2190

Merged
Philipinho merged 2 commits into
docmost:mainfrom
notpeter:better_trash
May 14, 2026
Merged

Philipinho merged 2 commits into
docmost:mainfrom
notpeter:better_trash

Conversation

@notpeter

Copy link
Copy Markdown
Contributor

I recently lost a bunch of time editing and searching for pages that were actually in the Trash. Docmost intentionally tries to not link to Trashed pages and only shows a read-only preview in Trash, but the url of the Trashed page and any inbound links still work.

This PR makes it clearer when a page you are interacting with is in the Trash and prevents you from editing trashed pages.

  • /trash
    • Refactored banner into trash-banner.tsx
    • Refactored "Restore" modal into use-restore-page-modal.tsx
  • Pages (when Deleted):
    • Add: trash-banner.tsx
    • Make read-only. Prevents editing. Hides "Move" and "Move to Trash" from menu.
    • Add "Restore" to menu (invokes use-restore-page-modal)
    • On restore/delete invalidate queries so trash banner immediately goes away.

I tried very hard to keep this as minimal as possible and not introduce new translation strings.

Before / After
docmost-trash-before-after

Potential future work:

  • Add "Failed to delete page" to translation string (existing oversight)
  • Change the display name so links on other Wiki pages to draw attention to linking to content pending deletion (e.g. "Page Name", "Page Name (Deleted)", "Page Name (Trash)", etc).

Let me know if you'd like me to do those as well.

notpeter and others added 2 commits May 12, 2026 09:23
I recently lost a bunch of time editing and searching for pages that were actually in the Trash. Docmost intentionally tries to not link to Trashed pages, but the url of that Trashed page and any inbound links still work.  This makes it clearer when a page you are interacting with is in the Trash.

- /trash
  - Refactored banner into `trash-banner.tsx`
  - Refactored "Restore" modal into `use-restore-page-modal.tsx`
- Page (when isDeleted)
  - Add: `trash-banner.tsx`
  - Add breadcrumbs: `Parent / Child / Page (Deleted)`
  - Change: Deleted Pages are read-only
  - Replace "Move to Trash" with "Restore" in page menu (invokes `use-restore-page-modal`)

I tried very hard to keep this simple and re-use existing translation strings wherever possible.
@Philipinho
Philipinho merged commit 932c1ad into docmost:main May 14, 2026
1 check passed
@Philipinho

Copy link
Copy Markdown
Member

Thanks for contributing.

Yundi339 pushed a commit to Yundi339/docmost that referenced this pull request Jun 18, 2026
* Better trash

I recently lost a bunch of time editing and searching for pages that were actually in the Trash. Docmost intentionally tries to not link to Trashed pages, but the url of that Trashed page and any inbound links still work.  This makes it clearer when a page you are interacting with is in the Trash.

- /trash
  - Refactored banner into `trash-banner.tsx`
  - Refactored "Restore" modal into `use-restore-page-modal.tsx`
- Page (when isDeleted)
  - Add: `trash-banner.tsx`
  - Add breadcrumbs: `Parent / Child / Page (Deleted)`
  - Change: Deleted Pages are read-only
  - Replace "Move to Trash" with "Restore" in page menu (invokes `use-restore-page-modal`)

I tried very hard to keep this simple and re-use existing translation strings wherever possible.

* cleanup

---------

Co-authored-by: Philipinho <[email protected]>
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.

2 participants