Skip to content

Conversation

@xCJPECKOVERx
Copy link
Collaborator

@xCJPECKOVERx xCJPECKOVERx commented May 28, 2025

Description

Adds undo button to the Assets Trashed notification.

Addresses #9571

How Has This Been Tested?

Tested on web using both trash menu button and delete key shortcut. Applies to most photos pages except Archive, Trash, and Locked. Undo option does not appear on those pages.
The notification timeout is extended to 5s when the undo button is present.

Screenshots (if appropriate)

image

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation if applicable
  • I have no unrelated changes in the PR.
  • I have confirmed that any new dependencies are strictly necessary.
  • I have written tests for new code (if applicable)
  • I have followed naming conventions/patterns in the surrounding code
  • All code in src/services/ uses repositories implementations for database calls, filesystem operations, etc.
  • All code in src/repositories/ is pretty basic/simple and does not have any immich specific logic (that belongs in src/services/)

@YarosMallorca YarosMallorca changed the title Feat/delete undo feat(web): undo delete May 30, 2025
Make onUndoDelete optional in Props interface
auto-merge was automatically disabled June 2, 2025 15:24

Head branch was pushed to by a user without write access

…bled.

- Enforce lint requirement for no-negated-condition
@xCJPECKOVERx xCJPECKOVERx requested a review from alextran1502 June 4, 2025 14:55
button: { text: $t('undo'), onClick: () => undoDeleteAssets(onUndoDelete, assets) },
timeout: 5000,
}),
...(onUndoDelete &&
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Prettier tends to have some weird opinions on formatting lol

Copy link
Member

Choose a reason for hiding this comment

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

You can run npm run format:fix in the web directory for fix everything

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Will do in the future. Didn't here since I didn't expect it to have an issue and make things arguably less readable.
I'll fix up the lint issue then I think we'll be good

@alextran1502 alextran1502 enabled auto-merge (squash) June 4, 2025 15:45
@alextran1502 alextran1502 merged commit 19ff39c into immich-app:main Jun 4, 2025
46 checks passed
savely-krasovsky pushed a commit to savely-krasovsky/immich that referenced this pull request Jun 8, 2025
* feat(web): Undo asset delete

* - lints and checks
- Update English translation

* Update delete-assets.svelte

Make onUndoDelete optional in Props interface

* - Ensure undo button not available on permanent delete, or trash disabled.
- Enforce lint requirement for no-negated-condition

* Fix formatting

* fix: lint

---------

Co-authored-by: Alex Tran <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants